Bug 99084

Summary: Formatter error when generic method has an argument
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olivier Thomann CLA 2005-06-08 18:43:16 EDT
Formatter doesn't work on the following code:

import java.lang.reflect.Constructor;
 
public class X {
    public <T extends X> Constructor<T> ctor() {return null;}
    static <T extends X> T f1() throws Exception{
        return new X().<T>ctor().newInstance(new Object[0]);
    }
    static <T extends X> T f2() throws Exception {
        return f1();
    }
}
Comment 1 Philipe Mulet CLA 2005-06-08 18:59:10 EDT
+1 for RC2
Comment 2 Olivier Thomann CLA 2005-06-08 19:03:11 EDT
Fixed and released in HEAD.
Regression tests added in
org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.test581/582.
Comment 3 Olivier Thomann CLA 2005-06-09 09:35:14 EDT
Verified with N20050609-0010 + JDT/Core HEAD
Comment 4 David Audel CLA 2005-06-10 10:33:07 EDT
Verified for 3.1 RC2 using build I20050610-0010