Bug 86878 - Parameterized varargs causes Java formatter to fail
Summary: Parameterized varargs causes Java formatter to fail
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-28 16:27 EST by Trevor Robinson CLA
Modified: 2005-03-30 23:17 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Robinson CLA 2005-02-28 16:27:48 EST
The Java formatter fails to format anything if a file contains method with
varargs of a parameterized type. In the snippet below, the formatter only works
if case1 is commented-out or removed. case2 and case3 do not cause problems.

import java.util.List;

public class Bug
{
void case1(List<Object>... lists)
{ int notFormatted; }

    void case2(List... lists)
    {
        int notFormatted;
    }

    void case3(List<Object> lists)
    {
        int notFormatted;
    }
}
Comment 1 Olivier Thomann CLA 2005-03-02 02:27:17 EST
Fixed and released in HEAD.
Regression test added in FormatterRegressionTests.test545.
Comment 2 Olivier Thomann CLA 2005-03-02 02:40:20 EST
I also added a test case for qualified parameterized type reference as varargs.
Comment 3 Olivier Thomann CLA 2005-03-30 23:17:24 EST
Verified in 20050330-0500