Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336545 - NPE when parsing the file content that is located in different file system
Summary: NPE when parsing the file content that is located in different file system
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: Faceted Project Framework (show other bugs)
Version: 3.2.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact: Konstantin Komissarchik CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-07 12:40 EST by Alex Smirnoff CLA
Modified: 2011-03-16 23:33 EDT (History)
1 user (show)

See Also:


Attachments
Patch that fixes NPE (2.17 KB, text/plain)
2011-02-07 12:40 EST, Alex Smirnoff CLA
no flags Details
Added new patch without getLocationURI (2.07 KB, patch)
2011-02-07 14:47 EST, Alex Smirnoff CLA
no flags Details | Diff
Patch v3 (2.27 KB, patch)
2011-03-16 23:30 EDT, Konstantin Komissarchik CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.