diff options
author | mkuppe | 2008-12-16 09:18:38 +0000 |
---|---|---|
committer | mkuppe | 2008-12-16 09:18:38 +0000 |
commit | 146a359d0c0acb288752949ad3066cd460089ed9 (patch) | |
tree | 2cffb5cbe3b477c5f7a36760734b69ddae8eb0fb /framework/bundles/org.eclipse.ecf.identity | |
parent | 2d464170b0c9fc21cfa14493c3d5df3f4806d736 (diff) | |
download | org.eclipse.ecf-146a359d0c0acb288752949ad3066cd460089ed9.tar.gz org.eclipse.ecf-146a359d0c0acb288752949ad3066cd460089ed9.tar.xz org.eclipse.ecf-146a359d0c0acb288752949ad3066cd460089ed9.zip |
NEW - bug 254872: Convert org.eclipse.ecf.core.identity.IDCreateException into RuntimeException
https://bugs.eclipse.org/bugs/show_bug.cgi?id=254872
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.identity')
3 files changed, 81 insertions, 3 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.identity/META-INF/MANIFEST.MF index 0ed853ecc..845b133c9 100644 --- a/framework/bundles/org.eclipse.ecf.identity/META-INF/MANIFEST.MF +++ b/framework/bundles/org.eclipse.ecf.identity/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin.name Bundle-SymbolicName: org.eclipse.ecf.identity;singleton:=true -Bundle-Version: 2.1.0.qualifier +Bundle-Version: 3.0.0.qualifier Bundle-Activator: org.eclipse.ecf.internal.core.identity.Activator Bundle-Localization: plugin Bundle-Vendor: %plugin.provider diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDCreateException.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDCreateException.java index f21da14cd..0b70f22a3 100644 --- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDCreateException.java +++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDCreateException.java @@ -9,9 +9,9 @@ package org.eclipse.ecf.core.identity; import org.eclipse.core.runtime.IStatus; -import org.eclipse.ecf.core.util.ECFException; +import org.eclipse.ecf.core.util.ECFRuntimeException; -public class IDCreateException extends ECFException { +public class IDCreateException extends ECFRuntimeException { private static final long serialVersionUID = 3258416140119323960L; public IDCreateException() { diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFRuntimeException.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFRuntimeException.java new file mode 100644 index 000000000..0233efbe5 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFRuntimeException.java @@ -0,0 +1,78 @@ +/******************************************************************************* + * Copyright (c) 2008 Versant Corp. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation + ******************************************************************************/ + +package org.eclipse.ecf.core.util; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; + +public class ECFRuntimeException extends RuntimeException { + + private static final long serialVersionUID = 456677468837349011L; + /** Status object. */ + private IStatus status; + + public ECFRuntimeException() { + super(); + } + + /** + * @param message + * message associated with exception + */ + public ECFRuntimeException(String message) { + super(message); + } + + /** + * @param cause + * the cause of the new exception + */ + public ECFRuntimeException(Throwable cause) { + super(cause); + } + + /** + * @param message + * @param cause + */ + public ECFRuntimeException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new exception with the given status object. The message + * of the given status is used as the exception message. + * + * @param status the status object to be associated with this exception + */ + public ECFRuntimeException(IStatus status) { + super(status.getMessage(), status.getException()); + this.status = status; + } + + /** + * Returns the status object for this exception. + * <p> + * <b>IMPORTANT:</b><br> + * The result must NOT be used to log a <code>CoreException</code> + * (e.g., using <code>yourPlugin.getLog().log(status);</code>), + * since that code pattern hides the original stacktrace. + * Instead, create a new {@link Status} with your plug-in ID and + * this <code>CoreException</code>, and log that new status. + * </p> + * + * @return a status object + */ + public IStatus getStatus() { + return status; + } +} |