Author: b00__1
Date: 2007-07-28 08:16:17-0700
New Revision: 13176
Modified:
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java
Log:
Minor changes
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java?view=diff&rev=13176&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&r1=13175&r2=13176
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java 2007-07-28 08:16:17-0700
@@ -139,9 +139,9 @@
public void addClassModelEventListener(PropertyChangeListener listener,
Object modelClass, String[] propertyNames) {
- if (!(modelClass instanceof Class && EObject.class
- .isAssignableFrom((Class) modelClass))) {
- throw new IllegalArgumentException();
+ if (!(modelClass instanceof Class && EObject.class.isAssignableFrom((Class) modelClass))) {
+ throw new IllegalArgumentException(
+ "The model class must be instance of java.lang.Class<EObject>"); //$NON-NLS-1$
}
registerListener(
modelClass, listener, propertyNames, registerForClasses);
@@ -150,7 +150,8 @@
public void addModelEventListener(PropertyChangeListener listener,
Object modelelement, String[] propertyNames) {
if (!(modelelement instanceof EObject)) {
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException(
+ "The modelelement must be instance of EObject."); //$NON-NLS-1$
}
registerListener(
modelelement, listener, propertyNames, registerForElements);
@@ -165,7 +166,8 @@
PropertyChangeListener listener, String[] propertyNames,
Map<Object, List<Listener>> register) {
if (notifier == null || listener == null) {
- throw new NullPointerException();
+ throw new NullPointerException(
+ "The model element/class and the listener must be non-null."); //$NON-NLS-1$
}
synchronized (mutex) {
List<Listener> list = register.get(notifier);
@@ -225,7 +227,8 @@
PropertyChangeListener listener, String[] propertyNames,
Map<Object, List<Listener>> register) {
if (notifier == null || listener == null) {
- throw new NullPointerException();
+ throw new NullPointerException(
+ "The model element/class and the listener must be non-null."); //$NON-NLS-1$
}
synchronized (mutex) {
List<Listener> list = register.get(notifier);
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java?view=diff&rev=13176&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java&r1=13175&r2=13176
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java 2007-07-28 08:16:17-0700
@@ -79,14 +79,15 @@
public Collection parse(InputSource inputSource, boolean profile)
throws UmlException {
+ if (inputSource == null) {
+ throw new NullPointerException("The input source must be non-null."); //$NON-NLS-1$
+ }
EditingDomain editingDomain = modelImpl.getEditingDomain();
- for (Resource resource
- : editingDomain.getResourceSet().getResources()) {
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
resource.unload();
}
- Resource r = editingDomain.createResource(
- "http://argouml.tigris.org/euml/resource/default_uri.xmi"); //$NON-NLS-1$
+ Resource r = editingDomain.createResource("http://argouml.tigris.org/euml/resource/default_uri.xmi"); //$NON-NLS-1$
try {
r.load(inputSource.getByteStream(), null);
} catch (IOException e) {
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java?view=diff&rev=13176&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java&r1=13175&r2=13176
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java 2007-07-28 08:16:17-0700
@@ -80,10 +80,11 @@
public XmiWriterEUMLImpl(EUMLModelImplementation implementation,
Object theModel, OutputStream stream, String version) {
if (stream == null) {
- throw new IllegalArgumentException("An OutputStream must be provided"); //$NON-NLS-1$
+ throw new IllegalArgumentException(
+ "An OutputStream must be provided"); //$NON-NLS-1$
}
if (!(theModel instanceof org.eclipse.uml2.uml.Package)) {
- throw new IllegalArgumentException("A model must be provided" //$NON-NLS-1$
+ throw new IllegalArgumentException("A container must be provided" //$NON-NLS-1$
+ " and it must be a UML 2 Package"); //$NON-NLS-1$
}
if (implementation == null) {
@@ -95,9 +96,10 @@
}
public void write() throws UmlException {
- if (model.eResource() == null) {
- throw new UmlException("Root container is not affiliated with any resource!"); //$NON-NLS-1$
- }
+ if (model.eResource() == null) {
+ throw new UmlException(
+ "Root container is not affiliated with any resource!"); //$NON-NLS-1$
+ }
// Do we need to get stereotype applications for each element? - tfm
// for (Iterator allContents = UMLUtil.getAllContents(model, true,
@@ -109,9 +111,9 @@
// }
Map<String, Integer> options = new HashMap<String, Integer>();
options.put(XMLResource.OPTION_LINE_WIDTH, 100);
-
+
// TODO: Is there an option we can use to save our ArgoUML version?
-
+
try {
model.eResource().save(oStream, options);
} catch (IOException ioe) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.