@@ -366,15 +366,12 @@ private static class Logging {
366366 * read* requests
367367 */
368368
369- /* ClassByNameCache Entry for caching class.forName results upon enableClassCaching */
370- private static final ClassByNameCache classByNameCache ;
371- private static final boolean isClassCachingEnabled ;
372- static {
373- isClassCachingEnabled =
369+ @ SuppressWarnings ("removal" )
370+ private static final boolean isClassCachingEnabled =
374371 AccessController .doPrivileged (new GetClassCachingSettingAction ());
375- classByNameCache = ( isClassCachingEnabled ? new ClassByNameCache () : null );
376- }
377-
372+ /* ClassByNameCache Entry for caching class.forName results upon enableClassCaching */
373+ private static final ClassByNameCache classByNameCache =
374+ isClassCachingEnabled ? new ClassByNameCache () : null ;
378375
379376 /** if true LUDCL/forName results would be cached, true by default starting Java8 */
380377 private static final class GetClassCachingSettingAction
@@ -513,12 +510,12 @@ public final Object readObject()
513510 * latestUserDefinedLoader().
514511 *
515512 * @throws ClassNotFoundException if the class of a serialized object
516- * could not be found.
513+ * could not be found.
517514 * @throws IOException if an I/O error occurs.
518515 *
519516 */
520517
521- private static Object redirectedReadObject (ObjectInputStream iStream , Class caller )
518+ private static Object redirectedReadObject (ObjectInputStream iStream , Class <?> caller )
522519 throws ClassNotFoundException , IOException
523520 {
524521 return iStream .readObject (Object .class , caller );
@@ -556,7 +553,7 @@ private String readString() throws IOException {
556553 * @throws ClassNotFoundException Class of a serialized object cannot be
557554 * found.
558555 */
559- private final Object readObject (Class <?> type , Class caller )
556+ private final Object readObject (Class <?> type , Class <?> caller )
560557 throws IOException , ClassNotFoundException
561558 {
562559 if (enableOverride ) {
@@ -567,17 +564,17 @@ private final Object readObject(Class<?> type, Class caller)
567564 throw new AssertionError ("internal error" );
568565
569566 ClassLoader oldCachedLudcl = null ;
570- boolean setCached = false ;
571-
572- if (((null == curContext ) || refreshLudcl ) && ( isClassCachingEnabled ) ) {
567+ boolean setCached = false ;
568+
569+ if (((null == curContext ) || refreshLudcl ) && isClassCachingEnabled ) {
573570 oldCachedLudcl = cachedLudcl ;
574571
575572 // If caller is not provided, follow the standard path to get the cachedLudcl.
576573 // Otherwise use the class loader provided by JIT as the cachedLudcl.
577574
578575 if (caller == null ) {
579576 cachedLudcl = latestUserDefinedLoader ();
580- }else {
577+ } else {
581578 cachedLudcl = caller .getClassLoader ();
582579 }
583580
@@ -693,9 +690,9 @@ protected Object readObjectOverride()
693690 public Object readUnshared () throws IOException , ClassNotFoundException {
694691
695692 ClassLoader oldCachedLudcl = null ;
696- boolean setCached = false ;
693+ boolean setCached = false ;
697694
698- if (((null == curContext ) || refreshLudcl ) && ( isClassCachingEnabled ) ) {
695+ if (((null == curContext ) || refreshLudcl ) && isClassCachingEnabled ) {
699696 oldCachedLudcl = cachedLudcl ;
700697 cachedLudcl = latestUserDefinedLoader ();
701698 setCached = true ;
0 commit comments