From 695e146ea14c973953a4e8984162e6a75e1d10d4 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Nov 21 2014 10:56:16 +0000 Subject: Update to upstream version 4.1 --- diff --git a/.gitignore b/.gitignore index 47514da..67d84ee 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ xbean-3.7.tar.xz /xbean-3.13-source-release.zip /xbean-3.16-source-release.zip /xbean-3.17-source-release.zip +/xbean-4.1-source-release.zip diff --git a/0001-Unshade-ASM.patch b/0001-Unshade-ASM.patch new file mode 100644 index 0000000..d9d07e5 --- /dev/null +++ b/0001-Unshade-ASM.patch @@ -0,0 +1,401 @@ +From 8d151d56250e13e5bdc21bc0df1e2f334010f268 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Fri, 21 Nov 2014 09:39:00 +0100 +Subject: [PATCH 1/4] Unshade ASM + +--- + pom.xml | 23 ------------ + xbean-finder/pom.xml | 5 --- + .../org/apache/xbean/finder/AbstractFinder.java | 30 ++++++++------- + .../org/apache/xbean/finder/AnnotationFinder.java | 43 +++++++++++----------- + xbean-reflect/pom.xml | 13 ------- + .../xbean/recipe/AsmParameterNameLoader.java | 6 ++- + .../org/apache/xbean/recipe/ReflectionUtil.java | 8 +--- + .../xbean/recipe/XbeanAsmParameterNameLoader.java | 18 +++++---- + 8 files changed, 53 insertions(+), 93 deletions(-) + +diff --git a/pom.xml b/pom.xml +index dd4d7ee..0c17645 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -217,26 +217,6 @@ + xbean-telnet + ${project.version} + +- +- org.apache.xbean +- xbean-asm-shaded +- ${project.version} +- +- +- org.apache.xbean +- xbean-asm5-shaded +- ${project.version} +- +- +- org.apache.xbean +- xbean-asm-util +- ${project.version} +- +- +- org.apache.xbean +- xbean-finder-shaded +- ${project.version} +- + + + +@@ -412,7 +392,6 @@ + xbean-classloader + xbean-classpath + xbean-bundleutils +- xbean-asm-util + xbean-finder + xbean-naming + xbean-reflect +@@ -420,8 +399,6 @@ + xbean-spring + xbean-telnet + maven-xbean-plugin +- xbean-asm5-shaded +- xbean-finder-shaded + + + +diff --git a/xbean-finder/pom.xml b/xbean-finder/pom.xml +index 6048ac3..4f20b5f 100644 +--- a/xbean-finder/pom.xml ++++ b/xbean-finder/pom.xml +@@ -58,11 +58,6 @@ + 4.3.1 + provided + +- +- org.apache.xbean +- xbean-asm-util +- ${project.version} +- + + + +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 8beb72b..164a490 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,7 +959,7 @@ 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 +@@ -965,16 +967,16 @@ public abstract class AbstractFinder implements IAnnotationFinder { + ClassInfo classInfo = ((ClassInfo) info); + 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 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) { ++ MethodInfo methodInfo = ((MethodInfo) info); ++ List 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 ea96d78..48b2262 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; +@@ -1755,13 +1755,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; + } + +@@ -1809,7 +1811,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 +@@ -1817,32 +1819,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 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 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 { +@@ -2007,4 +2008,4 @@ public class AnnotationFinder implements IAnnotationFinder { + + } + +-} +\ No newline at end of file ++} +diff --git a/xbean-reflect/pom.xml b/xbean-reflect/pom.xml +index e9e51c7..0b80389 100644 +--- a/xbean-reflect/pom.xml ++++ b/xbean-reflect/pom.xml +@@ -47,19 +47,6 @@ + true + + +- org.apache.xbean +- xbean-asm-util +- provided +- true +- +- +- org.apache.xbean +- xbean-asm5-shaded +- ${project.version} +- provided +- true +- +- + log4j + log4j + 1.2.12 +diff --git a/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java b/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java +index 6859cad..f513b77 100644 +--- a/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java ++++ b/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java +@@ -17,8 +17,8 @@ + */ + package org.apache.xbean.recipe; + +-import org.apache.xbean.asm5.original.commons.EmptyVisitor; + 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; +@@ -211,7 +211,7 @@ public class AsmParameterNameLoader implements ParameterNameLoader { + } + } + +- private static class AllParameterNamesDiscoveringVisitor extends EmptyVisitor { ++ private static class AllParameterNamesDiscoveringVisitor extends ClassVisitor { + private final Map> constructorParameters = new HashMap>(); + private final Map> methodParameters = new HashMap>(); + private final Map exceptions = new HashMap(); +@@ -220,6 +220,7 @@ public class AsmParameterNameLoader implements ParameterNameLoader { + private final Map constructorMap = new HashMap(); + + public AllParameterNamesDiscoveringVisitor(Class type, String methodName) { ++ super(Opcodes.ASM5); + this.methodName = methodName; + + List methods = new ArrayList(Arrays.asList(type.getMethods())); +@@ -232,6 +233,7 @@ public class AsmParameterNameLoader implements ParameterNameLoader { + } + + public AllParameterNamesDiscoveringVisitor(Class type) { ++ super(Opcodes.ASM5); + this.methodName = ""; + + List constructors = new ArrayList(Arrays.asList(type.getConstructors())); +diff --git a/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java b/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java +index 84ded16..39dfd58 100644 +--- a/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java ++++ b/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java +@@ -41,13 +41,7 @@ public final class ReflectionUtil { + private static ParameterNameLoader parameterNamesLoader; + + static { +- if (isClassAvailable("org.apache.xbean.asm5.ClassReader")) { +- parameterNamesLoader = new XbeanAsmParameterNameLoader(); +- } else if (isClassAvailable("org.objectweb.asm.ClassReader")) { +- parameterNamesLoader = new AsmParameterNameLoader(); +- } else if (isClassAvailable("org.apache.xbean.asm.ClassReader") || isClassAvailable("org.apache.xbean.asm4.ClassReader")) { +- throw new RuntimeException("Your xbean-asm-shade is too old, please upgrade to xbean-asm5-shade"); +- } ++ parameterNamesLoader = new XbeanAsmParameterNameLoader(); + } + + private ReflectionUtil() { +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 4a89c44..6242dd3 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,12 +17,12 @@ + */ + package org.apache.xbean.recipe; + +-import org.apache.xbean.asm5.shade.commons.EmptyVisitor; +-import org.apache.xbean.asm5.ClassReader; +-import org.apache.xbean.asm5.Label; +-import org.apache.xbean.asm5.MethodVisitor; +-import org.apache.xbean.asm5.Opcodes; +-import org.apache.xbean.asm5.Type; ++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 java.io.IOException; + import java.io.InputStream; +@@ -211,7 +211,7 @@ public class XbeanAsmParameterNameLoader implements ParameterNameLoader { + } + } + +- private static class AllParameterNamesDiscoveringVisitor extends EmptyVisitor { ++ private static class AllParameterNamesDiscoveringVisitor extends ClassVisitor { + private final Map> constructorParameters = new HashMap>(); + private final Map> methodParameters = new HashMap>(); + private final Map exceptions = new HashMap(); +@@ -220,6 +220,7 @@ public class XbeanAsmParameterNameLoader implements ParameterNameLoader { + private final Map constructorMap = new HashMap(); + + public AllParameterNamesDiscoveringVisitor(Class type, String methodName) { ++ super(Opcodes.ASM5); + this.methodName = methodName; + + List methods = new ArrayList(Arrays.asList(type.getMethods())); +@@ -232,6 +233,7 @@ public class XbeanAsmParameterNameLoader implements ParameterNameLoader { + } + + public AllParameterNamesDiscoveringVisitor(Class type) { ++ super(Opcodes.ASM5); + this.methodName = ""; + + List constructors = new ArrayList(Arrays.asList(type.getConstructors())); +@@ -312,4 +314,4 @@ public class XbeanAsmParameterNameLoader implements ParameterNameLoader { + return null; + } + } +-} +\ No newline at end of file ++} +-- +1.9.3 + diff --git a/0002-Port-to-Eclipse-Luna-OSGi.patch b/0002-Port-to-Eclipse-Luna-OSGi.patch new file mode 100644 index 0000000..dcf1dd6 --- /dev/null +++ b/0002-Port-to-Eclipse-Luna-OSGi.patch @@ -0,0 +1,62 @@ +From e310ab2bb5e5b34472a0fc6e368082897f140afa Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Fri, 21 Nov 2014 10:05:05 +0100 +Subject: [PATCH 2/4] Port to Eclipse Luna OSGi + +--- + xbean-bundleutils/pom.xml | 8 +------- + .../apache/xbean/osgi/bundle/util/DelegatingBundleContext.java | 10 ++++++++++ + 2 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/xbean-bundleutils/pom.xml b/xbean-bundleutils/pom.xml +index 015f97d..6dcad55 100644 +--- a/xbean-bundleutils/pom.xml ++++ b/xbean-bundleutils/pom.xml +@@ -35,15 +35,9 @@ + slf4j-api + + +- org.osgi +- org.osgi.core +- 4.3.1 +- provided +- +- + org.eclipse + osgi +- 3.6.0.v20100517 ++ 3.10.0-v20140606-1445 + provided + + +diff --git a/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java b/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java +index f4e876d..ea353ef 100644 +--- a/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java ++++ b/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java +@@ -31,7 +31,9 @@ import org.osgi.framework.BundleListener; + import org.osgi.framework.Filter; + import org.osgi.framework.FrameworkListener; + import org.osgi.framework.InvalidSyntaxException; ++import org.osgi.framework.ServiceFactory; + import org.osgi.framework.ServiceListener; ++import org.osgi.framework.ServiceObjects; + import org.osgi.framework.ServiceReference; + import org.osgi.framework.ServiceRegistration; + +@@ -153,5 +155,13 @@ public class DelegatingBundleContext implements BundleContext { + public Bundle getBundle(String location) { + return bundleContext.getBundle(location); + } ++ ++ public ServiceObjects getServiceObjects(ServiceReference reference) { ++ return bundleContext.getServiceObjects(reference); ++ } ++ ++ public ServiceRegistration registerService(Class clazz, ServiceFactory factory, Dictionary properties) { ++ return bundleContext.registerService(clazz, factory, properties); ++ } + + } +-- +1.9.3 + diff --git a/0003-Port-to-QDox-2.0.patch b/0003-Port-to-QDox-2.0.patch new file mode 100644 index 0000000..3f30f24 --- /dev/null +++ b/0003-Port-to-QDox-2.0.patch @@ -0,0 +1,655 @@ +From 0e20f1b48db827a457800c6f96bc413feeee115f Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Fri, 21 Nov 2014 10:51:38 +0100 +Subject: [PATCH 3/4] Port to QDox 2.0 + +--- + pom.xml | 2 +- + .../blueprint/generator/QdoxMappingLoader.java | 144 ++++++++++++--------- + .../xbean/spring/generator/QdoxMappingLoader.java | 144 ++++++++++++--------- + 3 files changed, 163 insertions(+), 127 deletions(-) + +diff --git a/pom.xml b/pom.xml +index 0c17645..36bb2da 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -277,7 +277,7 @@ + + com.thoughtworks.qdox + qdox +- 1.6.3 ++ 2.0-M2 + + + +diff --git a/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/QdoxMappingLoader.java b/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/QdoxMappingLoader.java +index 6635937..e17fd08 100644 +--- a/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/QdoxMappingLoader.java ++++ b/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/QdoxMappingLoader.java +@@ -20,6 +20,7 @@ import java.io.File; + import java.io.IOException; + import java.net.URL; + import java.util.ArrayList; ++import java.util.Collection; + import java.util.Collections; + import java.util.Enumeration; + import java.util.HashMap; +@@ -31,14 +32,17 @@ import java.util.TreeSet; + import java.util.jar.JarEntry; + import java.util.jar.JarFile; + +-import com.thoughtworks.qdox.JavaDocBuilder; ++import com.thoughtworks.qdox.JavaProjectBuilder; + import com.thoughtworks.qdox.model.BeanProperty; + import com.thoughtworks.qdox.model.DocletTag; + import com.thoughtworks.qdox.model.JavaClass; ++import com.thoughtworks.qdox.model.JavaConstructor; + import com.thoughtworks.qdox.model.JavaMethod; ++import com.thoughtworks.qdox.model.JavaModel; + import com.thoughtworks.qdox.model.JavaParameter; + import com.thoughtworks.qdox.model.JavaSource; +-import com.thoughtworks.qdox.model.Type; ++import com.thoughtworks.qdox.model.JavaType; ++ + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + +@@ -62,7 +66,7 @@ public class QdoxMappingLoader implements MappingLoader { + private final String defaultNamespace; + private final File[] srcDirs; + private final String[] excludedClasses; +- private Type collectionType; ++ private JavaClass collectionType; + + public QdoxMappingLoader(String defaultNamespace, File[] srcDirs, String[] excludedClasses) { + this.defaultNamespace = defaultNamespace; +@@ -79,7 +83,7 @@ public class QdoxMappingLoader implements MappingLoader { + } + + public Set loadNamespaces() throws IOException { +- JavaDocBuilder builder = new JavaDocBuilder(); ++ JavaProjectBuilder builder = new JavaProjectBuilder(); + + log.debug("Source directories: "); + +@@ -92,11 +96,11 @@ public class QdoxMappingLoader implements MappingLoader { + getSourceFiles(sourceDirectory, excludedClasses, builder); + } + +- collectionType = builder.getClassByName("java.util.Collection").asType(); ++ collectionType = builder.getClassByName("java.util.Collection"); + return loadNamespaces(builder); + } + +- private Set loadNamespaces(JavaDocBuilder builder) { ++ private Set loadNamespaces(JavaProjectBuilder builder) { + // load all of the elements + List elements = loadElements(builder); + +@@ -131,14 +135,14 @@ public class QdoxMappingLoader implements MappingLoader { + return Collections.unmodifiableSet(namespaces); + } + +- private List loadElements(JavaDocBuilder builder) { +- JavaSource[] javaSources = builder.getSources(); ++ private List loadElements(JavaProjectBuilder builder) { ++ Collection javaSources = builder.getSources(); + List elements = new ArrayList(); + for (JavaSource javaSource : javaSources) { +- if (javaSource.getClasses().length == 0) { ++ if (javaSource.getClasses().isEmpty()) { + log.info("No Java Classes defined in: " + javaSource.getURL()); + } else { +- JavaClass[] classes = javaSource.getClasses(); ++ Collection classes = javaSource.getClasses(); + for (JavaClass javaClass : classes) { + ElementMapping element = loadElement(builder, javaClass); + if (element != null && !javaClass.isAbstract()) { +@@ -152,7 +156,7 @@ public class QdoxMappingLoader implements MappingLoader { + return elements; + } + +- private ElementMapping loadElement(JavaDocBuilder builder, JavaClass javaClass) { ++ private ElementMapping loadElement(JavaProjectBuilder builder, JavaClass javaClass) { + DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); + if (xbeanTag == null) { + return null; +@@ -176,7 +180,7 @@ public class QdoxMappingLoader implements MappingLoader { + Map attributesByPropertyName = new HashMap(); + + for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { +- BeanProperty[] beanProperties = jClass.getBeanProperties(); ++ Collection beanProperties = jClass.getBeanProperties(); + for (BeanProperty beanProperty : beanProperties) { + // we only care about properties with a setter + if (beanProperty.getMutator() != null) { +@@ -219,9 +223,9 @@ public class QdoxMappingLoader implements MappingLoader { + String destroyMethod = null; + String factoryMethod = null; + for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { +- JavaMethod[] methods = javaClass.getMethods(); ++ Collection methods = javaClass.getMethods(); + for (JavaMethod method : methods) { +- if (method.isPublic() && !method.isConstructor()) { ++ if (method.isPublic()) { + if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { + initMethod = method.getName(); + } +@@ -237,22 +241,43 @@ public class QdoxMappingLoader implements MappingLoader { + } + + List> constructorArgs = new ArrayList>(); +- JavaMethod[] methods = javaClass.getMethods(); +- for (JavaMethod method : methods) { +- JavaParameter[] parameters = method.getParameters(); +- if (isValidConstructor(factoryMethod, method, parameters)) { +- List args = new ArrayList(parameters.length); +- for (JavaParameter parameter : parameters) { +- AttributeMapping attributeMapping = attributesByPropertyName.get(parameter.getName()); +- if (attributeMapping == null) { +- attributeMapping = loadParameter(parameter); +- +- attributes.add(attributeMapping); +- attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); ++ if (factoryMethod == null) { ++ Collection constructors = javaClass.getConstructors(); ++ for (JavaConstructor constructor : constructors) { ++ Collection parameters = constructor.getParameters(); ++ if (constructor.isPublic() && parameters.size() > 0) { ++ List args = new ArrayList(parameters.size()); ++ for (JavaParameter parameter : parameters) { ++ AttributeMapping attributeMapping = attributesByPropertyName.get(parameter.getName()); ++ if (attributeMapping == null) { ++ attributeMapping = loadParameter(parameter, constructor); ++ ++ attributes.add(attributeMapping); ++ attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); ++ } ++ args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); + } +- args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); ++ constructorArgs.add(Collections.unmodifiableList(args)); ++ } ++ } ++ } else { ++ Collection methods = javaClass.getMethods(); ++ for (JavaMethod method : methods) { ++ Collection parameters = method.getParameters(); ++ if (method.isPublic() && parameters.size() > 0 && method.getName().equals(factoryMethod)) { ++ List args = new ArrayList(parameters.size()); ++ for (JavaParameter parameter : parameters) { ++ AttributeMapping attributeMapping = attributesByPropertyName.get(parameter.getName()); ++ if (attributeMapping == null) { ++ attributeMapping = loadParameter(parameter, method); ++ ++ attributes.add(attributeMapping); ++ attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); ++ } ++ args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); ++ } ++ constructorArgs.add(Collections.unmodifiableList(args)); + } +- constructorArgs.add(Collections.unmodifiableList(args)); + } + } + +@@ -303,7 +328,7 @@ public class QdoxMappingLoader implements MappingLoader { + interfaces); + } + +- private List getFullyQualifiedNames(JavaClass[] implementedInterfaces) { ++ private List getFullyQualifiedNames(Collection implementedInterfaces) { + ArrayList l = new ArrayList(); + for (JavaClass implementedInterface : implementedInterfaces) { + l.add(implementedInterface.getFullyQualifiedName()); +@@ -395,19 +420,19 @@ public class QdoxMappingLoader implements MappingLoader { + return defaultDescription; + } + +- private AttributeMapping loadParameter(JavaParameter parameter) { ++ private AttributeMapping loadParameter(JavaParameter parameter, JavaModel methodOrConstructor) { + String parameterName = parameter.getName(); + String parameterDescription = getParameterDescription(parameter); + + // first attempt to load the attribute from the java beans accessor methods +- JavaClass javaClass = parameter.getParentMethod().getParentClass(); ++ JavaClass javaClass = parameter.getParentClass(); + BeanProperty beanProperty = javaClass.getBeanProperty(parameterName); + if (beanProperty != null) { + AttributeMapping attributeMapping = loadAttribute(beanProperty, parameterDescription); + // if the attribute mapping is null, the property was tagged as hidden and this is an error + if (attributeMapping == null) { + throw new InvalidModelException("Hidden property usage: " + +- "The construction method " + toMethodLocator(parameter.getParentMethod()) + ++ "The construction method " + toMethodLocator(parameter.getParentClass(), methodOrConstructor) + + " can not use a hidded property " + parameterName); + } + return attributeMapping; +@@ -426,9 +451,9 @@ public class QdoxMappingLoader implements MappingLoader { + + private String getParameterDescription(JavaParameter parameter) { + String parameterName = parameter.getName(); +- DocletTag[] tags = parameter.getParentMethod().getTagsByName("param"); ++ Collection tags = parameter.getTagsByName("param"); + for (DocletTag tag : tags) { +- if (tag.getParameters()[0].equals(parameterName)) { ++ if (tag.getParameters().get(0).equals(parameterName)) { + String parameterDescription = tag.getValue().trim(); + if (parameterDescription.startsWith(parameterName)) { + parameterDescription = parameterDescription.substring(parameterName.length()).trim(); +@@ -439,18 +464,6 @@ public class QdoxMappingLoader implements MappingLoader { + return null; + } + +- private boolean isValidConstructor(String factoryMethod, JavaMethod method, JavaParameter[] parameters) { +- if (!method.isPublic() || parameters.length == 0) { +- return false; +- } +- +- if (factoryMethod == null) { +- return method.isConstructor(); +- } else { +- return method.getName().equals(factoryMethod); +- } +- } +- + private static String getProperty(DocletTag propertyTag, String propertyName) { + return getProperty(propertyTag, propertyName, null); + } +@@ -477,14 +490,17 @@ public class QdoxMappingLoader implements MappingLoader { + return false; + } + +- private org.apache.xbean.blueprint.generator.Type toMappingType(Type type, String nestedType) { ++ private org.apache.xbean.blueprint.generator.Type toMappingType(JavaType type, String nestedType) { + try { +- if (type.isArray()) { +- return org.apache.xbean.blueprint.generator.Type.newArrayType(type.getValue(), type.getDimensions()); +- } else if (type.isA(collectionType)) { +- if (nestedType == null) nestedType = "java.lang.Object"; +- return org.apache.xbean.blueprint.generator.Type.newCollectionType(type.getValue(), +- org.apache.xbean.blueprint.generator.Type.newSimpleType(nestedType)); ++ if (type instanceof JavaClass) { ++ JavaClass clazz = (JavaClass)type; ++ if (clazz.isArray()) { ++ return org.apache.xbean.blueprint.generator.Type.newArrayType(type.getValue(), clazz.getDimensions()); ++ } else if (clazz.isA(collectionType)) { ++ if (nestedType == null) nestedType = "java.lang.Object"; ++ return org.apache.xbean.blueprint.generator.Type.newCollectionType(type.getValue(), ++ org.apache.xbean.blueprint.generator.Type.newSimpleType(nestedType)); ++ } + } + } catch (Throwable t) { + log.debug("Could not load type mapping", t); +@@ -492,26 +508,28 @@ public class QdoxMappingLoader implements MappingLoader { + return org.apache.xbean.blueprint.generator.Type.newSimpleType(type.getValue()); + } + +- private static String toMethodLocator(JavaMethod method) { ++ private static String toMethodLocator(JavaClass parentClass, JavaModel methodOrConstructor) { ++ JavaMethod method = methodOrConstructor instanceof JavaMethod ? (JavaMethod) methodOrConstructor : null; ++ JavaConstructor constructor = methodOrConstructor instanceof JavaConstructor ? (JavaConstructor) methodOrConstructor : null; + StringBuffer buf = new StringBuffer(); +- buf.append(method.getParentClass().getFullyQualifiedName()); +- if (!method.isConstructor()) { ++ buf.append(parentClass.getFullyQualifiedName()); ++ if (method != null) { + buf.append(".").append(method.getName()); + } + buf.append("("); +- JavaParameter[] parameters = method.getParameters(); +- for (int i = 0; i < parameters.length; i++) { +- JavaParameter parameter = parameters[i]; ++ List parameters = method != null ? method.getParameters() : constructor.getParameters(); ++ for (int i = 0; i < parameters.size(); i++) { ++ JavaParameter parameter = parameters.get(i); + if (i > 0) { + buf.append(", "); + } + buf.append(parameter.getName()); + } +- buf.append(") : ").append(method.getLineNumber()); ++ buf.append(") : ").append(method != null ? method.getLineNumber() : constructor.getLineNumber()); + return buf.toString(); + } + +- private static void getSourceFiles(File base, String[] excludedClasses, JavaDocBuilder builder) throws IOException { ++ private static void getSourceFiles(File base, String[] excludedClasses, JavaProjectBuilder builder) throws IOException { + if (base.isDirectory()) { + listAllFileNames(base, "", excludedClasses, builder); + } else { +@@ -519,7 +537,7 @@ public class QdoxMappingLoader implements MappingLoader { + } + } + +- private static void listAllFileNames(File base, String prefix, String[] excludedClasses, JavaDocBuilder builder) throws IOException { ++ private static void listAllFileNames(File base, String prefix, String[] excludedClasses, JavaProjectBuilder builder) throws IOException { + if (!base.canRead() || !base.isDirectory()) { + throw new IllegalArgumentException(base.getAbsolutePath()); + } +@@ -536,7 +554,7 @@ public class QdoxMappingLoader implements MappingLoader { + } + } + +- private static void listAllJarEntries(File base, String[] excludedClasses, JavaDocBuilder builder) throws IOException { ++ private static void listAllJarEntries(File base, String[] excludedClasses, JavaProjectBuilder builder) throws IOException { + JarFile jarFile = new JarFile(base); + for (Enumeration entries = jarFile.entries(); entries.hasMoreElements(); ) { + JarEntry entry = (JarEntry) entries.nextElement(); +diff --git a/xbean-spring/src/main/java/org/apache/xbean/spring/generator/QdoxMappingLoader.java b/xbean-spring/src/main/java/org/apache/xbean/spring/generator/QdoxMappingLoader.java +index 94bd7a1..ae55819 100644 +--- a/xbean-spring/src/main/java/org/apache/xbean/spring/generator/QdoxMappingLoader.java ++++ b/xbean-spring/src/main/java/org/apache/xbean/spring/generator/QdoxMappingLoader.java +@@ -20,6 +20,7 @@ import java.io.File; + import java.io.IOException; + import java.net.URL; + import java.util.ArrayList; ++import java.util.Collection; + import java.util.Collections; + import java.util.Enumeration; + import java.util.HashMap; +@@ -31,14 +32,17 @@ import java.util.TreeSet; + import java.util.jar.JarEntry; + import java.util.jar.JarFile; + +-import com.thoughtworks.qdox.JavaDocBuilder; ++import com.thoughtworks.qdox.JavaProjectBuilder; + import com.thoughtworks.qdox.model.BeanProperty; + import com.thoughtworks.qdox.model.DocletTag; + import com.thoughtworks.qdox.model.JavaClass; ++import com.thoughtworks.qdox.model.JavaConstructor; + import com.thoughtworks.qdox.model.JavaMethod; ++import com.thoughtworks.qdox.model.JavaModel; + import com.thoughtworks.qdox.model.JavaParameter; + import com.thoughtworks.qdox.model.JavaSource; +-import com.thoughtworks.qdox.model.Type; ++import com.thoughtworks.qdox.model.JavaType; ++ + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + +@@ -62,7 +66,7 @@ public class QdoxMappingLoader implements MappingLoader { + private final String defaultNamespace; + private final File[] srcDirs; + private final String[] excludedClasses; +- private Type collectionType; ++ private JavaClass collectionType; + + public QdoxMappingLoader(String defaultNamespace, File[] srcDirs, String[] excludedClasses) { + this.defaultNamespace = defaultNamespace; +@@ -79,7 +83,7 @@ public class QdoxMappingLoader implements MappingLoader { + } + + public Set loadNamespaces() throws IOException { +- JavaDocBuilder builder = new JavaDocBuilder(); ++ JavaProjectBuilder builder = new JavaProjectBuilder(); + + log.debug("Source directories: "); + +@@ -92,11 +96,11 @@ public class QdoxMappingLoader implements MappingLoader { + getSourceFiles(sourceDirectory, excludedClasses, builder); + } + +- collectionType = builder.getClassByName("java.util.Collection").asType(); ++ collectionType = builder.getClassByName("java.util.Collection"); + return loadNamespaces(builder); + } + +- private Set loadNamespaces(JavaDocBuilder builder) { ++ private Set loadNamespaces(JavaProjectBuilder builder) { + // load all of the elements + List elements = loadElements(builder); + +@@ -131,14 +135,14 @@ public class QdoxMappingLoader implements MappingLoader { + return Collections.unmodifiableSet(namespaces); + } + +- private List loadElements(JavaDocBuilder builder) { +- JavaSource[] javaSources = builder.getSources(); ++ private List loadElements(JavaProjectBuilder builder) { ++ Collection javaSources = builder.getSources(); + List elements = new ArrayList(); + for (JavaSource javaSource : javaSources) { +- if (javaSource.getClasses().length == 0) { ++ if (javaSource.getClasses().isEmpty()) { + log.info("No Java Classes defined in: " + javaSource.getURL()); + } else { +- JavaClass[] classes = javaSource.getClasses(); ++ Collection classes = javaSource.getClasses(); + for (JavaClass javaClass : classes) { + ElementMapping element = loadElement(builder, javaClass); + if (element != null && !javaClass.isAbstract()) { +@@ -152,7 +156,7 @@ public class QdoxMappingLoader implements MappingLoader { + return elements; + } + +- private ElementMapping loadElement(JavaDocBuilder builder, JavaClass javaClass) { ++ private ElementMapping loadElement(JavaProjectBuilder builder, JavaClass javaClass) { + DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); + if (xbeanTag == null) { + return null; +@@ -176,7 +180,7 @@ public class QdoxMappingLoader implements MappingLoader { + Map attributesByPropertyName = new HashMap(); + + for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { +- BeanProperty[] beanProperties = jClass.getBeanProperties(); ++ Collection beanProperties = jClass.getBeanProperties(); + for (BeanProperty beanProperty : beanProperties) { + // we only care about properties with a setter + if (beanProperty.getMutator() != null) { +@@ -219,9 +223,9 @@ public class QdoxMappingLoader implements MappingLoader { + String destroyMethod = null; + String factoryMethod = null; + for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { +- JavaMethod[] methods = javaClass.getMethods(); ++ Collection methods = javaClass.getMethods(); + for (JavaMethod method : methods) { +- if (method.isPublic() && !method.isConstructor()) { ++ if (method.isPublic()) { + if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { + initMethod = method.getName(); + } +@@ -237,22 +241,43 @@ public class QdoxMappingLoader implements MappingLoader { + } + + List> constructorArgs = new ArrayList>(); +- JavaMethod[] methods = javaClass.getMethods(); +- for (JavaMethod method : methods) { +- JavaParameter[] parameters = method.getParameters(); +- if (isValidConstructor(factoryMethod, method, parameters)) { +- List args = new ArrayList(parameters.length); +- for (JavaParameter parameter : parameters) { +- AttributeMapping attributeMapping = attributesByPropertyName.get(parameter.getName()); +- if (attributeMapping == null) { +- attributeMapping = loadParameter(parameter); +- +- attributes.add(attributeMapping); +- attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); ++ if (factoryMethod == null) { ++ Collection constructors = javaClass.getConstructors(); ++ for (JavaConstructor constructor : constructors) { ++ Collection parameters = constructor.getParameters(); ++ if (constructor.isPublic() && parameters.size() > 0) { ++ List args = new ArrayList(parameters.size()); ++ for (JavaParameter parameter : parameters) { ++ AttributeMapping attributeMapping = attributesByPropertyName.get(parameter.getName()); ++ if (attributeMapping == null) { ++ attributeMapping = loadParameter(parameter, constructor); ++ ++ attributes.add(attributeMapping); ++ attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); ++ } ++ args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); + } +- args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); ++ constructorArgs.add(Collections.unmodifiableList(args)); ++ } ++ } ++ } else { ++ Collection methods = javaClass.getMethods(); ++ for (JavaMethod method : methods) { ++ Collection parameters = method.getParameters(); ++ if (method.isPublic() && parameters.size() > 0 && method.getName().equals(factoryMethod)) { ++ List args = new ArrayList(parameters.size()); ++ for (JavaParameter parameter : parameters) { ++ AttributeMapping attributeMapping = attributesByPropertyName.get(parameter.getName()); ++ if (attributeMapping == null) { ++ attributeMapping = loadParameter(parameter, method); ++ ++ attributes.add(attributeMapping); ++ attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); ++ } ++ args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); ++ } ++ constructorArgs.add(Collections.unmodifiableList(args)); + } +- constructorArgs.add(Collections.unmodifiableList(args)); + } + } + +@@ -303,7 +328,7 @@ public class QdoxMappingLoader implements MappingLoader { + interfaces); + } + +- private List getFullyQualifiedNames(JavaClass[] implementedInterfaces) { ++ private List getFullyQualifiedNames(Collection implementedInterfaces) { + ArrayList l = new ArrayList(); + for (JavaClass implementedInterface : implementedInterfaces) { + l.add(implementedInterface.getFullyQualifiedName()); +@@ -395,19 +420,19 @@ public class QdoxMappingLoader implements MappingLoader { + return defaultDescription; + } + +- private AttributeMapping loadParameter(JavaParameter parameter) { ++ private AttributeMapping loadParameter(JavaParameter parameter, JavaModel methodOrConstructor) { + String parameterName = parameter.getName(); + String parameterDescription = getParameterDescription(parameter); + + // first attempt to load the attribute from the java beans accessor methods +- JavaClass javaClass = parameter.getParentMethod().getParentClass(); ++ JavaClass javaClass = parameter.getParentClass(); + BeanProperty beanProperty = javaClass.getBeanProperty(parameterName); + if (beanProperty != null) { + AttributeMapping attributeMapping = loadAttribute(beanProperty, parameterDescription); + // if the attribute mapping is null, the property was tagged as hidden and this is an error + if (attributeMapping == null) { + throw new InvalidModelException("Hidden property usage: " + +- "The construction method " + toMethodLocator(parameter.getParentMethod()) + ++ "The construction method " + toMethodLocator(parameter.getParentClass(), methodOrConstructor) + + " can not use a hidded property " + parameterName); + } + return attributeMapping; +@@ -426,9 +451,9 @@ public class QdoxMappingLoader implements MappingLoader { + + private String getParameterDescription(JavaParameter parameter) { + String parameterName = parameter.getName(); +- DocletTag[] tags = parameter.getParentMethod().getTagsByName("param"); ++ Collection tags = parameter.getTagsByName("param"); + for (DocletTag tag : tags) { +- if (tag.getParameters()[0].equals(parameterName)) { ++ if (tag.getParameters().get(0).equals(parameterName)) { + String parameterDescription = tag.getValue().trim(); + if (parameterDescription.startsWith(parameterName)) { + parameterDescription = parameterDescription.substring(parameterName.length()).trim(); +@@ -439,18 +464,6 @@ public class QdoxMappingLoader implements MappingLoader { + return null; + } + +- private boolean isValidConstructor(String factoryMethod, JavaMethod method, JavaParameter[] parameters) { +- if (!method.isPublic() || parameters.length == 0) { +- return false; +- } +- +- if (factoryMethod == null) { +- return method.isConstructor(); +- } else { +- return method.getName().equals(factoryMethod); +- } +- } +- + private static String getProperty(DocletTag propertyTag, String propertyName) { + return getProperty(propertyTag, propertyName, null); + } +@@ -477,14 +490,17 @@ public class QdoxMappingLoader implements MappingLoader { + return false; + } + +- private org.apache.xbean.spring.generator.Type toMappingType(Type type, String nestedType) { ++ private org.apache.xbean.spring.generator.Type toMappingType(JavaType type, String nestedType) { + try { +- if (type.isArray()) { +- return org.apache.xbean.spring.generator.Type.newArrayType(type.getValue(), type.getDimensions()); +- } else if (type.isA(collectionType)) { +- if (nestedType == null) nestedType = "java.lang.Object"; +- return org.apache.xbean.spring.generator.Type.newCollectionType(type.getValue(), +- org.apache.xbean.spring.generator.Type.newSimpleType(nestedType)); ++ if (type instanceof JavaClass) { ++ JavaClass clazz = (JavaClass)type; ++ if (clazz.isArray()) { ++ return org.apache.xbean.spring.generator.Type.newArrayType(type.getValue(), clazz.getDimensions()); ++ } else if (clazz.isA(collectionType)) { ++ if (nestedType == null) nestedType = "java.lang.Object"; ++ return org.apache.xbean.spring.generator.Type.newCollectionType(type.getValue(), ++ org.apache.xbean.spring.generator.Type.newSimpleType(nestedType)); ++ } + } + } catch (Throwable t) { + log.debug("Could not load type mapping", t); +@@ -492,26 +508,28 @@ public class QdoxMappingLoader implements MappingLoader { + return org.apache.xbean.spring.generator.Type.newSimpleType(type.getValue()); + } + +- private static String toMethodLocator(JavaMethod method) { ++ private static String toMethodLocator(JavaClass parentClass, JavaModel methodOrConstructor) { ++ JavaMethod method = methodOrConstructor instanceof JavaMethod ? (JavaMethod) methodOrConstructor : null; ++ JavaConstructor constructor = methodOrConstructor instanceof JavaConstructor ? (JavaConstructor) methodOrConstructor : null; + StringBuffer buf = new StringBuffer(); +- buf.append(method.getParentClass().getFullyQualifiedName()); +- if (!method.isConstructor()) { ++ buf.append(parentClass.getFullyQualifiedName()); ++ if (method != null) { + buf.append(".").append(method.getName()); + } + buf.append("("); +- JavaParameter[] parameters = method.getParameters(); +- for (int i = 0; i < parameters.length; i++) { +- JavaParameter parameter = parameters[i]; ++ List parameters = method != null ? method.getParameters() : constructor.getParameters(); ++ for (int i = 0; i < parameters.size(); i++) { ++ JavaParameter parameter = parameters.get(i); + if (i > 0) { + buf.append(", "); + } + buf.append(parameter.getName()); + } +- buf.append(") : ").append(method.getLineNumber()); ++ buf.append(") : ").append(method != null ? method.getLineNumber() : constructor.getLineNumber()); + return buf.toString(); + } + +- private static void getSourceFiles(File base, String[] excludedClasses, JavaDocBuilder builder) throws IOException { ++ private static void getSourceFiles(File base, String[] excludedClasses, JavaProjectBuilder builder) throws IOException { + if (base.isDirectory()) { + listAllFileNames(base, "", excludedClasses, builder); + } else { +@@ -519,7 +537,7 @@ public class QdoxMappingLoader implements MappingLoader { + } + } + +- private static void listAllFileNames(File base, String prefix, String[] excludedClasses, JavaDocBuilder builder) throws IOException { ++ private static void listAllFileNames(File base, String prefix, String[] excludedClasses, JavaProjectBuilder builder) throws IOException { + if (!base.canRead() || !base.isDirectory()) { + throw new IllegalArgumentException(base.getAbsolutePath()); + } +@@ -536,7 +554,7 @@ public class QdoxMappingLoader implements MappingLoader { + } + } + +- private static void listAllJarEntries(File base, String[] excludedClasses, JavaDocBuilder builder) throws IOException { ++ private static void listAllJarEntries(File base, String[] excludedClasses, JavaProjectBuilder builder) throws IOException { + JarFile jarFile = new JarFile(base); + for (Enumeration entries = jarFile.entries(); entries.hasMoreElements(); ) { + JarEntry entry = (JarEntry) entries.nextElement(); +-- +1.9.3 + diff --git a/0004-Port-to-Groovy-2.3.7.patch b/0004-Port-to-Groovy-2.3.7.patch new file mode 100644 index 0000000..79bbed1 --- /dev/null +++ b/0004-Port-to-Groovy-2.3.7.patch @@ -0,0 +1,65 @@ +From dbf7384e63d75bd33a919d6dfbfb1a75630acdae Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Fri, 21 Nov 2014 11:43:56 +0100 +Subject: [PATCH 4/4] Port to Groovy 2.3.7 + +--- + pom.xml | 4 ++-- + xbean-telnet/pom.xml | 2 +- + xbean-telnet/src/main/java/org/apache/xbean/command/GroovySh.java | 4 +++- + 3 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/pom.xml b/pom.xml +index 36bb2da..e483eb0 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -245,9 +245,9 @@ + + + +- groovy ++ org.codehaus.groovy + groovy +- 1.0-jsr-03 ++ 2.3.7 + + + +diff --git a/xbean-telnet/pom.xml b/xbean-telnet/pom.xml +index 1f26170..f6db40e 100644 +--- a/xbean-telnet/pom.xml ++++ b/xbean-telnet/pom.xml +@@ -36,7 +36,7 @@ + + + +- groovy ++ org.codehaus.groovy + groovy + + +diff --git a/xbean-telnet/src/main/java/org/apache/xbean/command/GroovySh.java b/xbean-telnet/src/main/java/org/apache/xbean/command/GroovySh.java +index 2ccb8eb..b7208fe 100755 +--- a/xbean-telnet/src/main/java/org/apache/xbean/command/GroovySh.java ++++ b/xbean-telnet/src/main/java/org/apache/xbean/command/GroovySh.java +@@ -17,6 +17,8 @@ + package org.apache.xbean.command; + + import groovy.lang.GroovyShell; ++import groovy.lang.GroovySystem; ++ + import org.codehaus.groovy.runtime.InvokerHelper; + + import java.io.BufferedReader; +@@ -33,7 +35,7 @@ public class GroovySh implements Command { + public int main(String[] args, InputStream in, PrintStream out) { + GroovyShell shell = new GroovyShell(); + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); +- String version = InvokerHelper.getVersion(); ++ String version = GroovySystem.getVersion(); + out.println("Lets get Groovy!"); + out.println("================"); + out.println("Version: " + version + " JVM: " + System.getProperty("java.vm.version")); +-- +1.9.3 + diff --git a/sources b/sources index 94d743b..5547972 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5b30546ef2478d31c787079072bf9def xbean-3.17-source-release.zip +6f10769b1109646edea129263e4fd7f4 xbean-4.1-source-release.zip diff --git a/xbean-asm4-unshade.patch b/xbean-asm4-unshade.patch deleted file mode 100644 index 70ca3f6..0000000 --- a/xbean-asm4-unshade.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java~ 2014-04-14 13:00:42.025851035 +0200 -+++ xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java 2014-04-14 13:01:13.794418041 +0200 -@@ -17,12 +17,12 @@ - */ - package org.apache.xbean.recipe; - --import org.apache.xbean.asm5.shade.commons.EmptyVisitor; --import org.apache.xbean.asm5.ClassReader; --import org.apache.xbean.asm5.Label; --import org.apache.xbean.asm5.MethodVisitor; --import org.apache.xbean.asm5.Opcodes; --import org.apache.xbean.asm5.Type; -+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 java.io.IOException; - import java.io.InputStream; -@@ -211,7 +211,7 @@ - } - } - -- private static class AllParameterNamesDiscoveringVisitor extends EmptyVisitor { -+ private static class AllParameterNamesDiscoveringVisitor extends ClassVisitor { - private final Map> constructorParameters = new HashMap>(); - private final Map> methodParameters = new HashMap>(); - private final Map exceptions = new HashMap(); -@@ -220,6 +220,7 @@ - private final Map constructorMap = new HashMap(); - - public AllParameterNamesDiscoveringVisitor(Class type, String methodName) { -+ super(Opcodes.ASM4); - this.methodName = methodName; - - List methods = new ArrayList(Arrays.asList(type.getMethods())); -@@ -232,6 +233,7 @@ - } - - public AllParameterNamesDiscoveringVisitor(Class type) { -+ super(Opcodes.ASM4); - this.methodName = ""; - - List constructors = new ArrayList(Arrays.asList(type.getConstructors())); diff --git a/xbean-luna.patch b/xbean-luna.patch deleted file mode 100644 index ae4db5d..0000000 --- a/xbean-luna.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java~ 2014-04-14 13:39:32.316688191 +0200 -+++ xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java 2014-04-14 13:39:41.973106769 +0200 -@@ -153,5 +153,13 @@ - public Bundle getBundle(String location) { - return bundleContext.getBundle(location); - } -+ -+ public org.osgi.framework.ServiceObjects getServiceObjects(ServiceReference reference) { -+ return bundleContext.getServiceObjects(reference); -+ } -+ -+ public ServiceRegistration registerService(Class clazz, org.osgi.framework.ServiceFactory factory, Dictionary properties) { -+ return bundleContext.registerService(clazz, factory, properties); -+ } - - } diff --git a/xbean.depmap b/xbean.depmap deleted file mode 100644 index 25ffb7f..0000000 --- a/xbean.depmap +++ /dev/null @@ -1,50 +0,0 @@ - - - - org.osgi - org.osgi.core - 4.2.0 - - - JPP/felix - org.osgi.core - 1.2.0 - - - - - asm - asm-commons - 3.1 - - - JPP/objectweb-asm - asm-commons - 3.2 - - - - - asm - asm - 3.1 - - - JPP/objectweb-asm - asm - 3.2 - - - - - asm - asm-tree - 3.1 - - - JPP/objectweb-asm - asm-tree - 3.2 - - - diff --git a/xbean.spec b/xbean.spec index a8434cf..8c6c764 100644 --- a/xbean.spec +++ b/xbean.spec @@ -6,21 +6,21 @@ %endif Name: xbean -Version: 3.17 -BuildArch: noarch - -Release: 2%{?dist} +Version: 4.1 +Release: 1%{?dist} Summary: Java plugin based web server - License: ASL 2.0 URL: http://geronimo.apache.org/xbean/ +BuildArch: noarch Source0: http://repo2.maven.org/maven2/org/apache/%{name}/%{name}/%{version}/%{name}-%{version}-source-release.zip # Fix dependency on xbean-asm4-shaded to original objectweb-asm -Patch0: %{name}-asm4-unshade.patch +Patch0: 0001-Unshade-ASM.patch # Compatibility with Eclipse Luna (rhbz#1087461) -Patch1: %{name}-luna.patch +Patch1: 0002-Port-to-Eclipse-Luna-OSGi.patch +Patch2: 0003-Port-to-QDox-2.0.patch +Patch3: 0004-Port-to-Groovy-2.3.7.patch BuildRequires: java-devel BuildRequires: apache-commons-beanutils @@ -48,7 +48,8 @@ BuildRequires: felix-framework %if %{with spring} BuildRequires: apache-commons-jexl BuildRequires: aries-blueprint -# test deps BuildRequires: cglib +# test deps +BuildRequires: cglib BuildRequires: felix-osgi-compendium BuildRequires: felix-osgi-core BuildRequires: geronimo-annotation @@ -115,17 +116,15 @@ This package provides %{summary}. # build failing on this due to doxia-sitetools problems rm src/site/site.xml -%patch0 -%patch1 +%patch0 -p1 +%if %{with equinox} +%patch1 -p1 +%endif +%patch2 -p1 +%patch3 -p1 %pom_remove_parent %pom_remove_dep mx4j:mx4j -%pom_remove_dep :xbean-asm5-shaded xbean-reflect - -# These aren't needed for now -%pom_disable_module xbean-asm5-shaded -%pom_disable_module xbean-finder-shaded -%pom_disable_module xbean-telnet # Prevent modules depending on springframework from building. %if %{without spring} @@ -142,13 +141,10 @@ rm src/site/site.xml # blueprint FTBFS, disable for now %pom_disable_module xbean-blueprint -# Replace generic OSGi dependencies with either Equinox or Felix -%pom_remove_dep :org.osgi.core xbean-bundleutils -%pom_remove_dep org.eclipse:osgi xbean-bundleutils -%if %{with equinox} - %pom_add_dep org.eclipse.osgi:org.eclipse.osgi xbean-bundleutils -%else +%if %{without equinox} + # Replace Eclipse Equinox OSGi dependency with Apeche Felix rm -rf xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/equinox/ + %pom_remove_dep org.eclipse:osgi xbean-bundleutils %pom_add_dep org.apache.felix:org.apache.felix.framework xbean-bundleutils %endif @@ -162,11 +158,6 @@ rm src/site/site.xml sed -i "s|||" xbean-blueprint/pom.xml -# Fix ant groupId -find -name pom.xml -exec sed -i "s|ant|org.apache.ant|" {} \; -# Fix cglib artifactId -find -name pom.xml -exec sed -i "s|cglib-nodep|cglib|" {} \; - %build %mvn_build -f @@ -197,6 +188,9 @@ find -name pom.xml -exec sed -i "s|cglib-nodep| - 4.1-1 +- Update to upstream version 4.1 + * Sun Jun 08 2014 Fedora Release Engineering - 3.17-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild