Bug 9933 - Format does not handle synchronized keyword correctly
Summary: Format does not handle synchronized keyword correctly
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P3 minor (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-15 14:36 EST by Philip Borlin CLA
Modified: 2002-03-12 12:46 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 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.