[Git][java-team/cglib][master] 6 commits: Declare compliance with Debian Policy 4.2.1.

Markus Koschany gitlab at salsa.debian.org
Tue Oct 2 19:33:01 BST 2018


Markus Koschany pushed to branch master at Debian Java Maintainers / cglib


Commits:
52818aa5 by Markus Koschany at 2018-10-02T18:19:47Z
Declare compliance with Debian Policy 4.2.1.

- - - - -
b6ee921c by Markus Koschany at 2018-10-02T18:20:38Z
New upstream version 3.2.8
- - - - -
a8ce4aaf by Markus Koschany at 2018-10-02T18:20:46Z
Update upstream source from tag 'upstream/3.2.8'

Update to upstream version '3.2.8'
with Debian dir 68ae0ccac58533d4770e1469aa63e23c2b366a47
- - - - -
6fa4d613 by Markus Koschany at 2018-10-02T18:23:32Z
Update changelog

- - - - -
d240b7d7 by Markus Koschany at 2018-10-02T18:24:08Z
Drop 04-optional-ant-dependency.patch

- - - - -
932f3730 by Markus Koschany at 2018-10-02T18:29:07Z
Update 04-optional-ant-dependency.patch for new release.

- - - - -


28 changed files:

- .travis.yml
- cglib-integration-test/pom.xml
- cglib-jmh/pom.xml
- cglib-nodep/pom.xml
- cglib-sample/pom.xml
- cglib/pom.xml
- + cglib/src/main/java/net/sf/cglib/core/AsmApi.java
- cglib/src/main/java/net/sf/cglib/core/ClassEmitter.java
- cglib/src/main/java/net/sf/cglib/core/ClassNameReader.java
- cglib/src/main/java/net/sf/cglib/core/Constants.java
- cglib/src/main/java/net/sf/cglib/core/DebuggingClassWriter.java
- cglib/src/main/java/net/sf/cglib/core/DuplicatesPredicate.java
- cglib/src/main/java/net/sf/cglib/core/LocalVariablesSorter.java
- cglib/src/main/java/net/sf/cglib/proxy/BridgeMethodResolver.java
- cglib/src/main/java/net/sf/cglib/proxy/Enhancer.java
- cglib/src/main/java/net/sf/cglib/transform/AbstractClassTransformer.java
- cglib/src/main/java/net/sf/cglib/transform/AnnotationVisitorTee.java
- cglib/src/main/java/net/sf/cglib/transform/ClassTransformer.java
- cglib/src/main/java/net/sf/cglib/transform/ClassTransformerTee.java
- cglib/src/main/java/net/sf/cglib/transform/ClassVisitorTee.java
- cglib/src/main/java/net/sf/cglib/transform/FieldVisitorTee.java
- cglib/src/main/java/net/sf/cglib/transform/MethodVisitorTee.java
- + cglib/src/test/java/net/sf/cglib/core/AsmApiTest.java
- cglib/src/test/java/net/sf/cglib/transform/DumpFieldsTask.java
- debian/changelog
- debian/control
- debian/patches/04-optional-ant-dependency.patch
- pom.xml


Changes:

=====================================
.travis.yml
=====================================
@@ -38,9 +38,4 @@ matrix:
             - oracle-java9-installer
       env: JDK=9
     - jdk: openjdk7
-    - jdk: openjdk6
-    
-addons:
-  apt:
-    packages:
-      - openjdk-6-jdk
+


=====================================
cglib-integration-test/pom.xml
=====================================
@@ -9,7 +9,7 @@
     <parent>
         <groupId>cglib</groupId>
         <artifactId>cglib-parent</artifactId>
-        <version>3.2.6</version>
+        <version>3.2.8</version>
     </parent>
 
     <!-- ====================================================================== -->


=====================================
cglib-jmh/pom.xml
=====================================
@@ -7,7 +7,7 @@
     <parent>
         <artifactId>cglib-parent</artifactId>
         <groupId>cglib</groupId>
