@@ -658,9 +658,12 @@ public static String getTypeDisplayName(Project project, Set<String> types) {
658
658
}
659
659
660
660
public static boolean isPropertyShortcutMethod (Method method ) {
661
+ return isPropertyShortcutMethod (method .getName ());
662
+ }
661
663
662
- for (String shortcut : PROPERTY_SHORTCUTS ) {
663
- if (method .getName ().startsWith (shortcut ) && method .getName ().length () > shortcut .length ()) {
664
+ public static boolean isPropertyShortcutMethod (String methodName ) {
665
+ for (String shortcut : PROPERTY_SHORTCUTS ) {
666
+ if (methodName .startsWith (shortcut ) && methodName .length () > shortcut .length ()) {
664
667
return true ;
665
668
}
666
669
}
@@ -669,9 +672,8 @@ public static boolean isPropertyShortcutMethod(Method method) {
669
672
}
670
673
671
674
public static boolean isPropertyShortcutMethodEqual (String methodName , String variableName ) {
672
-
673
- for (String shortcut : PROPERTY_SHORTCUTS ) {
674
- if (methodName .equalsIgnoreCase (shortcut + variableName )) {
675
+ for (String shortcut : PROPERTY_SHORTCUTS ) {
676
+ if (methodName .equalsIgnoreCase (shortcut + variableName )) {
675
677
return true ;
676
678
}
677
679
}
@@ -688,11 +690,13 @@ public static boolean isPropertyShortcutMethodEqual(String methodName, String va
688
690
*/
689
691
@ NotNull
690
692
public static String getPropertyShortcutMethodName (@ NotNull Method method ) {
691
- String methodName = method .getName ();
693
+ return getPropertyShortcutMethodName (method .getName ());
694
+ }
692
695
693
- for (String shortcut : PROPERTY_SHORTCUTS ) {
696
+ public static String getPropertyShortcutMethodName (@ NotNull String methodName ) {
697
+ for (String shortcut : PROPERTY_SHORTCUTS ) {
694
698
// strip possible property shortcut and make it lcfirst
695
- if ( method . getName (). startsWith (shortcut ) && method . getName () .length () > shortcut .length ()) {
699
+ if ( methodName . startsWith (shortcut ) && methodName .length () > shortcut .length ()) {
696
700
methodName = methodName .substring (shortcut .length ());
697
701
return Character .toLowerCase (methodName .charAt (0 )) + methodName .substring (1 );
698
702
}
0 commit comments