< prev index next >

make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java

Print this page
rev 53563 : imported patch 8218630

@@ -1784,13 +1784,17 @@
         boolean existed = false;
         for (ClassHeaderDescription existing : clazzDesc.header) {
             if (existing.equals(headerDesc)) {
                 headerDesc = existing;
                 existed = true;
-            } else {
+            }
+        }
+
+        if (!existed) {
                 //check if the only difference between the 7 and 8 version is the Profile annotation
                 //if so, copy it to the pre-8 version, so save space
+            for (ClassHeaderDescription existing : clazzDesc.header) {
                 List<AnnotationDescription> annots = existing.classAnnotations;
 
                 if (annots != null) {
                     for (AnnotationDescription ad : annots) {
                         if (PROFILE_ANNOTATION.equals(ad.annotationType)) {

@@ -2608,10 +2612,44 @@
                 Integer ver = getVersion(cf, req.requires_version_index);
                 return new RequiresDescription(mod,
                                                req.requires_flags,
                                                ver);
             }
+
+            @Override
+            public int hashCode() {
+                int hash = 7;
+                hash = 53 * hash + Objects.hashCode(this.moduleName);
+                hash = 53 * hash + this.flags;
+                hash = 53 * hash + Objects.hashCode(this.version);
+                return hash;
+            }
+
+            @Override
+            public boolean equals(Object obj) {
+                if (this == obj) {
+                    return true;
+                }
+                if (obj == null) {
+                    return false;
+                }
+                if (getClass() != obj.getClass()) {
+                    return false;
+                }
+                final RequiresDescription other = (RequiresDescription) obj;
+                if (this.flags != other.flags) {
+                    return false;
+                }
+                if (!Objects.equals(this.moduleName, other.moduleName)) {
+                    return false;
+                }
+                if (!Objects.equals(this.version, other.version)) {
+                    return false;
+                }
+                return true;
+            }
+
         }
 
         static class ProvidesDescription {
             final String interfaceName;
             final List<String> implNames;

@@ -2643,10 +2681,39 @@
                         Arrays.stream(prov.with_index)
                               .mapToObj(wi -> getClassName(cf, wi))
                               .collect(Collectors.toList());
                 return new ProvidesDescription(api, impls);
             }
+
+            @Override
+            public int hashCode() {
+                int hash = 5;
+                hash = 53 * hash + Objects.hashCode(this.interfaceName);
+                hash = 53 * hash + Objects.hashCode(this.implNames);
+                return hash;
+            }
+
+            @Override
+            public boolean equals(Object obj) {
+                if (this == obj) {
+                    return true;
+                }
+                if (obj == null) {
+                    return false;
+                }
+                if (getClass() != obj.getClass()) {
+                    return false;
+                }
+                final ProvidesDescription other = (ProvidesDescription) obj;
+                if (!Objects.equals(this.interfaceName, other.interfaceName)) {
+                    return false;
+                }
+                if (!Objects.equals(this.implNames, other.implNames)) {
+                    return false;
+                }
+                return true;
+            }
         }
     }
 
     public static class ClassDescription {
         String name;

@@ -2804,11 +2871,11 @@
                 return false;
             }
             if (!Objects.equals(this.nestHost, other.nestHost)) {
                 return false;
             }
-            if (!Objects.equals(this.nestMembers, other.nestMembers)) {
+            if (!listEquals(this.nestMembers, other.nestMembers)) {
                 return false;
             }
             return true;
         }
 
< prev index next >