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.
Please sign in to leave a comment.
Build No is 1179
Hi,
Please, file the bug to tracker (www.intellij.net/tracker)
Sergiy Dubovik wrote:
>> 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!"