@@ -113,19 +113,6 @@ public int hashCode() {
113113 }
114114 }
115115
116- /**
117- * Only log warning about accessibility work around once.
118- * <p>
119- * Note that this is broken when this class is deployed via a shared
120- * classloader in a container, as the warning message will be emitted
121- * only once, not once per webapp. However making the warning appear
122- * once per webapp means having a map keyed by context classloader
123- * which introduces nasty memory-leak problems. As this warning is
124- * really optional we can ignore this problem; only one of the webapps
125- * will get the warning in its logs but that should be good enough.
126- */
127- private static boolean loggedAccessibleWarning ;
128-
129116 /**
130117 * Indicates whether methods should be cached for improved performance.
131118 * <p>
@@ -136,6 +123,7 @@ public int hashCode() {
136123 * </p>
137124 */
138125 private static boolean CACHE_METHODS = true ;
126+
139127 /** An empty class array */
140128 private static final Class <?>[] EMPTY_CLASS_PARAMETERS = new Class [0 ];
141129
@@ -1282,29 +1270,6 @@ private static void setMethodAccessible(final Method method) {
12821270 } catch (final SecurityException se ) {
12831271 // log but continue just in case the method.invoke works anyway
12841272 final Log log = LogFactory .getLog (MethodUtils .class );
1285- if (!loggedAccessibleWarning ) {
1286- boolean vulnerableJVM = false ;
1287- try {
1288- final String specVersion = System .getProperty ("java.specification.version" );
1289- if (specVersion .charAt (0 ) == '1' &&
1290- (specVersion .charAt (2 ) == '0' ||
1291- specVersion .charAt (2 ) == '1' ||
1292- specVersion .charAt (2 ) == '2' ||
1293- specVersion .charAt (2 ) == '3' )) {
1294-
1295- vulnerableJVM = true ;
1296- }
1297- } catch (final SecurityException e ) {
1298- // don't know - so display warning
1299- vulnerableJVM = true ;
1300- }
1301- if (vulnerableJVM ) {
1302- log .warn (
1303- "Current Security Manager restricts use of workarounds for reflection bugs "
1304- + " in pre-1.4 JVMs." );
1305- }
1306- loggedAccessibleWarning = true ;
1307- }
13081273 log .debug ("Cannot setAccessible on method. Therefore cannot use jvm access bug workaround." , se );
13091274 }
13101275 }
0 commit comments