Bug 86410 - formatting generics type parameters
Summary: formatting generics type parameters
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-23 19:46 EST by Alan Malloy CLA
Modified: 2005-03-30 23:14 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 Alan Malloy CLA 2005-02-23 19:46:01 EST
The code formatter acts a little silly in the following situation:
1) You have "braces->class declaration" set to "next line"
2) You have "white space->parameterized types->type parameters->after closing
angle bracket" set

The intent here, of course, is that the whitespace after the angle bracket be a
newline. However, the formatter generates something like:
public class BoxOfComponents<C extends Component>
 {
//   ...
}

It apparently adds the newline from setting 1) then sees whether it ought to add
a space as per setting 2). Setting it to do these in the reverse order or not
add a space if there's already a newline would fix the problem.
Comment 1 Olivier Thomann CLA 2005-02-24 11:59:35 EST
The second statement is what should be done.
"not add a space if there's already a newline would fix the problem."
Comment 2 Olivier Thomann CLA 2005-02-24 12:00:36 EST
Fixed and released in HEAD.
Regression test added.

The bug was that new line was not resetting the pendingSpace variable.
Comment 3 Olivier Thomann CLA 2005-02-24 12:01:51 EST
Changes in the Scribe class only.
Comment 4 Olivier Thomann CLA 2005-03-30 23:14:47 EST
Verified in 20050330-0500