Bug 99084 - Formatter error when generic method has an argument
Summary: Formatter error when generic method has an argument
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-08 18:43 EDT by Olivier Thomann CLA
Modified: 2005-06-10 10:33 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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