Skip to content

Conversation

jongmin-chung
Copy link
Contributor

@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
Contributor 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 61.25%. Comparing base (b6af418) to head (92ff4bb).
⚠️ Report is 1 commits behind head on 2.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #7644      +/-   ##
============================================
- Coverage     61.29%   61.25%   -0.04%     
  Complexity      666      666              
============================================
  Files          1314     1314              
  Lines         49853    49853              
  Branches       5874     5874              
============================================
- Hits          30556    30538      -18     
- Misses        16516    16531      +15     
- Partials       2781     2784       +3     
Files with missing lines Coverage Δ
...org/apache/seata/tm/api/TransactionalTemplate.java 57.45% <ø> (ø)

... and 6 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
Contributor 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
Contributor 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.

@funky-eyes
Copy link
Contributor

According to the description in diffplug/spotless#2625, we should drop JDK 11 and make JDK 17 the minimum required to run Spotless.

@funky-eyes funky-eyes added the first-time contributor first-time contributor label Sep 26, 2025
@jongmin-chung
Copy link
Contributor Author

According to the description in diffplug/spotless#2625, we should drop JDK 11 and make JDK 17 the minimum required to run Spotless.

@funky-eyes
I saw your comment and worked on that commit. Please check.

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM @YongGoose PTAL

Comment on lines -266 to -268
<id>java11+</id>
<id>java17+</id>
<activation>
<jdk>[11,)</jdk>
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed?

@funky-eyes funky-eyes merged commit 0605fa8 into apache:2.x Oct 4, 2025
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor 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
5 participants