Skip to content

Commit

Permalink
Fix initialize() failing to set isClassInitialized = true (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Dolski committed Oct 4, 2017
1 parent 1bab1b0 commit 4763533
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,22 @@ private static String getPath(String binaryName) {
}

private static synchronized void initialize() throws IOException {
// Due to a quirk of kdu_expand, this processor requires access to
// /dev/stdout.
final Path devStdout = Paths.get("/dev/stdout");
if (Files.exists(devStdout) && Files.isWritable(devStdout)) {
// Due to another quirk of kdu_expand, we need to create a symlink
// from {temp path}/stdout.tif to /dev/stdout, to tell kdu_expand
// what format to write.
stdoutSymlink = createStdoutSymlink();
} else {
LOGGER.error("Sorry, but " + KakaduProcessor.class.getSimpleName() +
" won't work on this platform as it requires access to " +
"/dev/stdout.");
try {
// Due to a quirk of kdu_expand, this processor requires access to
// /dev/stdout.
final Path devStdout = Paths.get("/dev/stdout");
if (Files.exists(devStdout) && Files.isWritable(devStdout)) {
// Due to another quirk of kdu_expand, we need to create a symlink
// from {temp path}/stdout.tif to /dev/stdout, to tell kdu_expand
// what format to write.
stdoutSymlink = createStdoutSymlink();
} else {
LOGGER.error("Sorry, but " + KakaduProcessor.class.getSimpleName() +
" won't work on this platform as it requires access to " +
"/dev/stdout.");
}
} finally {
isClassInitialized.set(true);
}
}

Expand Down

0 comments on commit 4763533

Please sign in to comment.