changeset 48187:e712b777f28e

8192781: tools/jar/multiRelease/Basic.java test Basic.test09(): failure after change d34958 Reviewed-by: mchung
author sherman
date Wed, 29 Nov 2017 21:01:55 -0800
parents f1ad41a05fb7
children 3bb4d90d1ebc
files src/jdk.jartool/share/classes/sun/tools/jar/Validator.java
diffstat 1 files changed, 6 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jartool/share/classes/sun/tools/jar/Validator.java	Wed Nov 29 20:42:18 2017 -0800
+++ b/src/jdk.jartool/share/classes/sun/tools/jar/Validator.java	Wed Nov 29 21:01:55 2017 -0800
@@ -152,13 +152,10 @@
     public void validateBase(Map<String, FingerPrint> fps) {
         fps.values().forEach( fp -> {
             if (!checkClassName(fp)) {
-                isValid = false;
                 return;
             }
             if (fp.isNestedClass()) {
-                if (!checkNestedClass(fp, fps)) {
-                    isValid = false;
-                }
+                checkNestedClass(fp, fps);
             }
             classes.put(fp.className(), fp);
         });
@@ -178,9 +175,7 @@
             if (matchFp == null) {
                 // no match found
                 if (fp.isNestedClass()) {
-                    if (!checkNestedClass(fp, fps)) {
-                        isValid = false;
-                    }
+                    checkNestedClass(fp, fps);
                     return;
                 }
                 if (fp.isPublicClass()) {
@@ -205,9 +200,7 @@
 
             // ok, not identical, check for compatible class version and api
             if (fp.isNestedClass()) {
-                if (!checkNestedClass(fp, fps)) {
-                    isValid = false;
-                }
+                checkNestedClass(fp, fps);
                 return;    // fall through, need check nested public class??
             }
             if (!fp.isCompatibleVersion(matchFp)) {
@@ -221,7 +214,6 @@
                 return;
             }
             if (!checkClassName(fp)) {
-                isValid = false;
                 return;
             }
             classes.put(fp.className(), fp);
@@ -320,7 +312,7 @@
         }
         error(formatMsg2("error.validator.names.mismatch",
                          fp.entryName(), fp.className().replace("/", ".")));
-        return false;
+        return isValid = false;
     }
 
     private boolean checkNestedClass(FingerPrint fp, Map<String, FingerPrint> outerClasses) {
@@ -328,8 +320,9 @@
             return true;
         }
         // outer class was not available
+
         error(formatMsg("error.validator.isolated.nested.class", fp.entryName()));
-        return false;
+        return isValid = false;
     }
 
     private boolean isConcealed(String className) {