File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
util/src/main/java/org/hyperledger/besu/util Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -41,20 +41,16 @@ public final class BesuVersionUtils {
4141
4242 static {
4343 String className = BesuVersionUtils .class .getSimpleName () + ".class" ;
44- String classPath =
45- Optional .ofNullable (BesuVersionUtils .class .getResource (className ))
46- .map (URL ::toString )
47- .orElse (null );
44+ final URL classUrl = BesuVersionUtils .class .getResource (className );
4845
4946 String commit = null ;
5047 String implVersion =
5148 Optional .ofNullable (BesuVersionUtils .class .getPackage ())
5249 .map (Package ::getImplementationVersion )
5350 .orElse (null );
54- if (classPath != null ) {
51+ if (classUrl != null ) {
5552 try {
56- URL url = new URL (classPath );
57- JarURLConnection jarConnection = (JarURLConnection ) url .openConnection ();
53+ JarURLConnection jarConnection = (JarURLConnection ) classUrl .openConnection ();
5854 Manifest manifest = jarConnection .getManifest ();
5955 Attributes attributes = manifest .getMainAttributes ();
6056 commit = attributes .getValue ("Commit-Hash" );
You can’t perform that action at this time.
0 commit comments