You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* would mean having a map keyed by context classloader which may introduce memory-leak problems.
116
120
* </p>
117
121
*/
118
-
privatestaticbooleanCACHE_METHODS = true;
122
+
privatestaticbooleanCACHE_ENABLED = true;
119
123
120
124
/**
121
-
* Stores a cache of MethodDescriptor -> Method in a WeakHashMap.
125
+
* Stores a cache of MethodKey -> Method.
122
126
* <p>
123
127
* The keys into this map only ever exist as temporary variables within methods of this class, and are never exposed to users of this class. This means that
124
-
* the WeakHashMap is used only as a mechanism for limiting the size of the cache, that is, a way to tell the garbage collector that the contents of the
125
-
* cache can be completely garbage-collected whenever it needs the memory. Whether this is a good approach to this problem is doubtful; something like the
126
-
* commons-collections LRUMap may be more appropriate (though of course selecting an appropriate size is an issue).
128
+
* this map is used only as a mechanism for limiting the size of the cache, that is, a way to tell the garbage collector that the contents of the cache can
129
+
* be completely garbage-collected whenever it needs the memory. Whether this is a good approach to this problem is doubtful; something like the Commons
130
+
* Collections LRUMap may be more appropriate (though of course selecting an appropriate size is an issue).
127
131
* </p>
128
132
* <p>
129
-
* This static variable is safe even when this code is deployed via a shared classloader because it is keyed via a MethodDescriptor object which has a Class
130
-
* as one of its members and that member is used in the MethodDescriptor.equals method. So two components that load the same class via different class
131
-
* loaders will generate non-equal MethodDescriptor objects and hence end up with different entries in the map.
133
+
* This static variable is safe even when this code is deployed via a shared class loader because it is keyed via a MethodKey object which has a Class as
134
+
* one of its members and that member is used in the MethodKey.equals method. So two components that load the same class via different class loaders will
135
+
* generate non-equal MethodKey objects and hence end up with different entries in the map.
* Gets an accessible method (that is, one that can be invoked via reflection) that implements the specified Method. If no such method can be found,
162
-
* return {@code null}.
166
+
* Gets an accessible method (that is, one that can be invoked via reflection) that implements the specified Method. If no such method can be found, return
* Gets an accessible method (that is, one that can be invoked via reflection) that implements the specified Method. If no such method can be found,
239
-
* return {@code null}.
230
+
* Gets an accessible method (that is, one that can be invoked via reflection) that implements the specified Method. If no such method can be found, return
231
+
* {@code null}.
240
232
*
241
233
* @param method The method that we wish to call.
242
234
* @return The accessible method.
@@ -292,8 +284,8 @@ private static Method getAccessibleMethodFromInterfaceNest(Class<?> clazz, final
292
284
}
293
285
294
286
/**
295
-
* Gets an accessible method (that is, one that can be invoked via reflection) by scanning through the superclasses. If no such method can be found,
296
-
* return {@code null}.
287
+
* Gets an accessible method (that is, one that can be invoked via reflection) by scanning through the superclasses. If no such method can be found, return
288
+
* {@code null}.
297
289
*
298
290
* @param clazz Class to be checked.
299
291
* @param methodName Method name of the method we wish to call.
* Gets an accessible method that matches the given name and has compatible parameters. Compatible parameters mean that every method parameter is assignable
335
311
* from the given parameters. In other words, it finds a method with the given name that will take the parameters given.
* Gets the number of steps required needed to turn the source class into the destination class. This represents the number of steps in the object hierarchy
0 commit comments