make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java
changeset 53696 f0f8f0afed74
parent 51832 bf1d479fe7eb
equal deleted inserted replaced
53695:55d2d437c708 53696:f0f8f0afed74
  1784         boolean existed = false;
  1784         boolean existed = false;
  1785         for (ClassHeaderDescription existing : clazzDesc.header) {
  1785         for (ClassHeaderDescription existing : clazzDesc.header) {
  1786             if (existing.equals(headerDesc)) {
  1786             if (existing.equals(headerDesc)) {
  1787                 headerDesc = existing;
  1787                 headerDesc = existing;
  1788                 existed = true;
  1788                 existed = true;
  1789             } else {
  1789             }
  1790                 //check if the only difference between the 7 and 8 version is the Profile annotation
  1790         }
  1791                 //if so, copy it to the pre-8 version, so save space
  1791 
       
  1792         if (!existed) {
       
  1793             //check if the only difference between the 7 and 8 version is the Profile annotation
       
  1794             //if so, copy it to the pre-8 version, so save space
       
  1795             for (ClassHeaderDescription existing : clazzDesc.header) {
  1792                 List<AnnotationDescription> annots = existing.classAnnotations;
  1796                 List<AnnotationDescription> annots = existing.classAnnotations;
  1793 
  1797 
  1794                 if (annots != null) {
  1798                 if (annots != null) {
  1795                     for (AnnotationDescription ad : annots) {
  1799                     for (AnnotationDescription ad : annots) {
  1796                         if (PROFILE_ANNOTATION.equals(ad.annotationType)) {
  1800                         if (PROFILE_ANNOTATION.equals(ad.annotationType)) {
  2608                 Integer ver = getVersion(cf, req.requires_version_index);
  2612                 Integer ver = getVersion(cf, req.requires_version_index);
  2609                 return new RequiresDescription(mod,
  2613                 return new RequiresDescription(mod,
  2610                                                req.requires_flags,
  2614                                                req.requires_flags,
  2611                                                ver);
  2615                                                ver);
  2612             }
  2616             }
       
  2617 
       
  2618             @Override
       
  2619             public int hashCode() {
       
  2620                 int hash = 7;
       
  2621                 hash = 53 * hash + Objects.hashCode(this.moduleName);
       
  2622                 hash = 53 * hash + this.flags;
       
  2623                 hash = 53 * hash + Objects.hashCode(this.version);
       
  2624                 return hash;
       
  2625             }
       
  2626 
       
  2627             @Override
       
  2628             public boolean equals(Object obj) {
       
  2629                 if (this == obj) {
       
  2630                     return true;
       
  2631                 }
       
  2632                 if (obj == null) {
       
  2633                     return false;
       
  2634                 }
       
  2635                 if (getClass() != obj.getClass()) {
       
  2636                     return false;
       
  2637                 }
       
  2638                 final RequiresDescription other = (RequiresDescription) obj;
       
  2639                 if (this.flags != other.flags) {
       
  2640                     return false;
       
  2641                 }
       
  2642                 if (!Objects.equals(this.moduleName, other.moduleName)) {
       
  2643                     return false;
       
  2644                 }
       
  2645                 if (!Objects.equals(this.version, other.version)) {
       
  2646                     return false;
       
  2647                 }
       
  2648                 return true;
       
  2649             }
       
  2650 
  2613         }
  2651         }
  2614 
  2652 
  2615         static class ProvidesDescription {
  2653         static class ProvidesDescription {
  2616             final String interfaceName;
  2654             final String interfaceName;
  2617             final List<String> implNames;
  2655             final List<String> implNames;
  2642                 List<String> impls =
  2680                 List<String> impls =
  2643                         Arrays.stream(prov.with_index)
  2681                         Arrays.stream(prov.with_index)
  2644                               .mapToObj(wi -> getClassName(cf, wi))
  2682                               .mapToObj(wi -> getClassName(cf, wi))
  2645                               .collect(Collectors.toList());
  2683                               .collect(Collectors.toList());
  2646                 return new ProvidesDescription(api, impls);
  2684                 return new ProvidesDescription(api, impls);
       
  2685             }
       
  2686 
       
  2687             @Override
       
  2688             public int hashCode() {
       
  2689                 int hash = 5;
       
  2690                 hash = 53 * hash + Objects.hashCode(this.interfaceName);
       
  2691                 hash = 53 * hash + Objects.hashCode(this.implNames);
       
  2692                 return hash;
       
  2693             }
       
  2694 
       
  2695             @Override
       
  2696             public boolean equals(Object obj) {
       
  2697                 if (this == obj) {
       
  2698                     return true;
       
  2699                 }
       
  2700                 if (obj == null) {
       
  2701                     return false;
       
  2702                 }
       
  2703                 if (getClass() != obj.getClass()) {
       
  2704                     return false;
       
  2705                 }
       
  2706                 final ProvidesDescription other = (ProvidesDescription) obj;
       
  2707                 if (!Objects.equals(this.interfaceName, other.interfaceName)) {
       
  2708                     return false;
       
  2709                 }
       
  2710                 if (!Objects.equals(this.implNames, other.implNames)) {
       
  2711                     return false;
       
  2712                 }
       
  2713                 return true;
  2647             }
  2714             }
  2648         }
  2715         }
  2649     }
  2716     }
  2650 
  2717 
  2651     public static class ClassDescription {
  2718     public static class ClassDescription {
  2804                 return false;
  2871                 return false;
  2805             }
  2872             }
  2806             if (!Objects.equals(this.nestHost, other.nestHost)) {
  2873             if (!Objects.equals(this.nestHost, other.nestHost)) {
  2807                 return false;
  2874                 return false;
  2808             }
  2875             }
  2809             if (!Objects.equals(this.nestMembers, other.nestMembers)) {
  2876             if (!listEquals(this.nestMembers, other.nestMembers)) {
  2810                 return false;
  2877                 return false;
  2811             }
  2878             }
  2812             return true;
  2879             return true;
  2813         }
  2880         }
  2814 
  2881