mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-23 03:48:13 +00:00
7029680: fix test/sun/misc/Version/Version.java build parsing
Reviewed-by: ohair
This commit is contained in:
parent
1273c8e233
commit
3d3e0d5f7f
@ -142,15 +142,21 @@ public class Version {
|
||||
// non-product VM will have -debug|-release appended
|
||||
cs = cs.subSequence(1, cs.length());
|
||||
String[] res = cs.toString().split("-");
|
||||
for (String s : res) {
|
||||
for (int i = res.length - 1; i >= 0; i--) {
|
||||
String s = res[i];
|
||||
if (s.charAt(0) == 'b') {
|
||||
build =
|
||||
Integer.valueOf(s.substring(1, s.length())).intValue();
|
||||
break;
|
||||
try {
|
||||
build = Integer.parseInt(s.substring(1, s.length()));
|
||||
break;
|
||||
} catch (NumberFormatException nfe) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new VersionInfo(major, minor, micro, update, special, build);
|
||||
VersionInfo vi = new VersionInfo(major, minor, micro, update, special, build);
|
||||
System.out.printf("newVersionInfo: input=%s output=%s\n", version, vi);
|
||||
return vi;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user