Sorry, I should have provided more context.
Here's a full example. Have a look at the
comments to see what I mean (sorry for the HTML).

public class TestVariableNameSuggestion {

  public int getMatchLength() {
    return this.matchLength;
  }

  public int getMatchWidth() {
    return this.matchWidth;
  }

  public void doThis(String name) {
    System.out.println("name = " + name);
  }

  public void doThat(String code) {
    System.out.println("code = " + code);
  }

  public void doThat(Integer size) {
    System.out.println("size = " + size);
  }

  private int matchLength;
  private int matchWidth;

  public void test1() {

    // Renaming foo here suggests:
    // foo, matchLength, length, i (agree)
    int foo = this.getMatchLength();

    // Renaming bar here suggests:
    // bar, i (agree)
    int bar;

    // (1)
    // Renaming bar here suggests:
    // bar, i (would like: bar, matchLength, length, i)
    bar = this.getMatchLength();

    // (2)
    // Renaming bar here suggests:
    // bar, i (would like: bar, matchWidth, width, i)
    bar = this.getMatchWidth();

  }

  public void test2() {

    // Renaming foo here suggests:
    // foo, s (agree)
    String foo = "foo";

    // (3)
    // Renaming foo here suggests:
    // foo, s (would like: foo, name, s)
    this.doThis(foo);

    // (4)
    // Renaming foo here suggests:
    // foo, s (would like: foo, code, s)
    this.doThat(foo);

    // Renaming bar here suggests:
    // bar, integer (agree)
    Integer bar = new Integer(10);

    // (5)
    // Renaming bar here suggests:
    // bar, integer (would like: bar, size, integer)
    this.doThat(bar);

  }

  public void test3() {

    // (6)
    // Introduce Variable on "null" generates:
    // Object o = null;
    // Would like to be able to pick between:
    // String code = null;
    // Integer size = null;
    this.doThat(null);

  }

}

I think some of these have worked in the past but
some of these are RFE's. My highest priority is
to make (1)-(3) work. (4)-(6) are secondary but
would also be very helpful.

Regards,
Thomas

> -----Original Message-----
> From: Valentin Kipiatkov [
mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 07, 2002 7:29 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [Eap-list] 609: Problem with variable name suggestion
>
>
> > Consider this:
> >   charsMatched = currentPartNumberPattern.getMatchLength();
> > When renaming "charsMatched", it used to be that "matchLength"
> > was suggested (inferred from the method name).
>
> I checked exactly on your example and it suggests
> "matchLength" and "length"
> as variants. Doesn't it work for you? Please provide more details.
>
> > I also thought I noticed other small things in variable name
> > suggestion that used to work, but I can't remember now.
> > I'll let you know when I come across them again.
>
> The only change that I know is that it now prefers long suggestions
> ("matchLength") over shorter ones ("length") and puts them
> first. However,
> we are thinking about making it an option (prefer longer
> names or shorter
> names).
> Please provide any examples where it does not work as you want.
>
> Best regards,
> Valentin Kipiatkov
> -----------------------------------------------------------
>  IntelliJ Software,
http://www.intellij.com/
>  "Develop with pleasure"
> -----------------------------------------------------------
>
> ----- Original Message -----
> From: "Vollmer, Thomas - CannonSA" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 06, 2002 4:27 AM
> Subject: [Eap-list] 609: Problem with variable name suggestion
>
>
> > I recently upgraded from 537 to 609 and so far I really like it.
> > Great job (again)!
> >
> > I've noticed one thing though. Variable name suggestion seems to
> > be different, less smart. I haven't cross-checked with build 537
> > yet, so I don't know if I'm dreaming or not.
> >
> > Consider this:
> >   charsMatched = currentPartNumberPattern.getMatchLength();
> > When renaming "charsMatched", it used to be that "matchLength"
> > was suggested (inferred from the method name).
> >
> > I also thought I noticed other small things in variable name
> > suggestion that used to work, but I can't remember now.
> > I'll let you know when I come across them again.
> >
> > Regards,
> > Thomas
> >
> > ************************************
> > If this email is not intended for you, or you are not
> responsible for the
> > delivery of this message to the addressee, please note that
> this message
> may
> > contain ITT Privileged/Proprietary Information.  In such a
> case, you may
> not
> > copy or deliver this message to anyone.  You should destroy
> this message
> and
> > kindly notify the sender by reply email.  Information
> contained in this
> > message that does not relate to the business of ITT is
> neither endorsed by
> > nor attributable to ITT.
> > ************************************
> >
> >
> > _______________________________________________
> > 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
>


************************************
If this email is not intended for you, or you are not responsible for the delivery of this message to the addressee, please note that this message may contain ITT Privileged/Proprietary Information. In such a case, you may not copy or deliver this message to anyone. You should destroy this message and kindly notify the sender by reply email. Information contained in this message that does not relate to the business of ITT is neither endorsed by nor attributable to ITT.
************************************


Reply via email to