test/sun/misc/Version/Version.java
Print this page
rev 9165 : 8032678: [TESTBUG] sun/misc/Version/Version.java doesn't understand two-digit HotSpot minor version numbers
*** 1,7 ****
/*
! * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 114,128 ****
micro = Character.digit(cs.charAt(4), 10);
cs = cs.subSequence(5, cs.length());
} else if (Character.isDigit(cs.charAt(0)) &&
Character.isDigit(cs.charAt(1)) && cs.charAt(2) == '.' &&
Character.isDigit(cs.charAt(3))) {
! // HSX has nn.n (major.minor) version
major = Integer.valueOf(version.substring(0, 2)).intValue();
minor = Character.digit(cs.charAt(3), 10);
cs = cs.subSequence(4, cs.length());
}
if (cs.charAt(0) == '_' && cs.length() >= 3 &&
Character.isDigit(cs.charAt(1)) &&
Character.isDigit(cs.charAt(2))) {
int nextChar = 3;
String uu = cs.subSequence(1, 3).toString();
--- 114,134 ----
micro = Character.digit(cs.charAt(4), 10);
cs = cs.subSequence(5, cs.length());
} else if (Character.isDigit(cs.charAt(0)) &&
Character.isDigit(cs.charAt(1)) && cs.charAt(2) == '.' &&
Character.isDigit(cs.charAt(3))) {
! // HSX has nn.n[n] (major.minor) version
major = Integer.valueOf(version.substring(0, 2)).intValue();
+ if (Character.isDigit(cs.charAt(4))) {
+ minor = Integer.valueOf(version.substring(3, 5)).intValue();
+ cs = cs.subSequence(5, cs.length());
+ }
+ else {
minor = Character.digit(cs.charAt(3), 10);
cs = cs.subSequence(4, cs.length());
}
+ }
if (cs.charAt(0) == '_' && cs.length() >= 3 &&
Character.isDigit(cs.charAt(1)) &&
Character.isDigit(cs.charAt(2))) {
int nextChar = 3;
String uu = cs.subSequence(1, 3).toString();