Skip to content

Commit

Permalink
Don't use localized String during JVM shutdown
Browse files Browse the repository at this point in the history
During shutdown the JGitText class may already be unloaded causing
NoClassDefFoundError.

Bug: jgit-17
Change-Id: I657b5a508efc8b3778be346d640f4e4d69abd5c5
  • Loading branch information
msohn committed Feb 6, 2024
1 parent 906c2be commit e6d83d6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,6 @@ shortReadOfBlock=Short read of block.
shortReadOfOptionalDIRCExtensionExpectedAnotherBytes=Short read of optional DIRC extension {0}; expected another {1} bytes within the section.
shortSkipOfBlock=Short skip of block.
shutdownCleanup=Cleanup {} during JVM shutdown
shutdownCleanupFailed=Cleanup during JVM shutdown failed
shutdownCleanupListenerFailed=Cleanup of {0} during JVM shutdown failed
signatureVerificationError=Signature verification failed
signatureVerificationUnavailable=No signature verifier registered
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,6 @@ public static JGitText get() {
/***/ public String shortReadOfOptionalDIRCExtensionExpectedAnotherBytes;
/***/ public String shortSkipOfBlock;
/***/ public String shutdownCleanup;
/***/ public String shutdownCleanupFailed;
/***/ public String shutdownCleanupListenerFailed;
/***/ public String signatureVerificationError;
/***/ public String signatureVerificationUnavailable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ private void cleanup() {
}).get(30L, TimeUnit.SECONDS);
} catch (RejectedExecutionException | InterruptedException
| ExecutionException | TimeoutException e) {
LOG.error(JGitText.get().shutdownCleanupFailed, e);
// message isn't localized since during shutdown there's no
// guarantee which classes are still loaded
LOG.error("Cleanup during JVM shutdown failed", e); //$NON-NLS-1$
}
runner.shutdownNow();
}
Expand Down

0 comments on commit e6d83d6

Please sign in to comment.