Skip to content

Commit 59e7509

Browse files
committed
8348301: Remove unused Reference.waitForReferenceProcessing break-ins in tests
Reviewed-by: alanb
1 parent 605b53e commit 59e7509

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

test/jdk/sun/security/provider/FileInputStreamPool/FileInputStreamPoolTest.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
* @test
2626
* @bug 8047769
2727
* @modules java.base/java.io:open
28-
* java.base/java.lang.ref:open
2928
* java.base/sun.security.provider:open
3029
* @summary SecureRandom should be more frugal with file descriptors
3130
*/
@@ -133,11 +132,9 @@ public static void main(String[] args) throws Exception {
133132
/**
134133
* A proxy for (package)private static methods:
135134
* sun.security.provider.FileInputStreamPool.getInputStream
136-
* java.lang.ref.Reference.waitForReferenceProcessing
137135
*/
138136
static class TestProxy {
139137
private static final Method getInputStreamMethod;
140-
private static final Method waitForReferenceProcessingMethod;
141138
private static final Field inField;
142139

143140
static {
@@ -149,10 +146,6 @@ static class TestProxy {
149146
"getInputStream", File.class);
150147
getInputStreamMethod.setAccessible(true);
151148

152-
waitForReferenceProcessingMethod =
153-
Reference.class.getDeclaredMethod("waitForReferenceProcessing");
154-
waitForReferenceProcessingMethod.setAccessible(true);
155-
156149
inField = FilterInputStream.class.getDeclaredField("in");
157150
inField.setAccessible(true);
158151
} catch (Exception e) {
@@ -180,25 +173,6 @@ static InputStream FileInputStreamPool_getInputStream(File file)
180173
}
181174
}
182175

183-
static boolean Reference_waitForReferenceProcessing() {
184-
try {
185-
return (boolean) waitForReferenceProcessingMethod.invoke(null);
186-
} catch (InvocationTargetException e) {
187-
Throwable te = e.getTargetException();
188-
if (te instanceof InterruptedException) {
189-
return true;
190-
} else if (te instanceof RuntimeException) {
191-
throw (RuntimeException) te;
192-
} else if (te instanceof Error) {
193-
throw (Error) te;
194-
} else {
195-
throw new UndeclaredThrowableException(te);
196-
}
197-
} catch (IllegalAccessException e) {
198-
throw new RuntimeException(e);
199-
}
200-
}
201-
202176
static FileInputStream FilterInputStream_getInField(FilterInputStream fis) {
203177
try {
204178
return (FileInputStream) inField.get(fis);

0 commit comments

Comments
 (0)