Enable xbean-asm-util

This commit is contained in:
Michael Simacek 2016-05-12 11:43:32 +02:00
parent 6abf102139
commit 49bfa05776
4 changed files with 24 additions and 219 deletions

View File

@ -1,200 +1,17 @@
From aaf9dad09a9a26c5de3c2910d910b24a258b0b1d Mon Sep 17 00:00:00 2001
From 405a771f5fbbc7f88b9115e769c3dae084dec586 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Tue, 1 Dec 2015 12:36:21 +0100
Date: Thu, 12 May 2016 11:40:13 +0200
Subject: [PATCH 1/3] Unshade ASM
---
.../org/apache/xbean/finder/AbstractFinder.java | 31 ++++++++--------
.../org/apache/xbean/finder/AnnotationFinder.java | 43 +++++++++++-----------
.../xbean/recipe/XbeanAsmParameterNameLoader.java | 16 ++++----
3 files changed, 46 insertions(+), 44 deletions(-)
.../org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/xbean-finder/src/main/java/org/apache/xbean/finder/AbstractFinder.java b/xbean-finder/src/main/java/org/apache/xbean/finder/AbstractFinder.java
index 6bf1f3c..fab8b88 100644
--- a/xbean-finder/src/main/java/org/apache/xbean/finder/AbstractFinder.java
+++ b/xbean-finder/src/main/java/org/apache/xbean/finder/AbstractFinder.java
@@ -34,10 +34,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.xbean.asm5.original.commons.EmptyVisitor;
import org.apache.xbean.finder.util.SingleLinkedList;
import org.objectweb.asm.AnnotationVisitor;
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;
@@ -908,15 +908,17 @@ public abstract class AbstractFinder implements IAnnotationFinder {
}
}
- public class InfoBuildingVisitor extends EmptyVisitor {
+ public class InfoBuildingVisitor extends ClassVisitor {
private Info info;
private String path;
public InfoBuildingVisitor(String path) {
+ super(Opcodes.ASM5);
this.path = path;
}
public InfoBuildingVisitor(Info info) {
+ super(Opcodes.ASM5);
this.info = info;
}
@@ -949,7 +951,7 @@ public abstract class AbstractFinder implements IAnnotationFinder {
AnnotationInfo annotationInfo = new AnnotationInfo(desc);
info.getAnnotations().add(annotationInfo);
getAnnotationInfos(annotationInfo.getName()).add(info);
- return new InfoBuildingVisitor(annotationInfo).annotationVisitor();
+ return null;
}
@Override
@@ -957,24 +959,23 @@ public abstract class AbstractFinder implements IAnnotationFinder {
ClassInfo classInfo = ((ClassInfo) info);
FieldInfo fieldInfo = new FieldInfo(classInfo, name, desc);
classInfo.getFields().add(fieldInfo);
- return new InfoBuildingVisitor(fieldInfo).fieldVisitor();
+ return null;
}
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
ClassInfo classInfo = ((ClassInfo) info);
- MethodInfo methodInfo = new MethodInfo(classInfo, name, desc);
+ final MethodInfo methodInfo = new MethodInfo(classInfo, name, desc);
classInfo.getMethods().add(methodInfo);
- return new InfoBuildingVisitor(methodInfo).methodVisitor();
- }
-
- @Override
- public AnnotationVisitor visitMethodParameterAnnotation(int param, String desc, boolean visible) {
- MethodInfo methodInfo = ((MethodInfo) info);
- List<AnnotationInfo> annotationInfos = methodInfo.getParameterAnnotations(param);
- AnnotationInfo annotationInfo = new AnnotationInfo(desc);
- annotationInfos.add(annotationInfo);
- return new InfoBuildingVisitor(annotationInfo).annotationVisitor();
+ return new MethodVisitor(Opcodes.ASM5) {
+ @Override
+ public AnnotationVisitor visitParameterAnnotation(int param, String desc, boolean visible) {
+ List<AnnotationInfo> annotationInfos = methodInfo.getParameterAnnotations(param);
+ AnnotationInfo annotationInfo = new AnnotationInfo(desc);
+ annotationInfos.add(annotationInfo);
+ return null;
+ }
+ };
}
}
diff --git a/xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java b/xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java
index 7d68cd9..6454aa1 100644
--- a/xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java
+++ b/xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java
@@ -20,13 +20,13 @@
package org.apache.xbean.finder;
-import org.apache.xbean.asm5.original.commons.EmptyVisitor;
import org.apache.xbean.finder.archive.Archive;
import org.apache.xbean.finder.util.Classes;
import org.apache.xbean.finder.util.SingleLinkedList;
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;
@@ -1790,13 +1790,15 @@ public class AnnotationFinder implements IAnnotationFinder {
initAnnotationInfos(annotationInfo.getName()).add(info);
}
- public class InfoBuildingVisitor extends EmptyVisitor {
+ public class InfoBuildingVisitor extends ClassVisitor {
private Info info;
public InfoBuildingVisitor() {
+ super(Opcodes.ASM5);
}
public InfoBuildingVisitor(Info info) {
+ super(Opcodes.ASM5);
this.info = info;
}
@@ -1844,7 +1846,7 @@ public class AnnotationFinder implements IAnnotationFinder {
AnnotationInfo annotationInfo = new AnnotationInfo(desc);
info.getAnnotations().add(annotationInfo);
index(annotationInfo, info);
- return new InfoBuildingVisitor(annotationInfo).annotationVisitor();
+ return null;
}
@Override
@@ -1852,32 +1854,31 @@ public class AnnotationFinder implements IAnnotationFinder {
ClassInfo classInfo = ((ClassInfo) info);
FieldInfo fieldInfo = new FieldInfo(classInfo, name, desc);
classInfo.getFields().add(fieldInfo);
- return new InfoBuildingVisitor(fieldInfo).fieldVisitor();
+ return null;
}
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
ClassInfo classInfo = ((ClassInfo) info);
- MethodInfo methodInfo = new MethodInfo(classInfo, name, desc);
+ final MethodInfo methodInfo = new MethodInfo(classInfo, name, desc);
classInfo.getMethods().add(methodInfo);
- return new InfoBuildingVisitor(methodInfo).methodVisitor();
+ return new MethodVisitor(Opcodes.ASM5) {
+ @Override
+ public AnnotationVisitor visitParameterAnnotation(int param, String desc, boolean visible) {
+ List<AnnotationInfo> annotationInfos = methodInfo.getParameterAnnotations(param);
+ AnnotationInfo annotationInfo = new AnnotationInfo(desc);
+ annotationInfos.add(annotationInfo);
+
+ ParameterInfo parameterInfo = new ParameterInfo(methodInfo, param);
+ methodInfo.getParameters().add(parameterInfo);
+ index(annotationInfo, parameterInfo);
+
+ return null;
+ }
+ };
}
-
- @Override
- public AnnotationVisitor visitMethodParameterAnnotation(int param, String desc, boolean visible) {
- MethodInfo methodInfo = ((MethodInfo) info);
- List<AnnotationInfo> annotationInfos = methodInfo.getParameterAnnotations(param);
- AnnotationInfo annotationInfo = new AnnotationInfo(desc);
- annotationInfos.add(annotationInfo);
-
- ParameterInfo parameterInfo = new ParameterInfo(methodInfo, param);
- methodInfo.getParameters().add(parameterInfo);
- index(annotationInfo, parameterInfo);
-
- return new InfoBuildingVisitor(annotationInfo).annotationVisitor();
- }
}
public static class GenericAwareInfoBuildingVisitor extends SignatureVisitor {
@@ -2042,4 +2043,4 @@ public class AnnotationFinder implements IAnnotationFinder {
}
-}
\ No newline at end of file
+}
diff --git a/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java b/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java
index dea2f2a..dbbfb51 100644
index dea2f2a..303dfc3 100644
--- a/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java
+++ b/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java
@@ -17,13 +17,6 @@
@@ -17,12 +17,12 @@
*/
package org.apache.xbean.recipe;
@ -204,31 +21,15 @@ index dea2f2a..dbbfb51 100644
-import org.apache.xbean.asm5.MethodVisitor;
-import org.apache.xbean.asm5.Opcodes;
-import org.apache.xbean.asm5.Type;
-
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
@@ -37,6 +30,13 @@ import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
+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;
+
/**
* Implementation of ParameterNameLoader that uses ASM to read the parameter names from the local variable table in the
* class byte code.
@@ -314,4 +314,4 @@ public class XbeanAsmParameterNameLoader implements ParameterNameLoader {
return null;
}
}
-}
\ No newline at end of file
+}
import java.io.IOException;
import java.io.InputStream;
--
2.5.0
2.5.5

View File

@ -1,4 +1,4 @@
From 8c7cc1ab013f80fb71ab4bda77d922bc75ead514 Mon Sep 17 00:00:00 2001
From c6917e3b00cc856b0c8fc77a802f2dde88df2e89 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Fri, 21 Nov 2014 10:05:05 +0100
Subject: [PATCH 2/3] Port to Eclipse Luna OSGi
@ -9,7 +9,7 @@ Subject: [PATCH 2/3] Port to Eclipse Luna OSGi
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/xbean-bundleutils/pom.xml b/xbean-bundleutils/pom.xml
index acda42f..8a45319 100644
index 72f4865..2b3459d 100644
--- a/xbean-bundleutils/pom.xml
+++ b/xbean-bundleutils/pom.xml
@@ -35,15 +35,9 @@
@ -58,5 +58,5 @@ index 58a392b..cc8d081 100644
}
--
2.5.0
2.5.5

View File

@ -1,4 +1,4 @@
From 838dfd967213ac90a3124a57a414bc209fe25d68 Mon Sep 17 00:00:00 2001
From 9dd6a5b50adb726892b188c2999fd19483fab2b6 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Fri, 21 Nov 2014 10:51:38 +0100
Subject: [PATCH 3/3] Port to QDox 2.0
@ -10,10 +10,10 @@ Subject: [PATCH 3/3] Port to QDox 2.0
3 files changed, 163 insertions(+), 127 deletions(-)
diff --git a/pom.xml b/pom.xml
index b031527..836389b 100644
index 75e146b..86ec665 100644
--- a/pom.xml
+++ b/pom.xml
@@ -297,7 +297,7 @@
@@ -274,7 +274,7 @@
<dependency>
<groupId>com.thoughtworks.qdox</groupId>
<artifactId>qdox</artifactId>
@ -651,5 +651,5 @@ index 94bd7a1..ae55819 100644
for (Enumeration entries = jarFile.entries(); entries.hasMoreElements(); ) {
JarEntry entry = (JarEntry) entries.nextElement();
--
2.5.0
2.5.5

View File

@ -7,7 +7,7 @@
Name: xbean
Version: 4.5
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Java plugin based web server
License: ASL 2.0
URL: http://geronimo.apache.org/xbean/
@ -124,13 +124,14 @@ rm src/site/site.xml
%pom_remove_parent
%pom_remove_dep mx4j:mx4j
%pom_remove_dep -r :xbean-asm-util
%pom_remove_dep -r :xbean-asm5-shaded
%pom_remove_dep -r :xbean-finder-shaded
%pom_disable_module xbean-asm-util
%pom_disable_module xbean-asm5-shaded
%pom_disable_module xbean-finder-shaded
%pom_xpath_remove pom:scope xbean-asm-util
%pom_xpath_remove pom:optional xbean-asm-util
# Prevent modules depending on springframework from building.
%if %{without spring}
%pom_remove_dep org.springframework:
@ -193,6 +194,9 @@ sed -i "s|</Private-Package>|</Private-Package-->|" xbean-blueprint/pom.xml
%doc LICENSE NOTICE
%changelog
* Thu May 12 2016 Michael Simacek <msimacek@redhat.com> - 4.5-2
- Enable xbean-asm-util
* Mon May 02 2016 Michael Simacek <msimacek@redhat.com> - 4.5-1
- Update to upstream version 4.5