Community
Participate
Working Groups
This exception caused by a race condition can occur during Servlet creation !ENTRY org.eclipse.wst.common.frameworks 4 0 2010-05-03 16:07:30.859 !MESSAGE Extended Operation failure: org.eclipse.jst.j2ee.internal.web.operations.AddServletOperation !STACK 0 java.lang.NullPointerException at org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit.modify(WebArtifactEdit.java:693) at com.ibm.etools.javaee.model.internal.Web25ModelProvider.modify(Web25ModelProvider.java:293) at org.eclipse.jst.j2ee.internal.common.operations.AddJavaEEArtifactOperation.execute(AddJavaEEArtifactOperation.java:53) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl$1.run(DataModelPausibleOperationImpl.java:385) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:410) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:360) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.doExecute(DataModelPausibleOperationImpl.java:247) Although related fixes have made this condition unlikely, a null check is needed
Created attachment 168265 [details] patch
I approve of this change.
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. A rare race condition can lead to NPEs and blow up the stack. * Is there a work-around? If so, why do you believe the work-around is insufficient? No * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? Testing with UI * Give a brief technical overview. Who has reviewed this fix? The race condition can be avoided with a simple null check. Carl and Jason have reviewed this fix. * What is the risk associated with this fix? None.
I'm not sure its correct to say "The race condition can be avoided ..." by a null check, but I agree, null checks should always be done in finally blocks before dispose.
Committed to HEAD for WTP 3.2 RC1