-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-8146] Drop commons-lang #1564
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,10 @@ public void testCalculateDegreeOfConcurrency() { | |
int cpus = Runtime.getRuntime().availableProcessors(); | ||
assertEquals((int) (cpus * 2.2), cli.calculateDegreeOfConcurrency("2.2C")); | ||
assertEquals(1, cli.calculateDegreeOfConcurrency("0.0001C")); | ||
assertThrows(IllegalArgumentException.class, new ConcurrencyCalculator("2.C")); | ||
// Note: this assertion below makes no sense, first Float.parseFloat("2.") DOES parse the string in 2.0. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, just delete this then |
||
// Second, the limitation to reject string "2." was actually commons-lang3 NumberUtils.isParsable limitation | ||
// We should not "skew" our input validation by some utility, while using Java classes to perform actual parsing | ||
// assertThrows(IllegalArgumentException.class, new ConcurrencyCalculator("2.C")); | ||
assertThrows(IllegalArgumentException.class, new ConcurrencyCalculator("-2.2C")); | ||
assertThrows(IllegalArgumentException.class, new ConcurrencyCalculator("0C")); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,6 @@ under the License. | |
<classWorldsVersion>2.8.0</classWorldsVersion> | ||
<commonsCliVersion>1.8.0</commonsCliVersion> | ||
<commonsIoVersion>2.16.1</commonsIoVersion> | ||
<commonsLangVersion>3.14.0</commonsLangVersion> | ||
<junitVersion>4.13.2</junitVersion> | ||
<hamcrestVersion>2.2</hamcrestVersion> | ||
<mockitoVersion>4.11.0</mockitoVersion> | ||
|
@@ -442,16 +441,6 @@ under the License. | |
<groupId>commons-cli</groupId> | ||
<artifactId>commons-cli</artifactId> | ||
<version>${commonsCliVersion}</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>commons-lang</groupId> | ||
<artifactId>commons-lang</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>commons-logging</groupId> | ||
<artifactId>commons-logging</artifactId> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the commons-logging exclusion? This is unrelated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because commons-cli does not depend on any of these, this seems legacy that was never removed? Commons cli deps are only these:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commons Logging has been removed as a dep? |
||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-io</groupId> | ||
|
@@ -463,11 +452,6 @@ under the License. | |
<artifactId>commons-jxpath</artifactId> | ||
<version>${jxpathVersion}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-lang3</artifactId> | ||
<version>${commonsLangVersion}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.codehaus.plexus</groupId> | ||
<artifactId>plexus-sec-dispatcher</artifactId> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to allow digits from other alphabets beyond the usual 0-9. I don't think we want that, do we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was
https://github.com/apache/commons-lang/blob/45a955702a06d817aa18007a9b099c37ee2ec20a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java#L679
but it actually ended up here
https://github.com/apache/commons-lang/blob/45a955702a06d817aa18007a9b099c37ee2ec20a/src/main/java/org/apache/commons/lang3/StringUtils.java#L3812-L3813
And javadoc DOES contains example with non latin alphabet. But I agree, we really want ASCII 0-9 here.