Bug 9933

Summary: Format does not handle synchronized keyword correctly
Product: [Eclipse Project] JDT Reporter: Philip Borlin <philipborlin>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M4   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description Philip Borlin CLA 2002-02-15 14:36:51 EST
When coding Java:

If I type in a code block such as the following we have a one line if statement 
that does not need brackets around it.

if (bool)
   synchronized (this) {
      // doSomething
   }

If right click and select format the format incorrectly formats this code to:

if (bool)
   synchronized (this) {
      // doSomething
}

It correctly associates the opening brace with synchronized, but incorrectly 
associates the closing brace with the if statement.  This is pretty annoying.
Comment 1 Kevin Haaland CLA 2002-03-07 23:17:12 EST
Formatting java code is supplied by JDT. Moving defect report
Comment 2 Erich Gamma CLA 2002-03-11 10:31:26 EST
moving to JDT Core
Comment 3 Philipe Mulet CLA 2002-03-12 09:02:52 EST
Is this one easy to fix ? If not, then we will revisit post2.0.
Comment 4 Olivier Thomann CLA 2002-03-12 09:59:19 EST
Need to investigate.
Comment 5 Olivier Thomann CLA 2002-03-12 12:46:55 EST
Fixed and released in HEAD. Regression tests added.