1
1
/*
2
- * Copyright (c) 2002, 2019 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2002, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -83,21 +83,25 @@ public static void setJavaUtilCollectionAccess(JavaUtilCollectionAccess juca) {
83
83
}
84
84
85
85
public static JavaUtilCollectionAccess getJavaUtilCollectionAccess () {
86
- if (javaUtilCollectionAccess == null ) {
86
+ var access = javaUtilCollectionAccess ;
87
+ if (access == null ) {
87
88
try {
88
89
Class .forName ("java.util.ImmutableCollections$Access" , true , null );
90
+ access = javaUtilCollectionAccess ;
89
91
} catch (ClassNotFoundException e ) {};
90
92
}
91
- return javaUtilCollectionAccess ;
93
+ return access ;
92
94
}
93
95
94
96
public static JavaUtilJarAccess javaUtilJarAccess () {
95
- if (javaUtilJarAccess == null ) {
97
+ var access = javaUtilJarAccess ;
98
+ if (access == null ) {
96
99
// Ensure JarFile is initialized; we know that this class
97
100
// provides the shared secret
98
101
ensureClassInitialized (JarFile .class );
102
+ access = javaUtilJarAccess ;
99
103
}
100
- return javaUtilJarAccess ;
104
+ return access ;
101
105
}
102
106
103
107
public static void setJavaUtilJarAccess (JavaUtilJarAccess access ) {
@@ -117,23 +121,27 @@ public static void setJavaLangInvokeAccess(JavaLangInvokeAccess jlia) {
117
121
}
118
122
119
123
public static JavaLangInvokeAccess getJavaLangInvokeAccess () {
120
- if (javaLangInvokeAccess == null ) {
124
+ var access = javaLangInvokeAccess ;
125
+ if (access == null ) {
121
126
try {
122
127
Class .forName ("java.lang.invoke.MethodHandleImpl" , true , null );
128
+ access = javaLangInvokeAccess ;
123
129
} catch (ClassNotFoundException e ) {};
124
130
}
125
- return javaLangInvokeAccess ;
131
+ return access ;
126
132
}
127
133
128
134
public static void setJavaLangModuleAccess (JavaLangModuleAccess jlrma ) {
129
135
javaLangModuleAccess = jlrma ;
130
136
}
131
137
132
138
public static JavaLangModuleAccess getJavaLangModuleAccess () {
133
- if (javaLangModuleAccess == null ) {
139
+ var access = javaLangModuleAccess ;
140
+ if (access == null ) {
134
141
ensureClassInitialized (ModuleDescriptor .class );
142
+ access = javaLangModuleAccess ;
135
143
}
136
- return javaLangModuleAccess ;
144
+ return access ;
137
145
}
138
146
139
147
public static void setJavaLangRefAccess (JavaLangRefAccess jlra ) {
@@ -157,102 +165,127 @@ public static void setJavaNetUriAccess(JavaNetUriAccess jnua) {
157
165
}
158
166
159
167
public static JavaNetUriAccess getJavaNetUriAccess () {
160
- if (javaNetUriAccess == null )
168
+ var access = javaNetUriAccess ;
169
+ if (access == null ) {
161
170
ensureClassInitialized (java .net .URI .class );
162
- return javaNetUriAccess ;
171
+ access = javaNetUriAccess ;
172
+ }
173
+ return access ;
163
174
}
164
175
165
176
public static void setJavaNetURLAccess (JavaNetURLAccess jnua ) {
166
177
javaNetURLAccess = jnua ;
167
178
}
168
179
169
180
public static JavaNetURLAccess getJavaNetURLAccess () {
170
- if (javaNetURLAccess == null )
181
+ var access = javaNetURLAccess ;
182
+ if (access == null ) {
171
183
ensureClassInitialized (java .net .URL .class );
172
- return javaNetURLAccess ;
184
+ access = javaNetURLAccess ;
185
+ }
186
+ return access ;
173
187
}
174
188
175
189
public static void setJavaNetInetAddressAccess (JavaNetInetAddressAccess jna ) {
176
190
javaNetInetAddressAccess = jna ;
177
191
}
178
192
179
193
public static JavaNetInetAddressAccess getJavaNetInetAddressAccess () {
180
- if (javaNetInetAddressAccess == null )
194
+ var access = javaNetInetAddressAccess ;
195
+ if (access == null ) {
181
196
ensureClassInitialized (java .net .InetAddress .class );
182
- return javaNetInetAddressAccess ;
197
+ access = javaNetInetAddressAccess ;
198
+ }
199
+ return access ;
183
200
}
184
201
185
202
public static void setJavaNetHttpCookieAccess (JavaNetHttpCookieAccess a ) {
186
203
javaNetHttpCookieAccess = a ;
187
204
}
188
205
189
206
public static JavaNetHttpCookieAccess getJavaNetHttpCookieAccess () {
190
- if (javaNetHttpCookieAccess == null )
207
+ var access = javaNetHttpCookieAccess ;
208
+ if (access == null ) {
191
209
ensureClassInitialized (java .net .HttpCookie .class );
192
- return javaNetHttpCookieAccess ;
210
+ access = javaNetHttpCookieAccess ;
211
+ }
212
+ return access ;
193
213
}
194
214
195
215
public static void setJavaNioAccess (JavaNioAccess jna ) {
196
216
javaNioAccess = jna ;
197
217
}
198
218
199
219
public static JavaNioAccess getJavaNioAccess () {
200
- if (javaNioAccess == null ) {
220
+ var access = javaNioAccess ;
221
+ if (access == null ) {
201
222
// Ensure java.nio.Buffer is initialized, which provides the
202
223
// shared secret.
203
224
ensureClassInitialized (java .nio .Buffer .class );
225
+ access = javaNioAccess ;
204
226
}
205
- return javaNioAccess ;
227
+ return access ;
206
228
}
207
229
208
230
public static void setJavaIOAccess (JavaIOAccess jia ) {
209
231
javaIOAccess = jia ;
210
232
}
211
233
212
234
public static JavaIOAccess getJavaIOAccess () {
213
- if (javaIOAccess == null ) {
235
+ var access = javaIOAccess ;
236
+ if (access == null ) {
214
237
ensureClassInitialized (Console .class );
238
+ access = javaIOAccess ;
215
239
}
216
- return javaIOAccess ;
240
+ return access ;
217
241
}
218
242
219
243
public static void setJavaIOFileDescriptorAccess (JavaIOFileDescriptorAccess jiofda ) {
220
244
javaIOFileDescriptorAccess = jiofda ;
221
245
}
222
246
223
247
public static JavaIOFilePermissionAccess getJavaIOFilePermissionAccess () {
224
- if (javaIOFilePermissionAccess == null )
248
+ var access = javaIOFilePermissionAccess ;
249
+ if (access == null ) {
225
250
ensureClassInitialized (FilePermission .class );
226
-
227
- return javaIOFilePermissionAccess ;
251
+ access = javaIOFilePermissionAccess ;
252
+ }
253
+ return access ;
228
254
}
229
255
230
256
public static void setJavaIOFilePermissionAccess (JavaIOFilePermissionAccess jiofpa ) {
231
257
javaIOFilePermissionAccess = jiofpa ;
232
258
}
233
259
234
260
public static JavaIOFileDescriptorAccess getJavaIOFileDescriptorAccess () {
235
- if (javaIOFileDescriptorAccess == null )
261
+ var access = javaIOFileDescriptorAccess ;
262
+ if (access == null ) {
236
263
ensureClassInitialized (FileDescriptor .class );
237
-
238
- return javaIOFileDescriptorAccess ;
264
+ access = javaIOFileDescriptorAccess ;
265
+ }
266
+ return access ;
239
267
}
240
268
241
269
public static void setJavaSecurityAccess (JavaSecurityAccess jsa ) {
242
270
javaSecurityAccess = jsa ;
243
271
}
244
272
245
273
public static JavaSecurityAccess getJavaSecurityAccess () {
246
- if (javaSecurityAccess == null ) {
274
+ var access = javaSecurityAccess ;
275
+ if (access == null ) {
247
276
ensureClassInitialized (ProtectionDomain .class );
277
+ access = javaSecurityAccess ;
248
278
}
249
- return javaSecurityAccess ;
279
+ return access ;
250
280
}
251
281
252
282
public static JavaUtilZipFileAccess getJavaUtilZipFileAccess () {
253
- if (javaUtilZipFileAccess == null )
283
+ var access = javaUtilZipFileAccess ;
284
+ if (access == null ) {
254
285
ensureClassInitialized (java .util .zip .ZipFile .class );
255
- return javaUtilZipFileAccess ;
286
+ access = javaUtilZipFileAccess ;
287
+ }
288
+ return access ;
256
289
}
257
290
258
291
public static void setJavaUtilZipFileAccess (JavaUtilZipFileAccess access ) {
@@ -288,42 +321,51 @@ public static void setJavaBeansAccess(JavaBeansAccess access) {
288
321
}
289
322
290
323
public static JavaUtilResourceBundleAccess getJavaUtilResourceBundleAccess () {
291
- if (javaUtilResourceBundleAccess == null )
324
+ var access = javaUtilResourceBundleAccess ;
325
+ if (access == null ) {
292
326
ensureClassInitialized (ResourceBundle .class );
293
- return javaUtilResourceBundleAccess ;
327
+ access = javaUtilResourceBundleAccess ;
328
+ }
329
+ return access ;
294
330
}
295
331
296
332
public static void setJavaUtilResourceBundleAccess (JavaUtilResourceBundleAccess access ) {
297
333
javaUtilResourceBundleAccess = access ;
298
334
}
299
335
300
336
public static JavaObjectInputStreamReadString getJavaObjectInputStreamReadString () {
301
- if (javaObjectInputStreamReadString == null ) {
337
+ var access = javaObjectInputStreamReadString ;
338
+ if (access == null ) {
302
339
ensureClassInitialized (ObjectInputStream .class );
340
+ access = javaObjectInputStreamReadString ;
303
341
}
304
- return javaObjectInputStreamReadString ;
342
+ return access ;
305
343
}
306
344
307
345
public static void setJavaObjectInputStreamReadString (JavaObjectInputStreamReadString access ) {
308
346
javaObjectInputStreamReadString = access ;
309
347
}
310
348
311
349
public static JavaObjectInputStreamAccess getJavaObjectInputStreamAccess () {
312
- if (javaObjectInputStreamAccess == null ) {
350
+ var access = javaObjectInputStreamAccess ;
351
+ if (access == null ) {
313
352
ensureClassInitialized (ObjectInputStream .class );
353
+ access = javaObjectInputStreamAccess ;
314
354
}
315
- return javaObjectInputStreamAccess ;
355
+ return access ;
316
356
}
317
357
318
358
public static void setJavaObjectInputStreamAccess (JavaObjectInputStreamAccess access ) {
319
359
javaObjectInputStreamAccess = access ;
320
360
}
321
361
322
362
public static JavaObjectInputFilterAccess getJavaObjectInputFilterAccess () {
323
- if (javaObjectInputFilterAccess == null ) {
363
+ var access = javaObjectInputFilterAccess ;
364
+ if (access == null ) {
324
365
ensureClassInitialized (ObjectInputFilter .Config .class );
366
+ access = javaObjectInputFilterAccess ;
325
367
}
326
- return javaObjectInputFilterAccess ;
368
+ return access ;
327
369
}
328
370
329
371
public static void setJavaObjectInputFilterAccess (JavaObjectInputFilterAccess access ) {
@@ -335,32 +377,38 @@ public static void setJavaIORandomAccessFileAccess(JavaIORandomAccessFileAccess
335
377
}
336
378
337
379
public static JavaIORandomAccessFileAccess getJavaIORandomAccessFileAccess () {
338
- if (javaIORandomAccessFileAccess == null ) {
380
+ var access = javaIORandomAccessFileAccess ;
381
+ if (access == null ) {
339
382
ensureClassInitialized (RandomAccessFile .class );
383
+ access = javaIORandomAccessFileAccess ;
340
384
}
341
- return javaIORandomAccessFileAccess ;
385
+ return access ;
342
386
}
343
387
344
388
public static void setJavaSecuritySignatureAccess (JavaSecuritySignatureAccess jssa ) {
345
389
javaSecuritySignatureAccess = jssa ;
346
390
}
347
391
348
392
public static JavaSecuritySignatureAccess getJavaSecuritySignatureAccess () {
349
- if (javaSecuritySignatureAccess == null ) {
393
+ var access = javaSecuritySignatureAccess ;
394
+ if (access == null ) {
350
395
ensureClassInitialized (Signature .class );
396
+ access = javaSecuritySignatureAccess ;
351
397
}
352
- return javaSecuritySignatureAccess ;
398
+ return access ;
353
399
}
354
400
355
401
public static void setJavaxCryptoSealedObjectAccess (JavaxCryptoSealedObjectAccess jcsoa ) {
356
402
javaxCryptoSealedObjectAccess = jcsoa ;
357
403
}
358
404
359
405
public static JavaxCryptoSealedObjectAccess getJavaxCryptoSealedObjectAccess () {
360
- if (javaxCryptoSealedObjectAccess == null ) {
406
+ var access = javaxCryptoSealedObjectAccess ;
407
+ if (access == null ) {
361
408
ensureClassInitialized (SealedObject .class );
409
+ access = javaxCryptoSealedObjectAccess ;
362
410
}
363
- return javaxCryptoSealedObjectAccess ;
411
+ return access ;
364
412
}
365
413
366
414
private static void ensureClassInitialized (Class <?> c ) {
0 commit comments