This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
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

To avoid eclipse warnings...

 
Roby Kappa
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To obtain the best written code for my SCJD, I've enabled controls by Eclipse IDE. There are two types of warnings I'm not able to eliminate:

"The parameter X is never read": I can't eliminate the parameter because of inheritance (for example actionPerformed with unused ActionEvent parameter). Should I use an annotation to avoid it?

"Read access to enclosing field X is emulated by a synthetic accessor method. Increasing visibility will improve your performace": it appears when I have an inner class and I try to access private fields of enclosing class. The warning disappear when I change from private to default, but the field should be private for a good OO-design!

Thank you.
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I personally left the warnings in my code. Even though I consider this really minor "decisions", I still spent few minutes to think about it too

I thought I wouldn't be able to provide arguments as to why I would "hide" the warnings, other that it annoys you

On the other hand, you never know, these warnings might be worth something some day. I even included this comment in my design choices: I kept the warnings even though I might have hide them. I configured checkstyle to remove all the warnings I didn't like.

My advice, just don't spend too much time on this one.

Regards,
Alex
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic