Bug 540190 - Impossible to configure formatter according to Google's "empty for statement" style
Summary: Impossible to configure formatter according to Google's "empty for statement"...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.9   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-16 11:31 EDT by Peter De Maeyer CLA
Modified: 2022-11-01 06:13 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 Peter De Maeyer CLA 2018-10-16 11:31:16 EDT
It is impossible to configure the Eclipse Java code formatter in such a way that it formats empty for loops according to the Google style.

The objective is that formatter produces the following:

{code}
for (int i = 0; i != 10; i++) {
}
for (; ; ) {
}
{code}

It is impossible to configure this, Eclipse forcibly formats empty for loops like this:

{code}
for (int i = 0; i != 10; i++) {
}
for (;;) { // Checkstyle violation.
}
{code}

The two relevant Checkstyle checks are EmptyForIteratorPad and EmptyForInitializerPad.

The problem is that empty for statements are forcibly treated specially by Eclipse. There should be an option for that.

I'm prepared to try and fix this myself, and I'll try, but I'll have to figure out how to contribute to the right project.
Comment 1 Eclipse Genie CLA 2020-10-06 16:59:14 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Eclipse Genie CLA 2022-11-01 06:13:57 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.