Community
Participate
Working Groups
Follow-up of bug 155003. Given example: public class Test { public void x() throws InstantiationException, IllegalAccessException { getClass().newInstance(); } } works well with JRE 1.4 but not with JRE 1.5. It comes from the fact that BindingKeyParser does not parse correctly captures. As in the example, message newInstance() is send on a capture of Class<Test>, the thrown exceptions are not found in BindingKey as the parser failed after the added capture 'LTest;&' of the signature: LTest;&Ljava/lang/Class<!Ljava/lang/Class;+LTest;287;>;.newInstance()!+LTest;|Ljava/lang/InstantiationException;|Ljava/lang/IllegalAccessException;
Initial investigation was wrong. Problem was not the BindingKeyParser unable to parse capture in method binding key. Thrown exceptions were well read but during the parse of the capture (in method #parseTypeWithCapture). This method uses a local parser which stores the thrown exceptions but didn't give them back to the main parser.
Created attachment 53390 [details] Proposed patch Fix this issue by copying stored thrown exception in local parser to main one in KeyToSignature#consumeTypeWithCapture() method...
Released for 3.3 M4 in HEAD stream.
Verified for 3.3M4 with I20061212-0010.