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

Bug 297478

Summary: IFile#create(..) and IFolder#create(..) fail if parent is a virtual folder
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: ResourcesAssignee: Szymon Brandys <Szymon.Brandys>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, john.arthorne
Version: 3.6   
Target Milestone: 3.6 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix v01 none

Description Markus Keller CLA 2009-12-10 09:07:55 EST
I20091209-1800

IFile#create(..) and IFolder#create(..) now fail if the parent is a virtual folder. This is a breaking change for clients such as New wizards (e.g. bug 297442). This new case should be added to the reasons for throwing a CoreException.

Please add this to the porting guide and then announce the change to the cross-projects so that consumers know that they have to adapt.

Maybe coordinate with bug 297188.
Comment 1 Szymon Brandys CLA 2009-12-10 09:23:19 EST
I will handle it. The javadoc should be updated.

I don't understand why this is a breaking change? Clients of this API should catch CoreException and creating a resource inside of Virtual Folders is yet another reason of throwing one.
Comment 2 Markus Keller CLA 2009-12-10 09:53:46 EST
> I don't understand why this is a breaking change? Clients of this API should
> catch CoreException and creating a resource inside of Virtual Folders is yet
> another reason of throwing one.

For UI clients, it is a breaking change. UIs usually try to spare users from low-level error conditions. Therefore, they have special code that detects known problems before they happen and tell the user upfront that the operation will not work (e.g. with an error message in the wizard title area).

This is a new reason that didn't exist before, and UIs should adapt and support this case explicitly (rather than failing and writing to the log).
Comment 3 Szymon Brandys CLA 2010-01-22 07:03:25 EST
Created attachment 156919 [details]
Fix v01
Comment 4 Szymon Brandys CLA 2010-01-22 07:07:10 EST
Markus, how do you like the porting guide update?
Comment 5 Szymon Brandys CLA 2010-01-22 08:26:06 EST
The fix is in HEAD.
Comment 6 Markus Keller CLA 2010-01-22 08:33:44 EST
> Markus, how do you like the porting guide update?

Thanks, that looks good. But you should add a comma after "In particular". Even if some grammar schools may not see this as an absolute requirement, it makes the beginning of the sentence unambiguously understandable without backtracking.
Comment 7 Szymon Brandys CLA 2010-01-22 08:41:49 EST
(In reply to comment #6)
> But you should add a comma after "In particular". 
Done. Thanks Markus.