? SS or inspection : locating non-generified collections usages.


Is there a way (SS, or inspection) to locate all the
private List oldWay = new ArrayList();

, while avoiding the
private List newWay = new ArrayList]]>();

?

I tried S.S. with parameters inheriting from java.util.Collection, but I
get the "new" versions too.


Alain

21 comments
Comment actions Permalink

Abstraction issues | Raw use of parametrized type.

Plus I'd recommed using Generify refactoring. (on a package for instance)

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

Is there a way (SS, or inspection) to locate all the
private List oldWay = new ArrayList();
, while avoiding the
private List<String> newWay = new ArrayList<String>();
?

I tried S.S. with parameters inheriting from java.util.Collection, but
I get the "new" versions too.

Alain



0
Comment actions Permalink

Maxim

Thanks.

I've just posted:
"Tell the user what to do next., after he upgraded the language
level to 5.0:"
http://www.jetbrains.net/jira/browse/IDEA-1751

Alain

0
Comment actions Permalink

I beleive what you suggest is out of IDEA's style. An IDE should not appear
like a nanny to developer IMO.
We could add a productivity hint there instead.

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

Maxim

Thanks.

I've just posted:
"Tell the user what to do next., after he upgraded the language
level to 5.0:"
http://www.jetbrains.net/jira/browse/IDEA-1751
Alain



0
Comment actions Permalink

Or just extend the "Generify" refactoring to cover boxing/unboxing removal and for-loop upgrade as well. Call it "Modernize to J2SDK5.0..." or something like that.

--Dave Griffith

0
Comment actions Permalink

Maxim :

I beleive what you suggest is out of IDEA's style. An IDE should not
appear like a nanny to developer IMO.
We could add a productivity hint there instead.




Just add a
"don't show this dialog in the future"
checkbox to the dialog.

It's not nannying, it's informing. I wasn't informed, so I had to ask
the question in this thread.

Alain

0
Comment actions Permalink

Please make the (un)boxing optional, we rate it as 1.5's anti-feature.

Tom

0
Comment actions Permalink

Dave Griffith wrote:

Call it "Modernize to J2SDK5.0..." or something like that.

>

>


In the same vein, IDEA should come with a "moving to JSDK 5.0"
inspections profile, that would regroup all the inspections that locate
the places that can be "modernized" to 5.0.

Alain

0
Comment actions Permalink

It could be called "Migrate to J2SDK 5.0" to fit with the existing migration
stuff (although I'm not sure anyone has ever used the swing migration tool.
I wonder if it's even working :) )

Vince.


0
Comment actions Permalink

Worse than static imports? That's the one that made me itch when I heard about it.

--Dave Griffith

0
Comment actions Permalink

You are right, static imports are the second anti-feature.

Tom

0
Comment actions Permalink

It's not nannying, it's informing. I wasn't informed,
so I had to ask
the question in this thread.


-1, it's still nanning to me. I'm all for a "Migrate to 5.0 language features" inspection/refactoring/menu item, but informative (aka, annoying) dialogs are sooooo not the IDEA style.

0
Comment actions Permalink

-1, it's still nanning to me. I'm all for a "Migrate
to 5.0 language features" inspection/refactoring/menu
item, but informative (aka, annoying) dialogs are
sooooo not the IDEA style.


Thinking twice... unless we get something similar to the new bug report icon: a non-disruptive hint in the status bar (that goes away after a few seconds, unlike the bug report icon).

0
Comment actions Permalink

Marcus

>>It's not nannying, it's informing. I wasn't informed,
>>so I had to ask the question in this thread.
>>
>>
>
>-1, it's still nanning to me.
>



Nannying?
A dialog that you will see only once in your lifetime, if you wish so,
and that brings useful information to you.
Once again, look at the origin of this thread. I didn't know, because I
wasn't informed, so I start asking in this forum.
You still think it's not worth telling the user, once, that there is a
related feature that he probably wishes to use, based on the current action?



>... but informative (aka, annoying) dialogs are sooooo not the IDEA style.

>

If you're looking for an annoying dialog, that is sooooo not the IDEA
style, look no further than:

"Latest info from the plugin repository is required."
"Would you like to download it?"

It's not nannying, it's worse; and not informative; and useless. And
there is no way to keep it from bugging you.

Alain

0
Comment actions Permalink

Marcus

a non-disruptive hint in the status bar (that goes away after a few
seconds, unlike the bug report icon).



And what if I don't read the status bas, during those few seconds?

Alain

0
Comment actions Permalink

You still think it's not worth telling the user,
once, that there is a
related feature that he probably wishes to use, based
on the current action?


I've changed my mind on this, just check out my self-reply a couple of posts before this one.

"Latest info from the plugin repository is
is required."
"Would you like to download it?"


I know, I know! I think dialogs like this are exactly what prompted my exaggerated reaction to your suggestion. We need something else to fill the role of "informative dialogs". Something that doesn't interrupt the user, something like... a hint in the status bar :P

0
Comment actions Permalink

And what if I don't read the status bas, during those
few seconds?


You do notice the exception icon, don't you? I was thinking about something exactly like the exception icon: same size, flashing. The only difference is that it would stop flashing after a few (as in 30 or so, not 5) seconds, and maybe completly disappear after a longer (2 minutes?) time.

Of course, a "don't bug me again" option is always necessary. Also, keep in mind that this notification mechanism could be used for something else beyond your proposal -- there are lots of actions in IDEA that could benefit from this kind non-disruptive hint.

0
Comment actions Permalink

As the matter of fact there are plenty of IDEA features not that easy to
find like
- how do you know you're to /** + to get javadoc stub generated?
- how do you know you'll get "aaa" + "|bbb" if pressing at "aaa|bbb"?

And there's already visual solution to this called Productivity Hints. There's
just too few of them implemented.

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

I know, I know! I think dialogs like this are exactly what prompted my

exaggerated reaction to your suggestion. We need something else to
fill the role of "informative dialogs". Something that doesn't interrupt the
user, something like... a hint in the status bar :P

An intention?

Vince.


0
Comment actions Permalink

Maxim

As the matter of fact there are plenty of IDEA features not that easy
to find like
- how do you know you're to /** + to get javadoc stub generated?
- how do you know you'll get "aaa" + "|bbb" if pressing at
"aaa|bbb"?

>

Bad examples to me: POLS, and the knowledge of IDEA's smartness in other
cases could let you guess those two, or at least not be surprised.


On the other hand,
"how can IDEA help move my code from 1.4 to 5.0"
cannot be guessed: it has to be told, in some way.
If it's told in a simple, quick and painless way, - a dialog, once, the
first time you upgrade a language level to 5.0 -, that's better.


Alain

0
Comment actions Permalink


Alain Ravet wrote:

On the other hand,
"how can IDEA help move my code from 1.4 to 5.0"
cannot be guessed: it has to be told, in some way.


Personally, I found this just where I expected it and not at all
surprising. The productivity hints and/or help system would be the place
for that kind of info in my opinion. Less dialogs is better than more,
even when it's possible to turn them off.

Bas

0
Comment actions Permalink

On Tue, 03 May 2005 16:14:35 +0400, Marcus Brito wrote:

-1, it's still nanning to me. I'm all for a "Migrate to 5.0 language
features" inspection/refactoring/menu item, but informative (aka,
annoying) dialogs are sooooo not the IDEA style.


Apart from when there in the hints dialog that always shows up when a
process is taking a long time to run. Or on startup if you havn't told it
not to display.


0

Please sign in to leave a comment.