Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357889 - NPE when using publishSmart and ignore
Summary: NPE when using publishSmart and ignore
Status: NEW
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: wst.server CLA
QA Contact: Elson Yuen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-15 17:45 EDT by Rajeev Dayal CLA
Modified: 2011-09-15 17:45 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rajeev Dayal CLA 2011-09-15 17:45:15 EDT
Build Identifier:  20110615-0604

When using ignore paths with publishSmart, an NPE can occur if any of the ignored paths have subdirectories. 

Take a look at lines 349-370:

http://dev.eclipse.org/viewcvs/viewvc.cgi/servertools/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PublishHelper.java?view=markup&revision=1.9&root=WebTools_Project

If you have an ignore path (suppose WEB-INF/foo), and a subdirectory of WEB-INF/foo exists on disk (such as WEB-INF/foo/bar), then, at the point in the recursion where WEB-INF is being processed as the path, and the ignore list is "foo", an empty element is going to be added to ignoreChildPaths at line 360. 

In the following recursive call, the path to be processed will be WEB-INF/foo, and the ignore list will be an array of 1 element, containing an empty path. At line 359, there will be an NPE, because preservePath.segment(0) will be null.




Reproducible: Always