[libspring-java] 01/02: Transition to libasm4-java

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Sat Sep 13 22:52:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository libspring-java.

commit d14cd73db5faf80b4df8100e6c1842b551e20517
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Sat Sep 13 23:47:40 2014 +0200

    Transition to libasm4-java
---
 debian/build-classpath                    |   4 +-
 debian/changelog                          |   1 +
 debian/control                            |   6 +-
 debian/maven.ignoreRules                  |   2 +-
 debian/maven.rules                        |   2 +-
 debian/patches/0012_use_debian_asm4.patch | 299 ++++++++++++++++++++++++++++++
 debian/patches/series                     |   1 +
 7 files changed, 308 insertions(+), 7 deletions(-)

diff --git a/debian/build-classpath b/debian/build-classpath
index 5ad1e1b..3583690 100644
--- a/debian/build-classpath
+++ b/debian/build-classpath
@@ -7,8 +7,8 @@
 
 # Global Classpath
 /usr/share/java/aopalliance.jar
-/usr/share/java/asm3-commons.jar
-/usr/share/java/asm3.jar
+/usr/share/java/asm4-commons.jar
+/usr/share/java/asm4.jar
 /usr/share/java/aspectjrt.jar
 /usr/share/java/aspectjtools.jar
 /usr/share/java/aspectjweaver.jar
diff --git a/debian/changelog b/debian/changelog
index a808730..6b4d986 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 libspring-java (3.0.6.RELEASE-15) UNRELEASED; urgency=medium
 
   * Team upload.
