....that allowed java.lang classes to slip through. Thanks to Paul Holser for finding this. There are also some minor performance enhancements, refactoring, etc.
...that cropped up when a Class is used as a method parameter. Thanks to several people for noticing this bug.
...which excluded imports from java.lang subpackages (thanks to Paul Holser for finding this).
....which would skip imports of static inner classes. Thanks to Brad Johnson for reporting this bug.
Walton Channing also fine-tuned the package break logic.
...writing the files should be slightly faster now. There are also some internal design changes - i.e., refactoring.
...suggested and implemented by Walton Channing.
Import statements are now sorted without respect to case, and a blank line is place between packages from different vendors - i.e., between java.nnn and com.nnn.
...just install Java Web Start (if you haven't already) from here:
http://java.sun.com/products/javawebstart/
and click on the JNLP link on the Importscrubber homepage:
...which would interpret certain strings as class references.
...by replacing my clumsily written bubble sort with Collections.sort(). Hooray for java.util!
....and uses the BCEL bytecode parser. More info on this excellent piece of code can be found here - http://bcel.sourceforge.net - and a big thank you to Markus for his work!
So, no need to run over to Alphaworks any more before using Importscrubber... which is nice.
...http://bcel.sourceforge.net. As soon as I get importscrubber converted over I'll send the fellow an email and get appended to the long list of BCEL users.
It's LGPL, too, so no need to the separate CFParse download. Which is nice.
Tom
...but I'll wait until I can run it on some more complicated files before I do another release.
...after a brief but puzzling pause. In the next release, I should probably do some more refactoring and perhaps neaten up the GUI a bit.
...but for some odd reason the zip file isn't showing up as part of the release. Strange. Maybe it'll work later...
...the GUI works, inner classes are handled correctly, and generally, things are in decent shape.
As always, feedback is welcome at tomcopeland@users.sourceforge.net.
...it all comes together, finally.
Furthermore, I was able to do some refactoring, which should make things a bit easier to follow.
I was thinking a bit about a GUI for importscrubber. Perhaps a JFrame with a JFileChooser to pick the file/directory, a button to say "Go", a progress bar for reading/formatting the files, and a text area for showing some text output - i.e., "now processing Blah.java".... read more
...ah, the joys of 0.1! :-)
Anyhow, there it is - complete with Ant build script and a batch file that runs a short demo. Next big things to do are 1) write some unit tests and 2) find a GPL bytecode parser. Onwards and upwards!
...of the source code. Not sure if this is possible, but I'll give it a shot. The current importscrubber incarnation gets most things - but not everything.
...I've submitted a tech support request. I made some more changes to the way importscrubber figures out which files its supposed to clean up; now it's a tad more flexible. Next step is to allow it to clean up all the files under a given root node.
If you want to see the source so far, email me at tom@roku.com and I'll send you a jar file.
Also, it's JDK 1.1 compliant - for now. Not sure that's desirable or important.
I wrote a first draft using CFParse. It seems to work pretty well and is fast enough - about 300 ms to process a source file with 18 import statements. I'll do an Ant build script for it and check it in as soon as I can figure out how to use CVS. :-)
These are more "notes for Tom" than anything else.
I'd like to use Ant for building.
Need to set up a Ant-like directory structure -
/src
the code
/docs
readme & such
/lib
cfparse (if we can use it), ant, junit
/bin
scripts & such
/etc
?
/build
ant should put finished jars here
how to make "executable jars"?
Well, today is day one of this project. Hopefully this project will be useful and fun.
I was considering using the Alphaworks CFParse library to parse the class files. This sure would make things a lot easier. However, the Alphaworks license says that I have to delete CFParse 90 days after downloading it. I emailed the auther to see if there is any way around this... if not, I may have to roll my own .class file parser. Actually, that's probably wouldn't be such a bad thing for me personally, but it would slow down the project a but while I figured all that stuff out.... read more