diff options
author | Eike Stepper | 2010-06-05 06:17:01 +0000 |
---|---|---|
committer | Eike Stepper | 2010-06-05 06:17:01 +0000 |
commit | 9963b697f6166d6dca96d2f96af6b55a12a4dc01 (patch) | |
tree | 9e35e3bbaeef5563fee066df8c8a9c35f775b660 /plugins/org.eclipse.emf.cdo/src/org/eclipse/emf | |
parent | 211cbfa3cae25f0e4220c605272deadf4f6e84ad (diff) | |
download | cdo-9963b697f6166d6dca96d2f96af6b55a12a4dc01.tar.gz cdo-9963b697f6166d6dca96d2f96af6b55a12a4dc01.tar.xz cdo-9963b697f6166d6dca96d2f96af6b55a12a4dc01.zip |
better exception message
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse/emf')
4 files changed, 32 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/ObjectNotFoundException.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/ObjectNotFoundException.java index 1f48656a0e..157465c988 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/ObjectNotFoundException.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/ObjectNotFoundException.java @@ -11,7 +11,9 @@ */ package org.eclipse.emf.cdo.util; +import org.eclipse.emf.cdo.common.branch.CDOBranchPoint; import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.util.CDOCommonUtil; import org.eclipse.emf.cdo.common.util.CDOException; import org.eclipse.emf.internal.cdo.messages.Messages; @@ -28,12 +30,25 @@ public class ObjectNotFoundException extends CDOException { private static final long serialVersionUID = 1L; - private final CDOID id; + private CDOID id; + + private CDOBranchPoint branchPoint; public ObjectNotFoundException(CDOID id) { - super(MessageFormat.format(Messages.getString("ObjectNotFoundException.0"), id, id.isTemporary())); //$NON-NLS-1$ + super(MessageFormat.format(Messages.getString("ObjectNotFoundException.0"), id)); //$NON-NLS-1$ + this.id = id; + } + + /** + * @since 3.0 + */ + public ObjectNotFoundException(CDOID id, CDOBranchPoint branchPoint) + { + super(MessageFormat.format(Messages.getString("ObjectNotFoundException.1"), //$NON-NLS-1$ + id, branchPoint.getBranch().getID(), CDOCommonUtil.formatTimeStamp(branchPoint.getTimeStamp()))); this.id = id; + this.branchPoint = branchPoint; } /** @@ -43,4 +58,12 @@ public class ObjectNotFoundException extends CDOException { return id; } + + /** + * @since 3.0 + */ + public CDOBranchPoint getBranchPoint() + { + return branchPoint; + } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties index 575d416435..c708e83a55 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties @@ -82,9 +82,10 @@ FSMUtil.1=object == null FSMUtil.2=view == null FSMUtil.3=Legacy models not supported FSMUtil.4=Use CDOFactory to create dynamic object: -InvalidObjectException.0=Object {0} is not valid in branch {1} at {2} +ObjectNotFoundException.0=Object {0} not found +ObjectNotFoundException.1=Object {0} not found in branch {1} at {2} +InvalidObjectException.0=Object {0} not valid in branch {1} at {2} InvalidURIException.0=Invalid URI "{0}": {1} -ObjectNotFoundException.0=Object {0} not found (temporary = {1}) OpenSessionRequest.0=Repository {0} not found OpenSessionRequest.3=Failed to open session for repository {0} -SyncRevisionsRequest.2=Did not expect to receive object with id "{0}" +SyncRevisionsRequest.2=Did not expect to receive object with id {0} diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java index 04b52447f7..089411485f 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java @@ -859,7 +859,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa if (id.isTemporary() && isDetached(id)) { - throw new ObjectNotFoundException(id); + throw new ObjectNotFoundException(id, this); } return super.getObject(id, loadOnDemand); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java index 7bd123e900..c02e9c4c03 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java @@ -914,7 +914,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView { if (id.isTemporary()) { - throw new ObjectNotFoundException(id); + throw new ObjectNotFoundException(id, this); } localLookupObject = createObject(id); @@ -1026,7 +1026,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView InternalCDORevision revision = getRevision(id, true); if (revision == null) { - throw new ObjectNotFoundException(id); + throw new ObjectNotFoundException(id, this); } EClass eClass = revision.getEClass(); |