Skip to content

Commit

Permalink
checking for synthetic fields in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
osher-sade committed Jul 9, 2019
1 parent f9a83d0 commit e860593
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.Map;
import java.util.TreeMap;

public class ObjectUtil {
public class ObjectUtil {

public static Map<String, Field> getAllFields(Class c) {
Map<String, Field> fields;
Expand All @@ -30,7 +30,9 @@ public static Map<String, Field> getAllFields(Class c) {
}

for (Field f : c.getDeclaredFields()) {
fields.put(f.getName(), f);
if (!f.isSynthetic()) {
fields.put(f.getName(), f);
}
}

return fields;
Expand Down

0 comments on commit e860593

Please sign in to comment.