mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8218630: CreateSymbols includes class and module headers unnecessarily
Ensure class and module headers from the current version are properly matched to existing ones to avoid duplication. Reviewed-by: jjg
This commit is contained in:
parent
973cfaffa3
commit
42a47d9491
1 changed files with 71 additions and 4 deletions
|
@ -1786,9 +1786,13 @@ public class CreateSymbols {
|
||||||
if (existing.equals(headerDesc)) {
|
if (existing.equals(headerDesc)) {
|
||||||
headerDesc = existing;
|
headerDesc = existing;
|
||||||
existed = true;
|
existed = true;
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!existed) {
|
||||||
//check if the only difference between the 7 and 8 version is the Profile annotation
|
//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
|
//if so, copy it to the pre-8 version, so save space
|
||||||
|
for (ClassHeaderDescription existing : clazzDesc.header) {
|
||||||
List<AnnotationDescription> annots = existing.classAnnotations;
|
List<AnnotationDescription> annots = existing.classAnnotations;
|
||||||
|
|
||||||
if (annots != null) {
|
if (annots != null) {
|
||||||
|
@ -2610,6 +2614,40 @@ public class CreateSymbols {
|
||||||
req.requires_flags,
|
req.requires_flags,
|
||||||
ver);
|
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 {
|
static class ProvidesDescription {
|
||||||
|
@ -2645,6 +2683,35 @@ public class CreateSymbols {
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
return new ProvidesDescription(api, impls);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2806,7 +2873,7 @@ public class CreateSymbols {
|
||||||
if (!Objects.equals(this.nestHost, other.nestHost)) {
|
if (!Objects.equals(this.nestHost, other.nestHost)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Objects.equals(this.nestMembers, other.nestMembers)) {
|
if (!listEquals(this.nestMembers, other.nestMembers)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue