Skip to content

Commit 07199a3

Browse files
committed
Change sourceCompatibility to 1.6.
1 parent 0c44b10 commit 07199a3

File tree

69 files changed

+169
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+169
-165
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ apply plugin: 'java'
88
apply plugin: 'maven'
99
apply plugin: 'maven-publish'
1010

11-
sourceCompatibility = 1.7
11+
sourceCompatibility = 1.6
1212
def releaseVersion = System.properties.RELEASE_VERSION
1313
version = releaseVersion ? releaseVersion : new SimpleDateFormat('yyyy-MM-dd\'T\'HH-mm-ss').format(new Date())
1414
group = 'com.graphql-java'

src/main/java/graphql/ExecutionResultImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
public class ExecutionResultImpl implements ExecutionResult {
99

10-
private final List<GraphQLError> errors = new ArrayList<>();
10+
private final List<GraphQLError> errors = new ArrayList<GraphQLError>();
1111
private Object data;
1212

1313
public ExecutionResultImpl(List<? extends GraphQLError> errors) {
@@ -37,7 +37,7 @@ public void setData(Object result) {
3737

3838
@Override
3939
public List<GraphQLError> getErrors() {
40-
return new ArrayList<>(errors);
40+
return new ArrayList<GraphQLError>(errors);
4141
}
4242

4343

src/main/java/graphql/InvalidSyntaxError.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
public class InvalidSyntaxError implements GraphQLError {
1010

11-
private final List<SourceLocation> sourceLocations = new ArrayList<>();
11+
private final List<SourceLocation> sourceLocations = new ArrayList<SourceLocation>();
1212

1313
public InvalidSyntaxError(SourceLocation sourceLocation) {
1414
if (sourceLocation != null)

src/main/java/graphql/execution/Execution.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private ExecutionResult executeOperation(
5151
OperationDefinition operationDefinition) {
5252
GraphQLObjectType operationRootType = getOperationRootType(executionContext.getGraphQLSchema(), executionContext.getOperationDefinition());
5353

54-
Map<String, List<Field>> fields = new LinkedHashMap<>();
54+
Map<String, List<Field>> fields = new LinkedHashMap<String, List<Field>>();
5555
fieldCollector.collectFields(executionContext, operationRootType, operationDefinition.getSelectionSet(), new ArrayList<String>(), fields);
5656

5757
if (operationDefinition.getOperation() == OperationDefinition.Operation.MUTATION) {

src/main/java/graphql/execution/ExecutionContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ public class ExecutionContext {
1515

1616
private GraphQLSchema graphQLSchema;
1717
private ExecutionStrategy executionStrategy;
18-
private Map<String, FragmentDefinition> fragmentsByName = new LinkedHashMap<>();
18+
private Map<String, FragmentDefinition> fragmentsByName = new LinkedHashMap<String, FragmentDefinition>();
1919
private OperationDefinition operationDefinition;
20-
private Map<String, Object> variables = new LinkedHashMap<>();
20+
private Map<String, Object> variables = new LinkedHashMap<String, Object>();
2121
private Object root;
22-
private List<GraphQLError> errors = new ArrayList<>();
22+
private List<GraphQLError> errors = new ArrayList<GraphQLError>();
2323

2424
public GraphQLSchema getGraphQLSchema() {
2525
return graphQLSchema;

src/main/java/graphql/execution/ExecutionContextBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public ExecutionContextBuilder(ValuesResolver valuesResolver) {
1919
}
2020

2121
public ExecutionContext build(GraphQLSchema graphQLSchema, ExecutionStrategy executionStrategy, Object root, Document document, String operationName, Map<String, Object> args) {
22-
Map<String, FragmentDefinition> fragmentsByName = new LinkedHashMap<>();
23-
Map<String, OperationDefinition> operationsByName = new LinkedHashMap<>();
22+
Map<String, FragmentDefinition> fragmentsByName = new LinkedHashMap<String, FragmentDefinition>();
23+
Map<String, OperationDefinition> operationsByName = new LinkedHashMap<String, OperationDefinition>();
2424

2525
for (Definition definition : document.getDefinitions()) {
2626
if (definition instanceof OperationDefinition) {

src/main/java/graphql/execution/ExecutionStrategy.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ protected ExecutionResult completeValue(ExecutionContext executionContext, Graph
7676
resolvedType = (GraphQLObjectType) fieldType;
7777
}
7878

79-
Map<String, List<Field>> subFields = new LinkedHashMap<>();
80-
List<String> visitedFragments = new ArrayList<>();
79+
Map<String, List<Field>> subFields = new LinkedHashMap<String, List<Field>>();
80+
List<String> visitedFragments = new ArrayList<String>();
8181
for (Field field : fields) {
8282
if (field.getSelectionSet() == null) continue;
8383
fieldCollector.collectFields(executionContext, resolvedType, field.getSelectionSet(), visitedFragments, subFields);
@@ -123,7 +123,7 @@ protected ExecutionResult completeValueForScalar(GraphQLScalarType scalarType, O
123123
}
124124

125125
protected ExecutionResult completeValueForList(ExecutionContext executionContext, GraphQLList fieldType, List<Field> fields, List<Object> result) {
126-
List<Object> completedResults = new ArrayList<>();
126+
List<Object> completedResults = new ArrayList<Object>();
127127
for (Object item : result) {
128128
ExecutionResult completedValue = completeValue(executionContext, fieldType.getWrappedType(), fields, item);
129129
completedResults.add(completedValue != null ? completedValue.getData() : null);

src/main/java/graphql/execution/ExecutorServiceExecutionStrategy.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public ExecutorServiceExecutionStrategy(ExecutorService executorService) {
4040
public ExecutionResult execute(final ExecutionContext executionContext, final GraphQLObjectType parentType, final Object source, final Map<String, List<Field>> fields) {
4141
if (executorService == null) return new SimpleExecutionStrategy().execute(executionContext, parentType, source, fields);
4242

43-
Map<String, Future<ExecutionResult>> futures = new LinkedHashMap<>();
43+
Map<String, Future<ExecutionResult>> futures = new LinkedHashMap<String, Future<ExecutionResult>>();
4444
for (String fieldName : fields.keySet()) {
4545
final List<Field> fieldList = fields.get(fieldName);
4646
Callable<ExecutionResult> resolveField = new Callable<ExecutionResult>() {
@@ -53,14 +53,16 @@ public ExecutionResult call() throws Exception {
5353
futures.put(fieldName, executorService.submit(resolveField));
5454
}
5555
try {
56-
Map<String, Object> results = new LinkedHashMap<>();
56+
Map<String, Object> results = new LinkedHashMap<String, Object>();
5757
for (String fieldName : futures.keySet()) {
5858
ExecutionResult executionResult = futures.get(fieldName).get();
5959

6060
results.put(fieldName, executionResult != null ? executionResult.getData() : null);
6161
}
6262
return new ExecutionResultImpl(results, executionContext.getErrors());
63-
} catch (InterruptedException | ExecutionException e) {
63+
} catch (InterruptedException e) {
64+
throw new GraphQLException(e);
65+
} catch (ExecutionException e) {
6466
throw new GraphQLException(e);
6567
}
6668
}

src/main/java/graphql/execution/SimpleExecutionStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public class SimpleExecutionStrategy extends ExecutionStrategy {
1313
@Override
1414
public ExecutionResult execute(ExecutionContext executionContext, GraphQLObjectType parentType, Object source, Map<String, List<Field>> fields) {
15-
Map<String, Object> results = new LinkedHashMap<>();
15+
Map<String, Object> results = new LinkedHashMap<String, Object>();
1616
for (String fieldName : fields.keySet()) {
1717
List<Field> fieldList = fields.get(fieldName);
1818
ExecutionResult resolvedResult = resolveField(executionContext, parentType, source, fieldList);

src/main/java/graphql/execution/ValuesResolver.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class ValuesResolver {
1111

1212

1313
public Map<String, Object> getVariableValues(GraphQLSchema schema, List<VariableDefinition> variableDefinitions, Map<String, Object> inputs) {
14-
Map<String, Object> result = new LinkedHashMap<>();
14+
Map<String, Object> result = new LinkedHashMap<String, Object>();
1515
for (VariableDefinition variableDefinition : variableDefinitions) {
1616
result.put(variableDefinition.getName(), getVariableValue(schema, variableDefinition, inputs.get(variableDefinition.getName())));
1717
}
@@ -20,7 +20,7 @@ public Map<String, Object> getVariableValues(GraphQLSchema schema, List<Variable
2020

2121

2222
public Map<String, Object> getArgumentValues(List<GraphQLArgument> argumentTypes, List<Argument> arguments, Map<String, Object> variables) {
23-
Map<String, Object> result = new LinkedHashMap<>();
23+
Map<String, Object> result = new LinkedHashMap<String, Object>();
2424
Map<String, Argument> argumentMap = argumentMap(arguments);
2525
for (GraphQLArgument fieldArgument : argumentTypes) {
2626
Argument argument = argumentMap.get(fieldArgument.getName());
@@ -37,7 +37,7 @@ public Map<String, Object> getArgumentValues(List<GraphQLArgument> argumentTypes
3737

3838

3939
private Map<String, Argument> argumentMap(List<Argument> arguments) {
40-
Map<String, Argument> result = new LinkedHashMap<>();
40+
Map<String, Argument> result = new LinkedHashMap<String, Argument>();
4141
for (Argument argument : arguments) {
4242
result.put(argument.getName(), argument);
4343
}
@@ -82,7 +82,7 @@ private Object coerceValue(GraphQLType graphQLType, Object value) {
8282
}
8383

8484
private Object coerceValueForInputObjectField(GraphQLInputObjectType inputObjectType, Map<String, Object> input) {
85-
Map<String, Object> result = new LinkedHashMap<>();
85+
Map<String, Object> result = new LinkedHashMap<String, Object>();
8686
for (GraphQLInputObjectField inputField : inputObjectType.getFields()) {
8787
Object value = coerceValue(inputField.getType(), input.get(inputField.getName()));
8888
result.put(inputField.getName(), value == null ? inputField.getDefaultValue() : value);
@@ -101,7 +101,7 @@ private Object coerceValueForEnum(GraphQLEnumType graphQLEnumType, Object value)
101101

102102
private List coerceValueForList(GraphQLList graphQLList, Object value) {
103103
if (value instanceof Iterable) {
104-
List<Object> result = new ArrayList<>();
104+
List<Object> result = new ArrayList<Object>();
105105
for (Object val : (Iterable) value) {
106106
result.add(coerceValue(graphQLList.getWrappedType(), val));
107107
}
@@ -136,7 +136,7 @@ private Object coerceValueAst(GraphQLType type, Value inputValue, Map<String, Ob
136136
private Object coerceValueAstForList(GraphQLList graphQLList, Value value, Map<String, Object> variables) {
137137
if (value instanceof ArrayValue) {
138138
ArrayValue arrayValue = (ArrayValue) value;
139-
List<Object> result = new ArrayList<>();
139+
List<Object> result = new ArrayList<Object>();
140140
for (Value singleValue : arrayValue.getValues()) {
141141
result.add(coerceValueAst(graphQLList.getWrappedType(), singleValue, variables));
142142
}
@@ -147,7 +147,7 @@ private Object coerceValueAstForList(GraphQLList graphQLList, Value value, Map<S
147147
}
148148

149149
private Object coerceValueAstForInputObject(GraphQLInputObjectType type, ObjectValue inputValue, Map<String, Object> variables) {
150-
Map<String, Object> result = new LinkedHashMap<>();
150+
Map<String, Object> result = new LinkedHashMap<String, Object>();
151151

152152
for (ObjectField objectField : inputValue.getObjectFields()) {
153153
GraphQLInputObjectField inputObjectField = type.getField(objectField.getName());

0 commit comments

Comments
 (0)