updates to ensure backward compatability with 1.6

Former-commit-id: be26000c68fbdc88c6c500db76b760e4d948885a
This commit is contained in:
Jeremy Long
2013-08-24 17:01:39 -04:00
parent e33b5c36ff
commit c7b5620409

View File

@@ -40,7 +40,7 @@ import java.util.logging.Logger;
* *
* @author Jeremy Long (jeremy.long@owasp.org) * @author Jeremy Long (jeremy.long@owasp.org)
*/ */
public class DirectorySpinLock implements Closeable, AutoCloseable { public class DirectorySpinLock implements Closeable /*, AutoCloseable*/ {
/** /**
* The name of the lock file. * The name of the lock file.
@@ -224,13 +224,14 @@ public class DirectorySpinLock implements Closeable, AutoCloseable {
@Override @Override
public void close() throws IOException { public void close() throws IOException {
release(); release();
if (lock != null) { // TODO uncomment this once support for 1.6 is dropped.
try { // if (lock != null) {
lock.close(); // try {
} catch (IOException ex) { // lock.close();
Logger.getLogger(DirectorySpinLock.class.getName()).log(Level.FINEST, "Unable to close file lock due to IO Exception", ex); // } catch (IOException ex) {
} // Logger.getLogger(DirectorySpinLock.class.getName()).log(Level.FINEST, "Unable to close file lock due to IO Exception", ex);
} // }
// }
if (channel != null) { if (channel != null) {
try { try {
channel.close(); channel.close();