mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-09 03:24:58 +00:00
Merge pull request #439 from Stzx/master
Improvement JavaVersion get method
This commit is contained in:
commit
e610367507
@ -194,7 +194,9 @@ static JavaVersion getJavaVersion(final String nom) {
|
||||
* version is unknown
|
||||
*/
|
||||
static JavaVersion get(final String nom) {
|
||||
if ("0.9".equals(nom)) {
|
||||
if (nom == null) {
|
||||
return null;
|
||||
} else if ("0.9".equals(nom)) {
|
||||
return JAVA_0_9;
|
||||
} else if ("1.1".equals(nom)) {
|
||||
return JAVA_1_1;
|
||||
@ -223,9 +225,6 @@ static JavaVersion get(final String nom) {
|
||||
} else if ("13".equals(nom)) {
|
||||
return JAVA_13;
|
||||
}
|
||||
if (nom == null) {
|
||||
return null;
|
||||
}
|
||||
final float v = toFloatVersion(nom);
|
||||
if ((v - 1.) < 1.) { // then we need to check decimals > .9
|
||||
final int firstComma = Math.max(nom.indexOf('.'), nom.indexOf(','));
|
||||
|
Loading…
x
Reference in New Issue
Block a user