mirror of
https://github.com/stleary/JSON-java.git
synced 2026-01-24 00:03:17 -05:00
Make private methods static where possible
This avoids an unneeded object reference. Found via error-prone.
This commit is contained in:
@@ -1496,11 +1496,11 @@ public class JSONObject {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isValidMethodName(String name) {
|
||||
private static boolean isValidMethodName(String name) {
|
||||
return !"getClass".equals(name) && !"getDeclaringClass".equals(name);
|
||||
}
|
||||
|
||||
private String getKeyNameFromMethod(Method method) {
|
||||
private static String getKeyNameFromMethod(Method method) {
|
||||
final int ignoreDepth = getAnnotationDepth(method, JSONPropertyIgnore.class);
|
||||
if (ignoreDepth > 0) {
|
||||
final int forcedNameDepth = getAnnotationDepth(method, JSONPropertyName.class);
|
||||
|
||||
Reference in New Issue
Block a user