svn commit: r19617 - trunk/src/argouml-core-model-euml: .settings src/org/argouml/model/euml

[email protected] Sat, 23 Jul 2011 02:04:49 -0700 (PDT)
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: linus
Date: 2011-07-23 02:04:49-0700
New Revision: 19617

Modified:
   trunk/src/argouml-core-model-euml/.settings/org.eclipse.jdt.core.prefs
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsFactoryEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesHelperEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/NotYetImplementedException.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesHelperEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java

Log:
Fixed some style problems.

Modified: trunk/src/argouml-core-model-euml/.settings/org.eclipse.jdt.core.prefs
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/.settings/org.eclipse.jdt.core.prefs?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/.settings/org.eclipse.jdt.core.prefs	(original)
+++ trunk/src/argouml-core-model-euml/.settings/org.eclipse.jdt.core.prefs	2011-07-23 02:04:49-0700
@@ -1,4 +1,4 @@
-#Sun May 15 15:16:28 EDT 2011

+#Sat Jul 23 09:46:53 CEST 2011

 eclipse.preferences.version=1

 instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true

 org.eclipse.jdt.core.codeComplete.argumentPrefixes=

@@ -11,11 +11,17 @@
 org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=

 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled

 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6

+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve

 org.eclipse.jdt.core.compiler.compliance=1.6

+org.eclipse.jdt.core.compiler.debug.lineNumber=generate

+org.eclipse.jdt.core.compiler.debug.localVariable=generate

+org.eclipse.jdt.core.compiler.debug.sourceFile=generate

 org.eclipse.jdt.core.compiler.doc.comment.support=enabled

 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning

 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

 org.eclipse.jdt.core.compiler.problem.autoboxing=ignore

+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning

+org.eclipse.jdt.core.compiler.problem.deadCode=warning

 org.eclipse.jdt.core.compiler.problem.deprecation=warning

 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled

 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled

@@ -23,6 +29,7 @@
 org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore

 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error

 org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning

+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled

 org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore

 org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning

 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning

@@ -39,6 +46,7 @@
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore

 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning

 org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore

+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore

 org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore

 org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled

 org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public

@@ -47,14 +55,18 @@
 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public

 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore

 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore

+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore

 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning

 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning

-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning

+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore

 org.eclipse.jdt.core.compiler.problem.nullReference=warning

 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning

 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore

 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning

+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore

 org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore

+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore

+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore

 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled

 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning

 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled

@@ -67,14 +79,18 @@
 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore

 org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore

 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore

+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled

+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled

 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

 org.eclipse.jdt.core.compiler.problem.unusedImport=warning

 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning

 org.eclipse.jdt.core.compiler.problem.unusedLocal=warning

 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore

+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled

 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled

 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled

 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning

+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning

 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning

 org.eclipse.jdt.core.compiler.source=1.6

 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false

@@ -148,6 +164,9 @@
 org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true

 org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false

 org.eclipse.jdt.core.formatter.indentation.size=8

+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert

+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert

+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert

 org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert

 org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert

 org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert

@@ -316,6 +335,8 @@
 org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert

 org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert

 org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert

+org.eclipse.jdt.core.formatter.join_lines_in_comments=true

+org.eclipse.jdt.core.formatter.join_wrapped_lines=true

 org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false

 org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false

 org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true


Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsFactoryEUMLImpl.java?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsFactoryEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsFactoryEUMLImpl.java	2011-07-23 02:04:49-0700
@@ -1,5 +1,5 @@
 // $Id$
-/*******************************************************************************
+/***************************************************************************
  * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -8,7 +8,7 @@
  *
  * Contributors:
  *    Tom Morris - initial API and implementation
- *******************************************************************************/
+ ***************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.AbstractModelFactory;
@@ -22,8 +22,6 @@
 import org.eclipse.uml2.uml.Lifeline;
 import org.eclipse.uml2.uml.Message;
 import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Property;
 import org.eclipse.uml2.uml.UMLFactory;
 
 /**
@@ -42,7 +40,8 @@
      *
      * @param implementation The ModelImplementation.
      */
-    public CollaborationsFactoryEUMLImpl(EUMLModelImplementation implementation) {
+    public CollaborationsFactoryEUMLImpl(
+            EUMLModelImplementation implementation) {
         modelImpl = implementation;
     }
 
@@ -124,7 +123,8 @@
 
     public Collaboration buildCollaboration(Object namespace, 
             Object representedElement) {
-        throw new IllegalArgumentException("A collaboration is only attached to a namespace in UML2");
+        throw new IllegalArgumentException(
+                "A collaboration is only attached to a namespace in UML2");
     }
 
     public Object buildInteraction(Object collaboration) {

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	2011-07-23 02:04:49-0700
@@ -85,7 +85,8 @@
  */
 class CoreHelperEUMLImpl implements CoreHelper {
 
-    private static final Logger LOG = Logger.getLogger(CoreHelperEUMLImpl.class);
+    private static final Logger LOG = 
+        Logger.getLogger(CoreHelperEUMLImpl.class);
     
     /**
      * The model implementation.
@@ -105,50 +106,56 @@
         editingDomain = implementation.getEditingDomain();
     }
 
-    public void addAllStereotypes(final Object modelElement,
+    public void addAllStereotypes(
+            final Object modelElement,
             final Collection stereos) {
         if (!(modelElement instanceof Element)) {
             throw new IllegalArgumentException(
-                    "modelElement must be instance of Element"); //$NON-NLS-1$
+                    "modelElement must be instance of Element");
         }
         if (stereos == null) {
-            throw new NullPointerException(
-                    "stereos must be non-null"); //$NON-NLS-1$
+            throw new NullPointerException("stereos must be non-null");
         }
+
+        final Element element = (Element) modelElement;
+
         for (Object o : stereos) {
             if (!(o instanceof Stereotype)) {
                 throw new IllegalArgumentException(
-                        "The stereotypes from stereo collection" //$NON-NLS-1$
-                            + " must be instances of Stereotype"); //$NON-NLS-1$
+                        "The stereotypes from stereo collection"
+                            + " must be instances of Stereotype");
             }
-            if (!((Element) modelElement).isStereotypeApplicable((Stereotype) o)) {
+            if (!element.isStereotypeApplicable((Stereotype) o)) {
                 throw new UnsupportedOperationException(
-                        "The stereotype " + o //$NON-NLS-1$
-                        + " cannot be applied to " + modelElement); //$NON-NLS-1$
+                        "The stereotype " + o 
+                        + " cannot be applied to " + modelElement); 
             }
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
                 for (Object o : stereos) {
                     Stereotype stereotype = (Stereotype) o;
-                    EObject eo = ((Element) modelElement).applyStereotype(stereotype);
-                    if (((Element) modelElement).isStereotypeApplied(stereotype)) {
+                    EObject eo = element.applyStereotype(stereotype);
+                    if (element.isStereotypeApplied(stereotype)) {
                         fireApplyStereotypeEvent(modelElement, stereotype);
                     } else {
                         EcoreUtil.remove(eo);
                     }
                 }
             }
+
             /**
-             * Call the model event pump and ask it to fire an event indicating a
-             * stereotype has been added. This is a stop-gap until we have
+             * Call the model event pump and ask it to fire an event indicating 
+             * a stereotype has been added. This is a stop-gap until we have
              * determined how the event pump can detect itself that a stereotype
              * has been added.
              *  
              * @param modelElement
              * @param stereotype
              */
-            private void fireApplyStereotypeEvent(Object modelElement, Object stereotype) {
+            private void fireApplyStereotypeEvent(
+                    Object modelElement, 
+                    Object stereotype) {
                 final ModelEventPumpEUMLImpl pump =
                     (ModelEventPumpEUMLImpl) Model.getPump();
                 pump.fireEvent(
@@ -156,7 +163,7 @@
                         null, 
                         stereotype, 
                         Notification.ADD, 
-                        "stereotype",  //$NON-NLS-1$ 
+                        "stereotype",
                         null);
             }
             
@@ -178,11 +185,11 @@
             final Object annotatedElement) {
         if (!(annotatedElement instanceof Element)) {
             throw new IllegalArgumentException(
-                    "annotatedElement must be instance of Element"); //$NON-NLS-1$
+                    "annotatedElement must be instance of Element");
         }
         if (!(comment instanceof Comment)) {
             throw new IllegalArgumentException(
-                    "comment must be instance of Comment"); //$NON-NLS-1$
+                    "comment must be instance of Comment");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -199,11 +206,11 @@
     public void addClient(final Object dependency, final Object element) {
         if (!(dependency instanceof Dependency)) {
             throw new IllegalArgumentException(
-                    "The dependency must be instance of Dependency"); //$NON-NLS-1$
+                    "The dependency must be instance of Dependency");
         }
         if (!(element instanceof NamedElement)) {
             throw new IllegalArgumentException(
-                    "The element must be instance of NamedElement"); //$NON-NLS-1$
+                    "The element must be instance of NamedElement");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -232,11 +239,11 @@
     public void addConnection(Object handle, int position, Object connection) {
         if (!(handle instanceof Association)) {
             throw new IllegalArgumentException(
-                    "The handle must be instance of Association"); //$NON-NLS-1$
+                    "The handle must be instance of Association");
         }
         if (!(connection instanceof Property)) {
             throw new IllegalArgumentException(
-                    "The connection must be instance of Property"); //$NON-NLS-1$
+                    "The connection must be instance of Property");
         }
         RunnableClass run = getRunnableClassForAddCommand(
                 (Association) handle, position, (Property) connection);
@@ -244,22 +251,24 @@
                 new ChangeCommand(
                         modelImpl,
                         run,
-                        "Add the AssociationEnd (Property) # to the Association #",
+                        "Add the AssociationEnd (Property) # "
+                        + "to the Association #",
                         connection, handle));
     }
 
     public void addConstraint(final Object handle, final Object mc) {
         if (!(handle instanceof Element)) {
             throw new IllegalArgumentException(
-                    "The handle must be instance of Element"); //$NON-NLS-1$
+                    "The handle must be instance of Element");
         }
         if (!(mc instanceof Constraint)) {
             throw new IllegalArgumentException(
-                    "mc must be instance of Constraint"); //$NON-NLS-1$
+                    "mc must be instance of Constraint");
         }