+  * Transition to libasm4-java
   * debian/control:
     - Depend on libtomcat8-java instead of libtomcat6-java (Closes: #759635)
 
diff --git a/debian/control b/debian/control
index ecca179..7605a07 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Damien Raude-Morvan <drazzib at debian.org>, Miguel Landaeta <nomadium at d
 Build-Depends: debhelper (>= 9), ant, default-jdk (>= 1:1.6)
 Build-Depends-Indep: maven-repo-helper (>= 1.1), ivy, spring-build-scripts,
  libaspectj-java, bsh, glassfish-javaee, glassfish-mail, glassfish-toplink-essentials,
- groovy, junit4 (>= 4.5), libaopalliance-java, libasm3-java, libatinject-jsr330-api-java,
+ groovy, junit4 (>= 4.5), libaopalliance-java, libasm4-java, libatinject-jsr330-api-java,
  libaxis-java, libc3p0-java, libcastor-core-java, libcastor-xml-java,
  libcglib-java, libcommons-beanutils-java, libcommons-collections3-java, libcommons-fileupload-java,
  libcommons-httpclient-java, libcommons-logging-java, libcommons-pool-java, libdom4j-java, libecj-java,
@@ -26,7 +26,7 @@ Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-java/libspring-java.git
 
 Package: libspring-core-java
 Architecture: all
-Depends: ${misc:Depends}, libasm3-java, libcommons-logging-java
+Depends: ${misc:Depends}, libasm4-java, libcommons-logging-java
 Suggests: libcommons-collections3-java, liblog4j1.2-java, libaspectj-java, libjboss-vfs-java
 Description: modular Java/J2EE application framework - Core
  Spring is a layered Java/J2EE application framework offering a lot of freedom
@@ -65,7 +65,7 @@ Package: libspring-context-java
 Architecture: all
 Depends: ${misc:Depends}, libspring-aop-java (= ${source:Version}), libspring-beans-java (= ${source:Version}), libspring-core-java (= ${source:Version}), libspring-expression-java (= ${source:Version})
 Recommends: libspring-instrument-java (= ${source:Version}), libtomcat8-java, libgeronimo-ejb-3.0-spec-java, libatinject-jsr330-api-java, glassfish-javaee,
- libjodatime-java, libasm3-java, libaopalliance-java, libcglib-java, libgeronimo-validation-1.0-spec-java, libgeronimo-jms-1.1-spec-java
+ libjodatime-java, libasm4-java, libaopalliance-java, libcglib-java, libgeronimo-validation-1.0-spec-java, libgeronimo-jms-1.1-spec-java
 Suggests: jruby, bsh, groovy
 Description: modular Java/J2EE application framework - Context
  Spring is a layered Java/J2EE application framework offering a lot of freedom
diff --git a/debian/maven.ignoreRules b/debian/maven.ignoreRules
index 76b07e6..bdf59cd 100644
--- a/debian/maven.ignoreRules
+++ b/debian/maven.ignoreRules
@@ -1,5 +1,5 @@
 # Module "spring-asm" is not builded
-# as we use asm3 directly
+# as we use asm4 directly
 org.springframework spring-asm * * * *
 # No Websphere
 com.ibm.websphere com.springsource.com.ibm.websphere.uow * * * *
diff --git a/debian/maven.rules b/debian/maven.rules
index d6a7991..17a7116 100644
--- a/debian/maven.rules
+++ b/debian/maven.rules
@@ -3,7 +3,7 @@ log4j log4j jar s/1\.2\..*/1.2.x/
 commons-collections commons-collections jar s/3\..*/3.x/
 s/velocity/org.apache.velocity/ velocity jar s/.*/debian/
 s/velocity-tools/org.apache.velocity/ velocity-tools jar s/.*/debian/
-asm * jar s/.*/3.x/
+s/asm/org.ow2.asm/ * jar s/.*/4.x/
 junit junit jar s/.*/4.x/
 commons-httpclient commons-httpclient jar s/.*/3.x/
 javax.servlet servlet-api jar s/.*/2.5/
diff --git a/debian/patches/0012_use_debian_asm4.patch b/debian/patches/0012_use_debian_asm4.patch
new file mode 100644
index 0000000..6f1cf0a
--- /dev/null
+++ b/debian/patches/0012_use_debian_asm4.patch
@@ -0,0 +1,299 @@
+Description: Upgrade from ASM 3 to ASM 4. This patch can be dropped after upgrading to Spring 3.2 or later
+Origin: backport, https://github.com/spring-projects/spring-framework/commit/c16f18a5
+Bug: https://jira.spring.io/browse/SPR-9669
+--- /dev/null
++++ b/projects/org.springframework.core/src/main/java/org/springframework/asm/SpringAsmInfo.java
+@@ -0,0 +1,38 @@
++/*
++ * Copyright 2002-2012 the original author or authors.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package org.springframework.asm;
++
++/**
++ * Utility class exposing constants related to Spring's internal repackaging of the ASM
++ * bytecode manipulation library.
++ *
++ * <p>See <a href="package-summary.html">package-level Javadoc</a> for more
++ * information on {@code org.springframework.asm}.
++ *
++ * @author Chris Beams
++ * @since 3.2
++ */
++public final class SpringAsmInfo {
++
++	/**
++	 * The ASM version used internally throughout the framework.
++	 *
++	 * @see Opcodes#ASM4
++	 */
++	public static final int ASM_VERSION = org.objectweb.asm.Opcodes.ASM4;
++
++}
+--- a/projects/org.springframework.core/src/main/java/org/springframework/core/LocalVariableTableParameterNameDiscoverer.java
++++ b/projects/org.springframework.core/src/main/java/org/springframework/core/LocalVariableTableParameterNameDiscoverer.java
+@@ -29,11 +29,12 @@
+ import org.apache.commons.logging.LogFactory;
+ 
+ import org.objectweb.asm.ClassReader;
++import org.objectweb.asm.ClassVisitor;
+ import org.objectweb.asm.Label;
+ import org.objectweb.asm.MethodVisitor;
+ import org.objectweb.asm.Opcodes;
+ import org.objectweb.asm.Type;
+-import org.objectweb.asm.commons.EmptyVisitor;
++import org.springframework.asm.SpringAsmInfo;
+ import org.springframework.util.ClassUtils;
+ 
+ /**
+@@ -78,7 +79,7 @@
+ 	}
+ 
+ 	@SuppressWarnings("unchecked")
+-	public String[] getParameterNames(Constructor ctor) {
++	public String[] getParameterNames(Constructor<?> ctor) {
+ 		Class<?> declaringClass = ctor.getDeclaringClass();
+ 		Map<Member, String[]> map = this.parameterNamesCache.get(declaringClass);
+ 		if (map == null) {
+@@ -136,7 +137,7 @@
+ 	 * Helper class that inspects all methods (constructor included) and then
+ 	 * attempts to find the parameter names for that member.
+ 	 */
+-	private static class ParameterNameDiscoveringVisitor extends EmptyVisitor {
++	private static class ParameterNameDiscoveringVisitor extends ClassVisitor {
+ 
+ 		private static final String STATIC_CLASS_INIT = "<clinit>";
+ 
+@@ -144,6 +145,7 @@
+ 		private final Map<Member, String[]> memberMap;
+ 
+ 		public ParameterNameDiscoveringVisitor(Class<?> clazz, Map<Member, String[]> memberMap) {
++			super(SpringAsmInfo.ASM_VERSION);
+ 			this.clazz = clazz;
+ 			this.memberMap = memberMap;
+ 		}
+@@ -167,7 +169,7 @@
+ 	}
+ 
+ 
+-	private static class LocalVariableTableVisitor extends EmptyVisitor {
++	private static class LocalVariableTableVisitor extends MethodVisitor {
+ 
+ 		private static final String CONSTRUCTOR = "<init>";
+ 
+@@ -188,6 +190,7 @@
+ 
+ 		public LocalVariableTableVisitor(Class<?> clazz, Map<Member, String[]> map, String name, String desc,
+ 				boolean isStatic) {
++			super(SpringAsmInfo.ASM_VERSION);
+ 			this.clazz = clazz;
+ 			this.memberMap = map;
+ 			this.name = name;
+--- a/projects/org.springframework.core/src/main/java/org/springframework/core/ParameterNameDiscoverer.java
++++ b/projects/org.springframework.core/src/main/java/org/springframework/core/ParameterNameDiscoverer.java
+@@ -49,6 +49,6 @@
+ 	 * @return an array of parameter names if the names can be resolved,
+ 	 * or <code>null</code> if they cannot
+ 	 */
+-	String[] getParameterNames(Constructor ctor);
++	String[] getParameterNames(Constructor<?> ctor);
+ 
+ }
+--- a/projects/org.springframework.core/src/main/java/org/springframework/core/type/classreading/AnnotationAttributesReadingVisitor.java
++++ b/projects/org.springframework.core/src/main/java/org/springframework/core/type/classreading/AnnotationAttributesReadingVisitor.java
+@@ -27,7 +27,6 @@
+ 
+ import org.objectweb.asm.AnnotationVisitor;
+ import org.objectweb.asm.Type;
+-import org.objectweb.asm.commons.EmptyVisitor;
+ import org.springframework.core.annotation.AnnotationUtils;
+ import org.springframework.util.ObjectUtils;
+ import org.springframework.util.ReflectionUtils;
+@@ -38,7 +37,7 @@
+  * @author Juergen Hoeller
+  * @since 3.0
+  */
+-final class AnnotationAttributesReadingVisitor implements AnnotationVisitor {
++final class AnnotationAttributesReadingVisitor extends AnnotationVisitor {
+ 
+ 	private final String annotationType;
+ 
+@@ -54,7 +53,7 @@
+ 	public AnnotationAttributesReadingVisitor(
+ 			String annotationType, Map<String, Map<String, Object>> attributesMap,
+ 			Map<String, Set<String>> metaAnnotationMap, ClassLoader classLoader) {
+-
++                super(org.springframework.asm.SpringAsmInfo.ASM_VERSION);
+ 		this.annotationType = annotationType;
+ 		this.attributesMap = attributesMap;
+ 		this.metaAnnotationMap = metaAnnotationMap;
+@@ -82,11 +81,11 @@
+ 	}
+ 
+ 	public AnnotationVisitor visitAnnotation(String name, String desc) {
+-		return new EmptyVisitor();
++		return new EmptyAnnotationVisitor();
+ 	}
+ 
+ 	public AnnotationVisitor visitArray(final String attrName) {
+-		return new AnnotationVisitor() {
++		return new AnnotationVisitor(org.springframework.asm.SpringAsmInfo.ASM_VERSION) {
+ 			public void visit(String name, Object value) {
+ 				Object newValue = value;
+ 				Object existingValue = localAttributes.get(attrName);
+@@ -103,10 +102,10 @@
+ 			public void visitEnum(String name, String desc, String value) {
+ 			}
+ 			public AnnotationVisitor visitAnnotation(String name, String desc) {
+-				return new EmptyVisitor();
++				return new EmptyAnnotationVisitor();
+ 			}
+ 			public AnnotationVisitor visitArray(String name) {
+-				return new EmptyVisitor();
++				return new EmptyAnnotationVisitor();
+ 			}
+ 			public void visitEnd() {
+ 			}
+--- a/projects/org.springframework.core/src/main/java/org/springframework/core/type/classreading/ClassMetadataReadingVisitor.java
++++ b/projects/org.springframework.core/src/main/java/org/springframework/core/type/classreading/ClassMetadataReadingVisitor.java
+@@ -22,7 +22,7 @@
+ import org.objectweb.asm.FieldVisitor;
+ import org.objectweb.asm.MethodVisitor;
+ import org.objectweb.asm.Opcodes;
+-import org.objectweb.asm.commons.EmptyVisitor;
++import org.springframework.asm.SpringAsmInfo;
+ import org.springframework.core.type.ClassMetadata;
+ import org.springframework.util.ClassUtils;
+ 
+@@ -35,9 +35,10 @@
+  * @author Costin Leau
+  * @author Mark Fisher
+  * @author Ramnivas Laddad
++ * @author Chris Beams
+  * @since 2.5
+  */
+-class ClassMetadataReadingVisitor implements ClassVisitor, ClassMetadata {
++class ClassMetadataReadingVisitor extends ClassVisitor implements ClassMetadata {
+ 
+ 	private String className;
+ 
+@@ -56,6 +57,11 @@
+ 	private String[] interfaces;
+ 	
+ 
++	public ClassMetadataReadingVisitor() {
++		super(SpringAsmInfo.ASM_VERSION);
++	}
++
++
+ 	public void visit(int version, int access, String name, String signature, String supername, String[] interfaces) {
+ 		this.className = ClassUtils.convertResourcePathToClassName(name);
+ 		this.isInterface = ((access & Opcodes.ACC_INTERFACE) != 0);
+@@ -87,7 +93,7 @@
+ 
+ 	public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ 		// no-op
+-		return new EmptyVisitor();
++		return new EmptyAnnotationVisitor();
+ 	}
+ 
+ 	public void visitAttribute(Attribute attr) {
+@@ -96,12 +102,12 @@
+ 
+ 	public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
+ 		// no-op
+-		return new EmptyVisitor();
++		return new EmptyFieldVisitor();
+ 	}
+ 
+ 	public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ 		// no-op
+-		return new EmptyVisitor();
++		return new EmptyMethodVisitor();
+ 	}
+ 
+ 	public void visitEnd() {
+@@ -154,3 +160,38 @@
+ 	}
+ 
+ }
++
++
++class EmptyAnnotationVisitor extends AnnotationVisitor {
++
++	public EmptyAnnotationVisitor() {
++		super(SpringAsmInfo.ASM_VERSION);
++	}
++
++	@Override
++	public AnnotationVisitor visitAnnotation(String name, String desc) {
++		return this;
++	}
++
++	@Override
++	public AnnotationVisitor visitArray(String name) {
++		return this;
++	}
++}
++
++
++class EmptyMethodVisitor extends MethodVisitor {
++
++	public EmptyMethodVisitor() {
++		super(SpringAsmInfo.ASM_VERSION);
++	}
++}
++
++
++class EmptyFieldVisitor extends FieldVisitor {
++
++	public EmptyFieldVisitor() {
++		super(SpringAsmInfo.ASM_VERSION);
++	}
++
++}
+--- a/projects/org.springframework.core/src/main/java/org/springframework/core/type/classreading/MethodMetadataReadingVisitor.java
++++ b/projects/org.springframework.core/src/main/java/org/springframework/core/type/classreading/MethodMetadataReadingVisitor.java
+@@ -20,10 +20,10 @@
+ import java.util.Map;
+ 
+ import org.objectweb.asm.AnnotationVisitor;
+-import org.objectweb.asm.MethodAdapter;
++import org.objectweb.asm.MethodVisitor;
+ import org.objectweb.asm.Opcodes;
+ import org.objectweb.asm.Type;
+-import org.objectweb.asm.commons.EmptyVisitor;
++import org.springframework.asm.SpringAsmInfo;
+ import org.springframework.core.type.MethodMetadata;
+ import org.springframework.util.MultiValueMap;
+ 
+@@ -37,7 +37,7 @@
+  * @author Costin Leau
+  * @since 3.0
+  */
+-final class MethodMetadataReadingVisitor extends MethodAdapter implements MethodMetadata {
++final class MethodMetadataReadingVisitor extends MethodVisitor implements MethodMetadata {
+ 
+ 	private final String name;
+ 
+@@ -53,7 +53,7 @@
+ 
+ 	public MethodMetadataReadingVisitor(String name, int access, String declaringClassName, ClassLoader classLoader,
+ 			MultiValueMap<String, MethodMetadata> methodMetadataMap) {
+-		super(new EmptyVisitor());
++		super(SpringAsmInfo.ASM_VERSION);
+ 		this.name = name;
+ 		this.access = access;
+ 		this.declaringClassName = declaringClassName;
diff --git a/debian/patches/series b/debian/patches/series
index 9ae1856..fb98406 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -15,3 +15,4 @@ CVE-2013-6430.patch
 CVE-2014-0054.patch
 CVE-2014-1904.patch
 CVE-2014-0225.patch
+0012_use_debian_asm4.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libspring-java.git



More information about the pkg-java-commits mailing list