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

Bug 314433

Summary: [efs][testing] testDeleteSpecialCases runs into an NPE on Linux
Product: [Tools] Target Management Reporter: Martin Oberhuber <mober.at+eclipse>
Component: RSEAssignee: Martin Oberhuber <mober.at+eclipse>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: dmcknigh
Version: 3.2Flags: dmcknigh: review+
Target Milestone: 3.2 RC3   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 314496    
Bug Blocks: 247908, 314439    
Attachments:
Description Flags
patch v1
none
patch v2 none

Description Martin Oberhuber CLA 2010-05-26 07:15:37 EDT
Build ID: TM 3.2rc2 on Linux-GTK-RHEL-4

RSEFileStoreTest#testDeleteSpecialCases() runs into an NPE in line 178, because RSEFileStore#openOutputStream() violates the API contract by returning null.
Comment 1 Martin Oberhuber CLA 2010-05-26 07:29:24 EDT
Created attachment 169969 [details]
patch v1

Patch fixing the issue.

The problem was, that for a broken symbolic link, "exists()" is false, but neither "isFile()" nor "isDirectory()" is true. As a result, the EFS code ran into a case where it returned null (marked by a TODO comment).

Correct behavior is throwing an error if the output stream is opened on a folder, but try creating the stream in all other cases. Also, never return null but throw a "cannot write" core exception in unexpected cases.
Comment 2 Martin Oberhuber CLA 2010-05-26 07:30:02 EDT
Dave can you review this please? I want to get rid of known unittest errors for the TM 3.2 release.
Comment 3 David McKnight CLA 2010-05-26 10:44:46 EDT
(In reply to comment #2)
> Dave can you review this please? I want to get rid of known unittest errors for
> the TM 3.2 release.

I'm hitting a conflict when I try to apply the patch with the latest from HEAD.
Comment 4 Martin Oberhuber CLA 2010-05-26 14:42:11 EDT
Created attachment 170069 [details]
patch v2

Updated patch - this time it should apply cleanly.
Please review, thanks!
Comment 5 Martin Oberhuber CLA 2010-05-26 16:04:58 EDT
Released > I20100526 - thanks for the review.