Community
Participate
Working Groups
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.
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?
This second problem is a dup of bug 101247
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.
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 ***
I can tell you how to patch the code. The fix is trivial. But I would encourage you to move to 3.1.
Ok, what would be the procedure and perhaps I can try it here first before passing the fix onto the rest of the team.
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.