1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

Make private methods static where possible

This avoids an unneeded object reference.  Found via error-prone.
This commit is contained in:
Andrew Gaul 2019-07-26 15:23:31 -07:00
parent c8ae720caf
commit f63d21fd13
2 changed files with 5 additions and 5 deletions

View file

@ -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);