Attila Szegedi a écrit :
> On Sep 16, 2008, at 3:15 AM, Rich Hickey wrote:
>
>   
>> How is everyone handling the filtering of synthetic/bridge methods?
>>
>> Using the reflection API, I'm seeing differences between JDK 1.5 and
>> 6, with methods like StringBuilder.length marked as bridge/synthetic
>> in JDK 6 (!?)
>>
>> Is there a reliable way to deduce the 'real' method set via
>> reflection?
>>
>> Here are the signatures and (hex) modifiers for StringBuilder, via
>> getMethods():
>>
>> http://clojure.googlegroups.com/web/jdk5.txt
>> http://clojure.googlegroups.com/web/jdk6.txt
>>
>> In JDK 1.5, filtering on isBridge works ok. But this will filter out
>> StringBuilder.length and others on JDK 6.
>>     
>
> Most interesting, especially considering that bridge methods are  
> really only ever needed for parametric types, and there's not a single  
> type parameter in StringBuilder...
>   
Don't forget covariant return type :)
> Well, according to your pages, the length() method itself has 1041 for  
> modifier in , which is 1024+16+1, which, according to 
> <http://java.sun.com/javase/6/docs/api/constant-values.html#java.lang.reflect.Modifier.PUBLIC
>  
>  > means ABSTRACT+FINAL+PUBLIC. I guess they're using the otherwise  
> nonsensical ABSTRACT+FINAL combo to denote a bridge? (I honestly don't  
> know).
see jsr202, you can download the jvms spec update, the doc 
ClassFile-Java6.pdf, page 123:
ACC_BRIDGE 0x0040
ACC_SYNTHETIC 0x1000

>  If so, then even Java 5 StringBuilder has a  suspiciously large  
> number of these... i.e. doppelgangers of normal insert() and append()  
> methods returning java.lang.AbstractStringBuilder (a class I otherwise  
> didn't hear of). I find that too quite strange.
>   
Rémi

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to