+        final Element element = (Element) handle;
         RunnableClass run = new RunnableClass() {
             public void run() {
-                ((Constraint) mc).getConstrainedElements().add((Element) handle);
+                ((Constraint) mc).getConstrainedElements().add(element);
             }
         };
         editingDomain.getCommandStack().execute(
@@ -290,8 +299,8 @@
                 editingDomain, owner, null, element, index);
         if (cmd == null || !cmd.canExecute()) {
             throw new UnsupportedOperationException(
-                    "The element " + element  //$NON-NLS-1$
-                    + " cannot be added to the element " + owner); //$NON-NLS-1$
+                    "The element " + element
+                    + " cannot be added to the element " + owner);
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -304,11 +313,11 @@
     private RunnableClass getRunnableClassForRemoveCommand(Element element) {
         final Command cmd = RemoveCommand.create(editingDomain, element);
         if (cmd == null || !cmd.canExecute()) {
-            String s = "The element " + element; //$NON-NLS-1$
+            String s = "The element " + element;
             if (element.getOwner() != null) {
-                s += ", owned by " + element.getOwner() + ", "; //$NON-NLS-1$ //$NON-NLS-2$
+                s += ", owned by " + element.getOwner() + ", ";
             }
-            s += " cannot be removed"; //$NON-NLS-1$
+            s += " cannot be removed";
             throw new UnsupportedOperationException(s);
         }
         RunnableClass run = new RunnableClass() {
@@ -322,10 +331,10 @@
     public void addFeature(Object handle, int index, Object f) {
         if (!(handle instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "The handle must be instance of Classifier"); //$NON-NLS-1$
+                    "The handle must be instance of Classifier");
         }
         if (!(f instanceof Feature)) {
-            throw new IllegalArgumentException("f must be instance of Feature"); //$NON-NLS-1$
+            throw new IllegalArgumentException("f must be instance of Feature");
         }
         editingDomain.getCommandStack().execute(
                 new ChangeCommand(
@@ -346,11 +355,11 @@
     public void addLiteral(Object handle, int index, Object literal) {
         if (!(handle instanceof Enumeration)) {
             throw new IllegalArgumentException(
-                    "The handle must be instance of Enumeration"); //$NON-NLS-1$
+                    "The handle must be instance of Enumeration");
         }
         if (!(literal instanceof EnumerationLiteral)) {
             throw new IllegalArgumentException(
-                    "literal must be instance of EnumerationLiteral"); //$NON-NLS-1$
+                    "literal must be instance of EnumerationLiteral");
         }
         editingDomain.getCommandStack().execute(
                 new ChangeCommand(
@@ -364,11 +373,11 @@
     public void addManifestation(Object handle, Object manifestation) {
         if (!(handle instanceof Artifact)) {
             throw new IllegalArgumentException(
-                    "The handle must be instance of Artifact"); //$NON-NLS-1$
+                    "The handle must be instance of Artifact");
         }
         if (!(manifestation instanceof Manifestation)) {
             throw new IllegalArgumentException(
-                    "The manifestation must be instance of Manifestation"); //$NON-NLS-1$
+                    "The manifestation must be instance of Manifestation");
         }
         ((Artifact) handle).getManifestations()
                 .add((Manifestation) manifestation);
@@ -379,22 +388,25 @@
         // 'method' association of BehavioralFeature
         if (!(handle instanceof BehavioralFeature)) {
             throw new IllegalArgumentException(
-                    "The handle must be instance of BehavioralFeature"); //$NON-NLS-1$
+                    "The handle must be instance of BehavioralFeature");
         }
         if (!(method instanceof Behavior)) {
             throw new IllegalArgumentException(
-                    "method must be instance of Behavior"); //$NON-NLS-1$
+                    "method must be instance of Behavior");
         }
+
+        final Behavior behavior = (Behavior) method;
         RunnableClass run = new RunnableClass() {
             public void run() {
-                ((BehavioralFeature) handle).getMethods().add((Behavior) method);
+                ((BehavioralFeature) handle).getMethods().add(behavior);
             }
         };
         editingDomain.getCommandStack().execute(
                 new ChangeCommand(
                         modelImpl,
                         run,
-                        "Add the Behavior (method) # to the BehavioralFeature (operation) #",
+                        "Add the Behavior (method) # "
+                        + "to the BehavioralFeature (operation) #",
                         method, handle));
     }
     
@@ -402,17 +414,17 @@
             Object... objects) {
         if (!(handle instanceof Namespace)) {
             throw new IllegalArgumentException(
-                    "The handle must be instance of Namespace"); //$NON-NLS-1$
+                    "The handle must be instance of Namespace");
         }
         if (!(me instanceof Element)) {
             throw new IllegalArgumentException(
-                    "'me' must be instance of Element, we got a "//$NON-NLS-1$
-                     + me);
+                    "'me' must be instance of Element, we got a " + me);
         }
         Element element = (Element) me;
         if (element.getOwner() != null) {
-            LOG.info("Setting ignore delete for " + element); //$NON-NLS-1$
-            ModelEventPumpEUMLImpl pump = (ModelEventPumpEUMLImpl) Model.getPump();
+            LOG.info("Setting ignore delete for " + element); 
+            ModelEventPumpEUMLImpl pump = 
+                (ModelEventPumpEUMLImpl) Model.getPump();
             pump.addElementForDeleteEventIgnore(element);
         }
         editingDomain.getCommandStack().execute(
@@ -427,14 +439,15 @@
 
     public void addParameter(Object handle, int index, Object parameter) {
         // TODO: In UML2.x Event has no parameters.
-        // TODO: Treat ObjectFlowState (this doesn't exist anymore in UML2) and Classifier
+        // TODO: Treat ObjectFlowState (this doesn't exist anymore in UML2) 
+        // and Classifier
         if (!(handle instanceof BehavioralFeature)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of BehavioralFeature"); //$NON-NLS-1$
+                    "handle must be instance of BehavioralFeature");
         }
         if (!(parameter instanceof Parameter)) {
             throw new IllegalArgumentException(
-                    "parameter must be instance of Parameter"); //$NON-NLS-1$
+                    "parameter must be instance of Parameter");
         }
         editingDomain.getCommandStack().execute(
                 new ChangeCommand(
@@ -452,7 +465,7 @@
     public void addQualifier(Object handle, int position, Object qualifier) {
         if (!(handle instanceof Property) || !(qualifier instanceof Property)) {
             throw new IllegalArgumentException(
-                    "handle and qualifier must be instances of Property"); //$NON-NLS-1$
+                    "handle and qualifier must be instances of Property");
         }
         editingDomain.getCommandStack().execute(
                 new ChangeCommand(
@@ -492,11 +505,11 @@
     public void addSupplier(final Object dependency, final Object element) {
         if (!(dependency instanceof Dependency)) {
             throw new IllegalArgumentException(
-                    "The dependency must be instance of Dependency"); //$NON-NLS-1$
+                    "The dependency must be instance of Dependency");
         }
         if (!(element instanceof NamedElement)) {
             throw new IllegalArgumentException(
-                    "The element must be instance of NamedElement"); //$NON-NLS-1$
+                    "The element must be instance of NamedElement");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -530,7 +543,10 @@
         throw new NotYetImplementedException();
     }
 
-    public void addTemplateParameter(Object handle, int index, Object parameter) {
+    public void addTemplateParameter(
+            Object handle, 
+            int index, 
+            Object parameter) {
         // TODO: implement
         throw new NotYetImplementedException();
     }
@@ -545,10 +561,12 @@
         throw new NotYetImplementedException();
     }
 
-    public boolean equalsAggregationKind(Object associationEnd, String kindType) {
+    public boolean equalsAggregationKind(
+            Object associationEnd, 
+            String kindType) {
         if (!(associationEnd instanceof Property)) {
             throw new IllegalArgumentException(
-                    "associationEnd must be instance of Property"); //$NON-NLS-1$
+                    "associationEnd must be instance of Property");
         }
         return ((Property) associationEnd).getAggregation().getLiteral().equals(
                 kindType);
@@ -557,7 +575,7 @@
     public Collection getAllAttributes(Object classifier) {
         if (!(classifier instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "classifier must be instance of Classifier"); //$NON-NLS-1$
+                    "classifier must be instance of Classifier");
         }
         Collection result = new HashSet();
         result.addAll(((Classifier) classifier).getAttributes());
@@ -622,20 +640,26 @@
 
     
     public Collection getAllNodes(Object ns) {
-        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(ns, Node.class);
+        final ModelManagementHelperEUMLImpl helper =
+            modelImpl.getModelManagementHelper();
+        return helper.getAllModelElementsOfKind(ns, Node.class);
     }
 
-    public Collection getAllPossibleNamespaces(Object modelElement, Object model) {
+    public Collection getAllPossibleNamespaces(
+            Object modelElement, 
+            Object model) {
         if (!(model instanceof Element) || !(modelElement instanceof Element)) {
             throw new IllegalArgumentException(
-                    "modelElement and model must be instances of Element"); //$NON-NLS-1$
+                    "modelElement and model must be instances of Element");
         }
         Collection result = new ArrayList();
         if (isValidNamespace(modelElement, model)) {
             result.add((Namespace) model);
         }
-        for (Object o : modelImpl.getModelManagementHelper().getAllModelElementsOfKind(
-                model, Namespace.class)) {
+        final ModelManagementHelperEUMLImpl helper =
+            modelImpl.getModelManagementHelper();
+        for (Object o 
+                : helper.getAllModelElementsOfKind(model, Namespace.class)) {
             if (isValidNamespace(modelElement, o)) {
                 result.add((Namespace) o);
             }
@@ -646,15 +670,17 @@
     public Collection getAllRealizedInterfaces(Object element) {
         if (!(element instanceof org.eclipse.uml2.uml.Class)) {
             throw new IllegalArgumentException(
-                    "element must be instance of UML2 Class"); //$NON-NLS-1$
+                    "element must be instance of UML2 Class");
         }
-        return ((org.eclipse.uml2.uml.Class) element).getAllImplementedInterfaces();
+        final org.eclipse.uml2.uml.Class theClass = 
+            (org.eclipse.uml2.uml.Class) element;
+        return theClass.getAllImplementedInterfaces();
     }
 
     public Collection getAllSupertypes(Object classifier) {
         if (!(classifier instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "classifier must be instance of Classifier"); //$NON-NLS-1$
+                    "classifier must be instance of Classifier");
         }
         return ((Classifier) classifier).allParents();
     }
@@ -662,7 +688,7 @@
     public Collection getAllVisibleElements(Object ns) {
         if (!(ns instanceof Namespace)) {
             throw new IllegalArgumentException(
-                    "ns must be instance of Namespace"); //$NON-NLS-1$
+                    "ns must be instance of Namespace");
         }
         Collection result = new ArrayList();
         for (NamedElement e : ((Namespace) ns).getOwnedMembers()) {
@@ -677,7 +703,7 @@
     public Collection getAssociateEndsInh(Object classifier) {
         if (!(classifier instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "classifier must be instance of Classifier"); //$NON-NLS-1$
+                    "classifier must be instance of Classifier");
         }
         Collection result = new ArrayList();
         result.addAll(modelImpl.getFacade().getAssociationEnds(classifier));
@@ -690,7 +716,7 @@
     public Collection<Classifier> getAssociatedClassifiers(Object aclassifier) {
         if (!(aclassifier instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "aclassifier must be instance of Classifier"); //$NON-NLS-1$
+                    "aclassifier must be instance of Classifier");
         }
         Collection<Classifier> result = new ArrayList<Classifier>();
         for (Association a : ((Classifier) aclassifier).getAssociations()) {
@@ -706,11 +732,11 @@
     public Property getAssociationEnd(Object type, Object assoc) {
         if (!(type instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "type must be instance of Classifier"); //$NON-NLS-1$
+                    "type must be instance of Classifier");
         }
         if (!(assoc instanceof Association)) {
             throw new IllegalArgumentException(
-                    "assoc must be instance of Association"); //$NON-NLS-1$
+                    "assoc must be instance of Association");
         }
         return ((Association) assoc).getMemberEnd(null, (Classifier) type);
     }
@@ -724,7 +750,7 @@
         }
         if (!(from instanceof Classifier) || !(to instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'from' and 'to' must be instances of Classifier"); //$NON-NLS-1$
+                    "'from' and 'to' must be instances of Classifier");
         }
         Collection<Association> result = new ArrayList<Association>();
         for (Association a : ((Classifier) from).getAssociations()) {
@@ -738,7 +764,7 @@
     public Collection getAssociations(Object classifier) {
         if (!(classifier instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'classifier' must be instance of Classifier"); //$NON-NLS-1$
+                    "'classifier' must be instance of Classifier");
         }
         return ((Classifier) classifier).getAssociations();
     }
@@ -746,7 +772,7 @@
     public Collection getAttributesInh(Object classifier) {
         if (!(classifier instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'classifier' must be instance of Classifier"); //$NON-NLS-1$
+                    "'classifier' must be instance of Classifier");
         }
         return ((Classifier) classifier).getAllAttributes();
     }
@@ -754,7 +780,7 @@
     public List<BehavioralFeature> getBehavioralFeatures(Object classifier) {
         if (!(classifier instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'classifier' must be instance of Classifier"); //$NON-NLS-1$
+                    "'classifier' must be instance of Classifier");
         }
         List<BehavioralFeature> result = new ArrayList<BehavioralFeature>();
         for (Feature feature : ((Classifier) classifier).getFeatures()) {
@@ -768,7 +794,7 @@
     public String getBody(Object comment) {
         if (!(comment instanceof Comment)) {
             throw new IllegalArgumentException(
-                    "'comment' must be instance of Comment"); //$NON-NLS-1$
+                    "'comment' must be instance of Comment");
         }
         return ((Comment) comment).getBody();
     }
@@ -776,7 +802,7 @@
     public Collection<Classifier> getChildren(Object element) {
         if (!(element instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'element' must be instance of Classifier"); //$NON-NLS-1$
+                    "'element' must be instance of Classifier");
         }
         Collection<Classifier> results = new HashSet<Classifier>();
         LinkedList<Classifier> classifiers = new LinkedList<Classifier>();
@@ -787,7 +813,9 @@
                 break;
             }
             results.add(c);
-            for (DirectedRelationship d : c.getTargetDirectedRelationships(UMLPackage.Literals.GENERALIZATION)) {
+            for (DirectedRelationship d 
+                    : c.getTargetDirectedRelationships(
+                            UMLPackage.Literals.GENERALIZATION)) {
                 for (Element e : d.getSources()) {
                     if (e instanceof Classifier && !results.contains(e)) {
                         classifiers.add((Classifier) e);
@@ -799,13 +827,18 @@
         return results;
     }
 
-    public Collection<Dependency> getDependencies(Object supplierObj, Object clientObj) {
-        if (!(supplierObj instanceof NamedElement) || !(clientObj instanceof NamedElement)) {
+    public Collection<Dependency> getDependencies(
+            Object supplierObj, 
+            Object clientObj) {
+        if (!(supplierObj instanceof NamedElement) 
+                || !(clientObj instanceof NamedElement)) {
             throw new IllegalArgumentException(
-                    "supplierObj and clientObj must be instances of NamedElement"); //$NON-NLS-1$
+                    "supplierObj and clientObj must be "
+                    + "instances of NamedElement");
         }
         Collection<Dependency>  result = new ArrayList<Dependency> ();
-        for (Dependency d : ((NamedElement) clientObj).getClientDependencies()) {
+        for (Dependency d 
+                : ((NamedElement) clientObj).getClientDependencies()) {
             if (d.getSuppliers().contains(supplierObj)) {
                 result.add(d);
             }
@@ -818,7 +851,7 @@
         // all parents (direct and indirect) or only the direct parents?
         if (!(element instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'element' must be instance of Classifier"); //$NON-NLS-1$
+                    "'element' must be instance of Classifier");
         }
         return ((Classifier) element).getGenerals();
     }
@@ -829,7 +862,7 @@
         // extending classifiers?
         if (!(classifier instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'classifier' must be instance of Classifier"); //$NON-NLS-1$
+                    "'classifier' must be instance of Classifier");
         }
         Collection<Element> result = new HashSet<Element>();
         for (Element e : getExtendingElements(classifier)) {
@@ -843,11 +876,12 @@
     public Collection<Element> getExtendingElements(Object element) {
         if (!(element instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'element' must be instance of Classifier"); //$NON-NLS-1$
+                    "'element' must be instance of Classifier");
         }
         Collection<Element> result = new HashSet<Element>();
-        for (DirectedRelationship d : ((Classifier) element)
-                .getTargetDirectedRelationships(UMLPackage.Literals.GENERALIZATION)) {
+        for (DirectedRelationship d 
+                : ((Classifier) element).getTargetDirectedRelationships(
+                        UMLPackage.Literals.GENERALIZATION)) {
             for (Element e : d.getSources()) {
                 result.add(e);
             }
@@ -858,7 +892,7 @@
     public Namespace getFirstSharedNamespace(Object ns1, Object ns2) {
         if (!(ns1 instanceof Namespace) || !(ns2 instanceof Namespace)) {
             throw new IllegalArgumentException(
-                    "ns1 and ns2 must be instances of Namespace"); //$NON-NLS-1$
+                    "ns1 and ns2 must be instances of Namespace");
         }
         Namespace result = null;
         List<Namespace> l1 = new ArrayList<Namespace>();
@@ -891,7 +925,7 @@
                 || !(aparent instanceof Classifier)) {
             throw new IllegalArgumentException(
                     "'achild' and 'aparent' must "
-                    + "be instances of Classifier"); //$NON-NLS-1$
+                    + "be instances of Classifier");
         }
         return ((Classifier) achild).getGeneralization((Classifier) aparent);
     }
@@ -899,7 +933,7 @@
     public Collection<PackageableElement> getUtilizedElements(Object artifact) {
         if (!(artifact instanceof Artifact)) {
             throw new IllegalArgumentException(
-                    "'artifact' must be instance of Artifact"); //$NON-NLS-1$
+                    "'artifact' must be instance of Artifact");
         }
         Collection<PackageableElement> c = new ArrayList<PackageableElement>();
         for (Manifestation m : ((Artifact) artifact).getManifestations()) {
@@ -914,7 +948,7 @@
     public Collection<Operation> getOperationsInh(Object classifier) {
         if (!(classifier instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'classifier' must be instance of Classifier"); //$NON-NLS-1$
+                    "'classifier' must be instance of Classifier");
         }
         return ((Classifier) classifier).getAllOperations();
     }
@@ -922,17 +956,20 @@
     public Collection<Interface> getRealizedInterfaces(Object cls) {
         if (!(cls instanceof org.eclipse.uml2.uml.Class)) {
             throw new IllegalArgumentException(
-                    "'cls' must be instance of UML2 Class"); //$NON-NLS-1$
+                    "'cls' must be instance of UML2 Class");
         }
         return ((org.eclipse.uml2.uml.Class) cls).getImplementedInterfaces();
     }
 
-    public Collection<DirectedRelationship> getRelationships(Object source, Object dest) {
+    public Collection<DirectedRelationship> getRelationships(
+            Object source, 
+            Object dest) {
         if (!(source instanceof Element) || !(dest instanceof Element)) {
             throw new IllegalArgumentException(
-                    "'source' and 'dest' must be instances of Element"); //$NON-NLS-1$
+                    "'source' and 'dest' must be instances of Element");
         }
-        Collection<DirectedRelationship> result = new ArrayList<DirectedRelationship>();
+        Collection<DirectedRelationship> result = 
+            new ArrayList<DirectedRelationship>();
         for (DirectedRelationship d : ((Element) source)
                 .getSourceDirectedRelationships()) {
             if (d.getTargets().contains(dest)) {
@@ -951,7 +988,7 @@
     public List<Parameter> getReturnParameters(Object bf) {
         if (!(bf instanceof BehavioralFeature)) {
             throw new IllegalArgumentException(
-                    "'bf' must be instance of BehavioralFeature"); //$NON-NLS-1$
+                    "'bf' must be instance of BehavioralFeature");
         }
         List<Parameter> result = new ArrayList<Parameter>();
         for (Parameter p : ((Operation) bf).getOwnedParameters()) {
@@ -980,7 +1017,8 @@
         if (!(relationship instanceof Relationship)
                 && !(relationship instanceof Property)) {
             throw new IllegalArgumentException(
-                    "'relationship' must be instance of Relationship or Property"); //$NON-NLS-1$
+                    "'relationship' must be instance "
+                    + "of Relationship or Property");
         }
 
         if (relationship instanceof Association) {
@@ -1022,7 +1060,8 @@
         if (!(relationship instanceof Relationship)
                 && !(relationship instanceof Property)) {
             throw new IllegalArgumentException(
-                    "'relationship' must be instance of Relationship or Property"); //$NON-NLS-1$
+                    "'relationship' must be instance "
+                    + "of Relationship or Property");
         }
 
         if (relationship instanceof Association) {
@@ -1033,7 +1072,8 @@
             return conns.get(0).getType();
         }
         if (relationship instanceof DirectedRelationship) {
-            List<Element> targets = ((DirectedRelationship) relationship).getTargets();
+            List<Element> targets = 
+                ((DirectedRelationship) relationship).getTargets();
             if (targets.isEmpty()) {
                 return null;
             }
@@ -1048,7 +1088,7 @@
     public Object getSpecification(Object object) {
         if (!(object instanceof Behavior)) {
             throw new IllegalArgumentException(
-                    "'object' must be instance of Behavior"); //$NON-NLS-1$
+                    "'object' must be instance of Behavior");
         }
         return ((Behavior) object).getSpecification();
     }
@@ -1056,11 +1096,12 @@
     public Collection<Element> getSubtypes(Object cls) {
         if (!(cls instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'cls' must be instance of Classifier"); //$NON-NLS-1$
+                    "'cls' must be instance of Classifier");
         }
         Collection<Element> results = new HashSet<Element>();
-        for (DirectedRelationship d : ((Classifier) cls)
-                .getTargetDirectedRelationships(UMLPackage.Literals.GENERALIZATION)) {
+        for (DirectedRelationship d 
+                : ((Classifier) cls).getTargetDirectedRelationships(
+                        UMLPackage.Literals.GENERALIZATION)) {
             results.addAll(d.getSources());
         }
         return results;
@@ -1069,7 +1110,7 @@
     public Collection<Classifier> getSupertypes(Object generalizableElement) {
         if (!(generalizableElement instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "'generalizableElement' must be instance of Classifier"); //$NON-NLS-1$
+                    "'generalizableElement' must be instance of Classifier");
         }
         return ((Classifier) generalizableElement).getGenerals();
     }
@@ -1077,7 +1118,7 @@
     public boolean hasCompositeEnd(Object association) {
         if (!(association instanceof Association)) {
             throw new IllegalArgumentException(
-                    "'association' must be instance of Association"); //$NON-NLS-1$
+                    "'association' must be instance of Association");
         }
         for (Property p : ((Association) association).getMemberEnds()) {
             if (p.getAggregation() == AggregationKind.COMPOSITE_LITERAL) {
@@ -1090,7 +1131,7 @@
     public boolean isSubType(Object type, Object subType) {
         if (!(type instanceof Class) || !(subType instanceof Class)) {
             throw new IllegalArgumentException(
-                    "type and subType must be instances of java.lang.Class"); //$NON-NLS-1$
+                    "type and subType must be instances of java.lang.Class");
         }
         return ((Class) type).isAssignableFrom((Class) subType);
     }
@@ -1104,7 +1145,7 @@
             return true;
         }
         try {
-            RunnableClass run = getRunnableClassForAddCommand(
+            getRunnableClassForAddCommand(
                     (Namespace) namespace, (NamedElement) element);
         } catch (UnsupportedOperationException e) {
             return false;
@@ -1116,11 +1157,11 @@
             final Object annotatedElement) {
         if (!(annotatedElement instanceof Element)) {
             throw new IllegalArgumentException(
-                    "annotatedElement must be instance of Element"); //$NON-NLS-1$
+                    "annotatedElement must be instance of Element");
         }
         if (!(comment instanceof Comment)) {
             throw new IllegalArgumentException(
-                    "comment must be instance of Comment"); //$NON-NLS-1$
+                    "comment must be instance of Comment");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1132,18 +1173,19 @@
                 new ChangeCommand(
                         modelImpl,
                         run,
-                        "Remove the link between the comment # and the element #",
+                        "Remove the link between the comment # "
+                        + "and the element #",
                         comment, annotatedElement));
     }
 
     public void removeClientDependency(final Object handle, final Object dep) {
         if (!(handle instanceof NamedElement)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of NamedElement"); //$NON-NLS-1$
+                    "handle must be instance of NamedElement");
         }
         if (!(dep instanceof Dependency)) {
             throw new IllegalArgumentException(
-                    "dep must be instance of Dependency"); //$NON-NLS-1$
+                    "dep must be instance of Dependency");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1160,16 +1202,18 @@
     public void removeConnection(final Object handle, final Object connection) {
         if (!(handle instanceof Association)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of Association"); //$NON-NLS-1$
+                    "handle must be instance of Association");
         }
         if (!(connection instanceof Property)) {
             throw new IllegalArgumentException(
-                    "connection must be instance of Property"); //$NON-NLS-1$
+                    "connection must be instance of Property");
         }
+
+        final Association association = (Association) handle;
         RunnableClass run = new RunnableClass() {
             public void run() {
-                if (((Association) handle).getOwnedEnds().contains(connection)) {
-                    ((Association) handle).getOwnedEnds().remove(connection);
+                if (association.getOwnedEnds().contains(connection)) {
+                    association.getOwnedEnds().remove(connection);
                 }
                 if (((Property) connection).getAssociation() == handle) {
                     ((Property) connection).setAssociation(null);
@@ -1206,17 +1250,20 @@
     public void removeOwnedElement(Object handle, Object value) {
         if (!(handle instanceof Element)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of Element"); //$NON-NLS-1$
+                    "handle must be instance of Element");
         }
         if (!(value instanceof Element)) {
             throw new IllegalArgumentException(
-                    "value must be instance of Element"); //$NON-NLS-1$
+                    "value must be instance of Element");
         }
         editingDomain.getCommandStack().execute(
                 new ChangeCommand(
                         modelImpl,
-                        getRunnableClassForRemoveCommand((Element) value),
-                        "Remove the element # from the owner #", value, handle));
+                        getRunnableClassForRemoveCommand(
+                                (Element) value),
+                                "Remove the element # from the owner #", 
+                                value, 
+                                handle));
     }
 
     public void removeParameter(Object handle, Object parameter) {
@@ -1232,7 +1279,9 @@
     }
 
 
-    public void removeStereotype(final Object modelElement, final Object stereo) {
+    public void removeStereotype(
+            final Object modelElement, 
+            final Object stereo) {
         UMLUtil.checkArgs(new Object[] {modelElement, stereo},
                 new Class[] {Element.class, Stereotype.class});
         RunnableClass run = new RunnableClass() {
@@ -1242,15 +1291,17 @@
                 fireUnapplyStereotypeEvent(modelElement, stereotype);
             }
             /**
-             * Call the model event pump and ask it to fire an event indicating a
-             * stereotype has been removed. This is a stop-gap until we have
+             * Call the model event pump and ask it to fire an event indicating
+             * a stereotype has been removed. This is a stop-gap until we have
              * determined how the event pump can detect itself that a stereotype
              * has been removed.
              *  
              * @param modelElement
              * @param stereotype
              */
-            private void fireUnapplyStereotypeEvent(Object modelElement, Object stereotype) {
+            private void fireUnapplyStereotypeEvent(
+                    Object modelElement,
+                    Object stereotype) {
                 final ModelEventPumpEUMLImpl pump =
                     (ModelEventPumpEUMLImpl) Model.getPump();
                 pump.fireEvent(
@@ -1258,7 +1309,7 @@
                         stereotype, 
                         null, 
                         Notification.REMOVE, 
-                        "stereotype", //$NON-NLS-1$
+                        "stereotype",
                         null);
             }
 
@@ -1274,11 +1325,11 @@
             final Object dependency) {
         if (!(supplier instanceof NamedElement)) {
             throw new IllegalArgumentException(
-                    "supplier must be instance of NamedElement"); //$NON-NLS-1$
+                    "supplier must be instance of NamedElement");
         }
         if (!(dependency instanceof Dependency)) {
             throw new IllegalArgumentException(
-                    "dependency must be instance of Dependency"); //$NON-NLS-1$
+                    "dependency must be instance of Dependency");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1308,7 +1359,8 @@
         if (!(handle instanceof Classifier)
                 && !(handle instanceof BehavioralFeature)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of Classifier or BehavioralFeature"); //$NON-NLS-1$
+                    "handle must be instance "
+                    + "of Classifier or BehavioralFeature");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1328,7 +1380,7 @@
     public void setActive(final Object handle, final boolean isActive) {
         if (!(handle instanceof org.eclipse.uml2.uml.Class)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of UML2 Class"); //$NON-NLS-1$
+                    "handle must be instance of UML2 Class");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1362,15 +1414,17 @@
         setAggregation2(handle, aggregationKind);
     }
 
-    public void setAggregation2(final Object handle, final Object aggregationKind) {
+    public void setAggregation2(
+            final Object handle, 
+            final Object aggregationKind) {
         if (!(handle instanceof Property)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of Property"); //$NON-NLS-1$
+                    "handle must be instance of Property");
         }
         if (!(aggregationKind instanceof AggregationKind)) {
             throw new IllegalArgumentException(
-                    "aggregationKind must be instance of AggregationKind " //$NON-NLS-1$
-                    + aggregationKind + " recieved"); //$NON-NLS-1$
+                    "aggregationKind must be instance of AggregationKind " 
+                    + aggregationKind + " recieved");
         }
         final Property property = (Property) handle;
         final AggregationKind aggregation = (AggregationKind) aggregationKind;
@@ -1396,18 +1450,21 @@
     }
     
     
-    public void setAnnotatedElements(final Object handle, final Collection elems) {
+    public void setAnnotatedElements(
+            final Object handle, 
+            final Collection elems) {
         if (!(handle instanceof Comment)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of Comment"); //$NON-NLS-1$
+                    "handle must be instance of Comment");
         }
         if (elems == null) {
-            throw new NullPointerException("elems must be non-null"); //$NON-NLS-1$
+            throw new NullPointerException("elems must be non-null");
         }
         for (Object o : elems) {
             if (!(o instanceof Element)) {
                 throw new IllegalArgumentException(
-                        "the collection must contain only instances of Element"); //$NON-NLS-1$
+                        "the collection must contain "
+                        + "only instances of Element");
             }
         }
         RunnableClass run = new RunnableClass() {
@@ -1442,52 +1499,62 @@
 
     public void setBody(Object handle, String body) {
         
-	if( handle instanceof Comment) {
+	if (handle instanceof Comment) {
 	    ((Comment) handle).setBody(body);
 	    return;
 	}
 
-	if( handle instanceof Operation) {
+	if (handle instanceof Operation) {
 
-	    // We need a method (operation implementation) to store the method body.
+	    // We need a method (operation implementation) 
+	    // to store the method body.
 	    OpaqueBehavior methodImpl = null;
 
 	    // Maybe this operation already has a method, that fits our purpose?
-	    // In this case, try to reuse it, instead of creating a new implementation.
-	    for( Behavior impl : ((Operation)handle).getMethods()) {
-		if( impl instanceof OpaqueBehavior) {
-		    methodImpl = (OpaqueBehavior)impl;
+	    // In this case, try to reuse it, instead of creating a new 
+	    // implementation.
+	    for (Behavior impl : ((Operation) handle).getMethods()) {
+		if (impl instanceof OpaqueBehavior) {
+		    methodImpl = (OpaqueBehavior) impl;
 		    break;
 		}
 	    }
 
 	    // Check, if we have to create a new implementation.
-	    if( methodImpl == null) {
-		methodImpl = UMLFactory.eINSTANCE.createOpaqueBehavior();	// Create a new implementation.
-		methodImpl.setSpecification( (Operation)handle);		// And set the specification to the current operation.
-		((Operation)handle).getMethods().add( methodImpl);  		// Add it to the operation's methods.
+	    if (methodImpl == null) {
+	        // Create a new implementation.
+		methodImpl = UMLFactory.eINSTANCE.createOpaqueBehavior();
+
+		// And set the specification to the current operation.
+		methodImpl.setSpecification((Operation) handle);
+
+	        // Add it to the operation's methods.
+		((Operation) handle).getMethods().add(methodImpl);
 	    }
 
 	    // Look, if there's already a java implementation
-	    if( methodImpl.isSetLanguages()) {
+	    if (methodImpl.isSetLanguages()) {
 		int bodyIndex = 0;
 
 		// Search for our current target language.
-		for( String language : methodImpl.getLanguages()) {
-		    if( "java".equals( language)) {
+                for (String language : methodImpl.getLanguages()) {
+                    if ("java".equals(language)) {
 
-			// Try to get the corresponding body and set it to the current body
-			// This _should_ work, if all the bodies were stored with their corresponding languages.
-			methodImpl.getBodies().set( bodyIndex, body);
+                        // Try to get the corresponding body and set it 
+                        // to the current body
+                        // This _should_ work, if all the bodies 
+                        // were stored with their corresponding languages.
+                        methodImpl.getBodies().set(bodyIndex, body);
 			return;		// Job done.
 		    }
 		    bodyIndex++;
 		}
 	    }
   
-	    // It seems, there was no implementation of our current target language, so we just add one.
-	    methodImpl.getLanguages().add( "java");
-	    methodImpl.getBodies().add( body);
+            // It seems, there was no implementation of 
+            // our current target language, so we just add one.
+            methodImpl.getLanguages().add("java");
+            methodImpl.getBodies().add(body);
 	    return;
 	}
 
@@ -1504,11 +1571,11 @@
     public void setChild(final Object handle, final Object child) {
         if (!(handle instanceof Generalization)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of Generalization"); //$NON-NLS-1$
+                    "handle must be instance of Generalization");
         }
         if (!(child instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "child must be instance of Classifier"); //$NON-NLS-1$
+                    "child must be instance of Classifier");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1519,17 +1586,21 @@
                 new ChangeCommand(
                         modelImpl,
                         run,
-                        "Set the # as the specific classifier of the generalization #",
+                        "Set the # as the specific classifier "
+                        + "of the generalization #",
                         child, handle));
     }
 
-    public void setConcurrency(final Object handle, final Object concurrencyKind) {
+    public void setConcurrency(
+            final Object handle, 
+            final Object concurrencyKind) {
         UMLUtil.checkArgs(new Object[] {handle, concurrencyKind},
                 new Class[] {Element.class, CallConcurrencyKind.class});
         RunnableClass run = new RunnableClass() {
             public void run() {
-                ((Operation) handle).setConcurrency((CallConcurrencyKind) concurrencyKind);
-        }
+                ((Operation) handle).setConcurrency(
+                        (CallConcurrencyKind) concurrencyKind);
+            }
         };
         editingDomain.getCommandStack().execute(
                 new ChangeCommand(
@@ -1578,23 +1649,23 @@
 
     public void setKind(Object handle, Object kind) {
         // TODO: Needs undo support
-	if( handle instanceof Parameter 
-	        && kind instanceof ParameterDirectionKind) {
-		((Parameter)handle).setDirection( (ParameterDirectionKind)kind);
-		return;
+        if (handle instanceof Parameter 
+                && kind instanceof ParameterDirectionKind) {
+            ((Parameter) handle).setDirection((ParameterDirectionKind) kind);
+            return;
 	}
-	if( handle instanceof Pseudostate && kind instanceof PseudostateKind) {
-		((Pseudostate)handle).setKind( (PseudostateKind)kind);
-		return;
+        if (handle instanceof Pseudostate && kind instanceof PseudostateKind) {
+            ((Pseudostate) handle).setKind((PseudostateKind) kind);
+            return;
 	}
-        throw new IllegalArgumentException( "handle: " + handle  //$NON-NLS-1$
-                + " or kind: " + kind); //$NON-NLS-1$
+        throw new IllegalArgumentException( "handle: " + handle
+                + " or kind: " + kind);
     }
 
     public void setLeaf(final Object handle, final boolean isLeaf) {
         if (!(handle instanceof RedefinableElement)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of RedefinableElement"); //$NON-NLS-1$
+                    "handle must be instance of RedefinableElement");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1603,7 +1674,11 @@
         };
         editingDomain.getCommandStack().execute(
                 new ChangeCommand(
-                        modelImpl, run, "Set isLeaf to # for #", isLeaf, handle));
+                        modelImpl, 
+                        run, 
+                        "Set isLeaf to # for #", 
+                        isLeaf, 
+                        handle));
     }
 
     public void setModelElementContainer(Object handle, Object container) {
@@ -1619,9 +1694,9 @@
     public void setMultiplicity(final Object handle, String arg) {
         if (!(handle instanceof MultiplicityElement)) {
             throw new IllegalArgumentException(
-                    "A MultiplicityElement was expected"); //$NON-NLS-1$
+                    "A MultiplicityElement was expected");
         }
-        if (arg == null || arg.equals("")) { //$NON-NLS-1$
+        if (arg == null || arg.equals("")) {
             RunnableClass run = new RunnableClass() {
                 public void run() {
                     ((MultiplicityElement) handle).setLowerValue(null);
@@ -1631,7 +1706,7 @@
             editingDomain.getCommandStack().execute(
                     new ChangeCommand(
                             modelImpl, run,
-                            "Removing the multiplicity from element #", //$NON-NLS-1$
+                            "Removing the multiplicity from element #",
                             handle));
             return;
         }
@@ -1644,29 +1719,29 @@
     private int[] parseMultiplicity(String arg) {
         int lower = 1, upper = 1;
 
-        if ("*".equals(arg.trim())) { //$NON-NLS-1$
+        if ("*".equals(arg.trim())) {
             lower = 0;
             upper = -1;
-        } else if (arg.contains("..")) { //$NON-NLS-1$
-            String[] pieces = arg.trim().split("\\.\\."); //$NON-NLS-1$
+        } else if (arg.contains("..")) {
+            String[] pieces = arg.trim().split("\\.\\."); 
             if (pieces.length > 2) {
                 throw new IllegalArgumentException((String) arg);
             }
             lower = Integer.parseInt(pieces[0]);
-            if ("*".equals(pieces[1])) { //$NON-NLS-1$
+            if ("*".equals(pieces[1])) {
                 upper = -1;
             } else {
                 upper = Integer.parseInt(pieces[1]);
             }
-        } else if (arg.contains("_")) { //$NON-NLS-1$
+        } else if (arg.contains("_")) {
             // also parse 1_* or 0_N etc.
-            String[] pieces = arg.trim().split("_"); //$NON-NLS-1$
+            String[] pieces = arg.trim().split("_");
             if (pieces.length > 2) {
                 throw new IllegalArgumentException((String) arg);
             }
             lower = Integer.parseInt(pieces[0]);
-            if ("*".equals(pieces[1]) //$NON-NLS-1$
-                    || "N".equals(pieces[1])) { //$NON-NLS-1$
+            if ("*".equals(pieces[1])
+                    || "N".equals(pieces[1])) {
                 upper = -1;
             } else {
                 upper = Integer.parseInt(pieces[1]);
@@ -1700,7 +1775,7 @@
         editingDomain.getCommandStack().execute(
                 new ChangeCommand(
                         modelImpl, run,
-                        "Set the multiplicity #..# to the element #", //$NON-NLS-1$
+                        "Set the multiplicity #..# to the element #",
                         lower, upper, handle));
     }
 
@@ -1714,10 +1789,10 @@
                 return;
             }
             throw new IllegalArgumentException(
-                    "handle must be instance of NamedElement"); //$NON-NLS-1$
+                    "handle must be instance of NamedElement");
         }
         if (name == null) {
-            throw new NullPointerException("name must be non-null"); //$NON-NLS-1$
+            throw new NullPointerException("name must be non-null");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1738,7 +1813,7 @@
     public void setNavigable(final Object handle, final boolean flag) {
         if (!(handle instanceof Property)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of Property"); //$NON-NLS-1$
+                    "handle must be instance of Property");
         }
         final Property prop = (Property) handle;
         if (flag == prop.isNavigable()) {
@@ -1791,11 +1866,11 @@
     public void setParent(final Object handle, final Object parent) {
         if (!(handle instanceof Generalization)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of Generalization"); //$NON-NLS-1$
+                    "handle must be instance of Generalization");
         }
         if (!(parent instanceof Classifier)) {
             throw new IllegalArgumentException(
-                    "parent must be instance of Classifier"); //$NON-NLS-1$
+                    "parent must be instance of Classifier");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1806,7 +1881,8 @@
                 new ChangeCommand(
                         modelImpl,
                         run,
-                        "Set the # as the general classifier of the generalization #",
+                        "Set the # as the general classifier "
+                        + "of the generalization #",
                         parent, handle));
     }
 
@@ -1821,7 +1897,7 @@
     public void setQuery(final Object handle, final boolean isQuery) {
         if (!(handle instanceof Operation)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of Operation"); //$NON-NLS-1$
+                    "handle must be instance of Operation");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1841,7 +1917,7 @@
     public void setReadOnly(final Object handle, final boolean isReadOnly) {
         if (!(handle instanceof StructuralFeature)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of StructuralFeature"); //$NON-NLS-1$
+                    "handle must be instance of StructuralFeature");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1891,7 +1967,7 @@
     public void setStatic(final Object feature, final boolean isStatic) {
         if (!(feature instanceof Feature)) {
             throw new IllegalArgumentException(
-                    "feature must be instance of Feature"); //$NON-NLS-1$
+                    "feature must be instance of Feature");
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -1916,12 +1992,13 @@
     }
 
     public void setType(final Object handle, final Object type) {
-        if (!(handle instanceof TypedElement) && !(handle instanceof Operation)) {
+        if (!(handle instanceof TypedElement) 
+                && !(handle instanceof Operation)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of TypedElement"); //$NON-NLS-1$
+                    "handle must be instance of TypedElement");
         }
         if (type != null && !(type instanceof Type)) {
-            throw new IllegalArgumentException("type must be instance of Type"); //$NON-NLS-1$
+            throw new IllegalArgumentException("type must be instance of Type");
         }
         final TypedElement typedElement;
         if (handle instanceof Operation) {
@@ -1938,21 +2015,25 @@
         editingDomain.getCommandStack().execute(
                 new ChangeCommand(
                         modelImpl, run,
-                        "Set the type # for the typed element #", type, handle));
+                        "Set the type # for the typed element #", 
+                        type, 
+                        handle));
     }
 
     public void setVisibility(final Object handle, final Object visibility) {
         if (!(handle instanceof NamedElement)) {
             throw new IllegalArgumentException(
-                    "handle must be instance of NamedElement"); //$NON-NLS-1$
+                    "handle must be instance of NamedElement");
         }
         if (!(visibility instanceof VisibilityKind)) {
             throw new IllegalArgumentException(
-                    "visibility must be instance of VisibilityKind"); //$NON-NLS-1$
+                    "visibility must be instance of VisibilityKind");
         }
+
+        final NamedElement namedElement = (NamedElement) handle;
         RunnableClass run = new RunnableClass() {
             public void run() {
-                ((NamedElement) handle).setVisibility((VisibilityKind) visibility);
+                namedElement.setVisibility((VisibilityKind) visibility);
             }
         };
         editingDomain.getCommandStack().execute(

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesHelperEUMLImpl.java?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesHelperEUMLImpl.java	2011-07-23 02:04:49-0700
@@ -1,5 +1,5 @@
 // $Id$
-/*******************************************************************************
+/***************************************************************************
  * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -10,7 +10,7 @@
  *    Tom Morris - initial implementation
  *    Thomas Neustupny
  *    Laurent Braud 
- *******************************************************************************/
+ ***************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.ArrayList;
@@ -87,7 +87,8 @@
             bodies = ((OpaqueBehavior) handle).getBodies();
         } else {
             throw new IllegalArgumentException(
-                    "handle must be instance of OpaqueExpression or OpaqueBehavior"); //$NON-NLS-1$
+                    "handle must be instance "
+                    + "of OpaqueExpression or OpaqueBehavior"); //$NON-NLS-1$
         }
         return (bodies.size() < 1) ? null : bodies.get(0);
     }
@@ -109,7 +110,8 @@
     public String multiplicityToString(Object multiplicity) {
         if (!(multiplicity instanceof MultiplicityElement)) {
             throw new IllegalArgumentException(
-                    "multiplicity must be instance of MultiplicityElement"); //$NON-NLS-1$
+                    "multiplicity must be instance "
+                    + "of MultiplicityElement"); //$NON-NLS-1$
         }
         MultiplicityElement mult = (MultiplicityElement) multiplicity;
         if (mult.getLower() == mult.getUpper()) {
@@ -130,11 +132,13 @@
             bodies = ((OpaqueBehavior) handle).getBodies();
         } else {
             throw new IllegalArgumentException(
-                    "handle must be instance of OpaqueExpression or OpaqueBehavior"); //$NON-NLS-1$
+                    "handle must be instance "
+                    + "of OpaqueExpression or OpaqueBehavior"); //$NON-NLS-1$
         }
         // TODO: Support more than one body/language
         if (bodies.size() > 1) {
-            throw new IllegalStateException("Only one body/lang supported"); //$NON-NLS-1$
+            throw new IllegalStateException(
+                    "Only one body/lang supported"); //$NON-NLS-1$
         }
         bodies.clear();
         bodies.add(body);
@@ -149,11 +153,13 @@
             langs = ((OpaqueBehavior) handle).getLanguages();
         } else {
             throw new IllegalArgumentException(
-                    "handle must be instance of OpaqueExpression or OpaqueBehavior"); //$NON-NLS-1$
+                    "handle must be instance "
+                    + "of OpaqueExpression or OpaqueBehavior"); //$NON-NLS-1$
         }
         // TODO: Support more than one body/language
         if (langs.size() > 1) {
-            throw new IllegalStateException("Only one body/lang supported"); //$NON-NLS-1$
+            throw new IllegalStateException(
+                    "Only one body/lang supported"); //$NON-NLS-1$
         }
         langs.clear(); 
         langs.add(language);
@@ -196,31 +202,43 @@
             
             Object[] tabValues = null;
             if (type.equals("LiteralBoolean")) {
-                newValueSpecification = (ValueSpecification)UMLFactory.eINSTANCE.create(UMLPackage.eINSTANCE.getLiteralBoolean());
+                newValueSpecification = 
+                    (ValueSpecification) UMLFactory.eINSTANCE.create(
+                            UMLPackage.eINSTANCE.getLiteralBoolean());
             } else if (type.equals("LiteralNull")) {
-        	newValueSpecification = (ValueSpecification)UMLFactory.eINSTANCE.create(UMLPackage.eINSTANCE.getLiteralNull());
+        	newValueSpecification = 
+        	    (ValueSpecification) UMLFactory.eINSTANCE.create(
+        	            UMLPackage.eINSTANCE.getLiteralNull());
             } else if (type.equals("LiteralString")) {
-                newValueSpecification = (ValueSpecification)UMLFactory.eINSTANCE.create(UMLPackage.eINSTANCE.getLiteralString());
+                newValueSpecification = 
+                    (ValueSpecification) UMLFactory.eINSTANCE.create(
+                            UMLPackage.eINSTANCE.getLiteralString());
                 tabValues = new String[]{""};
             } else if (type.equals("LiteralUnlimitedNatural")) {
-                newValueSpecification = (ValueSpecification)UMLFactory.eINSTANCE.create(UMLPackage.eINSTANCE.getLiteralUnlimitedNatural());
+                newValueSpecification = 
+                    (ValueSpecification) UMLFactory.eINSTANCE.create(
+                            UMLPackage.eINSTANCE.getLiteralUnlimitedNatural());
                 tabValues = new String[]{"0"};
             } else if (type.equals("LiteralInteger")) {
-                newValueSpecification = (ValueSpecification)UMLFactory.eINSTANCE.create(UMLPackage.eINSTANCE.getLiteralInteger());
+                newValueSpecification = 
+                    (ValueSpecification) UMLFactory.eINSTANCE.create(
+                            UMLPackage.eINSTANCE.getLiteralInteger());
                 tabValues = new String[]{"0"};
             } else if (type.equals("OpaqueExpression")) {
-                newValueSpecification = (ValueSpecification)UMLFactory.eINSTANCE.create(UMLPackage.eINSTANCE.getOpaqueExpression());
+                newValueSpecification =
+                    (ValueSpecification) UMLFactory.eINSTANCE.create(
+                            UMLPackage.eINSTANCE.getOpaqueExpression());
                 setLanguage(newValueSpecification, "");
                 setBody(newValueSpecification, "");
             }
-            if(tabValues != null){
-                modifyValueSpecification(newValueSpecification,tabValues);
+            if (tabValues != null) {
+                modifyValueSpecification(newValueSpecification, tabValues);
             }
             
-            if(newValueSpecification!=null){
+            if (newValueSpecification != null) {
                 property.setDefaultValue(newValueSpecification);
             }
-        }// TODO else => Exception !
+        } // TODO else => Exception !
 
         return newValueSpecification;
         
@@ -259,7 +277,7 @@
             }
         } else if (handle instanceof OpaqueExpression) {
             //rewrite it after change setExpression ?
-            OpaqueExpression oe=(OpaqueExpression) handle;
+            OpaqueExpression oe = (OpaqueExpression) handle;
             List<String> bodies = oe.getBodies();
             List<String> langs = oe.getLanguages();
             // as write in UML specification, we have size(bodies)==size(langs)
@@ -267,8 +285,8 @@
             bodies.clear();
             langs.clear();
             for (int i = 0; i < tabValues.length; i += 2) {
-                bodies.add((String)tabValues[i]);
-                langs.add((String)tabValues[i+1]);
+                bodies.add((String) tabValues[i]);
+                langs.add((String) tabValues[i + 1]);
             }
         }
         // TODO Expression and InstanceValue (how)
@@ -293,7 +311,7 @@
             tabValues = new String[]{ls.getValue()};
         } else if (handle instanceof LiteralUnlimitedNatural) {
             LiteralUnlimitedNatural lun = (LiteralUnlimitedNatural) handle;
-            tabValues = new String[]{""+lun.getValue()};
+            tabValues = new String[]{"" + lun.getValue()};
         } else if (handle instanceof LiteralInteger) {
             LiteralInteger li = (LiteralInteger) handle;
             tabValues = new Integer[]{li.getValue()};
@@ -306,10 +324,10 @@
             // as write in UML specification, we have size(bodies)==size(langs)
             // we must have tabValues.length%2==0
             if (bodies.size() > 0) {
-                tabValues= new String[bodies.size()*2];
+                tabValues = new String[bodies.size() * 2];
                 for (int i = 0; i < bodies.size(); i++) {
-                    tabValues[i*2] = bodies.get(i);
-                    tabValues[i*2+1] = langs.get(i);
+                    tabValues[i * 2] = bodies.get(i);
+                    tabValues[i * 2 + 1] = langs.get(i);
                 }
             }
         }

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java	2011-07-23 02:04:49-0700
@@ -66,9 +66,9 @@
  * them.
  * <p>
  * The implementation of this subsystem was generously sponsored by Google as
- * part of the Google Summer of Code 2007. A large part of the implementation was
- * built by the sponsored student, Bogdan Ciprian Pistol, who was mentored by
- * Tom Morris.
+ * part of the Google Summer of Code 2007. A large part of the implementation
+ * was built by the sponsored student, Bogdan Ciprian Pistol, who was mentored
+ * by Tom Morris.
  * <p>
  * This implementation uses ideas and code snippets from the 
  * "org.eclipse.uml2.uml.editor.presentation" package which is part of the
@@ -167,7 +167,7 @@
      * <p>
      * TODO: This needs to be managed per EditingDomain.
      */
-    private Map<Resource,Boolean> readOnlyMap = 
+    private Map<Resource, Boolean> readOnlyMap = 
         new HashMap<Resource, Boolean>();
 
     /**
@@ -234,36 +234,52 @@
             //if (Character.isLetter(path.charAt(0))) {
             //    path = '/' + path;
             //}
-            URI uri = URI.createURI("jar:file:" + path + "!/"); //$NON-NLS-1$ //$NON-NLS-2$
+            URI uri = 
+                URI.createURI(
+                        "jar:file:" //$NON-NLS-1$
+                        + path 
+                        + "!/"); //$NON-NLS-1$
             LOG.debug("eUML.resource URI --> " + uri); //$NON-NLS-1$
 
             Registry packageRegistry = resourceSet.getPackageRegistry();
             packageRegistry.put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
             packageRegistry.put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE);
             // for other xmi files with further namespaces:
-            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_1_NS_URI, UMLPackage.eINSTANCE);
-            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_1_URI, UMLPackage.eINSTANCE);
-            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_NS_URI, UMLPackage.eINSTANCE);
-            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_URI, UMLPackage.eINSTANCE);
-            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_2_NS_URI, UMLPackage.eINSTANCE);
-            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_NS_URI, UMLPackage.eINSTANCE);
-            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_URI, UMLPackage.eINSTANCE);
+            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_1_NS_URI, 
+                    UMLPackage.eINSTANCE);
+            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_1_URI, 
+                    UMLPackage.eINSTANCE);
+            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_NS_URI, 
+                    UMLPackage.eINSTANCE);
+            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_URI, 
+                    UMLPackage.eINSTANCE);
+            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_2_NS_URI, 
+                    UMLPackage.eINSTANCE);
+            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_NS_URI, 
+                    UMLPackage.eINSTANCE);
+            packageRegistry.put(XMI212UMLResource.UML_METAMODEL_URI, 
+                    UMLPackage.eINSTANCE);
             // eclipse namespaces:
-            packageRegistry.put(UML212UMLResource.UML_METAMODEL_NS_URI, UMLPackage.eINSTANCE);
-            packageRegistry.put("http://www.eclipse.org/uml2/2.0.0/UML", UMLPackage.eINSTANCE);
+            packageRegistry.put(UML212UMLResource.UML_METAMODEL_NS_URI, 
+                    UMLPackage.eINSTANCE);
+            packageRegistry.put("http://www.eclipse.org/uml2/2.0.0/UML", 
+                    UMLPackage.eINSTANCE);
 
             // For the .uml files in the eclipse jar files, we need this:
             extensionToFactoryMap.put(
                     UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
             uriMap.put(
                     URI.createURI(UMLResource.LIBRARIES_PATHMAP),
-                    uri.appendSegment("libraries").appendSegment("")); //$NON-NLS-1$ //$NON-NLS-2$
+                    uri.appendSegment("libraries") //$NON-NLS-1$
+                       .appendSegment("")); //$NON-NLS-1$
             uriMap.put(
                     URI.createURI(UMLResource.METAMODELS_PATHMAP),
-                    uri.appendSegment("metamodels").appendSegment("")); //$NON-NLS-1$//$NON-NLS-2$
+                    uri.appendSegment("metamodels") //$NON-NLS-1$
+                       .appendSegment("")); //$NON-NLS-1$
             uriMap.put(
                     URI.createURI(UMLResource.PROFILES_PATHMAP),
-                    uri.appendSegment("profiles").appendSegment("")); //$NON-NLS-1$//$NON-NLS-2$
+                    uri.appendSegment("profiles") //$NON-NLS-1$
+                       .appendSegment("")); //$NON-NLS-1$
         }
 
         extensionToFactoryMap.put(
@@ -544,13 +560,6 @@
         return null;
     }
 
-    private CommandStackImpl getCommandStack() {
-        if (theCommandStack == null) {
-            theCommandStack = new CommandStackImpl(this);
-        }
-        return theCommandStack;
-    }
-
     /**
      * Unload all resources in the editing domain and clear the read only map.
      */

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	2011-07-23 02:04:49-0700
@@ -207,7 +207,8 @@
                     "association must be Association"); //$NON-NLS-1$
         }
         for (Property p : ((Association) association).getOwnedEnds()) {
-            if (p.getType() == classifier && p.getAssociation() == association) {
+            if (p.getType() == classifier 
+                    && p.getAssociation() == association) {
                 return p;
             }
         }
@@ -315,14 +316,18 @@
             return getValueSpecification((ValueSpecification) handle);
         } else if (handle instanceof Operation) {
 	    
-	    // Get the implementations of this operations and look for an OpaqueBehavior.
-	    for( Behavior impl : ((Operation)handle).getMethods()) {
-		if( impl instanceof OpaqueBehavior) {
-		    if( ((OpaqueBehavior)impl).isSetLanguages()) {
+	    // Get the implementations of this operations and 
+            // look for an OpaqueBehavior.
+	    for (Behavior impl : ((Operation) handle).getMethods()) {
+		if (impl instanceof OpaqueBehavior) {
+		    if (((OpaqueBehavior) impl).isSetLanguages()) {
 			int bodyIndex = 0;
-			for( String targetLanguage : ((OpaqueBehavior)impl).getLanguages()) {
-			    if( "java".equals( targetLanguage)) {
-				return ((OpaqueBehavior)impl).getBodies().get( bodyIndex);
+			for (String targetLanguage 
+			        : ((OpaqueBehavior) impl).getLanguages()) {
+			    if ("java".equals(targetLanguage)) {
+				EList<String> bodies = 
+				    ((OpaqueBehavior) impl).getBodies();
+                                return bodies.get(bodyIndex);
 			    }
 			    bodyIndex++;
 			}
@@ -332,8 +337,8 @@
 	    return null;  // No body found.
         } else if (handle instanceof OpaqueBehavior) {
             String ret = null;
-            if (((OpaqueBehavior) handle).getBodies() != null &&
-                    !((OpaqueBehavior) handle).getBodies().isEmpty()) {
+            if (((OpaqueBehavior) handle).getBodies() != null 
+                    && !((OpaqueBehavior) handle).getBodies().isEmpty()) {
                 ret = ((OpaqueBehavior) handle).getBodies().get(0);
             }
             return ret;
@@ -342,8 +347,8 @@
             return handle;
         }
         throw new IllegalArgumentException(
-                "Unsupported argument type - must be Comment, Constraint," +
-                " Expression, or Method ");
+                "Unsupported argument type - must be Comment, Constraint," 
+                + " Expression, or Method ");
 
     }
 
@@ -447,9 +452,10 @@
         }
 	if (handle instanceof Operation) {
 	    List<Collaboration> result = new ArrayList<Collaboration>();
-	    for( RedefinableElement re : ((Operation)handle).getRedefinedElements()) {
-		if( re instanceof Collaboration) {
-		    result.add( (Collaboration)re);
+	    for (RedefinableElement re 
+	            : ((Operation) handle).getRedefinedElements()) {
+		if (re instanceof Collaboration) {
+		    result.add((Collaboration) re);
                 }
 	    }
 	    return result;
@@ -488,9 +494,10 @@
 
     public Object getConcurrency(Object handle) {
         if (!(handle instanceof BehavioralFeature)) {
-            throw new IllegalArgumentException("handle must be a BehavioralFeature!");
+            throw new IllegalArgumentException(
+                    "handle must be a BehavioralFeature!");
         }
-        return ((BehavioralFeature)handle).getConcurrency();
+        return ((BehavioralFeature) handle).getConcurrency();
     }
 
     public Object getCondition(Object handle) {
@@ -625,12 +632,13 @@
     }
 	
     /**
-     * Get all the relationsships, that represent
+     * Get all the relationships, that represent
      * an import of this element.
      *
      * @param handle The imported model element
      *
-     * @return A collection of ElementImport object, that represent imports of this object.
+     * @return A collection of ElementImport object, 
+     * that represent imports of this object.
      */
     public Collection getElementImports2(Object handle) {
         if (!(handle instanceof Element)) {
@@ -641,11 +649,11 @@
 
 	// Get all the relationships, that this model element has.
 	// and filter everything, that is not an import.
-	for( Relationship rel : ((Element)handle).getRelationships()) {
-	    if( (rel instanceof ElementImport)
-		&& ((ElementImport)rel).getImportedElement() == handle) {
+	for (Relationship rel : ((Element) handle).getRelationships()) {
+	    if ((rel instanceof ElementImport)
+		&& ((ElementImport) rel).getImportedElement() == handle) {
 
-		result.add( rel);
+		result.add(rel);
 	    }
 	}
 	return result;
@@ -693,7 +701,8 @@
         
         // TODO: Untested alternative to investigate
 //        Collection<Element> result = new ArrayList<Element>();
-//        TreeIterator it = modelImpl.getEditingDomain().getResourceSet().getAllContents();
+//        TreeIterator it = 
+//            modelImpl.getEditingDomain().getResourceSet().getAllContents();
 //        while (it.hasNext()) {
 //            Object o = it.next();
 //            if (handle.getClass().isAssignableFrom(o.getClass())) {
@@ -711,13 +720,13 @@
     public Collection<Extend> getExtenders(Object handle) {
         if (isAUseCase(handle)) {
             ArrayList<Extend> extenders = new ArrayList<Extend>();
-            Model oModel=((Element) handle).getModel();
+            Model oModel = ((Element) handle).getModel();
             EList<Element> allElement = oModel.allOwnedElements();
             for (Element element : allElement) {
-                if(isAExtend(element)){
+                if (isAExtend(element)) {
                     Extend aExtend = (Extend) element;
                     
-                    if(aExtend.getExtendedCase().equals(handle)){
+                    if (aExtend.getExtendedCase().equals(handle)) {
                         extenders.add(aExtend);    
                     }
                 }
@@ -843,13 +852,13 @@
         if (isAUseCase(handle)) {
             ArrayList<Include> includers = new ArrayList<Include>();
             Model oModel = ((Element) handle).getModel();
-            EList<Element> allElement=oModel.allOwnedElements();
+            EList<Element> allElement = oModel.allOwnedElements();
             for (Element element : allElement) {
-                if(isAInclude(element)){
+                if (isAInclude(element)) {
                     Include aInclude = (Include) element;
-                    if(aInclude.getAddition().equals(handle)){
-                       includers.add(aInclude);    
-                   }
+                    if (aInclude.getAddition().equals(handle)) {
+                        includers.add(aInclude);    
+                    }
                 }
             }
             return includers;
@@ -911,13 +920,15 @@
 
     public Collection getInteractions(Object handle) {
         
-        // Comment by A- Rueckert: I don't think it makes much sense to query interactions
-        // from a Collaboration in UML2, since this diagram does no longer exist and 
+        // TODO: Comment by A- Rueckert: I don't think it makes much 
+        // sense to query interactions from a Collaboration in UML2, 
+        // since this diagram does no longer exist and 
         // an Interaction means something different in UML2.
         if (!(handle instanceof Collaboration)) {
-            throw new IllegalArgumentException("handle has to be a Collaboration!");
+            throw new IllegalArgumentException(
+                    "handle has to be a Collaboration!");
         }
-        return ((Collaboration)handle).getCollaborationRoles();
+        return ((Collaboration) handle).getCollaborationRoles();
     }
 
     public Collection getInternalTransitions(Object handle) {
@@ -1003,7 +1014,7 @@
 
     public Collection getMethods(Object handle) {
         if (handle instanceof BehavioralFeature) {
-            return ((BehavioralFeature)handle).getMethods();
+            return ((BehavioralFeature) handle).getMethods();
         }
         // there's more to be handled, which still need to be implemented:
         throw new NotYetImplementedException();
@@ -1097,7 +1108,7 @@
                 name.append('<').append('<');
                 EObject p = c.eContainer();
                 if (p instanceof EPackage) {
-                    name.append(((EPackage)p).getName()).append(':');
+                    name.append(((EPackage) p).getName()).append(':');
                 } else {
                     name.append("(null):");
                 }
@@ -1295,9 +1306,10 @@
 
     public Object getPowertype(Object handle) {
         if (handle instanceof Generalization) {
-            EList<GeneralizationSet> genSets = ((Generalization) handle).getGeneralizationSets();
+            EList<GeneralizationSet> genSets =
+                ((Generalization) handle).getGeneralizationSets();
             for (GeneralizationSet gs : genSets) {
-                Classifier powerType = gs.getPowertype();
+                /* Classifier powerType = */ gs.getPowertype();
             }
         }
         // TODO: This probably can't be implemented in a way that will make
@@ -1320,13 +1332,14 @@
         return ((Property) handle).getQualifiers();
     }
 
+    @Deprecated
     public Collection getRaisedSignals(Object handle) {
         return getRaisedExceptions(handle);
     }
     
     public Collection getRaisedExceptions( Object handle) {
         if (handle instanceof Operation) {
-            return ((Operation)handle).getRaisedExceptions();
+            return ((Operation) handle).getRaisedExceptions();
         }
         return null;
     }
@@ -1367,15 +1380,18 @@
 
     public Object getRepresentedClassifier(Object handle) {
         
-        // Comment by A. Rueckert <[email protected]> :
+        //TODO:  Comment by A. Rueckert <[email protected]> :
         // I think, the handle holding the collaboration implementation, should
         // rather be a CollaborationUse in UML2. 
-        // But as a workaround for now, I'll try to get a Collaboration representation
-        // (CollaborationUse) and then try to get the owning Classifier from there...
+        // But as a workaround for now, I'll try to get 
+        // a Collaboration representation (CollaborationUse) and 
+        // then try to get the owning Classifier from there...
         if (!(handle instanceof Collaboration)) {
-            throw new IllegalArgumentException("handle should be a Collaboration!"); //$NON-NLS-<n>$ 
+            throw new IllegalArgumentException(
+                    "handle should be a Collaboration!"); //$NON-NLS-<n>$ 
         }
-        CollaborationUse collabUse = ((Collaboration)handle).getRepresentation();
+        CollaborationUse collabUse = 
+            ((Collaboration) handle).getRepresentation();
         
         return collabUse == null ? null : collabUse.getOwner();
     }
@@ -1383,9 +1399,10 @@
     public Object getRepresentedOperation(Object handle) {
         
         if (!(handle instanceof Collaboration)) {
-            throw new IllegalArgumentException("handle should be a Collaboration!"); //$NON-NLS-<n>$
+            throw new IllegalArgumentException(
+                    "handle should be a Collaboration!"); //$NON-NLS-<n>$
         }
-        return ((Collaboration)handle).getOperation(null,null,null);
+        return ((Collaboration) handle).getOperation(null, null, null);
     }
 
     public Object getResident(Object handle) {
@@ -1428,7 +1445,8 @@
         if (handle instanceof Reception) {
             return ((Reception) handle).getSignal();
         }
-        throw new IllegalArgumentException("handle should be a SignalEvent or Reception!"); //$NON-NLS-<n>$
+        throw new IllegalArgumentException(
+                "handle should be a SignalEvent or Reception!"); //$NON-NLS-<n>$
     }
 
     public Vertex getSource(Object handle) {
@@ -1463,10 +1481,10 @@
         // TODO: The UML2 spec provides a specification for Behavior, which
         // is a BehavioralFeature, but ArgoUML calls this for an Operation
         // instance, so we must check what this method is intended for (bug?).
-        if( handle instanceof Behavior) {
-            return ((Behavior)handle).getSpecification().getName();
+        if (handle instanceof Behavior) {
+            return ((Behavior) handle).getSpecification().getName();
         }
-        if( handle instanceof Operation) {
+        if (handle instanceof Operation) {
             return null;
         }
         throw new NotYetImplementedException();
@@ -1478,7 +1496,8 @@
 //          return ((Property) handle).gets
             return Collections.emptySet();
         } else if (handle instanceof org.eclipse.uml2.uml.Class) {
-            return ((org.eclipse.uml2.uml.Class) handle).getInterfaceRealizations();
+            Class theClass = (org.eclipse.uml2.uml.Class) handle;
+            return theClass.getInterfaceRealizations();
         }
         throw new NotYetImplementedException();
 
@@ -1525,7 +1544,8 @@
     }
 
     public Collection getSubmachineStates(Object handle) {
-        throw new NotImplementedException("Not applicable in UML2"); //$NON-NLS-1$
+        throw new NotImplementedException(
+                "Not applicable in UML2"); //$NON-NLS-1$
     }
 
     public Collection getSubvertices(Object handle) {
@@ -1603,7 +1623,11 @@
         
         for (Stereotype st : elem.getAppliedStereotypes()) {
             for (Property p : st.getAttributes()) {
-                Object v = UMLUtil.getTaggedValue(elem, st.getQualifiedName(), p.getName());
+                Object v = 
+                    UMLUtil.getTaggedValue(
+                            elem, 
+                            st.getQualifiedName(), 
+                            p.getName());
                 if (v != null && v != handle) {
                     if (v instanceof Collection) {
                         for (Object o : (Collection) v) {
@@ -1670,6 +1694,7 @@
         throw new NotYetImplementedException();
     }
 
+    @Deprecated
     public Collection getTransitions(Object handle) {
         if (isAStateMachine(handle)) {
             List<Region> regions = ((StateMachine) handle).getRegions();
@@ -1683,16 +1708,19 @@
         } else if (isARegion(handle)) {
             return ((Region) handle).getTransitions();
         } else if (isATrigger(handle)) {
-            List<Transition> result = new ArrayList<Transition>();
+            // List<Transition> result = new ArrayList<Transition>();
             // TODO: not complete - how to retrieve the transitions?
+            throw new NotYetImplementedException();
         } else if (isAEvent(handle)) {
             // TODO: not complete
             throw new NotYetImplementedException();
         }
         throw new IllegalArgumentException(
-            "handle must be instance of StateMachine, Vertex, Region, Trigger or Event"); //$NON-NLS-1$
+            "handle must be instance of "
+                + "StateMachine, Vertex, Region, Trigger or Event");
     }
 
+    @Deprecated
     public Trigger getTrigger(Object handle) {
         if (!(handle instanceof Transition)) {
             throw new IllegalArgumentException();
@@ -1784,8 +1812,11 @@
         Element elem = (Element) handle;
         Property prop = (Property) property;
         Stereotype stereotype = (Stereotype) prop.eContainer();
-        Object value = UMLUtil.getTaggedValue(elem, stereotype.getQualifiedName(),
-                prop.getName());
+        Object value = 
+            UMLUtil.getTaggedValue(
+                    elem, 
+                    stereotype.getQualifiedName(),
+                    prop.getName());
         if (prop.isMultivalued() && !(value instanceof Collection)) {
             Collection newValue = new ArrayList();
             newValue.add(value);
@@ -1808,7 +1839,8 @@
         // workaround for missing ability to parse "*"
         if (prop.getType() != null
                 && "UnlimitedNatural".equals(prop.getType().getName())
-                && ((Integer) value).intValue() == LiteralUnlimitedNatural.UNLIMITED) {
+                && ((Integer) value).intValue() 
+                    == LiteralUnlimitedNatural.UNLIMITED) {
             value = "*";
         }
         return value;
@@ -2479,8 +2511,12 @@
     }
 
     public boolean isAsynchronous(Object handle) {
-        if (handle == MessageSort.ASYNCH_CALL_LITERAL) return true;
-        if (handle == MessageSort.ASYNCH_SIGNAL_LITERAL) return true;
+        if (handle == MessageSort.ASYNCH_CALL_LITERAL) {
+            return true;
+        }
+        if (handle == MessageSort.ASYNCH_SIGNAL_LITERAL) {
+            return true;
+        }
         if (handle instanceof CallAction) {
             return !((CallAction) handle).isSynchronous();
         }
@@ -2715,7 +2751,8 @@
         Resource resource = modelImpl
                 .getEditingDomain()
                 .getResourceSet()
-                .getResource(URI.createURI(UMLResource.UML_METAMODEL_URI), true);
+                .getResource(URI.createURI(UMLResource.UML_METAMODEL_URI), 
+                             true);
         
         Model metamodel = (Model) EcoreUtil.getObjectByType(resource
                 .getContents(), UMLPackage.Literals.PACKAGE);
@@ -2737,7 +2774,8 @@
         } else if (element instanceof ElementImport) {
             return ((ElementImport) element).getImportingNamespace();
         }
-        throw new IllegalArgumentException("Element must be one of PackageImport or ElementImport");
+        throw new IllegalArgumentException(
+                "Element must be one of PackageImport or ElementImport");
     }
     
     org.eclipse.uml2.uml.Package getImportedPackage(Object element) {

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java	2011-07-23 02:04:49-0700
@@ -1,5 +1,5 @@
 // $Id$
-/*******************************************************************************
+/***************************************************************************
  * Copyright (c) 2007,2011 Bogdan Pistol and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -11,7 +11,7 @@
  *    Thomas Neustupny
  *    Bob Tarling
  *    Laurent Braud
- *******************************************************************************/
+ ***************************************************************************/
 package org.argouml.model.euml;
 
 import java.beans.PropertyChangeEvent;
@@ -55,7 +55,7 @@
      * events. See issue 
 
      */
-    final private List<Element> deleteEventIgnoreList =
+    private final List<Element> deleteEventIgnoreList =
         new ArrayList<Element>();
     
     /**
@@ -67,8 +67,8 @@
 
         private Set<String> props;
 
-        Listener(EventListener listener, String[] properties) {
-            this.listener = listener;
+        Listener(EventListener theListener, String[] properties) {
+            listener = theListener;
             if (properties != null) {
                 setProperties(properties);
             }
@@ -297,7 +297,7 @@
                 if (l.getListener() == listener) {
                     if (propertyNames != null) {
                         l.removeProperties(propertyNames);
-                        if(l.getProperties().isEmpty()){
+                        if (l.getProperties().isEmpty()) {
                             iter.remove();
                         }
                     } else {
@@ -306,7 +306,7 @@
                     break;
                 }
             }
-            if(list.isEmpty()){
+            if (list.isEmpty()) {
                 register.remove(notifier);
             }
         }
@@ -413,7 +413,7 @@
                                     getListeners(
                                         oldValue)));
                 } else {
-                    LOG.info("Not sending delete event - assume remove"); //$NON-NLS-1$
+                    LOG.info("Not sending delete event - assume remove");
                 }
                 events.add(new EventAndListeners(
                         new RemoveAssociationEvent(

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java	2011-07-23 02:04:49-0700
@@ -85,10 +85,10 @@
             public void run() {
                 org.eclipse.uml2.uml.Package pkg =
                     (org.eclipse.uml2.uml.Package) createPackage();
-        if (name != null) {
-            pkg.setName(name);
-        }
-            getParams().add(pkg);
+                if (name != null) {
+                    pkg.setName(name);
+                }
+                getParams().add(pkg);
             }
         };
         editingDomain.getCommandStack().execute(
@@ -102,7 +102,7 @@
     }
 
     public ElementImport createElementImport() {
-       RunnableClass run = new RunnableClass() {
+        RunnableClass run = new RunnableClass() {
             public void run() {
                 getParams().add(UMLFactory.eINSTANCE.createElementImport());
             }
@@ -165,7 +165,8 @@
         if (rootModel != null 
                 && !(rootModel instanceof org.eclipse.uml2.uml.Package)) {
             throw new IllegalArgumentException(
-                    "The rootModel supplied must be a Package. Got a " //$NON-NLS-1$
+                    "The rootModel supplied must be a Package. " //$NON-NLS-1$
+                    + "Got a " 
                     + rootModel.getClass().getName());
         }
         List<EObject> restoreList = new ArrayList<EObject>();

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/NotYetImplementedException.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/NotYetImplementedException.java?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/NotYetImplementedException.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/NotYetImplementedException.java	2011-07-23 02:04:49-0700
@@ -1,5 +1,5 @@
 // $Id$
-/*******************************************************************************
+/***************************************************************************
  * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -8,7 +8,7 @@
  *
  * Contributors:
  *    Tom Morris - initial API and implementation
- *******************************************************************************/
+ ***************************************************************************/
 
 package org.argouml.model.euml;
 

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesHelperEUMLImpl.java?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesHelperEUMLImpl.java	2011-07-23 02:04:49-0700
@@ -1,5 +1,5 @@
 // $Id$
-/*******************************************************************************
+/***************************************************************************
  * Copyright (c) 2007-2011 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -10,7 +10,7 @@
  *    Tom Morris - initial framework 
  *    Bob Tarling
  *    Michiel van der Wulp
- *******************************************************************************/
+ ***************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.ArrayList;
@@ -33,7 +33,8 @@
  */
 class StateMachinesHelperEUMLImpl implements StateMachinesHelper {
 
-    private static final Logger LOG = Logger.getLogger(StateMachinesHelperEUMLImpl.class);
+    private static final Logger LOG = 
+        Logger.getLogger(StateMachinesHelperEUMLImpl.class);
     
     /**
      * The model implementation.
@@ -116,12 +117,13 @@
             Collection<Transition> result = new ArrayList<Transition>();
             List<Region> regions = ((StateMachine) handle).getRegions();
             for (Region region : regions) {
-                List<Transition> transitions =region.getTransitions();
+                List<Transition> transitions = region.getTransitions();
                 if (includeInternals) {
                     result.addAll(transitions);
                 } else {
                     for (Transition transition : transitions) {
-                        if (!transition.getKind().equals(TransitionKind.INTERNAL_LITERAL)) {
+                        if (!transition.getKind().equals(
+                                TransitionKind.INTERNAL_LITERAL)) {
                             result.add(transition);
                         }
                     }
@@ -355,7 +357,8 @@
     public void setStatemachineAsSubmachine(Object oSubmachineState,
             Object oStatemachine) {
         if (!(oSubmachineState instanceof State)
-                || !(oStatemachine instanceof StateMachine || oStatemachine == null)) {
+                || !(oStatemachine instanceof StateMachine 
+                        || oStatemachine == null)) {
             throw new IllegalArgumentException(
                     "Expected a state and statemachine, got a " //$NON-NLS-1$
                     + oSubmachineState + " and " + oStatemachine); //$NON-NLS-1$

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java?view=diff&pathrev=19617&r1=19616&r2=19617
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java	2011-07-23 02:04:49-0700
@@ -158,7 +158,8 @@
 //                throw new UmlException("Attempted to load non-UML 2.x file");
 //            }
             if (isUML14(r)) {
-                throw new UmlException("Attempted to load UML 1.4 file"); //$NON-NLS-1$
+                throw new UmlException(
+                        "Attempted to load UML 1.4 file"); //$NON-NLS-1$
             }
         } catch (IOException e) {
             throw new UmlException(e);
@@ -174,7 +175,8 @@
         }
         resource = r;
         LOG.debug("Parsed resource " + resource  //$NON-NLS-1$
-                + " with " + resource.getContents().size() + " elements"); //$NON-NLS-1$ //$NON-NLS-2$
+                + " with " + resource.getContents().size() //$NON-NLS-1$ 
+                + " elements"); //$NON-NLS-1$
         return r.getContents();
     }
 
@@ -187,7 +189,7 @@
      *         Element.
      */
     private boolean isUML2(Resource r) {
-        for (EObject eobj: r.getContents()) {
+        for (EObject eobj : r.getContents()) {
             if (eobj instanceof Element) {
                 return true;
             }
@@ -205,31 +207,31 @@
      */
     private boolean isUML14(Resource r) {
         for (EObject eobj : r.getContents()) {
-            if ("XMI.header".equals(eobj.eClass().getName())) { //$NON-NLS-1$
+            if ("XMI.header".equals(eobj.eClass().getName())) {
                 for (Entry e1 : ((AnyType) eobj).getMixed()) {
                     if (e1 instanceof BasicFeatureMapEntry) {
                         BasicFeatureMapEntry x1 = (BasicFeatureMapEntry) e1;
                         String n1 = x1.getEStructuralFeature().getName();
-                        if ("XMI.metamodel".equals(n1)) { //$NON-NLS-1$
+                        if ("XMI.metamodel".equals(n1)) {
                             AnyType v = (AnyType) x1.getValue();
                             for (Entry e2 : v.getAnyAttribute()) {
                                 if (e2 instanceof SimpleFeatureMapEntry) {
                                     SimpleFeatureMapEntry x = (SimpleFeatureMapEntry) e2;
                                     String n = x.getEStructuralFeature().getName();
-                                    if ("xmi.name".equals(n)) { //$NON-NLS-1$
-                                        if (!("UML".equals((String) x.getValue()))) { //$NON-NLS-1$
+                                    if ("xmi.name".equals(n)) {
+                                        if (!("UML".equals((String) x.getValue()))) {
                                             LOG.warn("Tried to parse XMI file with "
-                                                            + "XMI.header/XMI.metamodel/xmi.name = "
-                                                            + (String) x.getValue());
+                                                     + "XMI.header/XMI.metamodel/xmi.name = "
+                                                     + (String) x.getValue());
                                             return false;
                                         }
-                                    } else if ("xmi.version".equals(n)) { //$NON-NLS-1$
+                                    } else if ("xmi.version".equals(n)) {
                                         String version = (String) x.getValue();
                                         if (version != null
-                                                && version.startsWith("1.4")) { //$NON-NLS-1$
+                                                && version.startsWith("1.4")) {
                                             LOG.debug("Tried to parse XMI file with "
-                                                    + "XMI.header/XMI.metamodel/xmi.version = "
-                                                    + version);
+                                                      + "XMI.header/XMI.metamodel/xmi.version = "
+                                                      + version);
                                             return true;
                                         }
                                     }
@@ -247,7 +249,8 @@
         if (elementNames == null) {
             return true;
         }
-        throw new NotImplementedException("setIgnoredElements not implemented for UML 2.x");
+        throw new NotImplementedException(
+                "setIgnoredElements not implemented for UML 2.x");
         // TODO: Silently ignore instead?
 //        return false;
     }


------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2801509

To unsubscribe from this discussion, e-mail: [[email protected]].