[jtharness] 03/04: Depend on libasm-java (>= 5.0) instead of libasm3-java (Closes: #800850)
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Tue Nov 28 12:31:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to branch master
in repository jtharness.
commit 75a4fab30615827b32139b0c97640e2ed2ab4475
Author: Emmanuel Bourg <ebourg at apache.org>
Date: Tue Nov 28 13:22:27 2017 +0100
Depend on libasm-java (>= 5.0) instead of libasm3-java (Closes: #800850)
---
debian/ant.properties | 2 +-
debian/changelog | 1 +
debian/control | 4 +-
debian/patches/03_asm_compatibility.patch | 335 ++++++++++++++++++++++++++++++
debian/patches/series | 1 +
5 files changed, 340 insertions(+), 3 deletions(-)
diff --git a/debian/ant.properties b/debian/ant.properties
index a51ca88..8535ef2 100644
--- a/debian/ant.properties
+++ b/debian/ant.properties
@@ -1,5 +1,5 @@
jcommjar = /usr/share/java/RXTXcomm.jar
servletjar = /usr/share/java/servlet-api-3.1.jar
-bytecodelib = /usr/share/java/asm3.jar:/usr/share/java/asm3-commons.jar
+bytecodelib = /usr/share/java/asm.jar:/usr/share/java/asm-commons.jar
junitlib = /usr/share/java/junit4.jar
BUILD_DIR = ./jar-build
diff --git a/debian/changelog b/debian/changelog
index 3aa8044..da7015f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
jtharness (5.0-2) UNRELEASED; urgency=medium
* Team upload.
+ * Depend on libasm-java (>= 5.0) instead of libasm3-java (Closes: #800850)
* Replaced 02_dependencies.patch with debian/ant.properties
-- Emmanuel Bourg <ebourg at apache.org> Tue, 28 Nov 2017 13:09:07 +0100
diff --git a/debian/control b/debian/control
index d8b212d..7e0242e 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends-Indep: default-jdk,
ant,
junit4,
librxtx-java,
- libasm3-java,
+ libasm-java (>= 5.0),
libservlet3.1-java
Standards-Version: 4.1.0
Vcs-Git: https://anonscm.debian.org/git/pkg-java/jtharness.git
@@ -20,7 +20,7 @@ Package: libjtharness-java
Architecture: all
Depends: junit4,
librxtx-java,
- libasm3-java,
+ libasm-java (>= 5.0),
libservlet3.1-java,
${java:Depends},
${misc:Depends}
diff --git a/debian/patches/03_asm_compatibility.patch b/debian/patches/03_asm_compatibility.patch
new file mode 100644
index 0000000..f04c3ec
--- /dev/null
+++ b/debian/patches/03_asm_compatibility.patch
@@ -0,0 +1,335 @@
+
+# HG changeset patch
+# User afedorch
+# Date 1508808304 25200
+# Node ID df5f3f3fe4b3be828db3570506d35a7c3f8a6f6f
+# Parent a5dc7a40b3aa86189524b50e742fd0e9004994df
+CODETOOLS-7901981 Update asm dependency, contributed by: erik.helin at oracle.com
+
+diff -r a5dc7a40b3aa -r df5f3f3fe4b3 src/com/sun/javatest/junit/JUnitAnnotationTestFinder.java
+--- a/src/com/sun/javatest/junit/JUnitAnnotationTestFinder.java Mon Oct 23 17:51:16 2017 -0700
++++ b/src/com/sun/javatest/junit/JUnitAnnotationTestFinder.java Mon Oct 23 18:25:04 2017 -0700
+@@ -33,11 +33,8 @@
+ import java.util.HashMap;
+
+ import org.objectweb.asm.AnnotationVisitor;
+-import org.objectweb.asm.Attribute;
+ import org.objectweb.asm.ClassReader;
+ import org.objectweb.asm.ClassVisitor;
+-import org.objectweb.asm.FieldVisitor;
+-import org.objectweb.asm.Label;
+ import org.objectweb.asm.MethodVisitor;
+ import org.objectweb.asm.Opcodes;
+
+@@ -59,8 +56,7 @@
+ * @see com.sun.javatest.TestFinder
+ * @see com.sun.javatest.TestDescription
+ */
+-public class JUnitAnnotationTestFinder extends JUnitTestFinder
+- implements ClassVisitor, MethodVisitor {
++public class JUnitAnnotationTestFinder extends JUnitTestFinder {
+ /**
+ * Constructs the list of file names to exclude for pruning in the search
+ * for files to examine for test descriptions.
+@@ -195,7 +191,7 @@
+ try {
+ FileInputStream fis = new FileInputStream(classFile);
+ ClassReader cr = new ClassReader(fis);
+- cr.accept(this, 0);
++ cr.accept(new JUnitAnnotationClassVisitor(this), 0);
+ // action happens in visit(...) below
+
+ // methods are necessary for this to be a test
+@@ -227,114 +223,46 @@
+ return;
+ }
+
+- //----------ASM interface -----------
+- public void visit(int version, int access, String name, String signature,
+- String superName, String[] interfaces) {
+- if (verbose)
+- System.out.println("found class " + name + " with super " +superName);
++ class JUnitAnnotationMethodVisistor extends MethodVisitor {
++ private JUnitAnnotationTestFinder outer;
++
++ public JUnitAnnotationMethodVisistor(JUnitAnnotationTestFinder outer) {
++ super(Opcodes.ASM4);
++ this.outer = outer;
++ }
++
++ public AnnotationVisitor visitAnnotation(String string, boolean b) {
++ if (outer.methodAnnotation.equals(string))
++ outer.foundTestMethod(outer.currMethod);
++
++ return null;
++ }
+ }
+
+- // class visitor methods we are interested in
+- public MethodVisitor visitMethod(int access, String name, String desc,
+- String signature, String[] exceptions) {
+- if (access == Opcodes.ACC_PUBLIC) {
+- currMethod = name;
+- return this;
+- } else
+- return null;
+- }
++ class JUnitAnnotationClassVisitor extends ClassVisitor {
++ private JUnitAnnotationTestFinder outer;
++ private JUnitAnnotationMethodVisistor methodVisitor;
+
+- public void visitSource(String string, String string0) {
+- }
++ public JUnitAnnotationClassVisitor(JUnitAnnotationTestFinder outer) {
++ super(Opcodes.ASM4);
++ this.outer = outer;
++ methodVisitor = new JUnitAnnotationMethodVisistor(outer);
++ }
+
+- public void visitOuterClass(String string, String string0, String string1) {
+- }
++ public void visit(int version, int access, String name, String signature,
++ String superName, String[] interfaces) {
++ if (verbose)
++ System.out.println("found class " + name + " with super " + superName);
++ }
+
+- public AnnotationVisitor visitAnnotation(String string, boolean b) {
+- if (methodAnnotation.equals(string))
+- foundTestMethod(currMethod);
+-
+- return null;
+- }
+-
+- public void visitAttribute(Attribute attribute) {
+- }
+-
+- public void visitInnerClass(String string, String string0, String string1, int i) {
+- }
+-
+- public FieldVisitor visitField(int i, String string, String string0, String string1, Object object) {
+- return null;
+- }
+-
+- public void visitEnd() {
+- }
+-
+-
+- // -- Method visitor --
+- public void visitJumpInsn(int i, Label label) {
+- }
+-
+- public void visitLineNumber(int i, Label label) {
+- }
+-
+- public void visitLabel(Label label) {
+- }
+-
+- public void visitTableSwitchInsn(int i, int i0, Label label, Label[] label0) {
+- }
+-
+- public void visitLdcInsn(Object object) {
+- }
+-
+- public void visitFrame(int i, int i0, Object[] object, int i1, Object[] object0) {
+- }
+-
+- public void visitInsn(int i) {
+- }
+-
+- public void visitLookupSwitchInsn(Label label, int[] i, Label[] label0) {
+- }
+-
+- public void visitTryCatchBlock(Label label, Label label0, Label label1, String string) {
+- }
+-
+- public void visitTypeInsn(int i, String string) {
+- }
+-
+- public void visitMultiANewArrayInsn(String string, int i) {
+- }
+-
+- public void visitMethodInsn(int i, String string, String string0, String string1) {
+- }
+-
+- public void visitFieldInsn(int i, String string, String string0, String string1) {
+- }
+-
+- public void visitLocalVariable(String string, String string0, String string1, Label label, Label label0, int i) {
+- }
+-
+- public AnnotationVisitor visitParameterAnnotation(int i, String string, boolean b) {
+- return null;
+- }
+-
+- public void visitVarInsn(int i, int i0) {
+- }
+-
+- public void visitMaxs(int i, int i0) {
+- }
+-
+- public AnnotationVisitor visitAnnotationDefault() {
+- return null;
+- }
+-
+- public void visitCode() {
+- }
+-
+- public void visitIincInsn(int i, int i0) {
+- }
+-
+- public void visitIntInsn(int i, int i0) {
++ public MethodVisitor visitMethod(int access, String name, String desc,
++ String signature, String[] exceptions) {
++ if (access == Opcodes.ACC_PUBLIC) {
++ outer.currMethod = name;
++ return methodVisitor;
++ } else
++ return null;
++ }
+ }
+
+ //----------member variables------------------------------------------------
+diff -r a5dc7a40b3aa -r df5f3f3fe4b3 src/com/sun/javatest/junit/JUnitSuperTestFinder.java
+--- a/src/com/sun/javatest/junit/JUnitSuperTestFinder.java Mon Oct 23 17:51:16 2017 -0700
++++ b/src/com/sun/javatest/junit/JUnitSuperTestFinder.java Mon Oct 23 18:25:04 2017 -0700
+@@ -33,14 +33,10 @@
+ import java.util.ArrayList;
+ import java.util.HashMap;
+
+-import org.objectweb.asm.AnnotationVisitor;
+-import org.objectweb.asm.Attribute;
+ import org.objectweb.asm.ClassReader;
+ import org.objectweb.asm.ClassVisitor;
+-import org.objectweb.asm.FieldVisitor;
+ import org.objectweb.asm.MethodVisitor;
+ import org.objectweb.asm.Opcodes;
+-import org.objectweb.asm.commons.EmptyVisitor;
+
+ import com.sun.javatest.util.I18NResourceBundle;
+
+@@ -56,7 +52,7 @@
+ * @see com.sun.javatest.TestFinder
+ * @see com.sun.javatest.TestDescription
+ */
+-public class JUnitSuperTestFinder extends JUnitTestFinder implements ClassVisitor {
++public class JUnitSuperTestFinder extends JUnitTestFinder {
+ /**
+ * Constructs the list of file names to exclude for pruning in the search
+ * for files to examine for test descriptions.
+@@ -201,7 +197,7 @@
+ try {
+ FileInputStream fis = new FileInputStream(classFile);
+ ClassReader cr = new ClassReader(fis);
+- cr.accept(this, 0);
++ cr.accept(new JUnitClassVisitor(this), 0);
+ // action happens in visit(...) below
+
+ if (tdValues.get("executeClass") == null)
+@@ -275,63 +271,47 @@
+ else
+ return false;
+ }
+-//----------ASM inteface-----------
+- public void visit(int version, int access, String name, String signature,
+- String superName, String[] interfaces) {
+- if (verbose)
+- System.out.println("found class " + name + " with super " +superName);
+
+- if (isMatchSuper(superName.replaceAll("/", "."))) {
++ class JUnitClassVisitor extends ClassVisitor {
++ private JUnitSuperTestFinder outer;
+
+- //tdValues.put("sources", sources);
+- tdValues.put("executeClass", name.replaceAll("/", "."));
+- } else {
++ JUnitClassVisitor(JUnitSuperTestFinder outer) {
++ super(Opcodes.ASM4);
++ this.outer = outer;
++ }
+
++ public void visit(int version, int access, String name, String signature,
++ String superName, String[] interfaces) {
++ if (verbose)
++ System.out.println("found class " + name + " with super " + superName);
++
++ if (outer.isMatchSuper(superName.replaceAll("/", "."))) {
++ outer.tdValues.put("executeClass", name.replaceAll("/", "."));
++ }
++ }
++
++ /**
++ * Looks for methods which are test methods by calling <tt>isTestMethodSignature</tt>.
++ * You can override that method or this one. If overriding this one,
++ * use foundTestMethod(String) to register any test methods which you
++ * find.
++ */
++ public MethodVisitor visitMethod(int access, String name, String desc,
++ String signature, String[] exceptions) {
++ if (access == Opcodes.ACC_PUBLIC) {
++ if (outer.isTestMethodSignature(name))
++ outer.foundTestMethod(name);
++ }
++
++ return null;
+ }
+ }
+
+-// class visitor methods we are interested in
+- /**
+- * Looks for methods which are test methods by calling <tt>isTestMethodSignature</tt>.
+- * You can override that method or this one. If overriding this one,
+- * use foundTestMethod(String) to register any test methods which you
+- * find.
+- */
+- public MethodVisitor visitMethod(int access, String name, String desc,
+- String signature, String[] exceptions) {
+- if (access == Opcodes.ACC_PUBLIC) {
+- //System.out.println("found method " + name);
+- if (isTestMethodSignature(name))
+- foundTestMethod(name);
++ private static class MethodFinderVisitor extends ClassVisitor {
++
++ public MethodFinderVisitor() {
++ super(Opcodes.ASM4);
+ }
+-
+- return null;
+- }
+-
+- public void visitSource(String string, String string0) {
+- }
+-
+- public void visitOuterClass(String string, String string0, String string1) {
+- }
+-
+- public AnnotationVisitor visitAnnotation(String string, boolean b) {
+- return null;
+- }
+-
+- public void visitAttribute(Attribute attribute) {
+- }
+-
+- public void visitInnerClass(String string, String string0, String string1, int i) {
+- }
+-
+- public FieldVisitor visitField(int i, String string, String string0, String string1, Object object) {
+- return null;
+- }
+-
+- public void visitEnd() {
+- }
+-
+- private static class MethodFinderVisitor extends EmptyVisitor {
+ /**
+ * Return the given class' superclass name in dotted notation.
+ */
+@@ -349,6 +329,7 @@
+ }
+
+
++
+ //----------member variables------------------------------------------------
+
+ protected ArrayList<String> requiredSuperclass = new ArrayList();
+
diff --git a/debian/patches/series b/debian/patches/series
index 6e1ea93..79f8934 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
01_imports.patch
+03_asm_compatibility.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jtharness.git
More information about the pkg-java-commits
mailing list