summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Brinkmann <luckyduck@gentoo.org>2005-04-03 03:59:39 +0000
committerJan Brinkmann <luckyduck@gentoo.org>2005-04-03 03:59:39 +0000
commita5143502b379411a79169deb5b6e5a78c86287a4 (patch)
tree49674c9d846ba2c9f7e932b724623a2422095df3 /dev-java/xdoclet/files
parentInitial import, ebuild based on the contribution by Dan <dan@intuitivelyobvio... (diff)
downloadgentoo-2-a5143502b379411a79169deb5b6e5a78c86287a4.tar.gz
gentoo-2-a5143502b379411a79169deb5b6e5a78c86287a4.tar.bz2
gentoo-2-a5143502b379411a79169deb5b6e5a78c86287a4.zip
New upstream version, fixes #66727. This one also doesnt make use of packed jars any longer, fixes #63299. Ebuild based on the contributions by Dan <dan@intuitivelyobvious.net> and Jose Gonzalez Gomez <jgonzalez.openinput@gmail.com>. See # for more informations.
(Portage version: 2.0.51.19)
Diffstat (limited to 'dev-java/xdoclet/files')
-rw-r--r--dev-java/xdoclet/files/digest-xdoclet-1.2.21
-rw-r--r--dev-java/xdoclet/files/xdoclet-1.2.2-buildfile.patch48
-rw-r--r--dev-java/xdoclet/files/xdoclet-1.2.2-interface.patch273
3 files changed, 322 insertions, 0 deletions
diff --git a/dev-java/xdoclet/files/digest-xdoclet-1.2.2 b/dev-java/xdoclet/files/digest-xdoclet-1.2.2
new file mode 100644
index 000000000000..6e37b1f39528
--- /dev/null
+++ b/dev-java/xdoclet/files/digest-xdoclet-1.2.2
@@ -0,0 +1 @@
+MD5 5ed352554cd8ac048e8bf99a25c9b07d xdoclet-src-1.2.2.tgz 5745305
diff --git a/dev-java/xdoclet/files/xdoclet-1.2.2-buildfile.patch b/dev-java/xdoclet/files/xdoclet-1.2.2-buildfile.patch
new file mode 100644
index 000000000000..968485e71959
--- /dev/null
+++ b/dev-java/xdoclet/files/xdoclet-1.2.2-buildfile.patch
@@ -0,0 +1,48 @@
+diff -urpN xdoclet-1.2.2.orig/build.xml xdoclet-1.2.2/build.xml
+--- xdoclet-1.2.2.orig/build.xml 2005-04-03 05:13:08.000000000 +0200
++++ xdoclet-1.2.2/build.xml 2005-04-03 05:13:12.000000000 +0200
+@@ -75,7 +75,7 @@
+ <ant dir="${samples.dir}"/>
+ </target>
+
+- <target name="l10n" depends="core, modules">
++ <target name="l10n">
+ <!-- messages for each locale get built into a separate jar -->
+ <jar jarfile="${dist.lib.dir}/${name}-pt_BR-locale-${version}.jar">
+ <fileset dir="${l10n.build.dir}">
+diff -urpN xdoclet-1.2.2.orig/core/build.xml xdoclet-1.2.2/core/build.xml
+--- xdoclet-1.2.2.orig/core/build.xml 2005-04-03 05:13:08.000000000 +0200
++++ xdoclet-1.2.2/core/build.xml 2005-04-03 05:13:12.000000000 +0200
+@@ -106,7 +106,7 @@
+ <!-- =================================================================== -->
+ <!-- Compiles the source code -->
+ <!-- =================================================================== -->
+- <target name="compile" depends="beautify">
++ <target name="compile" depends="prepare">
+ <mkdir dir="${modules.all-src.dir}"/>
+ <copy todir="${modules.all-src.dir}">
+ <fileset dir="${core.src.dir}">
+diff -urpN xdoclet-1.2.2.orig/maven/build.xml xdoclet-1.2.2/maven/build.xml
+--- xdoclet-1.2.2.orig/maven/build.xml 2005-04-03 05:13:08.000000000 +0200
++++ xdoclet-1.2.2/maven/build.xml 2005-04-03 05:13:14.000000000 +0200
+@@ -77,7 +77,7 @@
+ </jar>
+
+ <!-- Install the plugin if MAVEN_HOME/MAVEN_LOCAL_HOME is defined -->
+- <antcall target="install"/>
++ <!--antcall target="install"/-->
+ </target>
+
+ <target name="clean">
+diff -urpN xdoclet-1.2.2.orig/modules/modules-common.ent xdoclet-1.2.2/modules/modules-common.ent
+--- xdoclet-1.2.2.orig/modules/modules-common.ent 2005-04-03 05:13:08.000000000 +0200
++++ xdoclet-1.2.2/modules/modules-common.ent 2005-04-03 05:13:12.000000000 +0200
+@@ -190,7 +190,7 @@
+ <!-- =================================================================== -->
+ <!-- Compiles the source code -->
+ <!-- =================================================================== -->
+- <target name="compile" depends="beautify" unless="module.jar.uptodate">
++ <target name="compile" depends="init" unless="module.jar.uptodate">
+ <mkdir dir="${module.classes.dir}"/>
+ <javac
+ destdir="${module.classes.dir}"
diff --git a/dev-java/xdoclet/files/xdoclet-1.2.2-interface.patch b/dev-java/xdoclet/files/xdoclet-1.2.2-interface.patch
new file mode 100644
index 000000000000..e1f38fa87552
--- /dev/null
+++ b/dev-java/xdoclet/files/xdoclet-1.2.2-interface.patch
@@ -0,0 +1,273 @@
+Index: modules/hibernate/src/xdoclet/modules/hibernate/resources/hibernate-properties.xdt
+===================================================================
+--- modules/hibernate/src/xdoclet/modules/hibernate/resources/hibernate-properties.xdt (.../v1.2.2) (revision 2286)
++++ modules/hibernate/src/xdoclet/modules/hibernate/resources/hibernate-properties.xdt (.../trunk) (revision 2286)
+@@ -1,4 +1,4 @@
+- <XDtMethod:ifHasMethodTag tagName="hibernate.property">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.property" superclasses="false">
+ <property
+ name="<XDtMethod:propertyName />"
+ type="<XDtMethod:methodTagValue tagName="hibernate.property" paramName="type" default="<XDtMethod:methodType/>"/>"
+@@ -20,7 +20,7 @@
+ </XDtHibernate:setCurrentTag>
+ </XDtMethod:ifHasMethodTag>
+
+- <XDtMethod:ifHasMethodTag tagName="hibernate.many-to-one">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.many-to-one" superclasses="false">
+ <many-to-one
+ name="<XDtMethod:propertyName/>"
+ class="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="class" default="<XDtMethod:methodType/>" />"
+@@ -43,7 +43,7 @@
+ </XDtHibernate:setCurrentTag>
+ </XDtMethod:ifHasMethodTag>
+
+- <XDtMethod:ifHasMethodTag tagName="hibernate.one-to-one">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.one-to-one" superclasses="false">
+ <one-to-one
+ name="<XDtMethod:propertyName/>"
+ class="<XDtMethod:methodTagValue tagName="hibernate.one-to-one" paramName="class" default="<XDtMethod:methodType/>"/>"
+@@ -59,7 +59,7 @@
+ />
+ </XDtMethod:ifHasMethodTag>
+
+- <XDtMethod:ifHasMethodTag tagName="hibernate.component">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.component" superclasses="false">
+ <component
+ name="<XDtMethod:propertyName />"
+ class="<XDtMethod:methodTagValue tagName="hibernate.component" paramName="class" default="<XDtMethod:methodType/>"/>"
+@@ -84,7 +84,7 @@
+ />
+ </XDtMethod:ifHasMethodTag>
+
+- <XDtMethod:ifHasMethodTag tagName="hibernate.set">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.set" superclasses="false">
+ <set
+ <XDtHibernate:roleAttribute/>="<XDtMethod:propertyName/>"
+ <XDtMethod:ifHasMethodTag tagName="hibernate.set" paramName="table">
+@@ -114,7 +114,7 @@
+ </set>
+ </XDtMethod:ifHasMethodTag>
+
+- <XDtMethod:ifHasMethodTag tagName="hibernate.bag">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.bag" superclasses="false">
+ <bag
+ <XDtHibernate:roleAttribute/>="<XDtMethod:propertyName/>"
+ <XDtMethod:ifHasMethodTag tagName="hibernate.bag" paramName="table">
+@@ -143,7 +143,7 @@
+ </bag>
+ </XDtMethod:ifHasMethodTag>
+
+- <XDtMethod:ifHasMethodTag tagName="hibernate.list">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.list" superclasses="false">
+ <list
+ <XDtHibernate:roleAttribute/>="<XDtMethod:propertyName/>"
+ <XDtMethod:ifHasMethodTag tagName="hibernate.list" paramName="table">
+@@ -166,7 +166,7 @@
+ </list>
+ </XDtMethod:ifHasMethodTag>
+
+- <XDtMethod:ifHasMethodTag tagName="hibernate.map">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.map" superclasses="false">
+ <map
+ <XDtHibernate:roleAttribute/>="<XDtMethod:propertyName/>"
+ <XDtMethod:ifHasMethodTag tagName="hibernate.map" paramName="table">
+@@ -193,7 +193,7 @@
+ </map>
+ </XDtMethod:ifHasMethodTag>
+
+- <XDtMethod:ifHasMethodTag tagName="hibernate.array">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.array" superclasses="false">
+ <array
+ <XDtHibernate:roleAttribute/>="<XDtMethod:propertyName/>"
+ <XDtMethod:ifHasMethodTag tagName="hibernate.array" paramName="table">
+@@ -218,7 +218,7 @@
+ </array>
+ </XDtMethod:ifHasMethodTag>
+
+- <XDtMethod:ifHasMethodTag tagName="hibernate.primitive-array">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.primitive-array" superclasses="false">
+ <primitive-array
+ <XDtHibernate:roleAttribute/>="<XDtMethod:propertyName/>"
+ <XDtMethod:ifHasMethodTag tagName="hibernate.primitive-array" paramName="table">
+@@ -236,7 +236,7 @@
+ </primitive-array>
+ </XDtMethod:ifHasMethodTag>
+
+- <XDtMethod:ifHasMethodTag tagName="hibernate.any">
++ <XDtMethod:ifHasMethodTag tagName="hibernate.any" superclasses="false">
+ <any
+ name="<XDtMethod:propertyName />"
+ id-type="<XDtMethod:methodTagValue tagName="hibernate.any" paramName="id-type"/>"
+Index: modules/hibernate/src/xdoclet/modules/hibernate/HibernateTagsHandler.java
+===================================================================
+--- modules/hibernate/src/xdoclet/modules/hibernate/HibernateTagsHandler.java (.../v1.2.2) (revision 2286)
++++ modules/hibernate/src/xdoclet/modules/hibernate/HibernateTagsHandler.java (.../trunk) (revision 2286)
+@@ -4,10 +4,7 @@
+ */
+ package xdoclet.modules.hibernate;
+
+-import java.util.Collection;
+-import java.util.Iterator;
+-import java.util.LinkedList;
+-import java.util.Properties;
++import java.util.*;
+
+ import org.apache.commons.logging.Log;
+ import org.apache.tools.ant.types.Parameter;
+@@ -48,6 +45,18 @@
+
+ private Parameter currentOtherMapping;
+
++ private static boolean isHibernated(XClass xClass)
++ {
++ if (xClass == null) {
++ return false;
++ }
++
++ return (
++ xClass.getDoc().getTag("hibernate.class") != null ||
++ xClass.getDoc().getTag("hibernate.subclass") != null
++ );
++ }
++
+ /**
+ * Returns full path of hibernate file for the current class.
+ *
+@@ -594,9 +603,11 @@
+ log.debug("typeName=" + typeName);
+
+ Collection classes = getXJavaDoc().getSourceClasses();
++ List reorderedClasses = flattenHierachy(getCurrentClass(), classes);
++
+ XClass clazz;
+
+- for (Iterator i = classes.iterator(); i.hasNext(); ) {
++ for (Iterator i = reorderedClasses.iterator(); i.hasNext(); ) {
+ clazz = (XClass) i.next();
+
+ log.debug("clazz=" + clazz);
+@@ -604,8 +615,13 @@
+ if (DocletSupport.isDocletGenerated(clazz)) {
+ log.debug("isDocletGenerated");
+ }
+- else if (clazz.getSuperclass() != null && clazz.getSuperclass().getQualifiedName().equals(typeName)) {
+- log.debug("is a subclass");
++ else if (isValidSubclass(clazz, getCurrentClass())) {
++ if (getCurrentClass().isInterface()) {
++ log.debug("is an implementing class");
++ }
++ else {
++ log.debug("is a subclass");
++ }
+
+ XClass current = getCurrentClass();
+
+@@ -735,10 +751,108 @@
+ //TODO: Why do we need this!!??
+ }
+
++ private boolean isValidSubclass(XClass clazz, XClass currentClass)
++ {
++ String typeName = currentClass.getQualifiedName();
++
++ // easy case, clazz is implementing interface of hibernated class
++ // NB: not easy anymore, if we've got a hibernated interface hierachy
++ // only return true for "deepest" implemented interface in this hierachy
++ if (currentClass.isInterface() && clazz.isImplementingInterface(typeName)) {
++ List extending = currentClass.getExtendingInterfaces();
++
++ if (extending.isEmpty()) {
++ return true;
++ }
++
++ for (int i = 0; i < extending.size(); i++) {
++ XClass xClass = (XClass) extending.get(i);
++
++ if (isHibernated(xClass) && clazz.isImplementingInterface(xClass.getQualifiedName())) {
++ // we found an interface deeper in the hierachy
++ return false;
++ }
++ }
++ return true;
++ }
++
++ if (clazz.getSuperclass() != null) {
++ // easy case, this class is direct subclass of the hibernated type
++ if (clazz.getSuperclass().equals(typeName)) {
++ return true;
++ }
++ else {
++ // go up class hierarchy to find first hibernate tag
++ XClass xc = clazz;
++
++ do {
++ xc = xc.getSuperclass();
++
++ } while (xc != null && !isHibernated(xc));
++
++ // did we find a valid superclass, is it the current ?
++ if (xc != null) {
++ return xc.equals(currentClass);
++ }
++ }
++ }
++
++ return false;
++ }
++
+ private HibernateSubTask getHibernateSubTask()
+ {
+ return ((HibernateSubTask) (DocletContext.getInstance()
+ .getSubTaskBy(DocletTask.getSubTaskName(HibernateSubTask.class))));
+ }
++
++ /**
++ * Flattens the collection of classes by eliminating descendants (for hibernated non
++ * interface classes).
++ *
++ * @param currentClass
++ * @param classes
++ * @return
++ */
++ private List flattenHierachy(XClass currentClass, Collection classes)
++ {
++ Log log = LogUtil.getLog(HibernateTagsHandler.class, "flattenHierachy");
++
++ log.debug("for class " + currentClass);
++
++ if (!currentClass.isInterface()) {
++ List l = new ArrayList(classes);
++
++ l.retainAll(currentClass.getAllSubclasses());
++ return l;
++ }
++
++ Set s = new HashSet(classes);
++
++ log.debug("initial set size: " + s.size());
++
++ for (Iterator iterator = classes.iterator(); iterator.hasNext(); ) {
++ XClass xClass = (XClass) iterator.next();
++
++ if (xClass.isInterface() || !isHibernated(xClass)) {
++ continue;
++ }
++
++ List subClasses = xClass.getAllSubclasses();
++
++ for (int i = 0; i < subClasses.size(); i++) {
++ XClass aClass = (XClass) subClasses.get(i);
++
++ if (s.contains(aClass)) {
++ log.debug("removing " + aClass + " from set");
++ s.remove(aClass);
++ }
++ }
++ }
++
++ log.debug("new set size: " + s.size());
++
++ return new ArrayList(s);
++ }
+ }
+