On Fri, 2003-05-02 at 02:27, Gerald Nunn wrote:
> I had a quick look at this, it is relatively easy to add if the imports required are gathered from the class file rather then doing a compilation. This lessens the usefullness somewhat in my opinion but can still be used to eliminate unneeded imports. Is this a good thing to add or should we just leave it off for now?
The tricky part about this - and I'm sure you've already realized this -
is that since static finals are inlined, the class files don't always
have all the types listed in them. Blah. This was dicussed on the
advanced java list at one point, and it turns out this inlining is
required by the JLS - otherwise switch statements couldn't reference
static finals since they wouldn't be constant, so the compiler couldn't
set up the case statement branching, blah blah blah.
This is a bummer for my little ImportScrubber utility -
- because it parses class files to figure
out required imports. Oh well.