Community
Participate
Working Groups
Since build M6 (nor using M7) the code formatting works only sometimes. I've been trying to figure out a pattern but without any result uptil now. The weird thing is that javadoc comments are always formatted correctly (since M7) but formatting of the code itself is quite unpredictable. On the other hand, once code formatting stops working for a particular file there is no way to get it back online again for that file (not even when closing and opening the file). I'm using JDK 1.4.2_08 and build M7. I have copied my workspace over from build to build cince M5. I did try to trash the .config directory however but without result. Since I'm using the code formatter pretty heavily to be conform to the coding standards in our company, this bug is causing me quite some extra work hand formatting my code again. Kind regards, Stef
Please include specific examples of where the code formatter is not giving you expected results. The JDT/Core team may also ask you for your settings. Are you referring to the code layout after doing a ctrl-shift-f or the auto-indent and formatting as you type in the java editor? Moving to JDT/Core.
Please provide examples and code formatter settings.
Without reproducable test cases, I will close it. Please attach test cases specifying what you expect and also attach your formatter settings.
Created attachment 8268 [details] Code formatter settings
Created attachment 8269 [details] other formatter settings
Created attachment 8270 [details] Test case to unzip
Well, I've just run into the same problem, and for me running the formatter with Ctrl-Shift-F stops working as soon as the code contains an assert statement - this was the minimal testcase I could come up with that shows it: public class Test { public Test() { //assert true; } } If you set the formatter settings to "Java Conventions", this'll get reformatted just as it should, but as soon as you remove the "//" from the comment it'll suddenly stop working (this is of course with Java 1.4 settings for the compiler). Of course, if you remove or comment out the assert statement the formatter starts working again. Hope this helps. np: The Orb - Outlands (Live 93)
If you use build M7, you are in the same case than bug 52246. Please use a newer build. This is fixed since the 24th of February. If your code is not syntactically correct, it won't format. This is a restriction of the new formatter that is using an AST instead of just a steam of tokens. Please ensure your code is syntactically correct before running the formatter.
Apparantly there is still another bug related to formatting the code. Changing version only helps in some cases. Stef
Could you please be more specific? Please describe with examples the cases that are not working.
The bug seems to be fixed in the latest integration build.
Reopening to mark as WORKSFORME.
Reporter said it now works.