You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2012/05/06 00:47:50 UTC
[jira] [Updated] (POOL-124) Access to enclosing constructor
Foo.Bar() is emulated by a synthetic accessor method. Increasing its
visibility will improve your performance.
[ https://issues.apache.org/jira/browse/POOL-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb updated POOL-124:
----------------------
Fix Version/s: (was: 2.0)
> Access to enclosing constructor Foo.Bar() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance.
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: POOL-124
> URL: https://issues.apache.org/jira/browse/POOL-124
> Project: Commons Pool
> Issue Type: Improvement
> Affects Versions: 1.4
> Environment: Eclipse Compiler 3.3M5.
> Reporter: Gary D. Gregory
>
> Fix compiler warnings like:
> {quote}
> Access to enclosing constructor GenericKeyedObjectPool.ObjectQueue() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance."
> {quote}
> By definition, when a class element is private, it cannot be seen from outside the scope of the type that defines it. The compiler treats inner classes with some special processing though.
> Here is Olivier Thomann's explanation [1]:
> "You get this warning as soon as you access a private member (fields or
> methods) of the enclosing class inside an inner class (anonymous, local or member classes).
> The compiler uses a static access method to access the private member in order to workaround the VM access violation. You cannot access directly a private member from another class. From the VM point of view, an inner class is a different class and has no relation with its enclosing class.
> So doing this access to a private member you pay the price of a method invocation each time you access the member at runtime. This is not the case if the member is package visible."
> Gary
> [1] http://dev.eclipse.org/mhonarc/lists/jdt-dev/msg00145.html
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira