Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314433 - [efs][testing] testDeleteSpecialCases runs into an NPE on Linux
Summary: [efs][testing] testDeleteSpecialCases runs into an NPE on Linux
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 RC3   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on: 314496
Blocks: 247908 314439
  Show dependency tree
 
Reported: 2010-05-26 07:15 EDT by Martin Oberhuber CLA
Modified: 2010-05-26 16:04 EDT (History)
1 user (show)

See Also:
dmcknigh: review+


Attachments
patch v1 (2.23 KB, patch)
2010-05-26 07:29 EDT, Martin Oberhuber CLA
no flags Details | Diff
patch v2 (2.50 KB, patch)
2010-05-26 14:42 EDT, Martin Oberhuber 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 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.