Skip to content

Commit

Permalink
Merge pull request #1438 from tazmaniax/Upgrade_Commons_Lang
Browse files Browse the repository at this point in the history
Upgrade Commons Lang
  • Loading branch information
xael-fry authored Jun 28, 2023
2 parents 1e50f43 + 32167b4 commit 21f5bfb
Show file tree
Hide file tree
Showing 33 changed files with 38 additions and 39 deletions.
3 changes: 2 additions & 1 deletion framework/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ require: &allDependencies
- commons-fileupload 1.5
- commons-io 2.11.0
- com.google.code.maven-play-plugin.org.apache.commons -> commons-javaflow 1590792
- commons-lang 2.6
- org.apache.commons -> commons-lang3 3.12.0
- org.apache.commons -> commons-text 1.10.0
- commons-logging 1.2
- org.dom4j -> dom4j 2.1.4
- com.h2database -> h2 1.4.200
Expand Down
Binary file removed framework/lib/commons-lang-2.6.jar
Binary file not shown.
Binary file added framework/lib/commons-lang3-3.12.0.jar
Binary file not shown.
Binary file added framework/lib/commons-text-1.10.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.Set;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

import play.Logger;
import play.Play;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/data/binding/AnnotationHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Date;
import java.util.Locale;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

import play.data.binding.types.DateBinder;
import play.i18n.Lang;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/data/binding/Binder.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package play.data.binding;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import play.Logger;
import play.Play;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/data/validation/IPv4AddressCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.sf.oval.context.OValContext;
import net.sf.oval.exception.OValException;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

