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

Bug 336545

Summary: NPE when parsing the file content that is located in different file system
Product: [WebTools] WTP Common Tools Reporter: Alex Smirnoff <alexander.smirnoff>
Component: Faceted Project FrameworkAssignee: Konstantin Komissarchik <konstantin>
Status: RESOLVED FIXED QA Contact: Konstantin Komissarchik <konstantin>
Severity: normal    
Priority: P3 CC: thatnitind
Version: 3.2.2   
Target Milestone: 3.3 M7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch that fixes NPE
none
Added new patch without getLocationURI
none
Patch v3 none

Description Alex Smirnoff CLA 2011-02-07 12:40:23 EST
Created attachment 188457 [details]
Patch that fixes NPE

To reproduce the failure you have to create faceted project that is located in different file system WebDav, In-Memory, etc. See http://wiki.eclipse.org/EFS

NPE happens in FacetedProject.refresh() method in this snippet:

root = parse( this.f.getLocation().toFile() );

getLocation() return null as it specified in JavaDoc for the files located in different, lot local file systems.

Attached is proposed patch to fix that problem.
Comment 1 Nitin Dahyabhai CLA 2011-02-07 14:07:44 EST
Does it matter that f.getLocationURI() is null or not if the file is accesible and the contents readable?
Comment 2 Alex Smirnoff CLA 2011-02-07 14:41:04 EST
I added it as a safeguard. It does not matter actually.
Comment 3 Alex Smirnoff CLA 2011-02-07 14:47:02 EST
Created attachment 188468 [details]
Added new patch without getLocationURI

Added new patch without getLocationURI
Comment 4 Konstantin Komissarchik CLA 2011-03-10 14:11:59 EST
Not major as this isn't an issue during normal use of WTP.
Comment 5 Konstantin Komissarchik CLA 2011-03-16 23:30:50 EDT
Created attachment 191370 [details]
Patch v3

A bit of cleanup to previous patch.
Comment 6 Konstantin Komissarchik CLA 2011-03-16 23:33:21 EDT
Fix released into 3.3 M7 stream.