It's not a bug actually, it's a feature. IDEA used to remove all imports of
unknown classes/packages. This caused IDEA could easily damage the code by
import optimizing in case some of the classes are not accessible (for
example, when user forgot to add some of library jars to the project). Then
we decided to leave such imports. That seems to be more correct because
Optimize import is intended to just beautify the code, not to correct
uncompilable code.

But now, even better solution came to my mind. We could leave imports of
unknown classes/packages ONLY when there are any unknown references in the
code. Otherwise we can safely remove them. What do you think?

Best regards,
Valentin Kipiatkov
-----------------------------------------------------------
 IntelliJ Software, http://www.intellij.com/
 "Develop with pleasure"
-----------------------------------------------------------

----- Original Message -----
From: "Thomas Singer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 19, 2001 11:47 AM
Subject: Re: [Eap-list] Optimize imports: problems with wrong packages


> Hello Valentin,
>
> we use the '*'-form. If a package does not exists any longer, IDEA
> highlights it as red, the compiler complains about it, but Optimize
Imports
> does not remove it.
>
> Tom
>
> At 20:00 18.12.01 +0300, you wrote:
> >I checked this but could not reproduce it. Do you mean imports of
packages
> >(with '*' at the end) or of classes from those packages?
> >
> >Best regards,
> >Valentin Kipiatkov
> >-----------------------------------------------------------
> >  IntelliJ Software, http://www.intellij.com/
> >  "Develop with pleasure"
> >-----------------------------------------------------------
> >
> >----- Original Message -----
> >From: "Thomas Singer" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Thursday, December 13, 2001 3:24 PM
> >Subject: [Eap-list] Optimize imports: problems with wrong packages
> >
> >
> > > I moved a lot of classes around. In some classes remained
> >import-statements
> > > that pointed to an existing, but empty package (== invalid package).
> > >
> > > Optimize imports does not removes them, but I would expect it to do.
> > >
> > > Tom
>
>
> _______________________________________________
> Eap-list mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-list


_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to