From 38f72171c5bc44e4cf4324dfce551b5f5af8759b4f8999cb7f261fd6059bc771 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Mon, 21 Mar 2022 08:27:20 +0000 Subject: [PATCH 1/2] OBS-URL: https://build.opensuse.org/package/show/Java:packages/groovy18?expand=0&rev=15 --- groovy18-amgiguous-function-calls.patch | 38 +++++++++++++++++ groovy18-asm7.patch | 57 +++++++++++++++++++++++++ groovy18-sourcetarget.patch | 18 ++++---- groovy18.spec | 14 ++++-- 4 files changed, 114 insertions(+), 13 deletions(-) create mode 100644 groovy18-amgiguous-function-calls.patch create mode 100644 groovy18-asm7.patch diff --git a/groovy18-amgiguous-function-calls.patch b/groovy18-amgiguous-function-calls.patch new file mode 100644 index 0000000..eff2f36 --- /dev/null +++ b/groovy18-amgiguous-function-calls.patch @@ -0,0 +1,38 @@ +--- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java 2013-02-15 09:42:29.000000000 +0100 ++++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java 2022-03-21 09:20:24.640511870 +0100 +@@ -7425,7 +7425,7 @@ + */ + @SuppressWarnings("unchecked") + public static T[] plus(T[] left, T[] right) { +- return (T[]) plus(toList(left), toList(right)).toArray(); ++ return (T[]) plus((Collection)toList(left), (Collection)toList(right)).toArray(); + } + + /** +@@ -7443,7 +7443,7 @@ + */ + @SuppressWarnings("unchecked") + public static T[] plus(T[] left, T right) { +- return (T[]) plus(toList(left), right).toArray(); ++ return (T[]) plus((Collection)toList(left), right).toArray(); + } + + /** +@@ -7461,7 +7461,7 @@ + */ + @SuppressWarnings("unchecked") + public static T[] plus(T[] left, Collection right) { +- return (T[]) plus(toList(left), right).toArray(); ++ return (T[]) plus((Collection)toList(left), right).toArray(); + } + + /** +@@ -7483,7 +7483,7 @@ + */ + @SuppressWarnings("unchecked") + public static T[] plus(T[] left, Iterable right) { +- return (T[]) plus(toList(left), toList(right)).toArray(); ++ return (T[]) plus((Collection)toList(left), toList(right)).toArray(); + } + + /** diff --git a/groovy18-asm7.patch b/groovy18-asm7.patch new file mode 100644 index 0000000..4a77cf6 --- /dev/null +++ b/groovy18-asm7.patch @@ -0,0 +1,57 @@ +--- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/ant/VerifyClass.java 2013-02-15 09:42:29.000000000 +0100 ++++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/ant/VerifyClass.java 2022-03-21 08:55:34.604198152 +0100 +@@ -119,23 +119,7 @@ + log("verifying of class " + clazz + " failed"); + } + if (verbose) log(method.name + method.desc); +- TraceMethodVisitor mv = new TraceMethodVisitor(null) { +- public void visitMaxs(int maxStack, int maxLocals) { +- StringBuffer buffer = new StringBuffer(); +- for (int i = 0; i < text.size(); ++i) { +- String s = frames[i] == null ? "null" : frames[i].toString(); +- while (s.length() < maxStack + maxLocals + 1) { +- s += " "; +- } +- buffer.append(Integer.toString(i + 100000).substring(1)); +- buffer.append(" "); +- buffer.append(s); +- buffer.append(" : "); +- buffer.append(text.get(i)); +- } +- if (verbose) log(buffer.toString()); +- } +- }; ++ TraceMethodVisitor mv = new TraceMethodVisitor(null); + for (int j = 0; j < method.instructions.size(); ++j) { + Object insn = method.instructions.get(j); + if (insn instanceof AbstractInsnNode) { +--- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/runtime/callsite/GroovySunClassLoader.java 2013-02-15 09:42:29.000000000 +0100 ++++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/runtime/callsite/GroovySunClassLoader.java 2022-03-21 08:58:16.241090031 +0100 +@@ -15,9 +15,10 @@ + */ + package org.codehaus.groovy.runtime.callsite; + ++import org.codehaus.groovy.reflection.SunClassLoader; + import org.objectweb.asm.ClassReader; ++import org.objectweb.asm.ClassVisitor; + import org.objectweb.asm.ClassWriter; +-import org.codehaus.groovy.reflection.SunClassLoader; + + import java.io.IOException; + import java.io.InputStream; +@@ -56,12 +57,13 @@ + private void loadAbstract() throws IOException { + final InputStream asStream = GroovySunClassLoader.class.getClass().getClassLoader().getResourceAsStream(resName("org.codehaus.groovy.runtime.callsite.AbstractCallSite")); + ClassReader reader = new ClassReader(asStream); +- final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS) { ++ final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); ++ final ClassVisitor cv = new ClassVisitor(4, cw) { + public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { + super.visit(version, access, name, signature, "sun/reflect/GroovyMagic", interfaces); + } + }; +- reader.accept(cw, ClassWriter.COMPUTE_MAXS); ++ reader.accept(cv, ClassWriter.COMPUTE_MAXS); + asStream.close(); + define(cw.toByteArray(), "org.codehaus.groovy.runtime.callsite.AbstractCallSite"); + } diff --git a/groovy18-sourcetarget.patch b/groovy18-sourcetarget.patch index b7dd888..2e1d30f 100644 --- a/groovy18-sourcetarget.patch +++ b/groovy18-sourcetarget.patch @@ -5,7 +5,7 @@ destdir="${targetDirectory}/tools" includeantruntime="false" - source="1.5" target="1.5" fork="true" classpathref="compilePath"/> -+ source="1.6" target="1.6" fork="true" classpathref="compilePath"/> ++ source="1.8" target="1.8" fork="true" classpathref="compilePath"/> @@ -14,7 +14,7 @@ -+ deprecation="on" debug="yes" source="1.6" target="1.6" fork="true" classpathref="compilePath"> ++ deprecation="on" debug="yes" source="1.8" target="1.8" fork="true" classpathref="compilePath"> - -+ ++ @@ -32,7 +32,7 @@ - -+ ++ @@ -42,7 +42,7 @@ - - -+ ++ @@ -52,8 +52,8 @@ destdir="${examplesClassesDirectory}" - source="1.5" - target="1.5" -+ source="1.6" -+ target="1.6" ++ source="1.8" ++ target="1.8" fork="true"> @@ -62,7 +62,7 @@ - -+ ++ @@ -71,7 +71,7 @@ provided" +%pom_change_dep asm::: org.ow2.asm::7.0: + # java 7 apis %pom_remove_dep org.livetribe:livetribe-jsr223 # explicit tomcat apis @@ -164,8 +170,8 @@ mkdir -p target/lib/{compile,tools} # Construct classpath build-jar-repository target/lib/compile glassfish-servlet-api glassfish-jsp-api/javax.servlet.jsp-api \ - asm3/asm-tree asm3/asm \ - asm3/asm-util asm3/asm-analysis \ + objectweb-asm/asm-tree objectweb-asm/asm \ + objectweb-asm/asm-util objectweb-asm/asm-analysis \ antlr ant/ant-antlr antlr \ bsf jline1/jline-1 xstream ant junit apache-ivy commons-cli \ jansi From 5c656f52f44de9f7be2484d8e11f523028a01d3537f99b8c15bacc455ba885cf Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Mon, 21 Mar 2022 15:06:02 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/Java:packages/groovy18?expand=0&rev=16 --- groovy18.changes | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/groovy18.changes b/groovy18.changes index 5c28790..de4289a 100644 --- a/groovy18.changes +++ b/groovy18.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Mon Mar 21 15:03:23 UTC 2022 - Fridrich Strba + +- Modified patch: + * groovy18-sourcetarget.patch + + Build with source and target levels 8 +- Added patches: + * groovy18-amgiguous-function-calls.patch + + Cast to Collection to help compiler to resolve ambiguities + with new JDKs + * groovy18-asm7.patch + + Remove dependency on the old asm3 + ------------------------------------------------------------------- Mon Dec 16 09:21:49 UTC 2019 - Fridrich Strba