[Git][java-team/annotation-indexer][upstream] New upstream version 1.15
Emmanuel Bourg (@ebourg)
gitlab at salsa.debian.org
Sat Sep 18 08:28:46 BST 2021
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / annotation-indexer
Commits:
ea793b47 by Emmanuel Bourg at 2021-09-18T09:25:52+02:00
New upstream version 1.15
- - - - -
2 changed files:
- pom.xml
- src/main/java/org/jvnet/hudson/annotation_indexer/Index.java
Changes:
=====================================
pom.xml
=====================================
@@ -10,7 +10,7 @@
<artifactId>annotation-indexer</artifactId>
<name>Annotation Indexer</name>
- <version>1.14</version>
+ <version>1.15</version>
<description>
Creates index of annotations.
</description>
@@ -30,7 +30,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.11</version>
+ <version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -45,7 +45,7 @@
<connection>scm:git:git://github.com/jenkinsci/lib-${project.artifactId}.git</connection>
<developerConnection>scm:git:git at github.com:jenkinsci/lib-${project.artifactId}.git</developerConnection>
<url>https://github.com/jenkinsci/lib-annotation-indexer</url>
- <tag>annotation-indexer-1.14</tag>
+ <tag>annotation-indexer-1.15</tag>
</scm>
<licenses>
=====================================
src/main/java/org/jvnet/hudson/annotation_indexer/Index.java
=====================================
@@ -42,14 +42,16 @@ public class Index {
}
/**
- * Lists up all the elements annotated by the given annotation.
+ * Lists the names of classes annotated by the given annotation.
+ * Typically you should use {@link #list(Class, ClassLoader, Class)} instead,
+ * but this lower-level method can be used for clients doing bytecode inspection or manipulation rather than class loading.
*/
- public static Iterable<AnnotatedElement> list(final Class<? extends Annotation> type, final ClassLoader cl) throws IOException {
+ public static Set<String> listClassNames(Class<? extends Annotation> type, ClassLoader cl) throws IOException {
// To allow annotations defined by 3rd parties to be indexable, skip this check
// if (!type.isAnnotationPresent(Indexed.class))
// throw new IllegalArgumentException(type+" doesn't have @Indexed");
- final Set<String> ids = new TreeSet<String>();
+ Set<String> ids = new TreeSet<>();
for (String prefix : PREFIXES) {
final Enumeration<URL> res = cl.getResources(prefix + type.getName());
@@ -66,6 +68,14 @@ public class Index {
}
}
+ return ids;
+ }
+
+ /**
+ * Lists up all the elements annotated by the given annotation.
+ */
+ public static Iterable<AnnotatedElement> list(final Class<? extends Annotation> type, final ClassLoader cl) throws IOException {
+ Set<String> ids = listClassNames(type, cl);
return new Iterable<AnnotatedElement>() {
public Iterator<AnnotatedElement> iterator() {
return new Iterator<AnnotatedElement>() {
View it on GitLab: https://salsa.debian.org/java-team/annotation-indexer/-/commit/ea793b47a2c9fe585e70932f2a81c01b7a4d958e
--
View it on GitLab: https://salsa.debian.org/java-team/annotation-indexer/-/commit/ea793b47a2c9fe585e70932f2a81c01b7a4d958e
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20210918/3d28328a/attachment.htm>
More information about the pkg-java-commits
mailing list