Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Jandex 3.0.0 #1229

Merged
merged 1 commit into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,22 @@ public Collection<ClassInfo> getAllKnownSubclasses(DotName className) {
return filterClasses(this.delegate.getAllKnownSubclasses(className));
}

/**
* @see org.jboss.jandex.IndexView#getKnownDirectSubinterfaces(org.jboss.jandex.DotName)
*/
@Override
public Collection<ClassInfo> getKnownDirectSubinterfaces(DotName interfaceName) {
return filterClasses(this.delegate.getKnownDirectSubinterfaces(interfaceName));
}

/**
* @see org.jboss.jandex.IndexView#getAllKnownSubinterfaces(org.jboss.jandex.DotName)
*/
@Override
public Collection<ClassInfo> getAllKnownSubinterfaces(DotName interfaceName) {
return filterClasses(this.delegate.getAllKnownSubinterfaces(interfaceName));
}

/**
* @see org.jboss.jandex.IndexView#getKnownDirectImplementors(org.jboss.jandex.DotName)
*/
Expand Down Expand Up @@ -332,6 +348,16 @@ public Collection<ClassInfo> getKnownUsers(DotName className) {
return filterClasses(this.delegate.getKnownUsers(className));
}

@Override
public Collection<ClassInfo> getClassesInPackage(DotName packageName) {
return filterClasses(this.delegate.getClassesInPackage(packageName));
}

@Override
public Set<DotName> getSubpackages(DotName packageName) {
return delegate.getSubpackages(packageName);
}

private Collection<AnnotationInstance> filterInstances(Collection<AnnotationInstance> annotations) {
if (annotations != null && !annotations.isEmpty()) {
return annotations.stream().filter(ai -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.smallrye.openapi.runtime.scanner.dataobject;

import java.util.Collection;
import java.util.Set;

import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.ClassInfo;
Expand Down Expand Up @@ -71,6 +72,18 @@ public Collection<ClassInfo> getAllKnownSubclasses(DotName className) {
return index.getAllKnownSubclasses(className);
}

@Override
public Collection<ClassInfo> getKnownDirectSubinterfaces(DotName interfaceName) {
validateInput(interfaceName);
return index.getKnownDirectSubinterfaces(interfaceName);
}

@Override
public Collection<ClassInfo> getAllKnownSubinterfaces(DotName interfaceName) {
validateInput(interfaceName);
return index.getAllKnownSubinterfaces(interfaceName);
}

@Override
public Collection<ClassInfo> getKnownDirectImplementors(DotName className) {
validateInput(className);
Expand Down Expand Up @@ -112,6 +125,18 @@ public Collection<ClassInfo> getKnownUsers(DotName className) {
return index.getKnownUsers(className);
}

@Override
public Collection<ClassInfo> getClassesInPackage(DotName packageName) {
validateInput(packageName);
return index.getClassesInPackage(packageName);
}

@Override
public Set<DotName> getSubpackages(DotName packageName) {
validateInput(packageName);
return index.getSubpackages(packageName);
}

private void validateInput(Object... inputs) {
for (Object input : inputs) {
if (input == null)
Expand Down
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<version.buildhelper.plugin>3.3.0</version.buildhelper.plugin>
<jackson-bom.version>2.13.3</jackson-bom.version>
<version.eclipse.microprofile.config>3.0</version.eclipse.microprofile.config>
<version.io.smallrye.jandex>3.0.0</version.io.smallrye.jandex>
<version.io.smallrye.smallrye-config>3.0.0</version.io.smallrye.smallrye-config>
<version.eclipse.microprofile.openapi>3.1-RC3</version.eclipse.microprofile.openapi>
<version.org.hamcrest>1.3</version.org.hamcrest>
<version.org.hamcrest.java-hamcrest>2.0.0.0</version.org.hamcrest.java-hamcrest>
<version.org.jboss.jandex>2.4.3.Final</version.org.jboss.jandex> <!-- won't be needed with SmallRye Parent v36 -->
<version.org.skyscreamer>1.5.1</version.org.skyscreamer>
<version.maven-resources-plugin>3.3.0</version.maven-resources-plugin>
<version.com.github.eirslett.frontend-maven-plugin>1.12.1</version.com.github.eirslett.frontend-maven-plugin>
Expand Down Expand Up @@ -129,6 +129,11 @@
</dependency>

<!-- SmallRye Projects -->
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
<version>${version.io.smallrye.jandex}</version>
</dependency>
<dependency>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tools/maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</dependency>

<dependency>
<groupId>org.jboss</groupId>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
</dependency>

Expand Down