Skip to content

Commit fc8912b

Browse files
committed
Method name builder doesn't change the name of the methods when
they become fields (i.e name of the field is the same as the name of the method)
1 parent 5dddce5 commit fc8912b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodNameBuilder.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ public MethodNameBuilder(Method method) {
3030

3131
@Override
3232
public String build() {
33-
String name = method.getName().replaceFirst("^(is|get|set)(.+)", "$2");
34-
name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
35-
GraphQLName nameAnn = method.getAnnotation(GraphQLName.class);
36-
return toGraphqlName(nameAnn == null ? name : nameAnn.value());
33+
GraphQLName name = method.getAnnotation(GraphQLName.class);
34+
return toGraphqlName(name == null ? method.getName() : name.value());
3735
}
3836
}

0 commit comments

Comments
 (0)