Skip to content

Conversation

jongmin-chung
Copy link

@jongmin-chung jongmin-chung commented Sep 18, 2025

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

fixes: #7640

Ⅲ. Why don't you add test cases (unit test/integration test)?

Just Maven Spoltess applied

Ⅳ. Describe how to verify it

image

Ⅴ. Special notes for reviews

@jongmin-chung
Copy link
Author

Hi. @xingfudeshi

Thank you for changing the Chinese phrase.

@xingfudeshi
Copy link
Member

Hi. @xingfudeshi

Thank you for changing the Chinese phrase.

No worries.

Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.99%. Comparing base (d1ae495) to head (e1518f1).

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #7644      +/-   ##
============================================
- Coverage     61.05%   60.99%   -0.06%     
+ Complexity      670      666       -4     
============================================
  Files          1316     1316              
  Lines         49804    49804              
  Branches       5855     5855              
============================================
- Hits          30407    30378      -29     
- Misses        16689    16714      +25     
- Partials       2708     2712       +4     
Files with missing lines Coverage Δ
...org/apache/seata/tm/api/TransactionalTemplate.java 57.45% <ø> (ø)

... and 8 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jongmin-chung jongmin-chung force-pushed the bugfix/spotless_apply_java25 branch from 354a075 to e1518f1 Compare September 18, 2025 09:46
case TimeoutRollbacked:
case Rollbacked:
// rollback transactions but do not exist are usually considered completed
// rollback transactions but do not exist are usually considered completed
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Java 11, this comment should be indented, but not indented in Java17, Java25, which is a problem.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Java 11, this comment should be indented, but not indented in Java17, Java25, which is a problem.

Yes — with your current changes, everything for Java11 and above should now follow the same coding style, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java 11 (Has Error ❌)

$ sdk use java 11.0.27-librca 
$  ./mvnw spotless:check 

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.3:check (default-cli) on project seata-tm: The following files had format violations:
[ERROR]     src/main/java/org/apache/seata/tm/api/TransactionalTemplate.java
[ERROR]         @@ -290,7 +290,7 @@
[ERROR]          ················break;
[ERROR]          ············case·TimeoutRollbacked:
[ERROR]          ············case·Rollbacked:
[ERROR]         -············//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR]         +················//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR]          ············case·Finished:
[ERROR]          ················code·=·TransactionalExecutor.Code.RollbackDone;
[ERROR]          ················break;
[ERROR] Run 'mvn spotless:apply' to fix these violations.

Java 17 and above (✅)

$ sdk use java 17.0.16-librca (java 21, java 25 OK)
$  ./mvnw spotless:check 

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.3:check (default-cli) on project seata-tm: The following files had format violations:
[ERROR]     src/main/java/org/apache/seata/tm/api/TransactionalTemplate.java
[ERROR]         @@ -290,7 +290,7 @@
[ERROR]          ················break;
[ERROR]          ············case·TimeoutRollbacked:
[ERROR]          ············case·Rollbacked:
[ERROR]         -················//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR]         +············//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR]          ············case·Finished:
[ERROR]          ················code·=·TransactionalExecutor.Code.RollbackDone;
[ERROR]          ················break;
[ERROR] Run 'mvn spotless:apply' to fix these violations.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :seata-tm

This is the situation above, so there's no problem starting with Java 17 or later.

I have a problem with Java 11. And this happens unconditionally because the position of the comment changes.

What should I do in this situation? (In CI, Java 17 is set, so there is no problem.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java 11 (Has Error ❌)

$ sdk use java 11.0.27-librca 
$  ./mvnw spotless:check 

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.3:check (default-cli) on project seata-tm: The following files had format violations:
[ERROR]     src/main/java/org/apache/seata/tm/api/TransactionalTemplate.java
[ERROR]         @@ -290,7 +290,7 @@
[ERROR]          ················break;
[ERROR]          ············case·TimeoutRollbacked:
[ERROR]          ············case·Rollbacked:
[ERROR]         -············//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR]         +················//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR]          ············case·Finished:
[ERROR]          ················code·=·TransactionalExecutor.Code.RollbackDone;
[ERROR]          ················break;
[ERROR] Run 'mvn spotless:apply' to fix these violations.

Java 17 and above (✅)

$ sdk use java 17.0.16-librca (java 21, java 25 OK)
$  ./mvnw spotless:check 

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.3:check (default-cli) on project seata-tm: The following files had format violations:
[ERROR]     src/main/java/org/apache/seata/tm/api/TransactionalTemplate.java
[ERROR]         @@ -290,7 +290,7 @@
[ERROR]          ················break;
[ERROR]          ············case·TimeoutRollbacked:
[ERROR]          ············case·Rollbacked:
[ERROR]         -················//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR]         +············//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR]          ············case·Finished:
[ERROR]          ················code·=·TransactionalExecutor.Code.RollbackDone;
[ERROR]          ················break;
[ERROR] Run 'mvn spotless:apply' to fix these violations.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :seata-tm

This is the situation above, so there's no problem starting with Java 17 or later.

I have a problem with Java 11. And this happens unconditionally because the position of the comment changes.

What should I do in this situation? (In CI, Java 17 is set, so there is no problem.)

Have you consulted the Spotless community about how to resolve this issue?

Copy link
Member

@YongGoose YongGoose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I think it’s best to wait for a reply on this issue.

If no response comes for a long time, then we may need to proceed with running Spotless only on a specific version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mvn spotless:apply failed
4 participants