ejbDoclet packageSubstitution issue with useFirst="true"
--------------------------------------------------------

                 Key: XDT-1683
                 URL: 
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1683
             Project: XDoclet
          Issue Type: Bug
          Components: EJB Module
    Affects Versions: 1.2.3
         Environment: win2003 server, xdoclet-1.2.3 within Eclipse 3.2.1, 
custom xdoclet-build script
            Reporter: Andrew Hoffman
            Assignee: xdoclet-devel (Use for new issues)


An issue has surfaced within our ejb-doclet code generation, stemming from a 
change in our ejb package structures.  Intially, all our ejb classes where in a 
single package (example: com.abc.main.ejb) and interfaces were being generated 
to another folder via package substitution (example: 
com.abc.main.ejbinterfaces).  Our packageSubstitution element of the ejbdoclet 
task looked like this:

<packageSubstitution packages="ejb" substituteWith="ejbinterfaces"/>

This works great for all files within the ejb package at a single level... 
however, we recently decided to ADD some new files in a sub-package (example: 
com.abc.main.ejb.newbeans), and discovered (as is proper, we now know) that the 
sub-package files were not being caught by the package substitution, and all 
generated files for the sub-package were put in the same source folder 
(com.abc.main.ejb.newbeans).  Soe we then discovered the useFirst attribute and 
tried this in our xdoclet script:

<packageSubstitution packages="ejb" substituteWith="ejbinterfaces" 
userFirst="true"/>

We THOUGHT this should accomplish what we wanted, but instead it looks like the 
package substitution is "double substituting" matching package names in our 
packages... all of the generated interfaces are now going into an 
"ejbinterfacesinterfaces" package (example: 
com.abc.main.ejbinterfacesinterfaces and 
com.abc.main.ejbinterfacesinterfaces.newbeans)

If you switch the substituteWith attribute from "ejbinterfaces" to just 
"interfaces", all works as expected for main package and sub-package, but we 
believe the fact that the substituteWith attribute STARTS WITH the same string 
as the packages attribute, the substitution is double-matching against the new 
"ejbinterfaces" packages (first result of the substitution) and RE-matching to 
change it to "ejbinterfacesinterfaces".

Now, short of a TON of refactoring from "com.abc.main.ejbinterfaces" to 
"com.abc.main.interfaces", we're stuck creating a whole set of new ant tasks 
within ejbdoclet to refactor the generated "interfaces" classes BACK into 
"ejbinterfaces" packages (copy "interfaces" to "ejbinterfaces", delete 
"interfaces", replace all references to "com.abc.main.interfaces" with 
"com.abc.main.ejbinterfaces" within generated class files.

Looks like the packageSubstitution task SHOULD be able to handle the situation 
where packages and substituteWith start with the same text, but ARE NOT an 
exact match.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to