Skip to content

Commit 2815608

Browse files
committed
Set the original cause of the IOException for the tryLock call
1 parent 83dc1b4 commit 2815608

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/Locker_JavaNio.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
*******************************************************************************/
1616
package org.eclipse.osgi.internal.location;
1717

18-
import java.io.*;
18+
import java.io.File;
19+
import java.io.FileNotFoundException;
20+
import java.io.IOException;
21+
import java.io.RandomAccessFile;
1922
import java.nio.channels.FileLock;
2023
import java.nio.channels.OverlappingFileLockException;
2124
import org.eclipse.osgi.internal.messages.Msg;
@@ -50,7 +53,7 @@ public synchronized boolean lock() throws IOException {
5053
System.out.println(NLS.bind(Msg.location_cannotLock, lockFile));
5154
// produce a more specific message for clients
5255
String specificMessage = NLS.bind(Msg.location_cannotLockNIO, new Object[] {lockFile, ioe.getMessage(), "\"-D" + LocationHelper.PROP_OSGI_LOCKING + "=none\""}); //$NON-NLS-1$ //$NON-NLS-2$
53-
throw new IOException(specificMessage);
56+
throw new IOException(specificMessage, ioe);
5457
} catch (OverlappingFileLockException e) {
5558
// handle it as null result
5659
fileLock = null;

0 commit comments

Comments
 (0)