mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8217389: JTREG: Clean up, remove unused variable warnings
Reviewed-by: lmesnik, tschatzl
This commit is contained in:
parent
3d13ab6882
commit
b09dfdbc01
15 changed files with 43 additions and 42 deletions
|
@ -120,19 +120,16 @@ public class TestMaxNewSize {
|
|||
|
||||
public static void main(String args[]) throws Exception {
|
||||
String gcName = args[0];
|
||||
final int M32 = 32 * 1024 * 1024;
|
||||
final int M64 = 64 * 1024 * 1024;
|
||||
final int M96 = 96 * 1024 * 1024;
|
||||
final int M128 = 128 * 1024 * 1024;
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M" }, M128);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewRatio=5" }, M128);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewSize=32M" }, M128);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:OldSize=96M" }, M128);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:MaxNewSize=32M" }, M32);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewSize=32M", "-XX:MaxNewSize=32M" }, M32);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewRatio=6", "-XX:MaxNewSize=32M" }, M32);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-Xms96M" }, M128);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx96M", "-Xms96M" }, M96);
|
||||
checkMaxNewSize(new String[] { gcName, "-XX:NewSize=128M", "-XX:MaxNewSize=50M"}, M128);
|
||||
final int M = 1024 * 1024;
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M" }, 128 * M);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewRatio=5" }, 128 * M);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewSize=32M" }, 128 * M);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:OldSize=96M" }, 128 * M);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:MaxNewSize=32M" }, 32 * M);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewSize=32M", "-XX:MaxNewSize=32M" }, 32 * M);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewRatio=6", "-XX:MaxNewSize=32M" }, 32 * M);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-Xms96M" }, 128 * M);
|
||||
checkMaxNewSize(new String[] { gcName, "-Xmx96M", "-Xms96M" }, 96 * M);
|
||||
checkMaxNewSize(new String[] { gcName, "-XX:NewSize=128M", "-XX:MaxNewSize=50M"}, 128 * M);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
package gc.arguments;
|
||||
|
||||
import static java.lang.ref.Reference.reachabilityFence;
|
||||
|
||||
/*
|
||||
* @test TestTargetSurvivorRatioFlag
|
||||
* @key gc
|
||||
|
@ -297,7 +299,7 @@ public class TestTargetSurvivorRatioFlag {
|
|||
|
||||
// force minor GC
|
||||
while (youngGCBean.getCollectionCount() <= initialGcId + MAX_TENURING_THRESHOLD * 2) {
|
||||
byte b[] = new byte[ARRAY_LENGTH];
|
||||
reachabilityFence(new byte[ARRAY_LENGTH]);
|
||||
}
|
||||
|
||||
allocator.release();
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
package gc.cms;
|
||||
|
||||
import static java.lang.ref.Reference.reachabilityFence;
|
||||
|
||||
/*
|
||||
* @test DisableResizePLAB
|
||||
* @key gc
|
||||
|
@ -41,7 +43,7 @@ public class DisableResizePLAB {
|
|||
}
|
||||
long startTime = System.currentTimeMillis();
|
||||
while (System.currentTimeMillis() - startTime < 10_000) {
|
||||
Object o = new byte[1024];
|
||||
reachabilityFence(new byte[1024]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
package gc.cslocker;
|
||||
|
||||
import static java.lang.ref.Reference.reachabilityFence;
|
||||
|
||||
/*
|
||||
* @test TestCSLocker
|
||||
* @key gc
|
||||
|
@ -73,8 +75,7 @@ class GarbageProducer extends Thread
|
|||
|
||||
while (isRunning) {
|
||||
try {
|
||||
int[] arr = null;
|
||||
arr = new int[size];
|
||||
reachabilityFence(new int[size]);
|
||||
sleep(sleepTime);
|
||||
} catch (InterruptedException e) {
|
||||
isRunning = false;
|
||||
|
|
|
@ -57,8 +57,8 @@ public class TestMemoryMXBeans {
|
|||
MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
|
||||
long heapInit = memoryMXBean.getHeapMemoryUsage().getInit();
|
||||
long heapMax = memoryMXBean.getHeapMemoryUsage().getMax();
|
||||
long nonHeapInit = memoryMXBean.getNonHeapMemoryUsage().getInit();
|
||||
long nonHeapMax = memoryMXBean.getNonHeapMemoryUsage().getMax();
|
||||
memoryMXBean.getNonHeapMemoryUsage().getInit(); // value not used
|
||||
memoryMXBean.getNonHeapMemoryUsage().getMax(); // value not used
|
||||
|
||||
if (initSize > 0 && heapInit != initSize) {
|
||||
throw new IllegalStateException("Init heap size is wrong: " + heapInit + " vs " + initSize);
|
||||
|
|
|
@ -130,7 +130,7 @@ public class TestFromCardCacheIndex {
|
|||
if (target == null) {
|
||||
continue;
|
||||
}
|
||||
final long startAddress = WB.getObjectAddress(target);
|
||||
WB.getObjectAddress(target); // startAddress not used
|
||||
final long lastAddress = getObjectLastAddress(target);
|
||||
final int card = getCardIndex32bit(lastAddress);
|
||||
if (card == -1) {
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
package gc.g1;
|
||||
|
||||
import static java.lang.ref.Reference.reachabilityFence;
|
||||
|
||||
/*
|
||||
* @test TestHumongousAllocNearlyFullRegion
|
||||
* @bug 8143587
|
||||
|
@ -62,7 +64,7 @@ public class TestHumongousAllocNearlyFullRegion {
|
|||
for (int i = 0; i < heapSize; i++) {
|
||||
// 131069 is the number of longs it takes to fill a heapRegion except
|
||||
// for 8 bytes on 64 bit.
|
||||
long[] largeObect = new long[131069];
|
||||
reachabilityFence(new long[131069]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,10 +54,6 @@ public class TestRemsetLoggingThreads {
|
|||
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
// a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used.
|
||||
// Additionally use at least one thread.
|
||||
int expectedNumRefinementThreads = refinementThreads;
|
||||
|
||||
String pattern = "Concurrent RS threads times \\(s\\)$";
|
||||
Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStdout());
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ package gc.g1.humongousObjects;
|
|||
import jdk.test.lib.Utils;
|
||||
import sun.hotspot.WhiteBox;
|
||||
|
||||
import static java.lang.ref.Reference.reachabilityFence;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
@ -139,7 +141,7 @@ public class TestNoAllocationsInHRegions {
|
|||
// Dead object allocation
|
||||
() -> {
|
||||
int size = RND.nextInt(DEAD_OBJECT_MAX_SIZE);
|
||||
byte[] deadObject = new byte[size];
|
||||
reachabilityFence(new byte[size]);
|
||||
},
|
||||
|
||||
// Check
|
||||
|
|
|
@ -27,7 +27,6 @@ package gc.logging;
|
|||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
|
@ -67,8 +66,6 @@ public class TestMetaSpaceLog {
|
|||
}
|
||||
|
||||
private static void verifyContainsMetaSpaceUpdate(OutputAnalyzer output) {
|
||||
Predicate<String> collectedMetaSpace = line -> check(line);
|
||||
|
||||
// At least one metaspace line from GC should show GC being collected.
|
||||
boolean foundCollectedMetaSpace = output.asLines().stream()
|
||||
.filter(s -> s.contains("[gc,metaspace"))
|
||||
|
|
|
@ -131,7 +131,6 @@ public class TestPrintReferences {
|
|||
|
||||
// Find the first Reference Processing log and check its format.
|
||||
private static void checkLogFormat(OutputAnalyzer output, boolean parallelRefProcEnabled) {
|
||||
String countRegex = "[0-9]+";
|
||||
String timeRegex = doubleRegex + "ms";
|
||||
|
||||
/* Total Reference processing time */
|
||||
|
|
|
@ -31,6 +31,9 @@ import javax.management.MBeanServer;
|
|||
import javax.management.MalformedObjectNameException;
|
||||
import javax.management.ObjectName;
|
||||
import javax.management.ReflectionException;
|
||||
|
||||
import static java.lang.ref.Reference.reachabilityFence;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
@ -128,7 +131,7 @@ class MemoryStresser implements Runnable {
|
|||
// Dead object allocation
|
||||
() -> {
|
||||
int size = RND.nextInt(DEAD_OBJECT_MAX_SIZE);
|
||||
byte[] deadObject = new byte[size];
|
||||
reachabilityFence(new byte[size]);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -111,13 +111,12 @@ public class G1AddMetaspaceDependency {
|
|||
Loader f_loader = new Loader(b_name, b_bytes, a_name, a_loader);
|
||||
Loader g_loader = new Loader(b_name, b_bytes, a_name, a_loader);
|
||||
|
||||
Class<?> c;
|
||||
c = b_loader.loadClass(b_name);
|
||||
c = c_loader.loadClass(b_name);
|
||||
c = d_loader.loadClass(b_name);
|
||||
c = e_loader.loadClass(b_name);
|
||||
c = f_loader.loadClass(b_name);
|
||||
c = g_loader.loadClass(b_name);
|
||||
b_loader.loadClass(b_name);
|
||||
c_loader.loadClass(b_name);
|
||||
d_loader.loadClass(b_name);
|
||||
e_loader.loadClass(b_name);
|
||||
f_loader.loadClass(b_name);
|
||||
g_loader.loadClass(b_name);
|
||||
}
|
||||
public class A {
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.util.ArrayList;
|
|||
*/
|
||||
public class TestMetaspaceInitialization {
|
||||
private class Internal {
|
||||
@SuppressWarnings("unused")
|
||||
public int x;
|
||||
public Internal(int x) {
|
||||
this.x = x;
|
||||
|
|
|
@ -132,7 +132,7 @@ class Decompiler {
|
|||
byteCodeIndex++;
|
||||
}
|
||||
|
||||
int def = cursor.readIntAt(byteCodeIndex);
|
||||
cursor.readIntAt(byteCodeIndex); // def
|
||||
byteCodeIndex +=4;
|
||||
|
||||
int npairs = cursor.readIntAt(byteCodeIndex);
|
||||
|
@ -149,7 +149,7 @@ class Decompiler {
|
|||
byteCodeIndex++;
|
||||
}
|
||||
|
||||
int def = cursor.readIntAt(byteCodeIndex);
|
||||
cursor.readIntAt(byteCodeIndex); // def
|
||||
byteCodeIndex +=4;
|
||||
|
||||
int low = cursor.readIntAt(byteCodeIndex);
|
||||
|
@ -245,7 +245,7 @@ class Decompiler {
|
|||
|
||||
private ConstantPoolEntry[] decodeConstantPool() {
|
||||
final int CONSTANT_Utf8 = 1;
|
||||
final int CONSTANT_Unicode = 2;
|
||||
// final int CONSTANT_Unicode = 2;
|
||||
final int CONSTANT_Integer = 3;
|
||||
final int CONSTANT_Float = 4;
|
||||
final int CONSTANT_Long = 5;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue