Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363463

Summary: On Win7 UnifiedTree#isRecursiveLink() returns false, even if there is a loop
Product: [Eclipse Project] Platform Reporter: Szymon Brandys <Szymon.Brandys>
Component: ResourcesAssignee: Sergey Prigogin <eclipse.sprigogin>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.sprigogin, mober.at+eclipse, sptaszkiewicz
Version: 3.7   
Target Milestone: 4.6 M2   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/54365
https://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=ae67854e69a5ccdc12ea04f5244513ef47dcbb0e
Whiteboard:
Bug Depends on: 472553    
Bug Blocks: 340834    

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
.