File tree Expand file tree Collapse file tree
src/main/java/graphql/execution Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import graphql .schema .GraphQLObjectType ;
77import graphql .schema .GraphQLSchema ;
88
9- import java .util .LinkedHashMap ;
109import java .util .Map ;
1110
1211/**
@@ -48,8 +47,8 @@ public static Builder newParameters() {
4847
4948 public static class Builder {
5049 private GraphQLSchema graphQLSchema ;
51- private final Map <String , FragmentDefinition > fragmentsByName = new LinkedHashMap <>() ;
52- private final Map <String , Object > variables = new LinkedHashMap <>() ;
50+ private Map <String , FragmentDefinition > fragmentsByName ;
51+ private Map <String , Object > variables ;
5352 private GraphQLObjectType objectType ;
5453
5554 /**
@@ -70,12 +69,12 @@ public Builder objectType(GraphQLObjectType objectType) {
7069 }
7170
7271 public Builder fragments (Map <String , FragmentDefinition > fragmentsByName ) {
73- this .fragmentsByName . putAll ( fragmentsByName ) ;
72+ this .fragmentsByName = fragmentsByName ;
7473 return this ;
7574 }
7675
7776 public Builder variables (Map <String , Object > variables ) {
78- this .variables . putAll ( variables ) ;
77+ this .variables = variables ;
7978 return this ;
8079 }
8180
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public class MergedField {
6767
6868 private MergedField (List <Field > fields ) {
6969 assertNotEmpty (fields );
70- this .fields = unmodifiableList (new ArrayList <>( fields ) );
70+ this .fields = unmodifiableList (fields );
7171 this .singleField = fields .get (0 );
7272 this .name = singleField .getName ();
7373 this .resultKey = singleField .getAlias () != null ? singleField .getAlias () : name ;
@@ -144,7 +144,8 @@ public MergedField transform(Consumer<Builder> builderConsumer) {
144144 }
145145
146146 public static class Builder {
147- private List <Field > fields ;
147+
148+ private final List <Field > fields ;
148149
149150 private Builder () {
150151 this .fields = new ArrayList <>();
@@ -155,7 +156,7 @@ private Builder(MergedField existing) {
155156 }
156157
157158 public Builder fields (List <Field > fields ) {
158- this .fields = fields ;
159+ this .fields . addAll ( fields ) ;
159160 return this ;
160161 }
161162
@@ -168,7 +169,6 @@ public MergedField build() {
168169 return new MergedField (fields );
169170 }
170171
171-
172172 }
173173
174174 @ Override
You can’t perform that action at this time.
0 commit comments