I assume this was supposed to go to the list.
-----Original Message-----
From: Zilvinas Kybartas [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 26, 2001 3:54 PM
To: mailto:eap-list
Subject: Encapsulate fields feature bug
Hello,
I'm not sure is this the right place where I should submit a bug...
I was using Encapsulate Fields refactoring feature and it seems that it
doesn't works wery well with the primitive types.
Here is the source code before fields enacpsulation:
public class Foo1
{
public int a;
}
public class Foo2
{
public static void main(String[] args)
{
Foo1 foo1 = new Foo1();
int b = foo1.a++;
}
}
And here is how it looks after encapsulation
public class Foo1
{
private int a;
public int getA() {
return a;
}
public void setA(int a) {
this.a = a;
}
}
public class Foo2
{
public static void main(String[] args)
{
Foo1 foo1 = new Foo1();
int b = foo1.setA(foo1.getA() + 1);
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//This is the error, because setA() method return type is void.
}
}
_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list