-        <version>3.2.6</version>
+        <version>3.2.8</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
@@ -44,7 +44,6 @@
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <jmh.version>1.11.3</jmh.version>
         <javac.target>1.6</javac.target>
         <uberjar.name>benchmarks</uberjar.name>
     </properties>
@@ -54,7 +53,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
+                <version>${maven-compiler-plugin.version}</version>
                 <configuration>
                     <compilerVersion>${javac.target}</compilerVersion>
                     <source>${javac.target}</source>
@@ -64,7 +63,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
-                <version>2.2</version>
+                <version>3.1.1</version>
                 <executions>
                     <execution>
                         <phase>package</phase>
@@ -102,39 +101,39 @@
             <plugins>
                 <plugin>
                     <artifactId>maven-clean-plugin</artifactId>
-                    <version>2.5</version>
+                    <version>3.1.0</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-deploy-plugin</artifactId>
-                    <version>2.8.1</version>
+                    <version>2.8.2</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-install-plugin</artifactId>
-                    <version>2.5.1</version>
+                    <version>2.5.2</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-jar-plugin</artifactId>
-                    <version>2.4</version>
+                    <version>${maven-jar-plugin.version}</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-javadoc-plugin</artifactId>
-                    <version>2.9.1</version>
+                    <version>${maven-javadoc-plugin.version}</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-resources-plugin</artifactId>
-                    <version>2.6</version>
+                    <version>${maven-resources-plugin.version}</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-site-plugin</artifactId>
-                    <version>3.3</version>
+                    <version>3.7.1</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-source-plugin</artifactId>
-                    <version>2.2.1</version>
+                    <version>3.0.1</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-surefire-plugin</artifactId>
-                    <version>2.17</version>
+                    <version>2.21.0</version>
                 </plugin>
             </plugins>
         </pluginManagement>


=====================================
cglib-nodep/pom.xml
=====================================
@@ -9,7 +9,7 @@
     <parent>
         <groupId>cglib</groupId>
         <artifactId>cglib-parent</artifactId>
-        <version>3.2.6</version>
+        <version>3.2.8</version>
     </parent>
 
     <!-- ====================================================================== -->


=====================================
cglib-sample/pom.xml
=====================================
@@ -9,7 +9,7 @@
     <parent>
         <groupId>cglib</groupId>
         <artifactId>cglib-parent</artifactId>
-        <version>3.2.6</version>
+        <version>3.2.8</version>
     </parent>
 
     <!-- ====================================================================== -->
@@ -38,7 +38,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jarsigner-plugin</artifactId>
-                <version>1.3.2</version>
+                <version>1.4</version>
                 <executions>
                     <execution>
                         <id>sign</id>


=====================================
cglib/pom.xml
=====================================
@@ -9,7 +9,7 @@
     <parent>
         <groupId>cglib</groupId>
         <artifactId>cglib-parent</artifactId>
-        <version>3.2.6</version>
+        <version>3.2.8</version>
     </parent>
 
     <!-- ====================================================================== -->


=====================================
cglib/src/main/java/net/sf/cglib/core/AsmApi.java
=====================================
@@ -0,0 +1,33 @@
+package net.sf.cglib.core;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.objectweb.asm.Opcodes;
+
+final class AsmApi {
+
+    private static final String EXPERIMENTAL_ASM7_PROPERTY_NAME = "net.sf.cglib.experimental_asm7";
+
+    /**
+     * Returns the latest stable ASM API value in {@link Opcodes} unless overridden via the
+     * net.sf.cglib.experimental_asm7 property.
+     */
+    static int value() {
+        boolean experimentalAsm7;
+        try {
+            experimentalAsm7 = Boolean.parseBoolean(AccessController.doPrivileged(
+                    new PrivilegedAction<String>() {
+                        public String run() {
+                            return System.getProperty(EXPERIMENTAL_ASM7_PROPERTY_NAME);
+                        }
+                    }));
+        } catch (Exception ignored) {
+            experimentalAsm7 = false;
+        }
+        return experimentalAsm7 ? Opcodes.ASM7_EXPERIMENTAL : Opcodes.ASM6;
+    }
+
+    private AsmApi() {
+    }
+}


