Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Performance issue with synthetic accessor method

 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo,

Sometime in my code I use the fallow construction :

It is something wrong with this code ?
I don't see any problem but when I use Eclipse with the warnings activated(Project->Properties->Java Compiler->Error&Warnings) I get the fallow warning :

"Read access to enclosing field Extern.extern is emulated by a synthetic accessor method. Increasing its visibility will improve your performance"

at line :

extern = 2;


I don't rely understand what they mean ?

They mean something like : the access to a private class field must be done always trough methods (logic until here), even if the field is access from a in
ner class - if this method is not existing maybe this method is generated (like the default constructor). If the field scope is relaxed (to default or prot
ected) then I don't need this "generated" method. Also I can only use the fields access methods.

If I am right, this is not performance issue ?


Regards,
Mihai

[ February 06, 2006: Message edited by: Mihai Radulescu ]

[Andrew: Changed subject line]
[ February 06, 2006: Message edited by: Andrew Monkhouse ]
 
Bridget Kennedy
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting blog on this very topic that thoroughly addresses your question.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mihai,

I have moved this to the Performance forum. You can now find it here.

Regards, Andrew
[ February 06, 2006: Message edited by: Andrew Monkhouse ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic