incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r899552 - /sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
Date Fri, 15 Jan 2010 07:50:38 GMT
Author: cziegeler
Date: Fri Jan 15 07:50:37 2010
New Revision: 899552

URL: http://svn.apache.org/viewvc?rev=899552&view=rev
Log:
SLING-1286 : Warning with invalid path during compilation

Modified:
    sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java

Modified: sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java?rev=899552&r1=899551&r2=899552&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
(original)
+++ sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
Fri Jan 15 07:50:37 2010
@@ -197,7 +197,15 @@
             return false;
         }
         String resourceName = result.replace('.', '/') + ".class";
-        InputStream is = options.getClassLoader().getResourceAsStream(resourceName);
+        if ( resourceName.startsWith("/") ) {
+            resourceName = resourceName.substring(1);
+        }
+        final InputStream is = options.getClassLoader().getResourceAsStream(resourceName);
+        if ( is != null ) {
+            try {
+                is.close();
+            } catch (IOException ignore) {}
+        }
         return is == null;
     }
 



Mime
View raw message