diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2024-02-06 10:23:37 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2024-02-06 10:24:44 +0100 |
commit | e6d83d61eade6dee223757d149a4df9650752a55 (patch) | |
tree | 9c5d3119499cde749302bfd18ff7e2b106cfffab | |
parent | 906c2bebed0dc732a2fbd5b397466cf3522714f0 (diff) | |
download | jgit-e6d83d61eade6dee223757d149a4df9650752a55.tar.gz jgit-e6d83d61eade6dee223757d149a4df9650752a55.zip |
Don't use localized String during JVM shutdown
During shutdown the JGitText class may already be unloaded causing
NoClassDefFoundError.
Bug: jgit-17
Change-Id: I657b5a508efc8b3778be346d640f4e4d69abd5c5
3 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index c54c811b57..aa9a1774ef 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -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 diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java index b7175508ee..a84b9d0dc7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -743,7 +743,6 @@ public class JGitText extends TranslationBundle { /***/ public String shortReadOfOptionalDIRCExtensionExpectedAnotherBytes; /***/ public String shortSkipOfBlock; /***/ public String shutdownCleanup; - /***/ public String shutdownCleanupFailed; /***/ public String shutdownCleanupListenerFailed; /***/ public String signatureVerificationError; /***/ public String signatureVerificationUnavailable; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/ShutdownHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/ShutdownHook.java index d6c5a81454..f52025fd6b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/ShutdownHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/ShutdownHook.java @@ -82,7 +82,9 @@ public enum ShutdownHook { }).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(); } |