sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1649573 - in /sling/trunk/contrib/scripting/java: pom.xml src/main/java/org/apache/sling/scripting/java/impl/CompilerOptions.java
Date Mon, 05 Jan 2015 16:23:39 GMT
Author: cziegeler
Date: Mon Jan  5 16:23:39 2015
New Revision: 1649573

URL: http://svn.apache.org/r1649573
Log:
SLING-4152 : Allow untyped configuration for JSP Compiler

Modified:
    sling/trunk/contrib/scripting/java/pom.xml
    sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/impl/CompilerOptions.java

Modified: sling/trunk/contrib/scripting/java/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java/pom.xml?rev=1649573&r1=1649572&r2=1649573&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/java/pom.xml (original)
+++ sling/trunk/contrib/scripting/java/pom.xml Mon Jan  5 16:23:39 2015
@@ -110,6 +110,12 @@
             <version>2.1.0</version>
             <scope>provided</scope>
         </dependency>
+        
+        <dependency>
+        	<groupId>org.apache.sling</groupId>
+        	<artifactId>org.apache.sling.commons.osgi</artifactId>
+        	<version>2.2.0</version>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.sling</groupId>

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=1649573&r1=1649572&r2=1649573&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
Mon Jan  5 16:23:39 2015
@@ -19,6 +19,7 @@ package org.apache.sling.scripting.java.
 import java.util.Dictionary;
 
 import org.apache.sling.commons.compiler.Options;
+import org.apache.sling.commons.osgi.PropertiesUtil;
 
 public class CompilerOptions extends Options {
 
@@ -34,22 +35,26 @@ public class CompilerOptions extends Opt
         final String currentVersion = System.getProperty("java.specification.version");
         final CompilerOptions opts = new CompilerOptions();
 
-        final Boolean classDebugInfo = (Boolean)props.get(JavaScriptEngineFactory.PROPERTY_CLASSDEBUGINFO);
-        opts.put(Options.KEY_GENERATE_DEBUG_INFO, classDebugInfo != null ? classDebugInfo
: true);
+        final Boolean classDebugInfo = PropertiesUtil.toBoolean(
+                props.get(JavaScriptEngineFactory.PROPERTY_CLASSDEBUGINFO), true);
+        opts.put(Options.KEY_GENERATE_DEBUG_INFO, classDebugInfo);
 
-        final String sourceVM = (String) props.get(JavaScriptEngineFactory.PROPERTY_COMPILER_SOURCE_V_M);
+        final String sourceVM = PropertiesUtil.toString(
+                props.get(JavaScriptEngineFactory.PROPERTY_COMPILER_SOURCE_V_M), null);
         opts.put(Options.KEY_SOURCE_VERSION, sourceVM != null && sourceVM.trim().length()
> 0 ? sourceVM.trim() : JavaScriptEngineFactory.VERSION_AUTO);
         if ( JavaScriptEngineFactory.VERSION_AUTO.equalsIgnoreCase((String)opts.get(Options.KEY_SOURCE_VERSION))
) {
             opts.put(Options.KEY_SOURCE_VERSION, currentVersion);
         }
 
-        final String targetVM = (String) props.get(JavaScriptEngineFactory.PROPERTY_COMPILER_TARGET_V_M);
+        final String targetVM = PropertiesUtil.toString(
+                props.get(JavaScriptEngineFactory.PROPERTY_COMPILER_TARGET_V_M), null);
         opts.put(Options.KEY_TARGET_VERSION, targetVM != null && targetVM.trim().length()
> 0 ? targetVM.trim() : JavaScriptEngineFactory.VERSION_AUTO);
         if ( JavaScriptEngineFactory.VERSION_AUTO.equalsIgnoreCase((String)opts.get(Options.KEY_TARGET_VERSION))
) {
             opts.put(Options.KEY_TARGET_VERSION, currentVersion);
         }
 
-        final String encoding = (String) props.get(JavaScriptEngineFactory.PROPERTY_ENCODING);
+        final String encoding = PropertiesUtil.toString(
+                props.get(JavaScriptEngineFactory.PROPERTY_ENCODING), null);
         opts.encoding = encoding != null && encoding.length() > 0 ? encoding :
"UTF-8";
 
         opts.put(Options.KEY_IGNORE_WARNINGS, true);



Mime
View raw message