introduce field, bug?

Hello,
Check this out:

public class Foo {
public Foo() {
String hello = "Hello";
}

public void bar(){
String hello = "Hello";
}
}


Now, select "Hello", press ctrlaltf,
check: replace 2 occurrence, initialize in constructor, press
Ok and you see:

public class Foo {
private final String string;

string = "Hello";
public Foo() {
String hello = string;
}

public void bar(){
String hello = string;
}
}

Sergiy

ps. i'm not following bug parade, so I don't know if this one was
reported already.

2 comments
Comment actions Permalink

Build No is 1179

Hello,
Check this out:

public class Foo {
public Foo() {
String hello = "Hello";
}

public void bar(){
String hello = "Hello";
}
}


Now, select "Hello", press ctrlaltf,
check: replace 2 occurrence, initialize in constructor, press
Ok and you see:

public class Foo {
private final String string;

string = "Hello";
public Foo() {
String hello = string;
}

public void bar(){
String hello = string;
}
}

Sergiy

ps. i'm not following bug parade, so I don't know if this one was
reported already.

0
Comment actions Permalink

Hi,

Please, file the bug to tracker (www.intellij.net/tracker)

Sergiy Dubovik wrote:

Build No is 1179

>> Hello,
>> Check this out:
>>
>> public class Foo {
>> public Foo() {
>> String hello = "Hello";
>> }
>>
>> public void bar(){
>> String hello = "Hello";
>> }
>> }
>>
>>
>> Now, select "Hello", press ctrlaltf,
>> check: replace 2 occurrence, initialize in constructor, press
>> Ok and you see:
>>
>> public class Foo {
>> private final String string;
>>
>> string = "Hello";
>> public Foo() {
>> String hello = string;
>> }
>>
>> public void bar(){
>> String hello = string;
>> }
>> }
>>
>> Sergiy
>>
>> ps. i'm not following bug parade, so I don't know if this one was
>> reported already.


--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.