Bug 86878

Summary: Parameterized varargs causes Java formatter to fail
Product: [Eclipse Project] JDT Reporter: Trevor Robinson <trevor>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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