You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2018/08/24 21:48:30 UTC

[commons-weaver] branch master updated: upgrade to ASM 6.2.1

This is an automated email from the ASF dual-hosted git repository.

mbenson pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-weaver.git


The following commit(s) were added to refs/heads/master by this push:
     new 57f3b1d  upgrade to ASM 6.2.1
57f3b1d is described below

commit 57f3b1d28f251b592b936f78dd69651e54444f8b
Author: Matt Benson <mb...@apache.org>
AuthorDate: Fri Aug 24 16:48:23 2018 -0500

    upgrade to ASM 6.2.1
---
 LICENSE-asm6.2.txt => LICENSE-asm6.2.1.txt         |  0
 .../commons/weaver/normalizer/Normalizer.java      |  4 +--
 .../commons/weaver/privilizer/Privilizer.java      |  4 +--
 pom.xml                                            |  2 +-
 .../commons/weaver/model/WeaveEnvironment.java     | 38 ----------------------
 src/changes/changes.xml                            |  2 +-
 6 files changed, 6 insertions(+), 44 deletions(-)

diff --git a/LICENSE-asm6.2.txt b/LICENSE-asm6.2.1.txt
similarity index 100%
rename from LICENSE-asm6.2.txt
rename to LICENSE-asm6.2.1.txt
diff --git a/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java b/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java
index 1894dba..890b3b8 100644
--- a/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java
+++ b/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java
@@ -230,8 +230,8 @@ public class Normalizer {
         }
 
         @Override
-        protected String getCommonSuperClass(final String type1, final String type2) {
-            return env.getCommonSuperClass(type1, type2);
+        protected ClassLoader getClassLoader() {
+            return env.classLoader;
         }
     }
 
diff --git a/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java b/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
index 25d54b0..218cea3 100644
--- a/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
+++ b/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
@@ -83,8 +83,8 @@ public class Privilizer {
         }
 
         @Override
-        protected String getCommonSuperClass(final String type1, final String type2) {
-            return env.getCommonSuperClass(type1, type2);
+        protected ClassLoader getClassLoader() {
+            return env.classLoader;
         }
     }
 
diff --git a/pom.xml b/pom.xml
index 1d59d42..793e848 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,7 +65,7 @@ under the License.
     <maven.compiler.target>1.8</maven.compiler.target>
 
     <ant.version>1.9.4</ant.version>
-    <asm.version>6.2</asm.version>
+    <asm.version>6.2.1</asm.version>
   </properties>
 
   <developers>
diff --git a/processor/src/main/java/org/apache/commons/weaver/model/WeaveEnvironment.java b/processor/src/main/java/org/apache/commons/weaver/model/WeaveEnvironment.java
index af7bd2b..565eb4b 100644
--- a/processor/src/main/java/org/apache/commons/weaver/model/WeaveEnvironment.java
+++ b/processor/src/main/java/org/apache/commons/weaver/model/WeaveEnvironment.java
@@ -215,44 +215,6 @@ public abstract class WeaveEnvironment {
     }
 
     /**
-     * Calculate a common superclass for the specified classnames, in terms of the {@link WeaveEnvironment}'s
-     * {@link #classLoader}. This method exists as a convenience feature for weaver modules that use ASM, and is
-     * implemented with the same logic as the method of the same name in that library's {@code ClassVisitor} class.
-     *
-     * @param type1
-     * @param type2
-     * @return {@link String} internal name of superclass common to {@code type1} and {@code type2}
-     */
-    public final String getCommonSuperClass(final String type1, final String type2) {
-        // https://gitlab.ow2.org/asm/asm/merge_requests/166
-        Class<?> class1;
-        try {
-            class1 = Class.forName(type1.replace('/', '.'), false, classLoader);
-        } catch (Exception e) {
-            throw new TypeNotPresentException(type1, e);
-        }
-        Class<?> class2;
-        try {
-            class2 = Class.forName(type2.replace('/', '.'), false, classLoader);
-        } catch (Exception e) {
-            throw new TypeNotPresentException(type2, e);
-        }
-        if (class1.isAssignableFrom(class2)) {
-            return type1;
-        }
-        if (class2.isAssignableFrom(class1)) {
-            return type2;
-        }
-        if (class1.isInterface() || class2.isInterface()) {
-            return "java/lang/Object";
-        }
-        do {
-            class1 = class1.getSuperclass();
-        } while (!class1.isAssignableFrom(class2));
-        return class1.getName().replace('.', '/');
-    }
-
-    /**
      * Delete the specified resource.
      * @param name to delete
      * @return whether successful
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e5f1a8a..b6786e4 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -29,7 +29,7 @@
       <action issue="WEAVER-19" type="add">Upgrade to Java 8.</action>
       <action issue="WEAVER-20" type="update">Remove commons-io, commons-collections dependencies.</action>
       <action issue="WEAVER-21" type="update">Upgrade xbean-finder to v4.9.</action>
-      <action issue="WEAVER-22" type="update">Upgrade modules to ASM 6.2.</action>
+      <action issue="WEAVER-22" type="update">Upgrade modules to ASM 6.2.1.</action>
       <action issue="WEAVER-23" type="fix">Privilizer Weaver computes Object for all variable types in catch context.</action>
       <action issue="WEAVER-24" type="add">Blueprint method references.</action>
       <action issue="WEAVER-25" type="update">Reject blueprint methods that access entities that would be inaccessible.</action>