On 10/22/01 1:04 PM, "Jon Stevens" <[EMAIL PROTECTED]> wrote:
> on 10/22/01 6:22 AM, "Jason van Zyl" <[EMAIL PROTECTED]> wrote: > >> It works fine, but there is a problem with the imports being placed in the >> wrong place when there is text right after the package declaration. I asked >> Tom Copeland to fix this for me and he said he would get to it today. It >> does the job correctly, it just doesn't put the imports in the right place. > > Run the ant target that I pasted here against Scarab and you will see that > it does NOT work fine at all. I pasted it here so that I wouldn't get a > response like you just gave me. I only ran it on a small body of source, but Scarab is a good test bed. > Here is an example of some imports it f*cked up: > > [196][ src/org/tigris/scarab/om ]% more Attachment.java > package org.tigris.scarab.om; > > import text.plain; > import org.apache.fulcrum.upload.FileItem; > import org.apache.torque.om.NumberKey; > import org.apache.torque.om.Persistent; > > I never knew that text.plain is a proper import. :-) > > Here is another one: > > [197][ src/org/tigris/scarab/om ]% more IssueTemplateInfo.java > package org.tigris.scarab.om; > > import email.RequireApproval.vm; > import org.apache.turbine.Turbine; > import org.apache.fulcrum.template.TemplateContext; > import org.apache.torque.om.NumberKey; > import org.apache.torque.om.UnsecurePersistent; > import org.tigris.scarab.security.ScarabSecurity; > import org.tigris.scarab.security.SecurityFactory; > import org.tigris.scarab.tools.Email; > import org.tigris.scarab.util.ScarabException; > import org.tigris.scarab.services.module.ModuleEntity; > > Wow. When did Velocity files become ok to import? :-) But it did a pretty good job, I think after a couple rounds of fixes it will be fine. > It appears that in its search through files, it finds any mention of a > "foo.bar" and sticks it into an import. That does not seem like a very good > assumption. Poking around in the constants pool isn't necessarily straight forward even though BCEL makes it much easier. > Another problem I noticed is that it imports java.util.Set when it doesn't > need to as well. I think that's a superclass problem. Same thing I ran into with the little hack I whipped up. > Yes, I compiled with debugging on. > > I'm starting to think that post processing JAD (the java decompiler) output > would be a better idea. I think in a couple of days it will do the trick just fine. I ran it on the Tambora source and it wasn't that bad. It doesn't work yet but it's pretty close. > -jon > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- jvz. Jason van Zyl http://tambora.zenplex.org http://jakarta.apache.org/turbine http://jakarta.apache.org/velocity http://jakarta.apache.org/alexandria http://jakarta.apache.org/commons --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]