Bug 198091 - [LinkedResources] Error logged when opening Properties dlg on a Linked Resource folder involving a path variable
Summary: [LinkedResources] Error logged when opening Properties dlg on a Linked Resour...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4.1   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 180363
Blocks: 182722 251995
  Show dependency tree
 
Reported: 2007-07-27 07:53 EDT by Martin Oberhuber CLA
Modified: 2008-10-24 09:03 EDT (History)
4 users (show)

See Also:
john.arthorne: review+


Attachments
Proposed change to fix 198091 (1.16 KB, patch)
2008-06-09 08:09 EDT, David Black CLA
bokowski: iplog+
Details | Diff
patch with local variables to avoid unnecessary calls (1.88 KB, patch)
2008-08-26 17:31 EDT, Boris Bokowski CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2007-07-27 07:53:37 EDT
Eclipse 3.3 on WinXP / Sun 1.6.0_01

Steps To Reproduce:
1.In physical file system, create C:\foo\bar\baz
2.Define a Path Variable: 
  Window > Preferences > General > Workspace > Linked Resources
  Add: "WIND_HOME" -> C:\foo
3.Create a new simple project in empty workspace:
  File > New > Project, (General:Project), name=fooproj
4. Create a linked resource folder in the new project
  File > New > Folder, Advanced:Link, Variables:select WIND_HOME, Extend ->
  drill down till you get the Link WIND_HOME/bar

Project Explorer expands contents below the linked resource properly.
Right-click on the linked resource folder bar > Properties
--> Error log shows two entries: 
    "Must specify a URI scheme:WIND_HOME/bar" (org.eclipse.core.filesystem)
    "Must specify a URI scheme:WIND_HOME/bar" (org.eclipse.ui.ide)

More information:
In spite of the errors logged, everything else seems to work as expected, so I'm marking this issue as minor.

We have seen the very same issue before and logged it as bug 180363 comment 1 which was originally about creating linked resources with variables. After fixing that issue, links can now be created with variables but the error still occurs when looking at properties of the resource.

The same errors are logged in Eclipse 3.2.1, but we do not see them in  
Eclipse 3.1.2 so we think it's a regression introduced by EFS.

Bug 182722 also seems similar, but this one is easier to reproduce and has
           fewer dependencies (no JDT involved).
Bug 151965 is similar for deleted resources while here the resource exists.

The contents of the .project file looks like this:
<linkedResources>
	<link>
		<name>bar</name>
		<type>2</type>
		<locationURI>WIND_HOME/bar</locationURI>
	</link>
</linkedResources>
Comment 1 David Black CLA 2008-06-09 08:08:20 EDT
I'm encountering this issue and it is serious enough from my perspective because it generates a lot of noisy errors in the error log. Attaching a patch for this issue for consideration. From what I can see the problem will not be easily fixed in the EFS itself. The patch I'm suggesting is in org.eclipse.ui.internal.ide.dialogs.IDEResourceInfoUtils in the getLocationText() method. Firstly, the call to getFileStore(<URI>) will always fail if a PATH variable is being used, so the resolved location should be passed to it instead. Secondly, if the resource is linked and is specified with a PATH variable, then the raw location should be used for the location text. The patch is created against the org.eclipse.ui.ide_3.3.1.M20070910-0800b tagged revision of this class.
Comment 2 David Black CLA 2008-06-09 08:09:18 EDT
Created attachment 104142 [details]
Proposed change to fix 198091
Comment 3 Boris Bokowski CLA 2008-06-09 08:17:47 EDT
consider for 3.4.1
Comment 4 Boris Bokowski CLA 2008-08-25 23:04:12 EDT
John, +1 for 3.4.1, or do you see any risk in this change?
Comment 5 John Arthorne CLA 2008-08-26 16:41:10 EDT
+1, this is low risk enough. However the attached patch is not efficient. It could be fixed without any additional method calls because all the information is already computed above.
Comment 6 Boris Bokowski CLA 2008-08-26 17:31:22 EDT
Created attachment 111008 [details]
patch with local variables to avoid unnecessary calls

This is the patch I am going to commit.
Comment 7 Boris Bokowski CLA 2008-08-26 17:32:40 EDT
Released to R3_4_maintenance. Thanks for the patch, David!