mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-08 19:44:29 +08: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