src/share/classes/java/lang/reflect/Proxy.java

Print this page
rev 3186 : 6880112: Project Coin: Port JDK core library code to use diamond operator

*** 230,240 **** private final static Class[] constructorParams = { InvocationHandler.class }; /** maps a class loader to the proxy class cache for that loader */ private static Map<ClassLoader, Map<List<String>, Object>> loaderToCache ! = new WeakHashMap<ClassLoader, Map<List<String>, Object>>(); /** marks that a particular proxy class is currently being generated */ private static Object pendingGenerationMarker = new Object(); /** next number to use for generation of unique proxy class names */ --- 230,240 ---- private final static Class[] constructorParams = { InvocationHandler.class }; /** maps a class loader to the proxy class cache for that loader */ private static Map<ClassLoader, Map<List<String>, Object>> loaderToCache ! = new WeakHashMap<>(); /** marks that a particular proxy class is currently being generated */ private static Object pendingGenerationMarker = new Object(); /** next number to use for generation of unique proxy class names */
*** 354,364 **** /* collect interface names to use as key for proxy class cache */ String[] interfaceNames = new String[interfaces.length]; // for detecting duplicates ! Set<Class<?>> interfaceSet = new HashSet<Class<?>>(); for (int i = 0; i < interfaces.length; i++) { /* * Verify that the class loader resolves the name of this * interface to the same Class object. --- 354,364 ---- /* collect interface names to use as key for proxy class cache */ String[] interfaceNames = new String[interfaces.length]; // for detecting duplicates ! Set<Class<?>> interfaceSet = new HashSet<>(); for (int i = 0; i < interfaces.length; i++) { /* * Verify that the class loader resolves the name of this * interface to the same Class object.
*** 411,421 **** */ Map<List<String>, Object> cache; synchronized (loaderToCache) { cache = loaderToCache.get(loader); if (cache == null) { ! cache = new HashMap<List<String>, Object>(); loaderToCache.put(loader, cache); } /* * This mapping will remain valid for the duration of this * method, without further synchronization, because the mapping --- 411,421 ---- */ Map<List<String>, Object> cache; synchronized (loaderToCache) { cache = loaderToCache.get(loader); if (cache == null) { ! cache = new HashMap<>(); loaderToCache.put(loader, cache); } /* * This mapping will remain valid for the duration of this * method, without further synchronization, because the mapping