Skip to content

Formatter conflicts with "Only one statement per line" checkstyle rule #17637

Closed
@michael-simons

Description

@michael-simons

I have the following code:

try (Session session = this.driver.session();
		Transaction tx = session.beginTransaction()) {
		// Do something
}

Spring Java Format complains

 Formatting violations found in the following files:
 * /Users/msimons/Projects/spring-projects/spring-boot/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/neo4j/Neo4jDriverAutoConfigurationIntegrationTests.java

Run `spring-javaformat:apply` to fix.

Fix turns the snippet into

try (Session session = this.driver.session(); Transaction tx = session.beginTransaction()) {
}

Checkstyle complains OneStatementPerLine.

I have no clue how to format the thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixstatus: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions