Skip to content

Commit

Permalink
minor: changed log level from severe to warning when permissions are …
Browse files Browse the repository at this point in the history
…missing on disabling close of channel upon Interruption
  • Loading branch information
lvca committed Oct 20, 2024
1 parent b73ae4d commit 4be4860
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ protected void open(final String filePath, final MODE mode) throws FileNotFoundE

private void doNotCloseOnInterrupt(final FileChannel fc) {
try {
Field field = AbstractInterruptibleChannel.class.getDeclaredField("interruptor");
Class<?> interruptibleClass = field.getType();
final Field field = AbstractInterruptibleChannel.class.getDeclaredField("interruptor");
final Class<?> interruptibleClass = field.getType();
field.setAccessible(true);
field.set(fc, Proxy.newProxyInstance(
interruptibleClass.getClassLoader(),
new Class[] { interruptibleClass },
new InterruptibleInvocationHandler()));
} catch (final Exception e) {
LogManager.instance().log(this, Level.SEVERE, "Couldn't disable close on interrupt", e);
LogManager.instance().log(this, Level.WARNING, "Unable to disable channel close on interrupt: %s", e.getMessage());
}
}
}

0 comments on commit 4be4860

Please sign in to comment.