Browse Source

Handle InternalError during symlink support detection on Windows

When JGit tries to detect symlink support the attempt to create a
symlink may fail with a java.lang.InternalError. This was reported for a
case where the application using JGit runs in Windows XP compatibility
mode using Oracle JDK 1.8. Handle this by assuming symlinks are not
supported in this case.

Bug: 471027
Change-Id: I978288754dea0c6fffd3457fad7d4d971e27c6c2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.3
Matthias Sohn 9 years ago
parent
commit
4acff5a59e
  1. 3
      org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java

3
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java

@ -171,7 +171,8 @@ public class FS_Win32 extends FS {
createSymLink(linkName, tempFile.getPath()); createSymLink(linkName, tempFile.getPath());
supportSymlinks = Boolean.TRUE; supportSymlinks = Boolean.TRUE;
linkName.delete(); linkName.delete();
} catch (IOException | UnsupportedOperationException e) { } catch (IOException | UnsupportedOperationException
| InternalError e) {
supportSymlinks = Boolean.FALSE; supportSymlinks = Boolean.FALSE;
} finally { } finally {
if (tempFile != null) if (tempFile != null)

Loading…
Cancel
Save