< prev index next >
test/hotspot/jtreg/runtime/LoadClass/TestResize.java
Print this page
*** 68,78 ****
--- 68,80 ----
static void analyzeOutputOn(ProcessBuilder pb) throws Exception {
pb.redirectErrorStream(true);
Process process = pb.start();
BufferedReader rd = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = rd.readLine();
+ String string_out = "";
while (line != null) {
+ string_out += line+"\n";
if (line.startsWith("Java dictionary (")) {
// ex. "Java dictionary (table_size=107, classes=6)"
// ex. "Java dictionary (table_size=20201, classes=50002)"
Scanner scanner = new Scanner(line);
scanner.next();
*** 81,91 ****
int classes = getInt(scanner.next());
scanner.close();
double loadFactor = (double)classes / (double)table_size;
if (loadFactor > MAX_LOAD_FACTOR) {
! throw new RuntimeException("Load factor too high, expected MAX "+MAX_LOAD_FACTOR+", got "+loadFactor);
} else {
System.out.println("PASS table_size:"+table_size+", classes:"+classes+" OK");
}
}
line = rd.readLine();
--- 83,98 ----
int classes = getInt(scanner.next());
scanner.close();
double loadFactor = (double)classes / (double)table_size;
if (loadFactor > MAX_LOAD_FACTOR) {
! System.out.println(string_out);
! while (line != null) {
! line = rd.readLine();
! System.out.println(line);
! }
! throw new RuntimeException("Load factor too high, expected MAX "+MAX_LOAD_FACTOR+", got "+loadFactor+" [table size "+table_size+", number of clases "+classes+"]");
} else {
System.out.println("PASS table_size:"+table_size+", classes:"+classes+" OK");
}
}
line = rd.readLine();
< prev index next >