Skip to content

Commit

Permalink
Make API from prev release consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehutch committed Mar 5, 2024
1 parent 2c77ec7 commit 02f1f76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/io/github/classgraph/ScanResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ public ClassInfoList getClassesWithAllAnnotations(final Class<? extends Annotati
Assert.isAnnotation(cls);
annotationNames.add(cls.getName());
}
return getClassesWithAllAnnotations(annotationNames);
return getClassesWithAllAnnotations(annotationNames.toArray(new String[0]));
}

/**
Expand All @@ -1263,7 +1263,7 @@ public ClassInfoList getClassesWithAnyAnnotation(final Class<? extends Annotatio
Assert.isAnnotation(cls);
annotationNames.add(cls.getName());
}
return getClassesWithAnyAnnotation(annotationNames);
return getClassesWithAnyAnnotation(annotationNames.toArray(new String[0]));
}

/**
Expand Down Expand Up @@ -1294,7 +1294,7 @@ public ClassInfoList getClassesWithAnnotation(final String annotationName) {
* @return A list of all non-annotation classes that were found with all of the named class annotations during
* the scan, or the empty list if none.
*/
public ClassInfoList getClassesWithAllAnnotations(final List<String> annotationNames) {
public ClassInfoList getClassesWithAllAnnotations(final String... annotationNames) {
ClassInfoList foundClassInfo = null;
for (final String annotationName : annotationNames) {
final ClassInfoList classInfoList = getClassesWithAnnotation(annotationName);
Expand All @@ -1316,7 +1316,7 @@ public ClassInfoList getClassesWithAllAnnotations(final List<String> annotationN
* @return A list of all non-annotation classes that were found with any of the named class annotations during
* the scan, or the empty list if none.
*/
public ClassInfoList getClassesWithAnyAnnotation(final List<String> annotationNames) {
public ClassInfoList getClassesWithAnyAnnotation(final String... annotationNames) {
ClassInfoList foundClassInfo = null;
for (final String annotationName : annotationNames) {
final ClassInfoList classInfoList = getClassesWithAnnotation(annotationName);
Expand Down

0 comments on commit 02f1f76

Please sign in to comment.