> This is a known problem just because ++ and -- operations cannot be > transformed into getters/sertters usage correctly.
More precisely: it's often not possible (at least, without performing too complex analysis of the program) to convert a construct using "++" or "--" operation when its value is used, into one using getter and setter, in an automatic mode and with 100% safety. That's why we decided to leave it as it is now. The generated code is obviously non-compilable and this will attract user's attention to review the code and make needed changes. Hopefully, ++ and -- operations are rarely used in such way, especially for fields being encapsulated. Best regards, Valentin Kipiatkov ----------------------------------------------------------- IntelliJ Software, http://www.intellij.com/ "Develop with pleasure" ----------------------------------------------------------- ----- Original Message ----- From: "Eugene Zhuravlev" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 26, 2001 4:42 PM Subject: Re: [Eap-list] FW: Encapsulate fields feature bug > Hi Zilvinas, > > This is a known problem just because ++ and -- operations cannot be > transformed into getters/sertters usage correctly. However it is not the big > issue to correct this manually. > > Best regards, > Eugene Zhuravlev > IntelliJ Software, http://www.intellij.com/ > "Develop with pleasure!" > > > ----- Original Message ----- > From: "Eugene Belyaev" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: 26 November, 2001 3:24 PM > Subject: [Eap-list] FW: Encapsulate fields feature bug > > > > 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); > > file://^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > file://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 > > > _______________________________________________ > 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
