Skip to content

Commit

Permalink
GEODE-6030: Upgrade commons-lang to commons-lang3 (apache#2830)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeppe-pivotal authored Nov 12, 2018
1 parent b43e571 commit 10d89ed
Show file tree
Hide file tree
Showing 244 changed files with 332 additions and 320 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,4 @@ class DockerizedTestPlugin implements Plugin<Project> {
}
}

}
}
2 changes: 1 addition & 1 deletion extensions/geode-modules-assembly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ task distAppServer(type: Zip, dependsOn: [':extensions:geode-modules-session:jar
filter(ReplaceTokens, tokens:['TX_VERSION': project.'javax.transaction-api.version'])
filter(ReplaceTokens, tokens:['JGROUPS_VERSION': project.'jgroups.version'])
filter(ReplaceTokens, tokens:['SHIRO_VERSION': project.'shiro.version'])
filter(ReplaceTokens, tokens:['COMMONS_LANG_VERSION': project.'commons-lang.version'])
filter(ReplaceTokens, tokens:['COMMONS_LANG_VERSION': project.'commons-lang3.version'])
filter(ReplaceTokens, tokens:['COMMONS_VALIDATOR_VERSION': project.'commons-validator.version'])
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ OTHER_JARS=(${GEODE}/lib/geode-core-${VERSION}.jar \
${GEODE}/lib/fastutil-@[email protected] \
${GEODE}/lib/javax.transaction-api-@[email protected] \
${GEODE}/lib/jgroups-@[email protected] \
${GEODE}/lib/commons-lang-@[email protected] \
${GEODE}/lib/commons-lang3-@[email protected] \
${GEODE}/lib/shiro-core-@[email protected] \
${GEODE}/lib/commons-validator-@[email protected] \
${LIB_DIR}/geode-modules-${VERSION}.jar \
Expand Down
2 changes: 1 addition & 1 deletion geode-assembly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def cp = {
it.contains('commons-io') ||
it.contains('classgraph') ||
it.contains('commons-collections') ||
it.contains('commons-lang') ||
it.contains('commons-lang3') ||
it.contains('commons-logging') ||
it.contains('commons-validator') ||
it.contains('commons-beanutils') ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import java.util.HashMap;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.SystemUtils;
import org.apache.commons.lang3.JavaVersion;
import org.apache.commons.lang3.SystemUtils;
import org.apache.logging.log4j.Logger;
import org.codehaus.cargo.container.ContainerType;
import org.codehaus.cargo.container.InstalledLocalContainer;
Expand Down Expand Up @@ -185,7 +186,7 @@ public void start() {
config.setProperty(TomcatPropertySet.AJP_PORT, Integer.toString(ports[2]));
config.setProperty(GeneralPropertySet.PORT_OFFSET, "0");
String jvmArgs = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=" + ports[3];
if (SystemUtils.isJavaVersionAtLeast(900)) {
if (SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)) {
jvmArgs += " --add-opens java.base/java.lang.module=ALL-UNNAMED" +
" --add-opens java.base/jdk.internal.module=ALL-UNNAMED" +
" --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assume.assumeTrue;

import org.apache.commons.lang.SystemUtils;
import org.apache.commons.lang3.JavaVersion;
import org.apache.commons.lang3.SystemUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Expand All @@ -42,7 +43,7 @@ public class ConnectCommandAcceptanceTest {
@Test
public void useCurrentGfshToConnectToOlderLocator() throws Exception {
// this test can only be run with pre-9 jdk since it needs to run older version of gfsh
assumeTrue(!SystemUtils.isJavaVersionAtLeast(900));
assumeTrue(!SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9));
GfshScript.of("start locator").execute(gfsh130);
GfshExecution connect = GfshScript.of("connect").expectFailure().execute(gfshDefault);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.CloseableHttpResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ lib/commons-codec-1.10.jar
lib/commons-collections-3.2.2.jar
lib/commons-digester-2.1.jar
lib/commons-io-2.6.jar
lib/commons-lang-2.6.jar
lib/commons-lang3-3.8.1.jar
lib/commons-logging-1.2.jar
lib/commons-math3-3.2.jar
lib/commons-modeler-2.0.1.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ commons-beanutils-1.9.3.jar
commons-codec-1.10.jar
commons-collections-3.2.2.jar
commons-io-2.6.jar
commons-lang-2.6.jar
commons-lang3-3.8.1.jar
commons-logging-1.2.jar
commons-validator-1.6.jar
fastutil-8.2.1.jar
Expand Down
2 changes: 1 addition & 1 deletion geode-connectors/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies {
}

compile('com.zaxxer:HikariCP:3.2.0')
compile('commons-lang:commons-lang:' + project.'commons-lang.version')
compile('org.apache.commons:commons-lang3:' + project.'commons-lang3.version')
compile('javax.xml.bind:jaxb-api:' + project.'jaxb.version')
compile('org.apache.logging.log4j:log4j-api:' + project.'log4j.version')
compile('org.apache.logging.log4j:log4j-jcl:' + project.'log4j.version') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import java.sql.SQLException;

import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;

import org.apache.geode.cache.CacheRuntimeException;

Expand Down Expand Up @@ -44,7 +44,7 @@ public class JdbcConnectorException extends CacheRuntimeException {
public static JdbcConnectorException createException(Exception e) {
if (containsNonSerializableException(e)) {
String message =
e.getMessage() + System.lineSeparator() + ExceptionUtils.getFullStackTrace(e);
e.getMessage() + System.lineSeparator() + ExceptionUtils.getStackTrace(e);
return new JdbcConnectorException(message);
} else {
return new JdbcConnectorException(e);
Expand All @@ -64,7 +64,7 @@ public static JdbcConnectorException createException(Exception e) {
*/
public static JdbcConnectorException createException(String message, Exception e) {
if (containsNonSerializableException(e)) {
message += e.getMessage() + System.lineSeparator() + ExceptionUtils.getFullStackTrace(e);
message += e.getMessage() + System.lineSeparator() + ExceptionUtils.getStackTrace(e);
return new JdbcConnectorException(message);
} else {
return new JdbcConnectorException(message, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import java.io.Serializable;

import org.apache.commons.lang.SerializationUtils;
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import java.io.Serializable;

import org.apache.commons.lang.SerializationUtils;
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import java.io.Serializable;

import org.apache.commons.lang.SerializationUtils;
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.SerializationUtils;
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
Expand Down
6 changes: 3 additions & 3 deletions geode-connectors/src/test/resources/expected-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion geode-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ dependencies {
compile('com.sun.xml.bind:jaxb-core:' + project.'jaxb.version')
compile('com.sun.xml.bind:jaxb-impl:' + project.'jaxb.version')

compile('commons-lang:commons-lang:' + project.'commons-lang.version')
compile('org.apache.commons:commons-lang3:' + project.'commons-lang3.version')
compile('commons-modeler:commons-modeler:' + project.'commons-modeler.version') {
exclude module: 'commons-digester'
exclude module: 'commons-logging-api'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import java.io.Serializable;

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

/**
* Test object which does not implement ObjectSizer, used as Key/Value in put operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import java.util.concurrent.TimeUnit;

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

import org.apache.geode.SystemFailure;
import org.apache.geode.cache.AttributesFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.Iterator;
import java.util.Set;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.Iterator;
import java.util.Set;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.Iterator;
import java.util.Set;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import java.util.Properties;
import java.util.Set;

import org.apache.commons.lang.SerializationException;
import org.apache.commons.lang3.SerializationException;
import org.jgroups.Address;
import org.jgroups.Event;
import org.jgroups.JChannel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
package org.apache.geode.internal.logging;

import static org.apache.commons.lang.SystemUtils.LINE_SEPARATOR;
import static org.apache.commons.lang3.SystemUtils.LINE_SEPARATOR;
import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
import static org.apache.geode.distributed.ConfigurationProperties.LOG_FILE;
import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void nullFileName_throwsIllegalArgumentException() throws Exception {
// act/assert
assertThatThrownBy(
() -> new ControlFileWatchdog(directory, requestFileName, requestHandler, stopAfterRequest))
.isInstanceOf(IllegalArgumentException.class);
.isInstanceOf(NullPointerException.class);
}

@Test
Expand All @@ -115,7 +115,7 @@ public void nullDirectory_throwsIllegalArgumentException() throws Exception {
// act/assert
assertThatThrownBy(
() -> new ControlFileWatchdog(directory, requestFileName, requestHandler, stopAfterRequest))
.isInstanceOf(IllegalArgumentException.class);
.isInstanceOf(NullPointerException.class);
}

@Test
Expand All @@ -126,7 +126,7 @@ public void nullRequestHandler_throwsIllegalArgumentException() throws Exception
// act/assert
assertThatThrownBy(
() -> new ControlFileWatchdog(directory, requestFileName, requestHandler, stopAfterRequest))
.isInstanceOf(IllegalArgumentException.class);
.isInstanceOf(NullPointerException.class);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void readingNullFileThrowsNullPointerException() throws Exception {

// act/assert
assertThatThrownBy(() -> new PidFile(pidFile).readPid())
.isInstanceOf(IllegalArgumentException.class);
.isInstanceOf(NullPointerException.class);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void createProcessController_nullParameters_throwsNullPointerException()

// act/assert
assertThatThrownBy(() -> factory.createProcessController(parameters, directory, pidFileName))
.isInstanceOf(IllegalArgumentException.class);
.isInstanceOf(NullPointerException.class);
}

@Test
Expand All @@ -116,7 +116,7 @@ public void createProcessController_nullDirectory_throwsNullPointerException() t

// act/assert
assertThatThrownBy(() -> factory.createProcessController(parameters, directory, pidFileName))
.isInstanceOf(IllegalArgumentException.class);
.isInstanceOf(NullPointerException.class);
}

@Test
Expand All @@ -127,6 +127,6 @@ public void createProcessController_nullPidFileName_throwsNullPointerException()

// act/assert
assertThatThrownBy(() -> factory.createProcessController(parameters, directory, pidFileName))
.isInstanceOf(IllegalArgumentException.class);
.isInstanceOf(NullPointerException.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static java.util.concurrent.TimeUnit.MINUTES;
import static org.apache.commons.io.FileUtils.moveFileToDirectory;
import static org.apache.commons.io.FileUtils.sizeOfDirectory;
import static org.apache.commons.lang.StringUtils.leftPad;
import static org.apache.commons.lang3.StringUtils.leftPad;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
package org.apache.geode.management.internal.cli;

import static org.apache.commons.lang.SystemUtils.LINE_SEPARATOR;
import static org.apache.commons.lang3.SystemUtils.LINE_SEPARATOR;
import static org.assertj.core.api.Assertions.assertThat;

import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.util.Random;
import java.util.Set;

import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
package org.apache.geode.admin.jmx.internal;

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

/**
* Type-safe definition for ModelMBean managed resources. The class type ({@link #getClassTypeName})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
package org.apache.geode.admin.jmx.internal;

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

/**
* Type-safe definition for refresh notifications.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
package org.apache.geode.cache.client.internal;

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

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
package org.apache.geode.cache.client.internal;

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

import java.net.InetSocketAddress;
import java.util.ArrayList;
Expand Down
Loading

0 comments on commit 10d89ed

Please sign in to comment.