Bug 103005 - code formatting
Summary: code formatting
Status: RESOLVED DUPLICATE of bug 101247
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-07 09:21 EDT by Richard Phillips CLA
Modified: 2005-07-21 16:43 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Phillips CLA 2005-07-07 09:21:06 EDT
In one file the code formatting works correctly on a sample piece of code,
however in another using the same sample code the formatter does not do anything.

code:
if (true) 
  {
    
  } 
  else 
  {
    
  }

which in one file formats to :

if (true) {

    } else {

    }

and as I said in the other file (same project, everything), the formatter does
not change it at all.

Buildid: 200503110845
JDK 1.4.2_04

Unfortunately I am unable to upgrade my version of eclipse since the project is
international and we are all using exactly the same build and settings etc.

Any help would be great.
Comment 1 Richard Phillips CLA 2005-07-11 11:43:14 EDT
I have since found some more information about this bug.  If, in any part of the
code, there are label statements ie cleanup: and effectively goto's ie cleanup:;
then the code formatter does nothing with the code.  Is this expected behaviour?
Comment 2 Olivier Thomann CLA 2005-07-11 11:47:15 EDT
This second problem is a dup of bug 101247
Comment 3 Olivier Thomann CLA 2005-07-11 12:01:56 EDT
If your first problem might be a consequence of the second problem you found. If
this is the case, then this is a dup of bug 101247.
Comment 4 Richard Phillips CLA 2005-07-12 04:01:58 EDT
Having looked into the differences in the two files it would appear that it is
in fact due to the presence of labels in the code, therefore making this a
duplicate bug.  Thanks for your help.  I will discuss with the team about
upgrading to 3.1 to obtain this fix.

*** This bug has been marked as a duplicate of 101247 ***
Comment 5 Olivier Thomann CLA 2005-07-12 09:31:23 EDT
I can tell you how to patch the code. The fix is trivial. But I would encourage
you to move to 3.1.
Comment 6 Richard Phillips CLA 2005-07-12 09:52:07 EDT
Ok, what would be the procedure and perhaps I can try it here first before
passing the fix onto the rest of the team.
Comment 7 Olivier Thomann CLA 2005-07-21 16:43:04 EDT
The procedure is quite simple.
You load jdt.core from dev.eclipse.org using the code in the 3.1 maintenance branch.
You apply the patch from bug 101247 and you use the export-plugin script in the
scripts folder to export the jdt/core plugin.
Then you simply replace your existing jdt/core plugin with the one you exported.
Let me know if you have an issue with this.