2023-09-01 12:21:12 +00:00
committed by Git OBS Bridge
parent 762a491117
commit 11cb02e8c8
3 changed files with 124 additions and 2 deletions
+7
View File
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Sep 1 12:20:23 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* java8.patch
+ keep Java 8 compatibility and build with -release 8
-------------------------------------------------------------------
Fri Jul 14 13:48:23 UTC 2023 - Anton Shvetz <shvetz.anton@gmail.com>
+8 -2
View File
@@ -25,7 +25,8 @@ Group: Development/Libraries/Java
URL: https://graphql-java.com/
Source0: https://github.com/%{name}/%{name}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://repo1.maven.org/maven2/com/%{name}/%{name}/%{version}/%{name}-%{version}.pom
BuildRequires: java-devel >= 11
Patch0: java8.patch
BuildRequires: java-devel >= 1.8
BuildRequires: maven-local
BuildRequires: mvn(com.google.guava:guava)
BuildRequires: mvn(com.graphql-java:java-dataloader)
@@ -49,6 +50,7 @@ API documentation for %{name}.
%prep
%setup -q
%patch0 -p1
cp %{SOURCE1} pom.xml
%pom_add_dep com.google.guava:guava
%pom_add_dep com.intellij:annotations
@@ -80,7 +82,11 @@ cp %{SOURCE1} pom.xml
mv src/main/antlr src/main/antlr4
%build
%{mvn_build} -f -- -Dmaven.compiler.{source,target}=11
%{mvn_build} -f -- \
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 9}%{!?pkg_vcmp:0}
-Dmaven.compiler.release=8 \
%endif
-Dmaven.compiler.{source,target}=8
%install
%mvn_install
+109
View File
@@ -0,0 +1,109 @@
diff -urEbwB graphql-java-21.0.orig/src/main/java/graphql/normalized/ExecutableNormalizedField.java graphql-java-21.0/src/main/java/graphql/normalized/ExecutableNormalizedField.java
--- graphql-java-21.0.orig/src/main/java/graphql/normalized/ExecutableNormalizedField.java 2023-09-01 13:45:52.666395044 +0200
+++ graphql-java-21.0/src/main/java/graphql/normalized/ExecutableNormalizedField.java 2023-09-01 14:07:53.265510599 +0200
@@ -16,6 +16,7 @@
import graphql.schema.GraphQLOutputType;
import graphql.schema.GraphQLSchema;
import graphql.schema.GraphQLUnionType;
+import graphql.schema.GraphQLUnmodifiedType;
import graphql.util.FpKit;
import graphql.util.MutableRef;
import org.jetbrains.annotations.NotNull;
@@ -187,7 +188,7 @@
}
public void forEachFieldDefinition(GraphQLSchema schema, Consumer<GraphQLFieldDefinition> consumer) {
- var fieldDefinition = resolveIntrospectionField(schema, objectTypeNames, fieldName);
+ GraphQLFieldDefinition fieldDefinition = resolveIntrospectionField(schema, objectTypeNames, fieldName);
if (fieldDefinition != null) {
consumer.accept(fieldDefinition);
return;
@@ -211,7 +212,7 @@
* Internally there are cases where we know it is safe to use this, so this exists.
*/
private GraphQLFieldDefinition getOneFieldDefinition(GraphQLSchema schema) {
- var fieldDefinition = resolveIntrospectionField(schema, objectTypeNames, fieldName);
+ GraphQLFieldDefinition fieldDefinition = resolveIntrospectionField(schema, objectTypeNames, fieldName);
if (fieldDefinition != null) {
return fieldDefinition;
}
@@ -512,14 +513,14 @@
private Set<GraphQLInterfaceType> getInterfacesCommonToAllOutputTypes(GraphQLSchema schema) {
// Shortcut for performance
if (objectTypeNames.size() == 1) {
- var fieldDef = getOneFieldDefinition(schema);
- var outputType = unwrapAll(fieldDef.getType());
+ GraphQLFieldDefinition fieldDef = getOneFieldDefinition(schema);
+ GraphQLUnmodifiedType outputType = unwrapAll(fieldDef.getType());
if (outputType instanceof GraphQLObjectType) {
return new LinkedHashSet<>((List) ((GraphQLObjectType) outputType).getInterfaces());
} else if (outputType instanceof GraphQLInterfaceType) {
- var result = new LinkedHashSet<>((List) ((GraphQLInterfaceType) outputType).getInterfaces());
- result.add(outputType);
+ Set<GraphQLInterfaceType> result = new LinkedHashSet<>((List) ((GraphQLInterfaceType) outputType).getInterfaces());
+ result.add((GraphQLInterfaceType) outputType);
return result;
} else {
return Collections.emptySet();
@@ -528,7 +529,7 @@
MutableRef<Set<GraphQLInterfaceType>> commonInterfaces = new MutableRef<>();
forEachFieldDefinition(schema, (fieldDef) -> {
- var outputType = unwrapAll(fieldDef.getType());
+ GraphQLUnmodifiedType outputType = unwrapAll(fieldDef.getType());
List<GraphQLInterfaceType> outputTypeInterfaces;
if (outputType instanceof GraphQLObjectType) {
diff -urEbwB graphql-java-21.0.orig/src/main/java/graphql/schema/diffing/ana/EditOperationAnalyzer.java graphql-java-21.0/src/main/java/graphql/schema/diffing/ana/EditOperationAnalyzer.java
--- graphql-java-21.0.orig/src/main/java/graphql/schema/diffing/ana/EditOperationAnalyzer.java 2023-09-01 13:45:52.673061757 +0200
+++ graphql-java-21.0/src/main/java/graphql/schema/diffing/ana/EditOperationAnalyzer.java 2023-09-01 14:18:28.283228972 +0200
@@ -1988,7 +1988,7 @@
*
* @see #getTraversalOrder(List)
*/
- private static final List<EditOperation.Operation> OPERATION_TRAVERSAL_ORDER = List.of(
+ private static final List<EditOperation.Operation> OPERATION_TRAVERSAL_ORDER = java.util.Arrays.asList(
EditOperation.Operation.CHANGE_VERTEX,
EditOperation.Operation.INSERT_VERTEX,
EditOperation.Operation.DELETE_VERTEX,
@@ -2002,7 +2002,7 @@
*
* @see #getTraversalOrder(List)
*/
- private static final List<String> TYPE_TRAVERSAL_ORDER = List.of(
+ private static final List<String> TYPE_TRAVERSAL_ORDER = java.util.Arrays.asList(
// These are all top level declarations
SchemaGraph.SCHEMA,
SchemaGraph.OBJECT,
diff -urEbwB graphql-java-21.0.orig/src/main/java/graphql/schema/fetching/LambdaFetchingSupport.java graphql-java-21.0/src/main/java/graphql/schema/fetching/LambdaFetchingSupport.java
--- graphql-java-21.0.orig/src/main/java/graphql/schema/fetching/LambdaFetchingSupport.java 2023-09-01 13:45:52.673061757 +0200
+++ graphql-java-21.0/src/main/java/graphql/schema/fetching/LambdaFetchingSupport.java 2023-09-01 14:11:52.880498400 +0200
@@ -209,11 +209,11 @@
//
// This is a Java 9+ approach to method look up allowing private access
//
- try {
- return MethodHandles.privateLookupIn(targetClass, lookupMe);
- } catch (IllegalAccessException e) {
+// try {
+// return MethodHandles.privateLookupIn(targetClass, lookupMe);
+// } catch (IllegalAccessException e) {
return lookupMe;
- }
+// }
}
}
diff -urEbwB graphql-java-21.0.orig/src/main/java/graphql/schema/SchemaTransformer.java graphql-java-21.0/src/main/java/graphql/schema/SchemaTransformer.java
--- graphql-java-21.0.orig/src/main/java/graphql/schema/SchemaTransformer.java 2023-09-01 13:45:52.669728400 +0200
+++ graphql-java-21.0/src/main/java/graphql/schema/SchemaTransformer.java 2023-09-01 13:53:09.762743168 +0200
@@ -195,7 +195,7 @@
Map<GraphQLSchemaElement, List<GraphQLSchemaElement>> reverseDependencies = new LinkedHashMap<>();
Map<String, List<GraphQLSchemaElement>> typeRefReverseDependencies = new LinkedHashMap<>();
- TraverserVisitor<GraphQLSchemaElement> nodeTraverserVisitor = new TraverserVisitor<>() {
+ TraverserVisitor<GraphQLSchemaElement> nodeTraverserVisitor = new TraverserVisitor<GraphQLSchemaElement>() {
@Override
public TraversalControl enter(TraverserContext<GraphQLSchemaElement> context) {
GraphQLSchemaElement currentSchemaElement = context.thisNode();