test/serviceability/dcmd/CodeCacheTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hs-comp Cdiff test/serviceability/dcmd/CodeCacheTest.java
test/serviceability/dcmd/CodeCacheTest.java
Print this page
rev 7051 : 8058479: serviceability/dcmd/CodeCacheTest.java fails
Summary: Don't parse really large hex values into a long
Revied-by:
*** 78,103 ****
// Validate second line
line = r.readLine();
m = line2.matcher(line);
if (m.matches()) {
! long start = Long.parseLong(m.group(1), 16);
! if (start < 0) {
! throw new Exception("Failed parsing dcmd codecache output");
! }
! long mark = Long.parseLong(m.group(2), 16);
! if (mark < 0) {
! throw new Exception("Failed parsing dcmd codecache output");
! }
! long top = Long.parseLong(m.group(3), 16);
! if (top < 0) {
! throw new Exception("Failed parsing dcmd codecache output");
! }
! if (start > mark) {
throw new Exception("Failed parsing dcmd codecache output");
}
! if (mark > top) {
throw new Exception("Failed parsing dcmd codecache output");
}
} else {
throw new Exception("Regexp 2 failed line: " + line);
}
--- 78,96 ----
// Validate second line
line = r.readLine();
m = line2.matcher(line);
if (m.matches()) {
! String start = m.group(1);
! String mark = m.group(2);
! String top = m.group(3);
!
! // Lexical compare of hex numbers to check that they look sane.
! if (start.compareTo(mark) > 1) {
throw new Exception("Failed parsing dcmd codecache output");
}
! if (mark.compareTo(top) > 1) {
throw new Exception("Failed parsing dcmd codecache output");
}
} else {
throw new Exception("Regexp 2 failed line: " + line);
}
test/serviceability/dcmd/CodeCacheTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File