Skip to content

Commit 5000415

Browse files
committed
minor optimization...
1 parent 57abaa0 commit 5000415

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/apache/ibatis/reflection/property/PropertyNamer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ public static String methodToProperty(String name) {
4545
}
4646

4747
public static boolean isProperty(String name) {
48-
return name.startsWith("get") || name.startsWith("set") || name.startsWith("is");
48+
return isGetter(name) || isSetter(name);
4949
}
5050

5151
public static boolean isGetter(String name) {
52-
return name.startsWith("get") || name.startsWith("is");
52+
return (name.startsWith("get") && name.length() > 3) || (name.startsWith("is") && name.length() > 2);
5353
}
5454

5555
public static boolean isSetter(String name) {
56-
return name.startsWith("set");
56+
return name.startsWith("set") && name.length() > 3;
5757
}
5858

5959
}

0 commit comments

Comments
 (0)