Related -
In general, the name completion could become smarter over time.
E.g. someone just started to create a method like this:
public SomeType create| // | is cursor position.
It would be nice if Idea suggested "createSomeType" in this case.
Probably, it would require the recognition of specific verbs, such as
"create", "delete", "remove", "add", etc. This is not very complicated, I
think. These verbs could be stored somewhere in configuration file (ordered by
preference) so anyone could add more verbs.
This could also be functional in "extract method". E.g. when an expression
new SomeType(...)
is extracted as a method, the suggested name could be "createSomeType".
Probably, there could be a distinction between "creational" and other methods.
-----Original Message-----
From: "Erik Hanson" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: Tue, 13 Aug 2002 11:06:11 -0700
Subject: [Eap-features] Refactorings: make more specific, make less specific
>
> I might have the wrong terminology here, but I think it would be useful to
> have IDEA figure out how specific or generic a variable, parameter or return
> type can be and make the change.
>
> For example, if I have:
>
> public void addFooAndBar( ArrayList list )
> {
> list.add( "foo" );
> list.add( "bar" );
> }
>
> and I select "list" and choose "make variable less specific", it would
> change the type of "list" to "Collection", since only methods from
> Collection are being used.
>
> Likewise, if I have:
>
> public Collection createFooAndBar()
> {
> ArrayList list = new ArrayList();
> list.add( "foo" );
> list.add( "bar" );
> return list;
> }
>
> and I select "createFooAndBar" and choose "make return type more specific",
> it would change the return type to "ArrayList".
>
>
> Finding return types that can be more specific and finding variables and
> parameters that can be more generic would be a good addition to the code
> inspection.
>
>
> _______________________________________________
> Eap-features mailing list
> [EMAIL PROTECTED]
> http://lists.jetbrains.com/mailman/listinfo/eap-features
>
_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features