commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <ggreg...@seagullsw.com>
Subject RE: [Pool] Compiler Warnings/What's left for a release?
Date Tue, 22 Apr 2003 23:11:15 GMT
FYI, Here is the answer from the Eclipse mailing list that posted today:

-----Original Message-----
From: Olivier Thomann [mailto:Olivier_Thomann@ca.ibm.com] 
Sent: Tuesday, April 22, 2003 1:15 PM
To: jdt-dev@eclipse.org
Subject: RE: [jdt-dev] Read access to enclosing field is emulated by a syn
thetic accesso r method. Increasing its visibility will improve your per f
ormance

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.

HTH,

Olivier

-----Original Message-----
From: Gary Gregory [mailto:ggregory@seagullsw.com] 
Sent: Tuesday, April 22, 2003 11:14 AM
To: 'Jakarta Commons Developers List'
Subject: RE: [Pool] Compiler Warnings/What's left for a release?

Ah! That's one to ask to the eclipse/sun folks. :-) I have been pondering
this one myself. I can only suppose that emulation "by a synthetic accessor"
is slower than direct ivar access since there is an "extra" step...

I have posted a question on 'jdt-dev@eclipse.org' but got no answer. I just
asked again today... I'll let you know if an answer gets posted...

Gary

-----Original Message-----
From: Mohan Kishore [mailto:mohankishore@yahoo.com] 
Sent: Tuesday, April 22, 2003 10:51 AM
To: Jakarta Commons Developers List
Subject: RE: [Pool] Compiler Warnings/What's left for a release?

Couldn't really understand the warnings - how would increasing the
visibility
improve the performance?

--- Gary Gregory <ggregory@seagullsw.com> wrote:
> 
> FYI,
> 
> If you're an eclipse user (2.1 for me), you get the following compiler
> warnings. Changing the ivars from private to protected fixes these
warnings.
> 
> 
> Kind	Status	Priority	Description	Resource	In Folder
> Location
> Warning			Write access to enclosing field
> GenericObjectPool._evictionCursor is emulated by a synthetic accessor
> method. Increasing its visibility will improve your performance
> GenericObjectPool.java	Apache Jakarta
> Commons/pool/src/java/org/apache/commons/pool/impl	line 1012


__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message