Skip to content

Commit f9a83d0

Browse files
committed
fixed a bug that could cause directives to be built with synthetic fields
1 parent 3e53e65 commit f9a83d0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/java/graphql/annotations/processor/directives/DirectiveCreator.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ public GraphQLDirective getDirective(Class<?> annotatedClass) {
4949
}
5050

5151
private void buildArguments(GraphQLDirective.Builder builder, Class<?> annotatedClass) {
52-
Arrays.stream(annotatedClass.getDeclaredFields()).forEach(x -> {
53-
if (!x.isSynthetic()) {
54-
builder.argument(directiveArgumentCreator.getArgument(x, annotatedClass));
55-
}
56-
});
52+
Arrays.stream(annotatedClass.getDeclaredFields())
53+
.filter(x -> !x.isSynthetic())
54+
.forEach(x -> builder.argument(directiveArgumentCreator.getArgument(x, annotatedClass)));
5755
}
5856

5957
private Introspection.DirectiveLocation[] getValidLocations(Class<?> annotatedClass) {

0 commit comments

Comments
 (0)