changeset 30136:1c5202fa105b

8076236: VM permits illegal flags for class init method Summary: Move check for multiple access flags so that it also covers instance initialization methods Reviewed-by: ctornqvi, lfoltan
author hseigel
date Thu, 02 Apr 2015 08:50:10 -0400
parents bbb14e0a0c79
children 35599707b3f7 b009de0c0cef
files hotspot/src/share/vm/classfile/classFileParser.cpp
diffstat 1 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Thu Apr 02 07:44:55 2015 +0000
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Thu Apr 02 08:50:10 2015 -0400
@@ -4838,20 +4838,21 @@
       }
     }
   } else { // not interface
-    if (is_initializer) {
-      if (is_static || is_final || is_synchronized || is_native ||
-          is_abstract || (major_gte_15 && is_bridge)) {
-        is_illegal = true;
-      }
-    } else { // not initializer
-      if (is_abstract) {
-        if ((is_final || is_native || is_private || is_static ||
-            (major_gte_15 && (is_synchronized || is_strict)))) {
+    if (has_illegal_visibility(flags)) {
+      is_illegal = true;
+    } else {
+      if (is_initializer) {
+        if (is_static || is_final || is_synchronized || is_native ||
+            is_abstract || (major_gte_15 && is_bridge)) {
           is_illegal = true;
         }
-      }
-      if (has_illegal_visibility(flags)) {
-        is_illegal = true;
+      } else { // not initializer
+        if (is_abstract) {
+          if ((is_final || is_native || is_private || is_static ||
+              (major_gte_15 && (is_synchronized || is_strict)))) {
+            is_illegal = true;
+          }
+        }
       }
     }
   }