Do synthetic methods generated for private fields really incur performance penalty?

1.1k Views Asked by At

In Eclipse, there is a optional warning when a private field is accessed from an inner class, saying that a synthetic accessor method will be generated and that performance may be improved by making the field package-private.

Does this synthetic method really incur performance penalty? I thought that accessors are generally inlined at runtime, aren't they?

1

There are 1 best solutions below

0
On BEST ANSWER

See this SO question, in short - not much but it raises some interesting class design points