Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Use StringUtils instead of NumberUtils to check timestamp string (#360)
Browse files Browse the repository at this point in the history
* Use StringUtils instead of NumberUtils to check timestamp string

* Remove unused imports
  • Loading branch information
ktkrg authored Aug 8, 2020
1 parent 79841f2 commit e03a120
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down Expand Up @@ -115,7 +115,7 @@ private boolean valid(final String overridesJson, final String timestamp) {
return false;
}

return NumberUtils.isCreatable(timestamp);
return StringUtils.isNumeric(timestamp);
}

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@
import com.amazon.opendistro.elasticsearch.performanceanalyzer.grpc.ResourceEnum;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.configs.CacheDeciderConfig;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.summaries.ResourceUtil;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.core.Stats;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.util.InstanceDetails;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.store.rca.cluster.NodeKey;
import com.google.common.collect.ImmutableSet;
import java.util.Map;
import org.checkerframework.checker.units.qual.Temperature;
import org.junit.Before;
import org.junit.Test;

Expand Down

0 comments on commit e03a120

Please sign in to comment.