=====================================
cglib/src/main/java/net/sf/cglib/core/ClassEmitter.java
=====================================
@@ -20,7 +20,6 @@ import net.sf.cglib.transform.ClassTransformer;
 import org.objectweb.asm.ClassVisitor;
 import org.objectweb.asm.FieldVisitor;
 import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
 import org.objectweb.asm.Type;
 
 import java.util.HashMap;
@@ -44,7 +43,7 @@ public class ClassEmitter extends ClassTransformer {
     }
 
     public ClassEmitter() {
-        super(Opcodes.ASM6);
+        super(Constants.ASM_API);
     }
 
     public void setTarget(ClassVisitor cv) {
@@ -148,7 +147,7 @@ public class ClassEmitter extends ClassTransformer {
                                          TypeUtils.toInternalNames(exceptions));
         if (sig.equals(Constants.SIG_STATIC) && !TypeUtils.isInterface(getAccess())) {
             rawStaticInit = v;
-            MethodVisitor wrapped = new MethodVisitor(Opcodes.ASM6, v) {
+            MethodVisitor wrapped = new MethodVisitor(Constants.ASM_API, v) {
                 public void visitMaxs(int maxStack, int maxLocals) {
                     // ignore
                 }


=====================================
cglib/src/main/java/net/sf/cglib/core/ClassNameReader.java
=====================================
@@ -17,7 +17,6 @@ package net.sf.cglib.core;
 
 import org.objectweb.asm.ClassReader;
 import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.Opcodes;
 
 import java.util.*;
 
@@ -38,7 +37,7 @@ public class ClassNameReader {
     public static String[] getClassInfo(ClassReader r) {
         final List array = new ArrayList();
         try {
-            r.accept(new ClassVisitor(Opcodes.ASM6, null) {
+            r.accept(new ClassVisitor(Constants.ASM_API, null) {
                 public void visit(int version,
                                   int access,
                                   String name,


=====================================
cglib/src/main/java/net/sf/cglib/core/Constants.java
=====================================
@@ -22,6 +22,10 @@ import org.objectweb.asm.Type;
  * @version $Id: Constants.java,v 1.21 2006/03/05 02:43:19 herbyderby Exp $
  */
 public interface Constants extends org.objectweb.asm.Opcodes {
+
+    /* Indicates the ASM API version that is used throughout cglib */
+    public static final int ASM_API = AsmApi.value();
+
     public static final Class[] EMPTY_CLASS_ARRAY = {};
     public static final Type[] TYPES_EMPTY = {};
 


=====================================
cglib/src/main/java/net/sf/cglib/core/DebuggingClassWriter.java
=====================================
@@ -46,7 +46,7 @@ public class DebuggingClassWriter extends ClassVisitor {
     }
     
     public DebuggingClassWriter(int flags) {
-	super(Opcodes.ASM6, new ClassWriter(flags));
+	super(Constants.ASM_API, new ClassWriter(flags));
     }
 
     public void visit(int version,


=====================================
cglib/src/main/java/net/sf/cglib/core/DuplicatesPredicate.java
=====================================
@@ -15,13 +15,150 @@
  */
 package net.sf.cglib.core;
 
+import java.io.IOException;
+import java.io.InputStream;
 import java.lang.reflect.Method;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
 
 public class DuplicatesPredicate implements Predicate {
-    private Set unique = new HashSet();
+  private final Set unique;
+  private final Set rejected;
 
-    public boolean evaluate(Object arg) {
-        return unique.add(MethodWrapper.create((Method)arg));
+  /**
+   * Constructs a DuplicatesPredicate that will allow subclass bridge methods to be preferred over
+   * superclass non-bridge methods.
+   */
+  public DuplicatesPredicate() {
+    unique = new HashSet();
+    rejected = Collections.emptySet();
+  }
+
+  /**
+   * Constructs a DuplicatesPredicate that prefers using superclass non-bridge methods despite a
+   * subclass method with the same signtaure existing (if the subclass is a bridge method).
+   */
+  public DuplicatesPredicate(List allMethods) {
+    rejected = new HashSet();
+    unique = new HashSet();
+
+    // Traverse through the methods and capture ones that are bridge
+    // methods when a subsequent method (from a non-interface superclass)
+    // has the same signature but isn't a bridge. Record these so that
+    // we avoid using them when filtering duplicates.
+    Map scanned = new HashMap();
+    Map suspects = new HashMap();
+    for (Object o : allMethods) {
+      Method method = (Method) o;
+      Object sig = MethodWrapper.create(method);
+      Method existing = (Method) scanned.get(sig);
+      if (existing == null) {
+        scanned.put(sig, method);
+      } else if (!suspects.containsKey(sig) && existing.isBridge() && !method.isBridge()) {
+        // TODO: this currently only will capture a single bridge. it will not work
+        // if there's Child.bridge1 Middle.bridge2 Parent.concrete.  (we'd offer the 2nd bridge).
+        // no idea if that's even possible tho...
+        suspects.put(sig, existing);
+      }
+    }
+    
+    if (!suspects.isEmpty()) {
+      Set classes = new HashSet();
+      UnnecessaryBridgeFinder finder = new UnnecessaryBridgeFinder(rejected);
+      for (Object o : suspects.values()) {
+        Method m = (Method) o;
+        classes.add(m.getDeclaringClass());
+        finder.addSuspectMethod(m);
+      }
+      for (Object o : classes) {
+        Class c = (Class) o;
+        try {
+          ClassLoader cl = getClassLoader(c);
+          if (cl == null) {
+            continue;
+          }
+          InputStream is = cl.getResourceAsStream(c.getName().replace('.', '/') + ".class");
+          if (is == null) {
+            continue;
+          }
+          try {
+            new ClassReader(is).accept(finder, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
+          } finally {
+            is.close();
+          }
+        } catch (IOException ignored) {
+        }
+      }
+    }
+  }
+
+  public boolean evaluate(Object arg) {
+    return !rejected.contains(arg) && unique.add(MethodWrapper.create((Method) arg));
+  }
+  
+  private static ClassLoader getClassLoader(Class c) {
+    ClassLoader cl = c.getClassLoader();
+    if (cl == null) {
+      cl = DuplicatesPredicate.class.getClassLoader();
+    }
+    if (cl == null) {
+      cl = Thread.currentThread().getContextClassLoader();
+    }
+    return cl;
+  }
+
+  private static class UnnecessaryBridgeFinder extends ClassVisitor {
+    private final Set rejected;
+
+    private Signature currentMethodSig = null;
+    private Map methods = new HashMap();
+
+    UnnecessaryBridgeFinder(Set rejected) {
+      super(Constants.ASM_API);
+      this.rejected = rejected;
+    }
+
+    void addSuspectMethod(Method m) {
+      methods.put(ReflectUtils.getSignature(m), m);
+    }
+
+    public void visit(
+        int version,
+        int access,
+        String name,
+        String signature,
+        String superName,
+        String[] interfaces) {}
+
+    public MethodVisitor visitMethod(
+        int access, String name, String desc, String signature, String[] exceptions) {
+      Signature sig = new Signature(name, desc);
+      final Method currentMethod = (Method) methods.remove(sig);
+      if (currentMethod != null) {
+        currentMethodSig = sig;
+        return new MethodVisitor(Constants.ASM_API) {
+          public void visitMethodInsn(
+              int opcode, String owner, String name, String desc, boolean itf) {
+            if (opcode == Opcodes.INVOKESPECIAL && currentMethodSig != null) {
+              Signature target = new Signature(name, desc);
+              if (target.equals(currentMethodSig)) {
+                rejected.add(currentMethod);
+              }
+              currentMethodSig = null;
+            }
+          }
+        };
+      } else {
+        return null;
+      }
     }
+  }
 }


=====================================
cglib/src/main/java/net/sf/cglib/core/LocalVariablesSorter.java
=====================================
@@ -63,7 +63,7 @@ public class LocalVariablesSorter extends MethodVisitor {
         final String desc,
         final MethodVisitor mv)
     {
-        super(Opcodes.ASM6, mv);
+        super(Constants.ASM_API, mv);
         state = new State();
         Type[] args = Type.getArgumentTypes(desc);
         state.nextLocal = ((Opcodes.ACC_STATIC & access) != 0) ? 0 : 1;
@@ -74,7 +74,7 @@ public class LocalVariablesSorter extends MethodVisitor {
     }
 
     public LocalVariablesSorter(LocalVariablesSorter lvs) {
-        super(Opcodes.ASM6, lvs.mv);
+        super(Constants.ASM_API, lvs.mv);
         state = lvs.state;
         firstLocal = lvs.firstLocal;
     }


=====================================
cglib/src/main/java/net/sf/cglib/proxy/BridgeMethodResolver.java
=====================================
@@ -23,14 +23,11 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
+import net.sf.cglib.core.Constants;
 import net.sf.cglib.core.Signature;
 
-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;
 
@@ -84,7 +81,7 @@ class BridgeMethodResolver {
         private Signature currentMethod = null;
 
         BridgedFinder(Set eligibleMethods, Map resolved) {
-            super(Opcodes.ASM6);
+            super(Constants.ASM_API);
             this.resolved = resolved;
             this.eligibleMethods = eligibleMethods;
         }
@@ -98,7 +95,7 @@ class BridgeMethodResolver {
             Signature sig = new Signature(name, desc);
             if (eligibleMethods.remove(sig)) {
                 currentMethod = sig;
-                return new MethodVisitor(Opcodes.ASM6) {
+                return new MethodVisitor(Constants.ASM_API) {
                     public void visitMethodInsn(int opcode, String owner, String name,
                                                 String desc, boolean itf) {
                         if (opcode == Opcodes.INVOKESPECIAL && currentMethod != null) {


=====================================
cglib/src/main/java/net/sf/cglib/proxy/Enhancer.java
=====================================
@@ -554,7 +554,7 @@ public class Enhancer extends AbstractClassGenerator
         }
         CollectionUtils.filter(methods, new RejectModifierPredicate(Constants.ACC_STATIC));
         CollectionUtils.filter(methods, new VisibilityPredicate(superclass, true));
-        CollectionUtils.filter(methods, new DuplicatesPredicate());
+        CollectionUtils.filter(methods, new DuplicatesPredicate(methods));
         CollectionUtils.filter(methods, new RejectModifierPredicate(Constants.ACC_FINAL));
     }
 


=====================================
cglib/src/main/java/net/sf/cglib/transform/AbstractClassTransformer.java
=====================================
@@ -15,12 +15,12 @@
  */
 package net.sf.cglib.transform;
 
+import net.sf.cglib.core.Constants;
 import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.Opcodes;
 
 abstract public class AbstractClassTransformer extends ClassTransformer {
     protected AbstractClassTransformer() {
-        super(Opcodes.ASM6);
+        super(Constants.ASM_API);
     }
 
     public void setTarget(ClassVisitor target) {


=====================================
cglib/src/main/java/net/sf/cglib/transform/AnnotationVisitorTee.java
=====================================
@@ -15,8 +15,8 @@
  */
 package net.sf.cglib.transform;
 
+import net.sf.cglib.core.Constants;
 import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.Opcodes;
 
 public class AnnotationVisitorTee extends AnnotationVisitor {
     private AnnotationVisitor av1, av2;
@@ -30,7 +30,7 @@ public class AnnotationVisitorTee extends AnnotationVisitor {
     }
 
     public AnnotationVisitorTee(AnnotationVisitor av1, AnnotationVisitor av2) {
-	super(Opcodes.ASM6);
+	super(Constants.ASM_API);
         this.av1 = av1;
         this.av2 = av2;
     }


=====================================
cglib/src/main/java/net/sf/cglib/transform/ClassTransformer.java
=====================================
@@ -15,12 +15,12 @@
  */
 package net.sf.cglib.transform;
 
+import net.sf.cglib.core.Constants;
 import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.Opcodes;
 
 public abstract class ClassTransformer extends ClassVisitor {
     public ClassTransformer() {
-	super(Opcodes.ASM6);
+	super(Constants.ASM_API);
     }
     public ClassTransformer(int opcode) {
 	super(opcode);


=====================================
cglib/src/main/java/net/sf/cglib/transform/ClassTransformerTee.java
=====================================
@@ -15,14 +15,14 @@
  */
 package net.sf.cglib.transform;
 
+import net.sf.cglib.core.Constants;
 import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.Opcodes;
 
 public class ClassTransformerTee extends ClassTransformer {
     private ClassVisitor branch;
     
     public ClassTransformerTee(ClassVisitor branch) {
-        super(Opcodes.ASM6);
+        super(Constants.ASM_API);
         this.branch = branch;
     }
     


=====================================
cglib/src/main/java/net/sf/cglib/transform/ClassVisitorTee.java
=====================================
@@ -15,13 +15,14 @@
  */
 package net.sf.cglib.transform;
 
+import net.sf.cglib.core.Constants;
 import org.objectweb.asm.*;
 
 public class ClassVisitorTee extends ClassVisitor {
     private ClassVisitor cv1, cv2;
     
     public ClassVisitorTee(ClassVisitor cv1, ClassVisitor cv2) {
-	super(Opcodes.ASM6);
+	super(Constants.ASM_API);
 	this.cv1 = cv1;
         this.cv2 = cv2;
     }


=====================================
cglib/src/main/java/net/sf/cglib/transform/FieldVisitorTee.java
=====================================
@@ -15,17 +15,17 @@
  */
 package net.sf.cglib.transform;
 
+import net.sf.cglib.core.Constants;
 import org.objectweb.asm.AnnotationVisitor;
 import org.objectweb.asm.Attribute;
 import org.objectweb.asm.FieldVisitor;
-import org.objectweb.asm.Opcodes;
 import org.objectweb.asm.TypePath;
 
 public class FieldVisitorTee extends FieldVisitor {
     private FieldVisitor fv1, fv2;
     
     public FieldVisitorTee(FieldVisitor fv1, FieldVisitor fv2) {
-	super(Opcodes.ASM6);
+	super(Constants.ASM_API);
 	this.fv1 = fv1;
         this.fv2 = fv2;
     }


=====================================
cglib/src/main/java/net/sf/cglib/transform/MethodVisitorTee.java
=====================================
@@ -15,6 +15,7 @@
  */
 package net.sf.cglib.transform;
 
+import net.sf.cglib.core.Constants;
 import org.objectweb.asm.*;
 
 public class MethodVisitorTee extends MethodVisitor {
@@ -22,7 +23,7 @@ public class MethodVisitorTee extends MethodVisitor {
     private final MethodVisitor mv2;
     
     public MethodVisitorTee(MethodVisitor mv1, MethodVisitor mv2) {
-	super(Opcodes.ASM6);
+	super(Constants.ASM_API);
 	this.mv1 = mv1;
         this.mv2 = mv2;
     }


=====================================
cglib/src/test/java/net/sf/cglib/core/AsmApiTest.java
=====================================
@@ -0,0 +1,42 @@
+package net.sf.cglib.core;
+
+import org.junit.Test;
+import org.objectweb.asm.Opcodes;
+
+import static org.junit.Assert.*;
+
+public class AsmApiTest {
+
+    @Test
+    public void testValue() {
+        assertEquals(Opcodes.ASM6, AsmApi.value());
+    }
+
+    @Test
+    public void testValueWithSystemPropertyTrue() {
+        int asmApi = setSystemPropertyAndGetValue("true");
+        assertEquals(Opcodes.ASM7_EXPERIMENTAL, asmApi);
+    }
+
+    @Test
+    public void testValueWithSystemPropertyEmptyString() {
+        int asmApi = setSystemPropertyAndGetValue("");
+        assertEquals(Opcodes.ASM6, asmApi);
+    }
+
+    @Test
+    public void testValueWithSystemPropertyFalse() {
+        int asmApi = setSystemPropertyAndGetValue("false");
+        assertEquals(Opcodes.ASM6, asmApi);
+    }
+
+    private int setSystemPropertyAndGetValue(String value) {
+        String propName = "net.sf.cglib.experimental_asm7";
+        System.setProperty(propName, value);
+        try {
+            return AsmApi.value();
+        } finally {
+            System.clearProperty(propName);
+        }
+    }
+}


=====================================
cglib/src/test/java/net/sf/cglib/transform/DumpFieldsTask.java
=====================================
@@ -18,6 +18,7 @@ package net.sf.cglib.transform;
 
 import java.io.*;
 
+import net.sf.cglib.core.Constants;
 import org.apache.tools.ant.BuildException;
 import org.objectweb.asm.*;
 
@@ -43,7 +44,7 @@ public class DumpFieldsTask extends AbstractProcessTask {
     }
 
     static class EmptyVisitor extends ClassVisitor {
-	AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM6) {
+	AnnotationVisitor av = new AnnotationVisitor(Constants.ASM_API) {
 	    public AnnotationVisitor visitAnnotation(
 		    String name, String desc) {
 		return this;
@@ -55,7 +56,7 @@ public class DumpFieldsTask extends AbstractProcessTask {
 	};
 
 	public EmptyVisitor() {
-	    super(Opcodes.ASM6);
+	    super(Constants.ASM_API);
 	}
 
 	public AnnotationVisitor visitAnnotation(
@@ -66,7 +67,7 @@ public class DumpFieldsTask extends AbstractProcessTask {
 	public FieldVisitor visitField(
 		int access, String name, String desc,
 		String signature, Object value) {
-	    return new FieldVisitor(Opcodes.ASM6) {
+	    return new FieldVisitor(Constants.ASM_API) {
 		public AnnotationVisitor visitAnnotation(
 			String desc, boolean visible) {
 		    return av;
@@ -78,7 +79,7 @@ public class DumpFieldsTask extends AbstractProcessTask {
 	public MethodVisitor visitMethod(
 		int access, String name, String desc, String signature,
 		String[] exceptions) {
-	    return new MethodVisitor(Opcodes.ASM6) {
+	    return new MethodVisitor(Constants.ASM_API) {
 		public AnnotationVisitor visitAnnotationDefault() {
 		    return av;
 		}


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+cglib (3.2.8-1) unstable; urgency=medium
+
+  * Team upload.
+  * New upstream version 3.2.8.
+  * Declare compliance with Debian Policy 4.2.1.
+
+ -- Markus Koschany <apo at debian.org>  Tue, 02 Oct 2018 20:23:12 +0200
+
 cglib (3.2.6-2) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -11,7 +11,7 @@ Build-Depends: ant,
                libjarjar-maven-plugin-java,
                libmaven-javadoc-plugin-java,
                maven-debian-helper (>= 2.0.4)
-Standards-Version: 4.1.3
+Standards-Version: 4.2.1
 Vcs-Git: https://anonscm.debian.org/git/pkg-java/cglib.git
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/cglib.git
 Homepage: http://cglib.sourceforge.net


=====================================
debian/patches/04-optional-ant-dependency.patch
=====================================
@@ -1,7 +1,17 @@
-Description: Really make the Ant dependency optional
-Author: Emmanuel Bourg
-Bug: https://github.com/cglib/cglib/pull/87
+From: Markus Koschany <apo at debian.org>
+Date: Tue, 2 Oct 2018 20:27:22 +0200
+Subject: 04-optional-ant-dependency
+
+Really make the Ant dependency optional
+Bug-Upstream: https://github.com/cglib/cglib/pull/87
 Bug-Debian: https://bugs.debian.org/830204
+---
+ cglib/pom.xml | 1 +
+ pom.xml       | 1 -
+ 2 files changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cglib/pom.xml b/cglib/pom.xml
+index 632138d..76fabaf 100644
 --- a/cglib/pom.xml
 +++ b/cglib/pom.xml
 @@ -64,6 +64,7 @@
@@ -12,12 +22,14 @@ Bug-Debian: https://bugs.debian.org/830204
          </dependency>
  
          <dependency>
+diff --git a/pom.xml b/pom.xml
+index 3a03f26..d68f3d9 100644
 --- a/pom.xml
 +++ b/pom.xml
-@@ -226,7 +226,6 @@
+@@ -232,7 +232,6 @@
                  <groupId>org.apache.ant</groupId>
                  <artifactId>ant</artifactId>
-                 <version>1.9.6</version>
+                 <version>${ant.version}</version>
 -                <optional>true</optional>
              </dependency>
  


=====================================
pom.xml
=====================================
@@ -14,7 +14,7 @@
     <!-- ====================================================================== -->
     <groupId>cglib</groupId>
     <artifactId>cglib-parent</artifactId>
-    <version>3.2.6</version>
+    <version>3.2.8</version>
     <packaging>pom</packaging>
 
     <name>Code Generation Library</name>
@@ -54,7 +54,13 @@
 
         <java.version.source>1.5</java.version.source>
         <java.version.target>1.5</java.version.target>
-        <asm.version>6.0</asm.version>
+        <asm.version>6.2.1</asm.version>
+        <ant.version>1.10.3</ant.version>
+        <jmh.version>1.21</jmh.version>
+        <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
+        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
+        <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
+        <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
         <java.compiler.argument />
 
         <java.test.compiler.argument>${java.compiler.argument}</java.test.compiler.argument>
@@ -107,7 +113,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
-                    <version>3.1</version>
+                    <version>${maven-compiler-plugin.version}</version>
                     <configuration>
                         <source>${java.version.source}</source>
                         <target>${java.version.target}</target>
@@ -120,7 +126,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
-                    <version>2.17</version>
+                    <version>2.21.0</version>
                     <configuration>
                         <systemProperties>
                             <property>
@@ -133,7 +139,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-failsafe-plugin</artifactId>
-                    <version>2.17</version>
+                    <version>2.21.0</version>
                     <configuration>
                         <systemProperties>
                             <property>
@@ -146,14 +152,14 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-javadoc-plugin</artifactId>
-                    <version>2.10</version>
+                    <version>${maven-javadoc-plugin.version}</version>
                     <configuration>
                       <quiet>true</quiet>
                       <detectLinks>false</detectLinks>
                       <detectOfflineLinks>false</detectOfflineLinks>
                       <!--<skip>${skipJavadoc}</skip>-->
                       <use>false</use>
-                      <additionalparam>-Xdoclint:none</additionalparam>
+                      <doclint>none</doclint>
                       <additionalDependencies>
                         <additionalDependency>
                           <groupId>org.ow2.asm</groupId>
@@ -163,7 +169,7 @@
                         <additionalDependency>
                           <groupId>org.apache.ant</groupId>
                           <artifactId>ant</artifactId>
-                          <version>1.9.6</version>
+                          <version>${ant.version}</version>
                         </additionalDependency>
                       </additionalDependencies>
                     </configuration>
@@ -225,7 +231,7 @@
             <dependency>
                 <groupId>org.apache.ant</groupId>
                 <artifactId>ant</artifactId>
-                <version>1.9.6</version>
+                <version>${ant.version}</version>
                 <optional>true</optional>
             </dependency>
 



View it on GitLab: https://salsa.debian.org/java-team/cglib/compare/f2f5614af6a91209f62760f386df5f81978042fe...932f3730bb6846dd9db936661fa3ad79e1a93d67

-- 
View it on GitLab: https://salsa.debian.org/java-team/cglib/compare/f2f5614af6a91209f62760f386df5f81978042fe...932f3730bb6846dd9db936661fa3ad79e1a93d67
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20181002/2f466816/attachment.html>


More information about the pkg-java-commits mailing list