Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 213640 - NPE when initial project is null
Summary: NPE when initial project is null
Status: CLOSED FIXED
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: jst.ws (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Kathy Chan CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-20 15:46 EST by Kathy Chan CLA
Modified: 2007-12-21 15:31 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kathy Chan CLA 2007-12-20 15:46:40 EST
Driver:  WTP 3.0 12/20 driver

When a user does not choose an initial project, creating a top-down Web service result in an NPE:

IWAB0014E Unexpected exception occurred.
  
      java.lang.NullPointerException
      at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectFrameworkImpl.create(FacetedProjectFrameworkImpl.java:659)
      at org.eclipse.wst.common.project.facet.core.ProjectFacetsManager.create(ProjectFacetsManager.java:344)
      at org.eclipse.jst.ws.internal.consumption.common.FacetUtils.isJavaProject(FacetUtils.java:1357)
      at org.eclipse.jst.ws.internal.creation.ui.extension.PreServiceDevelopCommand.execute(PreServiceDevelopCommand.java:180)
      at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(CommandFragmentEngine.java:419)

This problem also always shows up when running the Web service Ant scenario as well.
Comment 1 Kathy Chan CLA 2007-12-20 15:56:47 EST
This bug was introduced when fixing bug 200193.  A check for initialProject equals null has been added to PreServiceDevelopCommand and PreServiceAssembleCommand.

The fix has been committed and released to HEAD as v200712202051.
Comment 2 David Williams CLA 2007-12-20 19:03:14 EST
would it make sense if instead of requiring the caller to check for null before calling, to just return false immediately, if the argument was null? 

Just wondering. 

Comment 3 Kathy Chan CLA 2007-12-21 15:31:46 EST
Verified by Kelvin on 12/21 WTP 3.0 driver.

Bug 213730 has been opened to have FacetUtils.isJavaProject() properly guard against null input parameter.