Author: tfmorris Date: 2008-04-18 22:05:53-0700 New Revision: 14393 Modified: trunk/src/model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java
Log: Minor typing cleanup Modified: trunk/src/model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java?view=diff&rev=14393&p1=trunk/src/model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java&p2=trunk/src/model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java&r1=14392&r2=14393 ============================================================================== --- trunk/src/model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java (original) +++ trunk/src/model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java 2008-04-18 22:05:53-0700 @@ -203,8 +203,10 @@ public CompositeState buildCompositeStateOnStateMachine( Object statemachine) { if (statemachine instanceof StateMachine) { + StateMachine sm = (StateMachine) statemachine; CompositeState state = createCompositeState(); - state.setStateMachine((StateMachine) statemachine); + state.setStateMachine(sm); + assert state.equals(sm.getTop()); state.setName("top"); return state; } @@ -226,8 +228,8 @@ BehavioralFeature feature = (BehavioralFeature) context; machine.setNamespace(feature.getOwner()); } - Object top = buildCompositeStateOnStateMachine(machine); - machine.setTop((State) top); + State top = buildCompositeStateOnStateMachine(machine); + machine.setTop(top); return machine; } throw new IllegalArgumentException("In buildStateMachine: " @@ -568,16 +570,17 @@ if (!(elem instanceof StateMachine)) { throw new IllegalArgumentException(); } - + StateMachine stateMachine = (StateMachine) elem; + // This code is probably unnecessary since the top is // associated by composition - State top = (State) Model.getFacade().getTop(elem); + State top = stateMachine.getTop(); if (top != null) { modelImpl.getUmlFactory().delete(top); } modelImpl.getUmlHelper().deleteCollection( - ((StateMachine) elem).getSubmachineState()); + stateMachine.getSubmachineState()); } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
