incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1055887 - in /sling/trunk/bundles/scripting/core/src: main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java test/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactoryTest.java
Date Thu, 06 Jan 2011 14:13:22 GMT
Author: justin
Date: Thu Jan  6 14:13:22 2011
New Revision: 1055887

URL: http://svn.apache.org/viewvc?rev=1055887&view=rev
Log:
SLING-1921 - applying patch from Sandro Boehme (thanks!)

Modified:
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
    sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactoryTest.java

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java?rev=1055887&r1=1055886&r2=1055887&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
Thu Jan  6 14:13:22 2011
@@ -142,14 +142,16 @@ public class ScriptEngineManagerFactory 
             BufferedReader reader = new BufferedReader(new InputStreamReader(ins));
             String line;
             while ((line = reader.readLine()) != null) {
-                try {
-                    Class<ScriptEngineFactory> clazz = bundle.loadClass(line);
-                    ScriptEngineFactory spi = clazz.newInstance();
-                    registerFactory(mgr, spi);
-                    extensions.addAll(spi.getExtensions());
-                } catch (Throwable t) {
-                    log.error("Cannot register ScriptEngineFactory " + line, t);
-                }
+            	if (!line.startsWith("#")){
+	                try {
+	                    Class<ScriptEngineFactory> clazz = bundle.loadClass(line);
+	                    ScriptEngineFactory spi = clazz.newInstance();
+	                    registerFactory(mgr, spi);
+	                    extensions.addAll(spi.getExtensions());
+	                } catch (Throwable t) {
+	                    log.error("Cannot register ScriptEngineFactory " + line, t);
+	                }
+            	}
             }
         } catch (IOException ioe) {
             // ignore

Modified: sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactoryTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactoryTest.java?rev=1055887&r1=1055886&r2=1055887&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactoryTest.java
(original)
+++ sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactoryTest.java
Thu Jan  6 14:13:22 2011
@@ -140,6 +140,7 @@ public class ScriptEngineManagerFactoryT
         FileOutputStream fos = null;
         try {
             fos = new FileOutputStream(tempFile);
+            fos.write("#I'am a test-comment\n".getBytes());
             fos.write(SCRIPT_ENGINE_FACTORY.getName().getBytes());
         } finally {
             if (fos != null) {



Mime
View raw message