diff --git a/src/main/java/graphql/annotations/processor/directives/DirectiveCreator.java b/src/main/java/graphql/annotations/processor/directives/DirectiveCreator.java index ff846adb..94820472 100644 --- a/src/main/java/graphql/annotations/processor/directives/DirectiveCreator.java +++ b/src/main/java/graphql/annotations/processor/directives/DirectiveCreator.java @@ -50,8 +50,8 @@ public GraphQLDirective getDirective(Class annotatedClass) { private void buildArguments(GraphQLDirective.Builder builder, Class annotatedClass) { Arrays.stream(annotatedClass.getDeclaredFields()) - .filter(x -> !x.isSynthetic()) - .forEach(x -> builder.argument(directiveArgumentCreator.getArgument(x, annotatedClass))); + .filter(field -> !field.isSynthetic()) + .forEach(field -> builder.argument(directiveArgumentCreator.getArgument(field, annotatedClass))); } private Introspection.DirectiveLocation[] getValidLocations(Class annotatedClass) { diff --git a/src/main/java/graphql/annotations/processor/util/ObjectUtil.java b/src/main/java/graphql/annotations/processor/util/ObjectUtil.java index f4c23ffa..3f28395f 100644 --- a/src/main/java/graphql/annotations/processor/util/ObjectUtil.java +++ b/src/main/java/graphql/annotations/processor/util/ObjectUtil.java @@ -18,7 +18,7 @@ import java.util.Map; import java.util.TreeMap; -public class ObjectUtil { +public class ObjectUtil { public static Map getAllFields(Class c) { Map fields; @@ -30,7 +30,9 @@ public static Map getAllFields(Class c) { } for (Field f : c.getDeclaredFields()) { - fields.put(f.getName(), f); + if (!f.isSynthetic()) { + fields.put(f.getName(), f); + } } return fields;