Bug 163647 - [model] Thrown exceptions are not found in method binding key which have a capture as declaring class
Summary: [model] Thrown exceptions are not found in method binding key which have a ca...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-07 07:46 EST by Frederic Fusier CLA
Modified: 2006-12-12 05:06 EST (History)
2 users (show)

See Also:


Attachments
Proposed patch (10.18 KB, patch)
2006-11-07 12:24 EST, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2006-11-07 07:46:04 EST
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;
Comment 1 Frederic Fusier CLA 2006-11-07 10:24:52 EST
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.
Comment 2 Frederic Fusier CLA 2006-11-07 12:24:38 EST
Created attachment 53390 [details]
Proposed patch

Fix this issue by copying stored thrown exception in local parser to main one in KeyToSignature#consumeTypeWithCapture() method...
Comment 3 Frederic Fusier CLA 2006-11-08 02:52:44 EST
Released for 3.3 M4 in HEAD stream.
Comment 4 David Audel CLA 2006-12-12 05:06:27 EST
Verified for 3.3M4 with I20061212-0010.