Skip to content

Commit

Permalink
Replace use of TeiidRuntimeException with TeiidDesignerRuntimeException
Browse files Browse the repository at this point in the history
* Instead of using the teiid class TeiidRuntimeException, replace all
  usage with a new TeiidDesignerRuntimeException
  • Loading branch information
Paul Richardson committed Oct 12, 2012
1 parent ecd5a0e commit 8e37695
Show file tree
Hide file tree
Showing 51 changed files with 151 additions and 105 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* JBoss, Home of Professional Open Source.
*
* See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
*
* See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
*/
package org.teiid.core.designer;

/**
* @since 8.0
*/
public class TeiidDesignerRuntimeException extends RuntimeException {

private static final long serialVersionUID = 1L;

/**
* Default Constructor
*/
public TeiidDesignerRuntimeException() {
super();
}

/**
* @param message
*/
public TeiidDesignerRuntimeException(String message) {
super(message);
}

/**
* @param cause
*/
public TeiidDesignerRuntimeException(Throwable cause) {
super(cause);
}

/**
* @param message
* @param cause
*/
public TeiidDesignerRuntimeException(String message, Throwable cause) {
super(message, cause);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
*/
package org.teiid.core.designer;

import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;


/**
* UserCancelledException
*
* @since 8.0
*/
public class UserCancelledException extends TeiidRuntimeException {
public class UserCancelledException extends TeiidDesignerRuntimeException {

/**
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.regex.Pattern;

import org.teiid.core.CorePlugin;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;

/**
* This is a common place to put String utility methods.
Expand Down Expand Up @@ -1068,7 +1068,7 @@ public static String[] getLines( final String value ) {
line = reader.readLine();
}
} catch (IOException e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
}
return (String[])result.toArray(new String[result.size()]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;

/**
* The StreamPipe class provides the ability for an information consumer to read via an
Expand Down Expand Up @@ -47,7 +47,7 @@ public StreamPipe() {
try {
this.ostream = new PipedOutputStream(istream);
} catch (IOException e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
import org.eclipse.xsd.util.XSDConstants;
import org.eclipse.xsd.util.XSDResourceImpl;
import org.teiid.core.designer.TeiidDesignerException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.designer.ModelerCoreException;
import org.teiid.core.designer.ModelerCoreRuntimeException;
import org.teiid.core.designer.id.IDGenerator;
Expand Down Expand Up @@ -5121,7 +5121,7 @@ static EObject resolveWhenProxy( EObject e ) {
if (e.eIsProxy()) {
resolvedEObject = EcoreUtil.resolve(e, getContainer());
if (resolvedEObject.eIsProxy()) {
throw new TeiidRuntimeException(
throw new TeiidDesignerRuntimeException(
ModelerCore.Util.getString("ModelEditorImpl.Error_EObject_can_not_be_a_proxy", resolvedEObject.toString())); //$NON-NLS-1$
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EPackage;
import org.osgi.framework.Bundle;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.designer.util.CoreArgCheck;
import org.teiid.core.designer.util.CoreStringUtil;
import org.teiid.designer.core.ModelInitializer;
Expand Down Expand Up @@ -555,7 +555,7 @@ protected EPackage getPackageForURI(final String uriString) {
Field field = javaClass.getField("eINSTANCE"); //$NON-NLS-1$
ePackage = (EPackage)field.get(null);
} catch (Exception e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
}
} else {
try {
Expand All @@ -565,7 +565,7 @@ protected EPackage getPackageForURI(final String uriString) {
ePackage = (EPackage)field.get(null);
}
} catch (Exception e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.designer.util.CoreArgCheck;
import org.teiid.designer.core.ModelerCore;
import org.teiid.designer.core.metamodel.aspect.MetamodelEntity;
Expand Down Expand Up @@ -198,7 +198,7 @@ public String getSignature(Object eObject, int showMask) {
//Properties
return (""); //$NON-NLS-1$
default :
throw new TeiidRuntimeException(ModelerCore.Util.getString("XAttributeUmlAspect.Invalid_showMask_for_getSignature") + showMask ); //$NON-NLS-1$
throw new TeiidDesignerRuntimeException(ModelerCore.Util.getString("XAttributeUmlAspect.Invalid_showMask_for_getSignature") + showMask ); //$NON-NLS-1$
}
return result.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.designer.util.CoreArgCheck;
import org.teiid.designer.core.ModelerCore;
import org.teiid.designer.core.metamodel.aspect.MetamodelEntity;
Expand Down Expand Up @@ -104,7 +104,7 @@ public String getSignature(Object eObject, int showMask) {
result.append(xclass.getName() );
break;
default :
throw new TeiidRuntimeException(ModelerCore.Util.getString("XClassUmlAspect.Invalid_showMask_for_getSignature") + showMask ); //$NON-NLS-1$
throw new TeiidDesignerRuntimeException(ModelerCore.Util.getString("XClassUmlAspect.Invalid_showMask_for_getSignature") + showMask ); //$NON-NLS-1$
}
return result.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.designer.util.CoreArgCheck;
import org.teiid.designer.core.ModelerCore;
import org.teiid.designer.core.metamodel.aspect.MetamodelEntity;
Expand Down Expand Up @@ -168,7 +168,7 @@ public String getSignature(Object eObject, int showMask) {
//Properties
return (""); //$NON-NLS-1$
default :
throw new TeiidRuntimeException(ModelerCore.Util.getString("XEnumLiteralUmlAspect.Invalid_showMask_for_getSignature") + showMask ); //$NON-NLS-1$
throw new TeiidDesignerRuntimeException(ModelerCore.Util.getString("XEnumLiteralUmlAspect.Invalid_showMask_for_getSignature") + showMask ); //$NON-NLS-1$
}
return result.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.Collection;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.designer.util.CoreArgCheck;
import org.teiid.designer.core.ModelerCore;
import org.teiid.designer.core.metamodel.aspect.MetamodelEntity;
Expand Down Expand Up @@ -95,7 +95,7 @@ public String getSignature(Object eObject, int showMask) {
result.append(xenum.getName() );
break;
default :
throw new TeiidRuntimeException(ModelerCore.Util.getString("XEnumUmlAspect.Invalid_showMask_for_getSignature") + showMask ); //$NON-NLS-1$
throw new TeiidDesignerRuntimeException(ModelerCore.Util.getString("XEnumUmlAspect.Invalid_showMask_for_getSignature") + showMask ); //$NON-NLS-1$
}
return result.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.designer.util.CoreArgCheck;
import org.teiid.designer.core.ModelerCore;
import org.teiid.designer.core.metamodel.aspect.MetamodelEntity;
Expand Down Expand Up @@ -79,7 +79,7 @@ public String getSignature(Object eObject, int showMask) {
result.append(xpkg.getName() );
break;
default :
throw new TeiidRuntimeException(ModelerCore.Util.getString("XPackageUmlAspect.Invalid_showMask_for_getSignature") + showMask ); //$NON-NLS-1$
throw new TeiidDesignerRuntimeException(ModelerCore.Util.getString("XPackageUmlAspect.Invalid_showMask_for_getSignature") + showMask ); //$NON-NLS-1$
}
return result.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.eclipse.emf.edit.provider.IChangeNotifier;
import org.eclipse.emf.edit.provider.INotifyChangedListener;
import org.teiid.core.designer.TeiidDesignerException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.designer.id.IDGenerator;
import org.teiid.core.designer.id.InvalidIDException;
import org.teiid.core.designer.id.ObjectID;
Expand Down Expand Up @@ -386,7 +386,7 @@ protected void checkForDuplicateUuid( final URI uri ) {

/**
* Check if the XMI version corresponding to the specified resource URI represents an older 1.x version of the XMI
* specification. If it does a TeiidRuntimeException is thrown indicating that the resource must be converted to an
* specification. If it does a TeiidDesignerRuntimeException is thrown indicating that the resource must be converted to an
* xmi:version="2.0" file
*
* @param uri
Expand All @@ -397,7 +397,7 @@ protected void checkForInvalidXmiVersion( final URI uri ) {
if (header != null && header.getXmiVersion() != null && header.getXmiVersion().startsWith("1.")) { //$NON-NLS-1$
Object[] params = new Object[] {uri};
String msg = ModelerCore.Util.getString("EResourceSetImpl.Old_model_format_encountered", params); //$NON-NLS-1$
throw new TeiidRuntimeException(msg);
throw new TeiidDesignerRuntimeException(msg);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.eclipse.emf.edit.command.RemoveCommand;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.provider.ChangeNotifier;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.designer.ModelerCoreException;
import org.teiid.core.designer.ModelerCoreRuntimeException;
import org.teiid.core.designer.util.CoreArgCheck;
Expand Down Expand Up @@ -97,7 +97,7 @@ public UnitOfWorkImpl( final ResourceSet resources,
try {
this.container = ModelerCore.getModelContainer();
} catch (CoreException err) {
throw new TeiidRuntimeException(err);
throw new TeiidDesignerRuntimeException(err);
}
}
this.filter = new TxnNotificationFilter(resources);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;

/**
* This class contains static utilities that return strings that are the result of manipulating other strings or objects.
Expand Down Expand Up @@ -169,7 +169,7 @@ public static String[] getLines( final String value ) {
line = reader.readLine();
}
} catch (final IOException e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
}
return (String[])result.toArray(new String[result.size()]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.io.Serializable;

import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.designer.common.util.ErrorMessageKeys;
import org.teiid.designer.common.util.I18nUtil;

Expand Down Expand Up @@ -199,7 +199,7 @@ public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
import org.teiid.core.designer.TeiidDesignerException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.util.ArgCheck;

/**
Expand Down Expand Up @@ -61,7 +61,7 @@ public static VdbHeader readHeader( final File file ) throws TeiidDesignerExcept
VdbHeaderReader reader = new VdbHeaderReader();
header = reader.read(iStream);
} catch (IOException e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
} finally {
if (iStream != null) {
try {
Expand Down Expand Up @@ -256,7 +256,7 @@ private static InputStream getEntryStreamFromArchive( final ZipFile zipFile,
}
}
} catch (IOException e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.designer.id.InvalidIDException;
import org.teiid.core.designer.id.UUID;
import org.teiid.designer.metadata.runtime.RuntimeMetadataPlugin;
Expand Down Expand Up @@ -105,7 +105,7 @@ public class DatatypeConstants {
try {
BUILTIN_DATATYPES_MODEL_UUID = DatatypeConstants.stringToObject("6b862080-3019-1e20-921b-eeee28353879"); //$NON-NLS-1$
} catch (InvalidIDException e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
}
try {
XML_SCHEMA_UUID_1999 = DatatypeConstants.stringToObject("1da96d2e-fc8c-1f0b-aa25-a4ec5e156765"); //$NON-NLS-1$
Expand All @@ -118,7 +118,7 @@ public class DatatypeConstants {
XML_MAGIC_SCHEMA_UUID_2001 = DatatypeConstants.stringToObject("a8a3ee88-fc82-1f0b-9301-8cc12cf53072"); //$NON-NLS-1$
XML_SCHEMA_INSTANCE_UUID_2001 = DatatypeConstants.stringToObject("ac653e49-fc82-1f0b-9301-8cc12cf53072"); //$NON-NLS-1$
} catch (InvalidIDException e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.io.Reader;
import java.io.StringWriter;

import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.designer.TeiidDesignerRuntimeException;
import org.teiid.core.util.StringUtil;

/**
Expand Down Expand Up @@ -55,7 +55,7 @@ public static String read(Reader reader) {
writer.write(StringUtil.LINE_SEPARATOR);
}
} catch (IOException e) {
throw new TeiidRuntimeException(e);
throw new TeiidDesignerRuntimeException(e);
} finally {
if (bufferedReader != null) {
try {
Expand Down

0 comments on commit 8e37695

Please sign in to comment.