When I start Code Cleanup in IntelliJ it seems like it does not use the Eclipse Formatter and it will change indentations. I have to reformat the code and then it looks right but I don't want to do this extra step.
What steps will reproduce the issue?
- Insert the following code, whose format is based on the Eclipse Formatter
return someMethode(someParameter, someParameter2, someParameter3)
&& someMethode(someParameter, someParameter3, someParameter4)
&& someMethode(someParameter, someParameter5, someParameter6)
? something: null;
- Configure the IntelliJ Code Cleanup and select the option
Java > multiple operators with different precedence and set severity to Warning
- Run Clean Up
What is the expected result?
New braces are set. Indentation will not be changed
return (someMethode(someParameter, someParameter2, someParameter3)
&& someMethode(someParameter, someParameter3, someParameter4)
&& someMethode(someParameter, someParameter5, someParameter6))
? something: null;
What happens instead?
The indentation changed. Reformating will be necessary
return (someMethode(someParameter, someParameter2, someParameter3)
&& someMethode(someParameter, someParameter3, someParameter4)
&& someMethode(someParameter, someParameter5, someParameter6))
? something: null;
IDEs
IntelliJ
IntelliJ IDEA 2024.1 (Ultimate Edition)
Build #IU-241.14494.240, built on March 28, 2024
Eclipse
Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)
Version: 2024-03 (4.31.0)
Build id: 20240307-1437
Eclipse Formatter Settings
Here are my configured settings:
Eclipse_formatter_anonym.txt
When I start Code Cleanup in IntelliJ it seems like it does not use the Eclipse Formatter and it will change indentations. I have to reformat the code and then it looks right but I don't want to do this extra step.
What steps will reproduce the issue?
Java > multiple operators with different precedenceand set severity to WarningWhat is the expected result?
New braces are set. Indentation will not be changed
What happens instead?
The indentation changed. Reformating will be necessary
IDEs
IntelliJ
IntelliJ IDEA 2024.1 (Ultimate Edition)
Build #IU-241.14494.240, built on March 28, 2024
Eclipse
Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)
Version: 2024-03 (4.31.0)
Build id: 20240307-1437
Eclipse Formatter Settings
Here are my configured settings:
Eclipse_formatter_anonym.txt