mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
Specifically ignore annotations in java package for meta-annotations
There's no world in which a java annotation contains one of the command annotations and may only lead to infinite recursion.
This commit is contained in:
committed by
Daniel Ennis
parent
667dfec904
commit
2ba6895e0c
@@ -108,9 +108,11 @@ class Annotations <M extends CommandManager> extends AnnotationLookups {
|
||||
return object.getAnnotation(annoClass);
|
||||
} else {
|
||||
for (Annotation otherAnnotation : object.getDeclaredAnnotations()) {
|
||||
final Annotation foundAnnotation = getAnnotationRecursive(otherAnnotation.annotationType(), annoClass);
|
||||
if (foundAnnotation != null) {
|
||||
return foundAnnotation;
|
||||
if (!otherAnnotation.annotationType().getPackage().getName().startsWith("java.")) {
|
||||
final Annotation foundAnnotation = getAnnotationRecursive(otherAnnotation.annotationType(), annoClass);
|
||||
if (foundAnnotation != null) {
|
||||
return foundAnnotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user