mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 03:15:32 -04:00
Merge pull request #845 from seppl831/fix-annotation-search-performance
improved annotation search performance
This commit is contained in:
commit
ac7806d060
@ -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 {
|
try {
|
||||||
return getAnnotation(
|
return getAnnotation(
|
||||||
c.getSuperclass().getMethod(m.getName(), m.getParameterTypes()),
|
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 {
|
try {
|
||||||
int d = getAnnotationDepth(
|
int d = getAnnotationDepth(
|
||||||
c.getSuperclass().getMethod(m.getName(), m.getParameterTypes()),
|
c.getSuperclass().getMethod(m.getName(), m.getParameterTypes()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user