mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-05 10:15:19 +08:00
improved annotation search performance
This commit is contained in:
@@ -1865,6 +1865,10 @@ public class JSONObject {
|
||||
}
|
||||
}
|
||||
|
||||
//If the superclass is Object, no annotations will be found any more
|
||||
if (c.getSuperclass().equals(Object.class))
|
||||
return null;
|
||||
|
||||
try {
|
||||
return getAnnotation(
|
||||
c.getSuperclass().getMethod(m.getName(), m.getParameterTypes()),
|
||||
@@ -1919,6 +1923,10 @@ public class JSONObject {
|
||||
}
|
||||
}
|
||||
|
||||
//If the superclass is Object, no annotations will be found any more
|
||||
if (c.getSuperclass().equals(Object.class))
|
||||
return -1;
|
||||
|
||||
try {
|
||||
int d = getAnnotationDepth(
|
||||
c.getSuperclass().getMethod(m.getName(), m.getParameterTypes()),
|
||||
|
Reference in New Issue
Block a user