public class IPv4AddressCheck extends AbstractAnnotationCheck<IPv4Address> {

Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/db/DBPlugin.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package play.db;

import jregex.Matcher;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import play.Logger;
import play.Play;
import play.PlayPlugin;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/db/Evolutions.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.util.Set;
import java.util.Stack;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

import play.Logger;
import play.Play;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/db/evolutions/EvolutionQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import javax.sql.rowset.CachedRowSet;
import javax.sql.rowset.RowSetProvider;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

import play.Logger;
import play.Play;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/db/jpa/GenericModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import javax.persistence.PostUpdate;
import javax.persistence.Query;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

import play.Play;
import play.data.binding.BeanWrapper;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/libs/CronExpression.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.TimeZone;
import java.util.TreeSet;

import org.apache.commons.lang.NotImplementedException;
import org.apache.commons.lang3.NotImplementedException;

/**
* Thanks to Quartz project, https://quartz.dev.java.net
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/libs/I18N.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package play.libs;

import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import play.Play;
import play.i18n.Lang;

Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/libs/Mail.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import javax.mail.PasswordAuthentication;
import javax.mail.Session;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.mail.Email;
import org.apache.commons.mail.EmailException;

Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/libs/OpenID.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import javax.xml.parsers.DocumentBuilder;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;

Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/libs/WS.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import javax.xml.parsers.DocumentBuilder;

import org.apache.commons.lang.NotImplementedException;
import org.apache.commons.lang3.NotImplementedException;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package play.libs.mail.test;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.mail.Email;
import play.Logger;
import play.libs.Mail;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/libs/ws/WSAsync.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import javax.net.ssl.SSLContext;

import org.apache.commons.lang.NotImplementedException;
import org.apache.commons.lang3.NotImplementedException;

import com.ning.http.client.AsyncCompletionHandler;
import com.ning.http.client.AsyncHttpClient;
Expand Down
4 changes: 2 additions & 2 deletions framework/src/play/mvc/Mailer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import javax.activation.URLDataSource;
import javax.mail.internet.InternetAddress;

import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.mail.Email;
import org.apache.commons.mail.EmailAttachment;
import org.apache.commons.mail.EmailException;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/mvc/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import jregex.Matcher;
import jregex.Pattern;
import jregex.REFlags;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import play.Logger;
import play.Play;
import play.Play.Mode;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/plugins/PlayStatusPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.jamonapi.Monitor;
import com.jamonapi.MonitorFactory;
import com.jamonapi.utils.Misc;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import play.Invoker;
import play.Logger;
import play.Play;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/server/ServletWrapper.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package play.server;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import play.Invoker;
import play.Invoker.InvocationContext;
import play.Logger;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/templates/FastTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.Map;

import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.codehaus.groovy.runtime.NullObject;

import play.cache.Cache;
Expand Down
10 changes: 5 additions & 5 deletions framework/src/play/templates/JavaExtensions.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import java.util.Map;
import java.util.TimeZone;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;

import groovy.lang.Closure;
import groovy.util.XmlSlurper;
import groovy.util.slurpersupport.GPathResult;
import groovy.xml.XmlSlurper;
import groovy.xml.slurpersupport.GPathResult;
import play.Logger;
import play.i18n.Lang;
import play.i18n.Messages;
Expand Down Expand Up @@ -110,7 +110,7 @@ public static RawData escapeHtml(String htmlToEscape) {
}

public static String escapeJavaScript(String str) {
return StringEscapeUtils.escapeJavaScript(str);
return StringEscapeUtils.escapeEcmaScript(str);
}

public static RawData raw(Object val) {
Expand Down Expand Up @@ -156,7 +156,7 @@ protected static boolean eval(Object condition) {
}

public static String escapeXml(String str) {
return StringEscapeUtils.escapeXml(str);
return StringEscapeUtils.escapeXml11(str);
}

public static String format(Number number, String pattern) {
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/templates/types/SafeCSVFormatter.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package play.templates.types;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;
import play.templates.SafeFormatter;
import play.templates.Template;

Expand Down
4 changes: 2 additions & 2 deletions framework/src/play/templates/types/SafeXMLFormatter.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package play.templates.types;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;
import play.templates.SafeFormatter;
import play.templates.TagContext;
import play.templates.Template;
Expand All @@ -13,7 +13,7 @@ public String format(Template template, Object value) {
if (TagContext.hasParentTag("verbatim")) {
return value.toString();
}
return StringEscapeUtils.escapeXml(value.toString());
return StringEscapeUtils.escapeXml11(value.toString());
}
return "";
}
Expand Down
4 changes: 1 addition & 3 deletions framework/src/play/test/FunctionalTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.ning.http.client.multipart.MultipartUtils;
import com.ning.http.client.multipart.Part;
import com.ning.http.client.multipart.StringPart;
import org.apache.commons.lang.ArrayUtils;
import org.junit.Before;
import play.Invoker;
import play.Invoker.InvocationContext;
Expand Down Expand Up @@ -222,8 +221,7 @@ public static Response POST(Request request, Object url, Map<String, String> par
_ByteArrayOutputStream baos;
try {
requestEntity = MultipartUtils.newMultipartBody(parts, new FluentCaseInsensitiveStringsMap());
request.headers.putAll(ArrayUtils
.toMap(new Object[][] { { "content-type", new Http.Header("content-type", requestEntity.getContentType()) } }));
request.headers.put("content-type", new Http.Header("content-type", requestEntity.getContentType()));
long contentLength = requestEntity.getContentLength();
if (contentLength < Integer.MIN_VALUE || contentLength > Integer.MAX_VALUE) {
throw new IllegalArgumentException(contentLength + " cannot be cast to int without changing its value.");
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/test/PlayJUnitRunner.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package play.test;

import java.io.File;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.junit.rules.MethodRule;
import org.junit.runner.Description;
import org.junit.runner.Runner;
Expand Down
4 changes: 2 additions & 2 deletions framework/src/play/utils/HTTP.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package play.utils;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import play.Logger;
import play.libs.IO;

import java.io.InputStream;
import java.text.ParseException;
import java.util.*;

import static org.apache.commons.lang.StringUtils.isEmpty;
import static org.apache.commons.lang3.StringUtils.isEmpty;

public class HTTP {

Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/utils/OrderSafeProperties.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package play.utils;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand Down
2 changes: 1 addition & 1 deletion framework/test-src/play/utils/HTTPTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.text.ParseException;
import java.util.Date;

import static org.apache.commons.lang.time.DateUtils.addDays;
import static org.apache.commons.lang3.time.DateUtils.addDays;
import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.SuffixFileFilter;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import play.Play;
import play.libs.IO;
import play.templates.Template;
Expand Down

0 comments on commit 21f5bfb

Please sign in to comment.