Skip to content

Commit

Permalink
Remove uses of log4j in picard, it's still a required transitively
Browse files Browse the repository at this point in the history
* replace the dependency with a version constraint so we don't import a buggy version
  • Loading branch information
lbergelson committed Jan 10, 2024
1 parent 7566e5b commit f5ba9b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ dependencies {
api 'org.broadinstitute:barclay:5.0.0'

//log4j api and core used in logging
api 'org.apache.logging.log4j:log4j-api:' +log4jVersion
implementation 'org.apache.logging.log4j:log4j-core:' + log4jVersion
implementation 'org.apache.logging.log4j:log4j-api:' +log4jVersion
runtimeOnly 'org.apache.logging.log4j:log4j-core:' + log4jVersion

//gkl and associated native bindings
implementation('com.intel.gkl:gkl:0.8.11'){
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/picard/nio/DeleteRecursive.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package picard.nio;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import htsjdk.samtools.util.Log;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
Expand All @@ -15,10 +15,10 @@
*
* <p>This class is a modification of {@link htsjdk.samtools.util.nio.DeleteOnExitPathHook}
*
* This class should be considered an implementation detail of {@link IOUtils#deleteOnExit(Path)} and not used directly.
* This class should be considered an implementation detail of {@link GATKIOUtils#deleteOnExit(Path)} and not used directly.
*/
class DeleteRecursivelyOnExitPathHook {
private static final Logger LOG = LogManager.getLogger(DeleteRecursivelyOnExitPathHook.class);
private static final Log LOG = Log.getInstance(DeleteRecursivelyOnExitPathHook.class);
private static LinkedHashSet<Path> paths = new LinkedHashSet<>();
static {
Runtime.getRuntime().addShutdownHook(new Thread(DeleteRecursivelyOnExitPathHook::runHooks));
Expand Down Expand Up @@ -60,8 +60,8 @@ static void runHooks() {
try {
GATKIOUtils.deleteRecursively(path);
} catch (final Exception e) {
// do nothing if cannot be deleted, because it is a shutdown hook
LOG.debug(() -> "Could not recursively delete " + path.toString() + " during JVM shutdown because we encountered the following exception:", e);
// do nothing if itcannot be deleted, because it is a shutdown hook
LOG.debug(e, "Could not recursively delete ", path.toString(), " during JVM shutdown because we encountered the following exception:");
}
}
}
Expand Down

0 comments on commit f5ba9b8

Please sign in to comment.