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

Bug 172355

Summary: Eclipse does not support resources whose paths resolve to external forms that exceed 255 characters
Product: [Eclipse Project] Platform Reporter: John O'Shea <john.oshea>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: critical    
Priority: P3 CC: jtouati
Version: 3.2.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Junit Test Plugin illustrating the failing code. none

Description John O'Shea CLA 2007-01-31 13:58:24 EST
Build ID: M20060921-0945

Steps To Reproduce:
1. Import attached plugin project.
2. Run com.capeclear.efs.test.ResourceExistsTest test suite (as Junit Plugin Tests)
3. Observe that testStupidlyLongResourceName fails.


More information:
The problem appears to be in the EFS LocalFile FileStore implementation.  It appears that for resources with external form paths that exceed 255 characters the local IFileStore implementation creates a IFileInfo object that does not have the EXISTS attribute set correctly.

Setting a breakpoint at 
Thread [main] (Suspended (breakpoint at line 595 in org.eclipse.core.internal.localstore.FileSystemResourceManager))	
	org.eclipse.core.internal.localstore.FileSystemResourceManager.read(org.eclipse.core.resources.IFile, boolean, org.eclipse.core.runtime.IProgressMonitor) line: 595	
	org.eclipse.core.internal.resources.File.getContents(boolean) line: 290	
	org.eclipse.core.internal.resources.File.getContents() line: 279	
	com.capeclear.efs.test.ResourceExistsTest.tryCreateAndReadNewResourceInFolder(org.eclipse.core.resources.IFolder) line: 69	
	com.capeclear.efs.test.ResourceExistsTest.testReasonablyLongResourceName() line: 36

will allow you to observe that fileInfo.exists() returns false for the resource whose contents are being retrieved by this test.

I'm not sure if you are going to be able to resolve this as I think the 255 limit is imposed by Windows (NTFS)?  

Regardless, the error message currently returned by is very misleading.  The ResourceException subsequently thrown states that the project does not exist (when it does).  This is a side effect of exists() incorrectly returning false.

junit.framework.AssertionFailedError: Resource /testProject-1170269685802 does not exist.
	at junit.framework.Assert.fail(Assert.java:47)
	at com.capeclear.efs.test.ResourceExistsTest.tryCreateAndReadNewResourceInFolder(ResourceExistsTest.java:75)
	at com.capeclear.efs.test.ResourceExistsTest.testStupidlyLongResourceName(ResourceExistsTest.java:44)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58)
	at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 1 John O'Shea CLA 2007-01-31 14:00:16 EST
Created attachment 57930 [details]
Junit Test Plugin illustrating the failing code.
Comment 2 John Arthorne CLA 2007-01-31 15:10:38 EST
Fixed in 3.3 stream.  Note that Java 5 is also required for this to really work, since Java prior to version 5 did not make the unicode calls required to support paths with length > 260 characters.

*** This bug has been marked as a duplicate of bug 30995 ***
Comment 3 Jamel Touati CLA 2008-09-22 16:29:42 EDT
It is still possible to reproduce the issue in IES 3.4. Could you please verify this and triage this bugzilla, since we have a customer defect dependant on it and we need to plan in which release the fix will go. Thanks