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
Copy file name to clipboardExpand all lines: src/main/java/org/apache/commons/beanutils2/MethodUtils.java
+8-33Lines changed: 8 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,7 @@ public int hashCode() {
113
113
* <p>
114
114
* Note that when this class is deployed via a shared classloader in a container, this will affect all webapps. However making this configurable per webapp
115
115
* would mean having a map keyed by context classloader which may introduce memory-leak problems.
116
+
* </p>
116
117
*/
117
118
privatestaticbooleanCACHE_METHODS = true;
118
119
@@ -123,12 +124,14 @@ public int hashCode() {
123
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
124
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
125
126
* commons-collections LRUMap may be more appropriate (though of course selecting an appropriate size is an issue).
127
+
* </p>
126
128
* <p>
127
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
128
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
129
131
* loaders will generate non-equal MethodDescriptor objects and hence end up with different entries in the map.
* Return an accessible method (that is, one that can be invoked via reflection) that implements the specified method, by scanning through all implemented
260
256
* interfaces and subinterfaces. If no such method can be found, return {@code null}.
261
-
* </p>
262
257
*
263
258
* <p>
264
259
* There isn't any good reason why this method must be private. It is because there doesn't seem any reason why other classes should call this rather than
@@ -311,10 +306,8 @@ private static Method getAccessibleMethodFromInterfaceNest(Class<?> clazz, final
311
306
}
312
307
313
308
/**
314
-
* <p>
315
309
* Return an accessible method (that is, one that can be invoked via reflection) by scanning through the superclasses. If no such method can be found,
316
310
* return {@code null}.
317
-
* </p>
318
311
*
319
312
* @param clazz Class to be checked
320
313
* @param methodName Method name of the method we wish to call
* Find an accessible method that matches the given name and has compatible parameters. Compatible parameters mean that every method parameter is assignable
357
349
* from the given parameters. In other words, it finds a method with the given name that will take the parameters given.
358
-
* </p>
359
350
*
360
351
* <p>
361
352
* This method is slightly indeterministic since it loops through methods names and return the first matching method.
0 commit comments