6622385: Accessing protected static methods
authorkamg
Wed, 16 Apr 2008 17:36:29 -0400
changeset 362 00cf4bffd828
parent 360 21d113ecbf6a
child 363 99d43e8a76ad
6622385: Accessing protected static methods Summary: Protected contraints should only be applied if member is not static Reviewed-by: acorn, coleenp
hotspot/src/share/vm/runtime/reflection.cpp
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Sun Apr 13 17:43:42 2008 -0400
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Wed Apr 16 17:36:29 2008 -0400
@@ -500,7 +500,8 @@
     if (!protected_restriction) {
       // See if current_class is a subclass of field_class
       if (Klass::cast(current_class)->is_subclass_of(field_class)) {
-        if (current_class == resolved_class ||
+        if (access.is_static() || // static fields are ok, see 6622385
+            current_class == resolved_class ||
             field_class == resolved_class ||
             Klass::cast(current_class)->is_subclass_of(resolved_class) ||
             Klass::cast(resolved_class)->is_subclass_of(current_class)) {