Author: cziegeler
Date: Wed Aug  9 14:57:12 2017
New Revision: 1804538

URL: http://svn.apache.org/viewvc?rev=1804538&view=rev
Log:
SLING-7040 : Update commons lang 2.x to 3.5

Modified:
    sling/trunk/bundles/scripting/core/pom.xml
    
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptCacheConsolePlugin.java
    
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingBindingsVariablesListJsonServlet.java

Modified: sling/trunk/bundles/scripting/core/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/pom.xml?rev=1804538&r1=1804537&r2=1804538&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/pom.xml (original)
+++ sling/trunk/bundles/scripting/core/pom.xml Wed Aug  9 14:57:12 2017
@@ -191,12 +191,6 @@
             <version>2.4</version>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
-            <version>2.4</version>
-            <scope>provided</scope>
-        </dependency>
 
         <dependency>
             <groupId>com.google.code.findbugs</groupId>

Modified: 
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptCacheConsolePlugin.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptCacheConsolePlugin.java?rev=1804538&r1=1804537&r2=1804538&view=diff
==============================================================================
--- 
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptCacheConsolePlugin.java
 (original)
+++ 
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptCacheConsolePlugin.java
 Wed Aug  9 14:57:12 2017
@@ -23,16 +23,14 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
 import org.apache.felix.webconsole.AbstractWebConsolePlugin;
 import org.apache.felix.webconsole.WebConsoleConstants;
-import org.apache.sling.api.SlingHttpServletRequest;
-import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.scripting.api.ScriptCache;
 import org.osgi.framework.Constants;
 import org.osgi.service.component.annotations.Component;
@@ -78,7 +76,7 @@ public class ScriptCacheConsolePlugin ex
             throws ServletException, IOException {
         if (scriptCache instanceof ScriptCacheImpl) {
             ScriptCacheImpl scriptCacheImpl = (ScriptCacheImpl) scriptCache;
-            List<String> scripts = new 
ArrayList<String>(scriptCacheImpl.getCachedScripts());
+            List<String> scripts = new 
ArrayList<>(scriptCacheImpl.getCachedScripts());
             StringBuilder sb = new StringBuilder();
             sb.append("<script type='text/javascript' 
src='").append(RESOURCES).append("/").append(SCRIPTCACHE_JS).append("'></script>");
             sb.append("<div id='cached-scripts' class='ui-widget statline'>");
@@ -116,7 +114,7 @@ public class ScriptCacheConsolePlugin ex
     @Override
     protected void doPost(HttpServletRequest req, HttpServletResponse resp) 
throws ServletException, IOException {
         String script = req.getParameter(POST_SCRIPT);
-        if (StringUtils.isNotEmpty(script)) {
+        if (script != null && !script.isEmpty()) {
             if ("all".equals(script)) {
                 scriptCache.clear();
                 renderContent(req, resp);

Modified: 
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingBindingsVariablesListJsonServlet.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingBindingsVariablesListJsonServlet.java?rev=1804538&r1=1804537&r2=1804538&view=diff
==============================================================================
--- 
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingBindingsVariablesListJsonServlet.java
 (original)
+++ 
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingBindingsVariablesListJsonServlet.java
 Wed Aug  9 14:57:12 2017
@@ -27,7 +27,6 @@ import javax.script.ScriptEngineManager;
 import javax.servlet.Servlet;
 import javax.servlet.ServletException;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.felix.utils.json.JSONWriter;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
@@ -97,7 +96,7 @@ public class SlingBindingsVariablesListJ
         jsonWriter.array();
         // get filter by engine selector
         String requestedExtension = request.getParameter(PARAMETER_EXTENSION);
-        if (StringUtils.isNotBlank(requestedExtension)) {
+        if (requestedExtension != null && !requestedExtension.isEmpty() ) {
             ScriptEngine selectedScriptEngine = 
scriptEngineManager.getEngineByExtension(requestedExtension);
             if (selectedScriptEngine == null) {
                 throw new IllegalArgumentException("Invalid extension 
requested: "+requestedExtension);


Reply via email to