문제

We use jalopy to format our code to the sun standard (well 99%).

I have 1 issue with it. It keeps moving comments to the right of the line.

E.g

// Panel
"JPanel.border", new LazyValue(packageName + "PanelBorder"), //frozen

// Button
"Button.background", new ColorUIResource(251, 251, 251), //frozen
"Button.foreground", new ColorUIResource(0, 0, 0), //frozen

But jalopy always moves the // Button to the far right.

// Panel
"JPanel.border", new LazyValue(packageName + "PanelBorder"), //frozen
                                                             // Button
"Button.background", new ColorUIResource(251, 251, 251), //frozen
"Button.foreground", new ColorUIResource(0, 0, 0), //frozen

Is there any way to stop this?

Thanks Neil

도움이 되었습니까?

해결책

so we use jaloppy 1.9.2 (commercial version) and single-line comments are formatted correctly

다른 팁

This is due to comment association. You have //frozen followed by an empty line and then //Button. Jalopy thinks that these two comments are associated with each other, so brings them together.

Take a look at Section 2.8.13.2 Comment association of the manual for more information.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top