Skip to content

Commit

Permalink
Merge pull request #36105 from Ladicek/jandex-3.1.5
Browse files Browse the repository at this point in the history
Upgrade to Jandex 3.1.5
  • Loading branch information
gsmet authored Oct 5, 2023
2 parents edb0616 + fcbd46d commit eddc83e
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 19 deletions.
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<bouncycastle.tls.fips.version>1.0.16</bouncycastle.tls.fips.version>
<expressly.version>5.0.0</expressly.version>
<findbugs.version>3.0.2</findbugs.version>
<jandex.version>3.1.3</jandex.version>
<jandex.version>3.1.5</jandex.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
<javax.inject.version>1</javax.inject.version>
<parsson.version>1.1.2</parsson.version>
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<failsafe-plugin.version>${version.surefire.plugin}</failsafe-plugin.version>

<!-- Jandex versions -->
<jandex.version>3.1.3</jandex.version>
<jandex.version>3.1.5</jandex.version>
<jandex-gradle-plugin.version>1.0.0</jandex-gradle-plugin.version>

<asciidoctorj.version>2.5.10</asciidoctorj.version>
Expand Down
2 changes: 1 addition & 1 deletion independent-projects/arc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<version.jta>2.0.1</version.jta>
<!-- main versions -->
<version.gizmo>1.7.0</version.gizmo>
<version.jandex>3.1.3</version.jandex>
<version.jandex>3.1.5</version.jandex>
<version.jboss-logging>3.5.3.Final</version.jboss-logging>
<version.mutiny>2.2.0</version.mutiny>
<version.bridger>1.6.Final</version.bridger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ public TypeAndQualifiers(Type type, Set<AnnotationInstance> qualifiers) {
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((qualifiers == null) ? 0 : qualifiers.hashCode());
// We cannot use AnnotationInstance#hashCode() as it includes the AnnotationTarget
result = prime * result + annotationSetHashCode(qualifiers);
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
}
Expand All @@ -409,8 +410,8 @@ public boolean equals(Object obj) {
if (other.qualifiers != null) {
return false;
}
} else if (!qualifiersAreEqual(qualifiers, other.qualifiers)) {
// We cannot use AnnotationInstance#equals() as it requires the exact same annotationTarget instance
} else if (!annotationSetEquals(qualifiers, other.qualifiers)) {
// We cannot use AnnotationInstance#equals() as it requires the exact same AnnotationTarget instance
return false;
}
if (type == null) {
Expand All @@ -423,30 +424,44 @@ public boolean equals(Object obj) {
return true;
}

private boolean qualifiersAreEqual(Set<AnnotationInstance> q1, Set<AnnotationInstance> q2) {
if (q1 == q2) {
private static boolean annotationSetEquals(Set<AnnotationInstance> s1, Set<AnnotationInstance> s2) {
if (s1 == s2) {
return true;
}
if (q1.size() != q2.size()) {
if (s1.size() != s2.size()) {
return false;
}
for (AnnotationInstance a1 : q1) {
for (AnnotationInstance a2 : q2) {
if (!annotationsAreEqual(a1, a2)) {
for (AnnotationInstance a1 : s1) {
for (AnnotationInstance a2 : s2) {
if (!annotationEquals(a1, a2)) {
return false;
}
}
}
return true;
}

private boolean annotationsAreEqual(AnnotationInstance a1, AnnotationInstance a2) {
private static boolean annotationEquals(AnnotationInstance a1, AnnotationInstance a2) {
if (a1 == a2) {
return true;
}
return a1.name().equals(a2.name()) && a1.values().equals(a2.values());
}

private static int annotationSetHashCode(Set<AnnotationInstance> s) {
int result = 1;
for (AnnotationInstance a : s) {
result = 31 * result + annotationHashCode(a);
}
return result;
}

private static int annotationHashCode(AnnotationInstance a) {
int result = a.name().hashCode();
result = 31 * result + a.values().hashCode();
return result;
}

}

}
2 changes: 1 addition & 1 deletion independent-projects/bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<version.compiler.plugin>3.11.0</version.compiler.plugin>
<version.enforcer.plugin>3.2.1</version.enforcer.plugin>
<version.surefire.plugin>3.1.2</version.surefire.plugin>
<jandex.version>3.1.3</jandex.version>
<jandex.version>3.1.5</jandex.version>

<!-- Dependency versions -->
<assertj.version>3.24.2</assertj.version>
Expand Down
4 changes: 2 additions & 2 deletions independent-projects/junit5-virtual-threads/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<compiler.plugin.version>3.11.0</compiler.plugin.version>
<enforcer.plugin.version>3.2.1</enforcer.plugin.version>
<surefire.plugin.version>3.1.2</surefire.plugin.version>
<jandex.version>3.1.3</jandex.version>
<jandex.version>3.1.5</jandex.version>
<formatter-maven-plugin.version>2.23.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.9.0</impsort-maven-plugin.version>

Expand Down Expand Up @@ -295,4 +295,4 @@
</profile>
</profiles>

</project>
</project>
2 changes: 1 addition & 1 deletion independent-projects/qute/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<maven.compiler.release>11</maven.compiler.release>
<version.junit>5.10.0</version.junit>
<version.assertj>3.24.2</version.assertj>
<version.jandex>3.1.3</version.jandex>
<version.jandex>3.1.5</version.jandex>
<version.gizmo>1.7.0</version.gizmo>
<version.jboss-logging>3.5.3.Final</version.jboss-logging>
<version.compiler.plugin>3.11.0</version.compiler.plugin>
Expand Down
2 changes: 1 addition & 1 deletion independent-projects/resteasy-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<maven.compiler.release>11</maven.compiler.release>
<!-- Versions -->
<jakarta.enterprise.cdi-api.version>4.0.1</jakarta.enterprise.cdi-api.version>
<jandex.version>3.1.3</jandex.version>
<jandex.version>3.1.5</jandex.version>
<bytebuddy.version>1.12.12</bytebuddy.version>
<junit5.version>5.10.0</junit5.version>
<maven.version>3.9.3</maven.version>
Expand Down
2 changes: 1 addition & 1 deletion independent-projects/tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<version.surefire.plugin>3.1.2</version.surefire.plugin>
<quarkus.version>${project.version}</quarkus.version>
<maven-model-helper.version>25</maven-model-helper.version>
<jandex.version>3.1.3</jandex.version>
<jandex.version>3.1.5</jandex.version>
<system-stubs-jupiter.version>2.0.2</system-stubs-jupiter.version>
<awaitility.version>4.2.0</awaitility.version>
</properties>
Expand Down

0 comments on commit eddc83e

Please sign in to comment.