8287761: Make the logging of J2DBench stable

Reviewed-by: aghaisas, prr
This commit is contained in:
Sergey Bylokhov 2022-06-06 21:25:14 +00:00
parent 5264881a15
commit a277590c89
2 changed files with 23 additions and 23 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -40,11 +40,11 @@
package j2dbench;
import java.util.Vector;
import java.util.Hashtable;
import java.util.Enumeration;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Vector;
public class Result {
public static final int RATE_UNKNOWN = 0;
@ -243,7 +243,7 @@ public class Result {
int repsPerRun;
int unitsPerRep;
Vector times;
Hashtable modifiers;
LinkedHashMap modifiers;
Throwable error;
public Result(Test test) {
@ -277,7 +277,7 @@ public class Result {
this.error = t;
}
public void setModifiers(Hashtable modifiers) {
public void setModifiers(LinkedHashMap modifiers) {
this.modifiers = modifiers;
}
@ -297,7 +297,7 @@ public class Result {
return ((long) getRepsPerRun()) * ((long) getUnitsPerRep());
}
public Hashtable getModifiers() {
public LinkedHashMap getModifiers() {
return modifiers;
}
@ -423,11 +423,11 @@ public class Result {
System.out.println(test+" averaged "+getAverageString());
}
if (true) {
Enumeration enum_ = modifiers.keys();
Iterator iter_ = modifiers.keySet().iterator();
System.out.print(" with");
String sep = " ";
while (enum_.hasMoreElements()) {
Modifier mod = (Modifier) enum_.nextElement();
while (iter_.hasNext()) {
Modifier mod = (Modifier) iter_.next();
Object v = modifiers.get(mod);
System.out.print(sep);
System.out.print(mod.getAbbreviatedModifierDescription(v));
@ -442,9 +442,9 @@ public class Result {
"num-reps=\""+getRepsPerRun()+"\" "+
"num-units=\""+getUnitsPerRep()+"\" "+
"name=\""+test.getTreeName()+"\">");
Enumeration enum_ = modifiers.keys();
while (enum_.hasMoreElements()) {
Modifier mod = (Modifier) enum_.nextElement();
Iterator iter_ = modifiers.keySet().iterator();
while (iter_.hasNext()) {
Modifier mod = (Modifier) iter_.next();
Object v = modifiers.get(mod);
String val = mod.getModifierValueName(v);
pw.println(" <option "+

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -40,15 +40,15 @@
package j2dbench;
import java.awt.AlphaComposite;
import java.awt.Canvas;
import java.awt.Image;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Dimension;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import j2dbench.tests.GraphicsTests;
@ -105,12 +105,12 @@ public class TestEnvironment implements Node.Visitor {
Image srcImage;
boolean stopped;
ResultSet results;
Hashtable modifiers;
LinkedHashMap modifiers;
Timer timer;
public TestEnvironment() {
results = new ResultSet();
modifiers = new Hashtable();
modifiers = new LinkedHashMap();
timer = Timer.getImpl();
}
@ -246,8 +246,8 @@ public class TestEnvironment implements Node.Visitor {
modifiers.remove(o);
}
public Hashtable getModifiers() {
return (Hashtable) modifiers.clone();
public LinkedHashMap getModifiers() {
return (LinkedHashMap) modifiers.clone();
}
public void record(Result result) {