Summary: | Inconsistent Implementations of ReferenceType.getDeclaredMethods() | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Ron Bodkin <rbodkin+LISTS> | ||||
Component: | Compiler | Assignee: | Andrew Clement <aclement> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | DEVELOPMENT | ||||||
Target Milestone: | 1.5.0RC1 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Ron Bodkin
2005-12-05 23:11:15 EST
Two small clarifications: the incorrect bridge method results in a VerifyError. If I use only BCEL delegates then the system behaves properly. I modified the test program to output what the differences are between the two sets. Interesting results: Couldn't find java.util.HashMap java.util.HashMap.init(int) in the bcel set Couldn't find java.util.HashMap java.util.HashMap.init() in the bcel set Couldn't find java.util.HashMap java.util.HashMap.init(java.util.Map) in the bcel set Couldn't find java.util.HashMap java.util.HashMap.init(int, float) in the bcel set Couldn't find void java.util.HashMap.<init>(int, float) in the reflection set Couldn't find void java.util.HashMap.<init>(int) in the reflection set Couldn't find void java.util.HashMap.<init>() in the reflection set Couldn't find void java.util.HashMap.<init>(java.util.Map) in the reflection set Couldn't find void java.util.HashMap.<clinit>() in the reflection set I don't like the disagreement between the 'init' and '<init>' strings. I suspect that is the root of this problem. I'm not sure about the <clinit> - but at least we know that can't have an impact on bridge methods ;) I'm not sure how this quite ties up with Rons description that getDeclaredMethods() is differing in each case as the initial fix here just seems to be transforming the reflection based entries for ctors to indicate <init>... Created attachment 31379 [details]
Patch to the delegates (1.5 and < 1.5)
Ron ... this zip contains two patches, one for the weaver project, one for weaver5 - can you try it out and see if it helps your situation with the rogue bridge method? Basically I've made the reflection world return the same thing as the bcel world. The test I modified still fails because of the <clinit> method but that shouldnt impact bridge method creation.
Hmmm .. I just re-read the original append by Ron. In my case I wasn't getting 41 and 29, I was getting 41 and 40. perhaps I'm not running it in quite the same way - i'll keep hacking away - but if you could try the patch it might help with the bridge problem. I will try the patches and report back... On closer examination, the 29 vs 41 methods I was seeing was on a Java 1.3.1 VM but running in Eclipse where the Java 1.5 JRE was on the classpath and BCEL was using that to resolve types (!). When corrected to use a 1.3 JRE in Eclipse, I see 29 vs 30 methods on a Java 1.3 VM and I always saw 40 vs 41 on a Java 1.5 VM. Hopefully this test will show 29 vs 30 when run via ant (the docs on how to run ant tests for a module from the command line aren't working for me...) Reflect: put, clone, get, access$000, access$100, values, size, access$200, clear, remove, access$300, loadFactor, keySet, entrySet, isEmpty, containsValue, containsKey, rehash, putAll, writeObject, readObject, capacity, getHashIterator, access$308, access$110, init, init, init, init BCEL: <init>, <init>, <init>, <init>, size, isEmpty, containsValue, containsKey, get, rehash, put, remove, putAll, clear, clone, keySet, values, entrySet, getHashIterator, writeObject, readObject, capacity, loadFactor, access$000, access$100, access$200, access$308, access$110, access$300, <clinit> It looks like those patches fix the problem (although I had to patch the patches to use an IReflectionWorld interface that my LTWWorld implementation also implements :-)). I am not seeing the same error messages and things appear to be working properly on a quick run. Thanks! fixes checked in - thanks for trying them out Ron. waiting on build. oops - closed prematurely. i'm really waiting on the build... fix available. |