Summary: | [1.5][compiler] preserveAllLocals option has undesirable side-effect when invoking generic method | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> | ||||||||||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||||||
Severity: | normal | ||||||||||||||
Priority: | P3 | CC: | philippe_mulet | ||||||||||||
Version: | 3.3 | ||||||||||||||
Target Milestone: | 3.3 M6 | ||||||||||||||
Hardware: | PC | ||||||||||||||
OS: | Windows XP | ||||||||||||||
Whiteboard: | |||||||||||||||
Attachments: |
|
Description
Olivier Thomann
2007-03-13 15:34:48 EDT
Other scenario broken as well: class A<T> { public T foo; } public class X { public static void main(String[] args) { A<X> a = new A<X>(); A ua = a; ua.foo = new Object(); try { X s = a.foo; } catch(ClassCastException e) { System.out.println("SUCCESS"); return; } System.out.println("FAILED"); } } Other variation: class A<T> { public T foo; } public class X extends A<X>{ public static void main(String[] args) { new X().foo(); } public void foo() { A ua = this; ua.foo = new Object(); try { X s = foo; } catch(ClassCastException e) { System.out.println("SUCCESS"); return; } System.out.println("FAILED"); } } More: class A<T> { public T foo; } public class X extends A<X>{ public static void main(String[] args) { new X().foo(); } public void foo() { A ua = this; ua.foo = new Object(); try { X s = this.foo; } catch(ClassCastException e) { System.out.println("SUCCESS"); return; } System.out.println("FAILED"); } } Created attachment 60750 [details]
In progress patch
Olivier - pls check test1111 which seems to raise a stackmap issue (verifyError)
(patch is still incomplete - need support for qname, allocation)
Created attachment 60757 [details]
Proposed fix
This patch is fixing the VerifyError issue in the SingleNameReference by adding a extra pop of the required value.
This patch replaces the previous patch for the org.eclipse.jdt.core plugin. It doesn't contain the regression tests added in GenericTypeTests.
Added GenericTypeTest#test1111-test1117. Created attachment 60920 [details] Proposed patch Includes fix for bug 177372 Created attachment 60927 [details]
Better patch
better tests
Released for 3.3M6 backporting to 3.2 maintenance Created attachment 60990 [details]
Proposed patch for 3.2.x
Verified for 3.3 M6 using build I20070320-0010 |