Skip to content

Commit

Permalink
Refactor Java version output in web3_clientVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoreliovlabs authored and Vovchyk committed Sep 16, 2024
1 parent 128bcdb commit b0d9fe5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rskj-core/src/main/java/org/ethereum/rpc/Web3Impl.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,12 @@ public void stop() {

@Override
public String web3_clientVersion() {
String javaVersion = System.getProperty("java.version");
String javaMajorVersion = javaVersion.startsWith("1.") ? javaVersion.split("\\.")[1] : javaVersion.split("\\.")[0];
String formattedJavaVersion = "Java" + javaMajorVersion;

String clientVersion = CLIENT_VERSION_PREFIX + "/" + config.projectVersion() + "/" +
System.getProperty("os.name") + "/Java1.8/" +
System.getProperty("os.name") + "/" + formattedJavaVersion + "/" +
config.projectVersionModifier() + "-" + buildInfo.getBuildHash();

if (logger.isDebugEnabled()) {
Expand Down

0 comments on commit b0d9fe5

Please # to comment.