Skip to content

Commit

Permalink
Using commons-lang3 to replace commons-lang (#4225)
Browse files Browse the repository at this point in the history
* Using commons-lang3 to replace commons-lang
  • Loading branch information
ruanwenjun authored Feb 15, 2022
1 parent 9d27eb8 commit a9579f1
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 24 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ Apollo 2.0.0
* [Fix update user's password failure](https://github.com/apolloconfig/apollo/pull/4212)
* [Fix bug: associated namespace display incorrect in text view](https://github.com/apolloconfig/apollo/pull/4219)
* [Add Ordered interface to ProviderManager SPI](https://github.com/apolloconfig/apollo/pull/4218)

* [Using commons-lang3 to replace commons-lang](https://github.com/apolloconfig/apollo/pull/4225)
------------------
All issues and pull requests are [here](https://github.com/ctripcorp/apollo/milestone/8?closed=1)
4 changes: 2 additions & 2 deletions apollo-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
<artifactId>janino</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<!-- Micrometer core dependecy -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
*/
package com.ctrip.framework.apollo.common.utils;

import com.google.common.base.Joiner;

import com.ctrip.framework.apollo.core.utils.ByteUtil;
import com.ctrip.framework.apollo.core.utils.MachineUtil;

import org.apache.commons.lang.time.FastDateFormat;
import com.google.common.base.Joiner;
import org.apache.commons.lang3.time.FastDateFormat;

import java.security.SecureRandom;
import java.util.Date;
Expand All @@ -34,8 +32,6 @@ public class UniqueKeyGenerator {
private static final AtomicInteger counter = new AtomicInteger(new SecureRandom().nextInt());
private static final Joiner KEY_JOINER = Joiner.on("-");



public static String generate(Object... args){
String hexIdString =
ByteUtil.toHexString(toByteArray(Objects.hash(args), MachineUtil.getMachineIdentifier(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.hash.Hashing;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang.time.FastDateFormat;
import org.apache.commons.lang3.time.FastDateFormat;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
* @author Jason Song([email protected])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package com.ctrip.framework.apollo.portal.component.emailbuilder;


import com.google.common.collect.Lists;

import com.ctrip.framework.apollo.common.constants.ReleaseOperation;
Expand All @@ -38,7 +37,7 @@
import com.ctrip.framework.apollo.portal.spi.UserService;
import com.ctrip.framework.apollo.portal.util.RoleUtils;

import org.apache.commons.lang.time.FastDateFormat;
import org.apache.commons.lang3.time.FastDateFormat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;

Expand All @@ -50,7 +49,6 @@
import java.util.Set;
import java.util.regex.Matcher;


public abstract class ConfigPublishEmailBuilder {

private static final String EMERGENCY_PUBLISH_TAG = "<span style='color:red'>(紧急发布)</span>";
Expand Down Expand Up @@ -81,7 +79,6 @@ public abstract class ConfigPublishEmailBuilder {

protected FastDateFormat dateFormat = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss");


@Autowired
private RolePermissionService rolePermissionService;
@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.ctrip.framework.apollo.portal.service.NamespaceService;
import com.ctrip.framework.apollo.portal.util.NamespaceBOUtils;

import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.TreeSet;
import javax.naming.directory.Attribute;
import javax.naming.ldap.LdapName;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.EmptyResultDataAccessException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
*/
package com.ctrip.framework.apollo.portal.util;

import org.apache.commons.lang.time.FastDateFormat;
import org.apache.commons.lang3.time.FastDateFormat;

import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;


public class RelativeDateFormat {
private static final FastDateFormat TIMESTAMP_FORMAT = FastDateFormat.getInstance("yyyy-MM-dd");

Expand Down
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<javax.mail.version>1.6.2</javax.mail.version>
<javassist.version>3.23.1-GA</javassist.version>
<nacos-discovery-api.version>1.4.0</nacos-discovery-api.version>
<common-lang3.version>3.12.0</common-lang3.version>
<!-- Plugins Version -->
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
Expand Down Expand Up @@ -175,9 +176,9 @@
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${common-lang3.version}</version>
</dependency>
<!-- to fix CVE-2020-26217 -->
<dependency>
Expand Down

0 comments on commit a9579f1

Please sign in to comment.