You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Formatter Bug: All values for parentheses_positions_in_method_declaration are ignored, while ...invocation works #4237
There appears to be a persistent bug in the Java formatter where the setting org.eclipse.jdt.core.formatter.parentheses_positions_in_method_declaration is completely ignored.
It seems that all possible values for this setting (e.g., separate_lines, preserve_positions, etc.) have no effect on formatting method declarations.
This is especially problematic for the separate_lines_if_wrapped value, which is a common and useful setting for code readability. Even when parameters are wrapped onto new lines, the closing parenthesis ) is still incorrectly forced onto the same line as the last parameter, directly violating the ...if_wrapped rule.
Key Evidence of Bug: Inconsistency with ...invocation
The strongest evidence of this bug is the clear inconsistency with its parallel setting, which works perfectly.
This setting fails to apply the exact same logic to method declarations.
This inconsistency proves the bug is isolated specifically to the ..._in_method_declaration implementation.
Related Anomaly (Workaround Glitch)
We also observed a related anomaly that further highlights the bug:
If a user manually inserts a blank line (two newlines) before the closing parenthesis in a method declaration (e.g., ...status, \n \n ) {), the formatter preserves this structure.
This shows the formatter is not applying its own rules consistently. It fails to enforce the parentheses_positions... rule, but it can be "tricked" into the correct layout by this manual formatting glitch (likely due to join_wrapped_lines="false" behavior).
Conclusion
This is a bug in the Red Hat Java extension's formatter. The configuration settings for method declarations and invocations should behave identically, but they do not.
idk if it will work in vscode but try org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration
I was running into a similar problem when setting up Spotless (eclipse) in intellij for a Java project I'm working on and this same problem was driving me crazy.
turns out LLM's are good for something as it pointed out the typo in the official documentation:
This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.
Activity
fbricon commentedon Nov 7, 2025
Can you please attach a sample project with code and settings, reproducing this behavior?
StrikeForceZero commentedon Nov 14, 2025
idk if it will work in vscode but try
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcarationI was running into a similar problem when setting up Spotless (eclipse) in intellij for a Java project I'm working on and this same problem was driving me crazy.
turns out LLM's are good for something as it pointed out the typo in the official documentation:
https://help.eclipse.org/latest/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_PARENTHESES_POSITIONS_IN_METHOD_DECLARATION
fbricon commentedon Nov 14, 2025
nice catch! indeed, vscode-java would reuse the same typo'ed
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcarationgithub-actions commentedon Dec 8, 2025
This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.