incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1049800 - in /sling/trunk/contrib/scripting/java: ./ src/main/java/org/apache/sling/scripting/java/impl/ src/main/resources/META-INF/ src/main/resources/OSGI-INF/metatype/
Date Thu, 16 Dec 2010 07:37:17 GMT
Author: cziegeler
Date: Thu Dec 16 07:37:16 2010
New Revision: 1049800

URL: http://svn.apache.org/viewvc?rev=1049800&view=rev
Log:
Set target vm version and remove obsolete notice/licence files.

Removed:
    sling/trunk/contrib/scripting/java/LICENSE
    sling/trunk/contrib/scripting/java/NOTICE
    sling/trunk/contrib/scripting/java/src/main/resources/META-INF/
Modified:
    sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/CompilerOptions.java
    sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/JavaScriptEngineFactory.java
    sling/trunk/contrib/scripting/java/src/main/resources/OSGI-INF/metatype/metatype.properties

Modified: sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/CompilerOptions.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/CompilerOptions.java?rev=1049800&r1=1049799&r2=1049800&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/CompilerOptions.java
(original)
+++ sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/CompilerOptions.java
Thu Dec 16 07:37:16 2010
@@ -22,6 +22,8 @@ import org.apache.sling.commons.compiler
 
 public class CompilerOptions extends Options {
 
+    private static final long serialVersionUID = 6526386931840426139L;
+
     private String encoding;
 
     /**
@@ -37,6 +39,9 @@ public class CompilerOptions extends Opt
         final String sourceVM = (String) props.get(JavaScriptEngineFactory.PROPERTY_COMPILER_SOURCE_V_M);
         opts.put(Options.KEY_SOURCE_VERSION, sourceVM != null && sourceVM.length()
> 0 ? sourceVM : JavaScriptEngineFactory.DEFAULT_VM_VERSION);
 
+        final String targetVM = (String) props.get(JavaScriptEngineFactory.PROPERTY_COMPILER_TARGET_V_M);
+        opts.put(Options.KEY_TARGET_VERSION, targetVM != null && targetVM.length()
> 0 ? targetVM : JavaScriptEngineFactory.DEFAULT_VM_VERSION);
+
         final String encoding = (String) props.get(JavaScriptEngineFactory.PROPERTY_ENCODING);
         opts.encoding = encoding != null && encoding.length() > 0 ? encoding :
"UTF-8";
 

Modified: sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/JavaScriptEngineFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/JavaScriptEngineFactory.java?rev=1049800&r1=1049799&r2=1049800&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/JavaScriptEngineFactory.java
(original)
+++ sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/JavaScriptEngineFactory.java
Thu Dec 16 07:37:16 2010
@@ -58,6 +58,7 @@ import org.osgi.service.event.EventHandl
  * @scr.service interface="javax.script.ScriptEngineFactory"
  *
  * @scr.property nameRef="PROPERTY_COMPILER_SOURCE_V_M" valueRef="DEFAULT_VM_VERSION"
+ * @scr.property nameRef="PROPERTY_COMPILER_TARGET_V_M" valueRef="DEFAULT_VM_VERSION"
  * @scr.property nameRef="PROPERTY_CLASSDEBUGINFO" value="true" type="Boolean"
  * @scr.property nameRef="PROPERTY_ENCODING" value="UTF-8"
  */
@@ -67,6 +68,8 @@ public class JavaScriptEngineFactory
 
     public static final String PROPERTY_COMPILER_SOURCE_V_M = "java.compilerSourceVM";
 
+    public static final String PROPERTY_COMPILER_TARGET_V_M = "java.compilerTargetVM";
+
     public static final String PROPERTY_CLASSDEBUGINFO = "java.classdebuginfo";
 
     public static final String PROPERTY_ENCODING = "java.javaEncoding";
@@ -198,7 +201,7 @@ public class JavaScriptEngineFactory
         } catch (ServletException se) {
             throw new SlingServletException(se);
         } catch (Exception ex) {
-            throw new SlingException(ex) {};
+            throw new SlingException(null, ex);
         } finally {
             request.setAttribute(SlingBindings.class.getName(), oldValue);
             ioProvider.resetRequestResourceResolver();

Modified: sling/trunk/contrib/scripting/java/src/main/resources/OSGI-INF/metatype/metatype.properties
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=1049800&r1=1049799&r2=1049800&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/java/src/main/resources/OSGI-INF/metatype/metatype.properties
(original)
+++ sling/trunk/contrib/scripting/java/src/main/resources/OSGI-INF/metatype/metatype.properties
Thu Dec 16 07:37:16 2010
@@ -37,3 +37,7 @@ java.javaEncoding.description = Encoding
 java.compilerSourceVM.name = Source VM
 java.compilerSourceVM.description = Java Specification to be used to read \
  the source files.
+
+java.compilerTargetVM.name = Target VM
+java.compilerTargetVM.description = Target Java version for compilation.
+ 
\ No newline at end of file



Mime
View raw message