Skip to content

Commit

Permalink
SONAR-22152 Remove JGit workaround
Browse files Browse the repository at this point in the history
No longer needed as the update to JGit 6.10 fixes the issue.
  • Loading branch information
ericg138 authored and sonartech committed Jun 20, 2024
1 parent f12ffe8 commit 821580d
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
import org.eclipse.jgit.internal.util.ShutdownHook;
import org.slf4j.LoggerFactory;
import org.sonar.api.utils.MessageException;
import org.sonar.scanner.bootstrap.EnvironmentConfig;
import org.sonar.scanner.bootstrap.SpringGlobalContainer;
Expand Down Expand Up @@ -75,16 +73,6 @@ public synchronized Batch doExecute(Map<String, String> scannerProperties, List<
SpringGlobalContainer.create(scannerProperties, components).execute();
} catch (RuntimeException e) {
throw handleException(e);
} finally {
// Workaround for SONAR-22152
// Call the cleanup method ourselves to avoid ClassNotFound errors when the Shutdown hook is called after the classloader is closed
try {
var cleanupMethod = ShutdownHook.class.getDeclaredMethod("cleanup");
cleanupMethod.setAccessible(true);
cleanupMethod.invoke(ShutdownHook.INSTANCE);
} catch (Exception e) {
LoggerFactory.getLogger(Batch.class).debug("Failed to call JGit cleanup method", e);
}
}
return this;
}
Expand Down

0 comments on commit 821580d

Please sign in to comment.