You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Mike Kienenberger <mk...@gmail.com> on 2014/10/07 16:39:25 UTC

Eclipse Static imports

John,

I had issues with static imports as well, but there is a solution.
Take a look at this url:

http://stackoverflow.com/questions/288861/eclipse-optimize-imports-to-include-static-imports

On Tue, Oct 7, 2014 at 10:31 AM, John Huss <jo...@gmail.com> wrote:
> Hmm... I have a lot to say, so I might ramble a bit.
>
> 1) Static imports
>
> I'll never been a big user of static imports, largely because the tooling
> (Eclipse) doesn't support them well.  Everytime I've used a static import
> (which is really only in JUnit) I've wanted to import all the members:
> import package.*;  Well, when you organize import Eclipse will replace the
> star with the specific items you've used.  So you end up have to fix the
> import over and over.  On the other side, Eclipse won't automatically add
> the static import or even recommend it based on your code, so it becomes a
> rarely used feature.

Re: Eclipse Static imports

Posted by Andrus Adamchik <an...@objectstyle.org>.
Yeah, that's what I am using too. It is certainly unfortunate that "Organize Imports" doesn't recognize statics. But "Favorites" and autocomplete (per Mike's link) more or less compensate for that. 

Andrus

On Oct 7, 2014, at 10:39 AM, Mike Kienenberger <mk...@gmail.com> wrote:
> John,
> 
> I had issues with static imports as well, but there is a solution.
> Take a look at this url:
> 
> http://stackoverflow.com/questions/288861/eclipse-optimize-imports-to-include-static-imports
> 
> On Tue, Oct 7, 2014 at 10:31 AM, John Huss <jo...@gmail.com> wrote:
>> Hmm... I have a lot to say, so I might ramble a bit.
>> 
>> 1) Static imports
>> 
>> I'll never been a big user of static imports, largely because the tooling
>> (Eclipse) doesn't support them well.  Everytime I've used a static import
>> (which is really only in JUnit) I've wanted to import all the members:
>> import package.*;  Well, when you organize import Eclipse will replace the
>> star with the specific items you've used.  So you end up have to fix the
>> import over and over.  On the other side, Eclipse won't automatically add
>> the static import or even recommend it based on your code, so it becomes a
>> rarely used feature.
>