Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322754 - NullPointerException after deleting a resource
Summary: NullPointerException after deleting a resource
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-16 04:00 EDT by Johan Linde CLA
Modified: 2012-09-21 06:51 EDT (History)
1 user (show)

See Also:


Attachments
Test v1 - for future reference (3.93 KB, patch)
2010-08-16 08:04 EDT, Eike Stepper CLA
no flags Details | Diff
Fix (4.20 KB, patch)
2010-10-30 04:35 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Linde CLA 2010-08-16 04:00:41 EDT
When trying to upgrade to CDO 3, I have run into a NullPointerException after deleting a resource (stack trace below). The delete is done by

resource.delete(null);

When commiting this change I get the exception. The variable "view" is null when the exception occurs. 

This exception never happened with CDO 2.

 java.lang.NullPointerException
	at org.eclipse.emf.internal.cdo.util.FSMUtil.adapt(FSMUtil.java:108)
	at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.getURIFragment(CDOResourceImpl.java:557)
	at org.eclipse.emf.ecore.util.EcoreUtil.getURI(EcoreUtil.java:2901)
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.provideCDOID(CDOViewImpl.java:1196)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.provideCDOID(CDOTransactionImpl.java:1788)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDOSingleValueFeatureDeltaImpl.writeValue(CDOSingleValueFeatureDeltaImpl.java:86)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDOSingleValueFeatureDeltaImpl.write(CDOSingleValueFeatureDeltaImpl.java:62)
	at org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputImpl.writeCDOFeatureDelta(CDODataOutputImpl.java:385)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl.write(CDORevisionDeltaImpl.java:158)
	at org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputImpl.writeCDORevisionDelta(CDODataOutputImpl.java:380)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requestingCommit(CommitTransactionRequest.java:190)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:141)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:116)
	at org.eclipse.net4j.signal.RequestWithMonitoring.requesting(RequestWithMonitoring.java:163)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedOutput(RequestWithConfirmation.java:117)
	at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:102)
	at org.eclipse.net4j.signal.RequestWithMonitoring.doExecute(RequestWithMonitoring.java:233)
	at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:66)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:240)
	at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:462)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:87)
	at org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:73)
	at org.eclipse.net4j.signal.RequestWithMonitoring.send(RequestWithMonitoring.java:108)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:375)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.commitTransaction(CDOClientProtocol.java:258)
	at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:73)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:906)
Comment 1 Eike Stepper CLA 2010-08-16 08:04:54 EDT
Created attachment 176668 [details]
Test v1 - for future reference

The test passes!
Comment 2 Eike Stepper CLA 2010-08-16 08:06:03 EDT
Test v1 committed to R3_0_maintenance
Comment 3 Eike Stepper CLA 2010-10-30 04:35:12 EDT
Created attachment 182098 [details]
Fix

Please see bug 322779 for explanations...
Comment 4 Eike Stepper CLA 2010-10-30 04:35:47 EDT
Committed to R3_0_maintenance.

Please see bug 322779 for explanations...
Comment 5 Eike Stepper CLA 2011-06-23 04:27:15 EDT
Moving all open problem reports to 4.0
Comment 6 Eike Stepper CLA 2012-09-21 06:37:13 EDT
Undoing accidental version change.
Comment 7 Eike Stepper CLA 2012-09-21 06:51:51 EDT
Closing.