SLING-6717 : Use commons lang3
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1788867 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 10f3764..9b3a87e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -133,9 +133,9 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
diff --git a/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java b/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
index a047953..7b5a35d 100644
--- a/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
+++ b/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
@@ -24,7 +24,7 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.sling.api.SlingConstants;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
@@ -104,7 +104,7 @@
pw.println("<h1>Resource dumped by " + getClass().getSimpleName() + "</h1>");
pw.println("<p>Resource path: <b>" + r.getPath() + "</b></p>");
pw.println("<p>Resource metadata: <b>"
- + StringEscapeUtils.escapeHtml(String.valueOf(r.getResourceMetadata()))
+ + StringEscapeUtils.escapeHtml4(String.valueOf(r.getResourceMetadata()))
+ "</b></p>");
pw.println("<p>Resource type: <b>" + r.getResourceType() + "</b></p>");
diff --git a/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java b/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java
index 461d6ad..9d7a58a 100644
--- a/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java
+++ b/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java
@@ -20,7 +20,7 @@
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.SlingException;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
@@ -52,17 +52,17 @@
/** Selector that means "pretty-print the output */
public static final String TIDY = "tidy";
-
- /** Selector that causes hierarchy to be rendered as arrays
- * instead of child objects - useful to preserve the order of those
- * child objects */
+
+ /** Selector that causes hierarchy to be rendered as arrays
+ * instead of child objects - useful to preserve the order of those
+ * child objects */
public static final String HARRAY = "harray";
-
+
/** How much to indent in tidy mode */
public static final int INDENT_SPACES = 2;
private long maximumResults;
-
+
private final JSONRenderer renderer = new JSONRenderer();
public JsonRendererServlet(long maximumResults) {
@@ -136,7 +136,7 @@
reportException(je);
}
}
-
+
/**
* Get recursion level from selectors. as per SLING-167: the last selector, if present, gives the recursion level.
*
@@ -160,7 +160,7 @@
if (StringUtils.isNumeric(level)){
maxRecursionLevels = -1;
} else {
- throw new IllegalArgumentException("Invalid recursion selector value '" + level + "'");
+ throw new IllegalArgumentException("Invalid recursion selector value '" + level + "'");
}
}
}