25
25
* @test
26
26
* @bug 8047769
27
27
* @modules java.base/java.io:open
28
- * java.base/java.lang.ref:open
29
28
* java.base/sun.security.provider:open
30
29
* @summary SecureRandom should be more frugal with file descriptors
31
30
*/
@@ -133,11 +132,9 @@ public static void main(String[] args) throws Exception {
133
132
/**
134
133
* A proxy for (package)private static methods:
135
134
* sun.security.provider.FileInputStreamPool.getInputStream
136
- * java.lang.ref.Reference.waitForReferenceProcessing
137
135
*/
138
136
static class TestProxy {
139
137
private static final Method getInputStreamMethod ;
140
- private static final Method waitForReferenceProcessingMethod ;
141
138
private static final Field inField ;
142
139
143
140
static {
@@ -149,10 +146,6 @@ static class TestProxy {
149
146
"getInputStream" , File .class );
150
147
getInputStreamMethod .setAccessible (true );
151
148
152
- waitForReferenceProcessingMethod =
153
- Reference .class .getDeclaredMethod ("waitForReferenceProcessing" );
154
- waitForReferenceProcessingMethod .setAccessible (true );
155
-
156
149
inField = FilterInputStream .class .getDeclaredField ("in" );
157
150
inField .setAccessible (true );
158
151
} catch (Exception e ) {
@@ -180,25 +173,6 @@ static InputStream FileInputStreamPool_getInputStream(File file)
180
173
}
181
174
}
182
175
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
-
202
176
static FileInputStream FilterInputStream_getInField (FilterInputStream fis ) {
203
177
try {
204
178
return (FileInputStream ) inField .get (fis );
0 commit comments