Bug 363463 - On Win7 UnifiedTree#isRecursiveLink() returns false, even if there is a loop
Summary: On Win7 UnifiedTree#isRecursiveLink() returns false, even if there is a loop
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.6 M2   Edit
Assignee: Sergey Prigogin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 472553
Blocks: 340834
  Show dependency tree
 
Reported: 2011-11-10 08:53 EST by Szymon Brandys CLA
Modified: 2015-08-23 15:23 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Brandys CLA 2011-11-10 08:53:02 EST
Szymon P. in Bug 340834, comment 1 said: "I have compared the execution of the test on Win7 and on Linux and it turned out that the test fails on Win7 because java.io.File#getCanonicalPath() does not resolve symbolic links on Win7. See http://download.oracle.com/javase/6/docs/api/java/io/File.html#getCanonicalPath(). This is why UnifiedTree#isRecursiveLink() keeps returning "false" on Win7 while at the same time on Linux it returns "true" (the loop is correctly discovered)."

Szymon P., could you check what the Java plan is to support Win7 symlink correctly?
Comment 1 Szymon Ptaszkiewicz CLA 2014-04-28 07:33:33 EDT
(In reply to Szymon Brandys from comment #0)
> Szymon P., could you check what the Java plan is to support Win7 symlink
> correctly?

Java supports symbolic links resolution on Windows 7 since Java 7 by introducing new API to handle following or not symbolic links. See for example the implementation of org.eclipse.core.internal.filesystem.java7.DosHandler and the way it uses the LinkOption.NOFOLLOW_LINKS option.
Comment 2 Martin Oberhuber CLA 2014-04-28 10:26:11 EDT
Java 7 Files#toRealPath() might work resolving the issue.
http://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#toRealPath-java.nio.file.LinkOption...-
Comment 3 Eclipse Genie CLA 2015-08-23 14:53:05 EDT
New Gerrit change created: https://git.eclipse.org/r/54365
Comment 5 Sergey Prigogin CLA 2015-08-23 15:23:20 EDT
.