Skip to content

Conversation

@halibobo1205
Copy link
Contributor

What does this PR do?
Replace the UnsupportedOperationException with TronError if the JDK does not support.
Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

AnsiConsole.systemUninstall();
throw new TronError(e, TronError.ErrCode.JDK_VERSION);
}
clearParam(); // reset all parameters to avoid the influence in test
Copy link
Contributor

Choose a reason for hiding this comment

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

The method name throwIfUnsupportedJavaVersion can be modified as checkJdkCompatible ?
What's the output of three lines related with AnsiConsole ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

throwIfUnsupportedJavaVersion is the more accurate and intention-revealing name because it clearly communicates that the method will throw an exception if the condition is not met.

This error will appear on the console to alert the user, rather than being quietly recorded in the log files.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to show this infomation in console, this AnsiConsole should be placed in ExitManager, so all TronError has the same action.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To avoid confusion caused by silent execution when using -h or -v flags, errors are explicitly logged to the console in this context. Console output is not required for errors in other scenarios.

Copy link
Contributor

Choose a reason for hiding this comment

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

Get it.

"1.8 ", getOsArch(), javaSpecificationVersion()));
"Java %s is required for %s architecture. Detected version %s", "1.8",
getOsArch(), javaSpecificationVersion()));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not write Java 1.8 directly ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe either style is fine.

@kuny0707 kuny0707 moved this to In Review in java-tron Sep 24, 2025
@kuny0707 kuny0707 linked an issue Sep 24, 2025 that may be closed by this pull request
17 tasks
@kuny0707 kuny0707 merged commit 7f237fd into tronprotocol:release_v4.8.1 Sep 24, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in java-tron Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Expand ARM Architecture Compatibility

7 participants