From: <bob...@us...> - 2011-02-14 05:26:46
|
Revision: 14845 http://andromda.svn.sourceforge.net/andromda/?rev=14845&view=rev Author: bobfields Date: 2011-02-14 05:26:37 +0000 (Mon, 14 Feb 2011) Log Message: ----------- Fix compiler warnings: Add strongly-typed Collections. Add serialVersionUID. Iterator -> for: . Code cleanup. Modified Paths: -------------- trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsActionLogicImpl.java trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsActionStateLogicImpl.java trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsAttributeLogicImpl.java trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsControllerLogicImpl.java trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsControllerOperationLogicImpl.java trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsManageableEntityAttributeLogicImpl.java trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsUseCaseLogicImpl.java trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFActionLogicImpl.java trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFControllerLogicImpl.java trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFManageableEntityLogicImpl.java trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFParameterLogicImpl.java trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFUseCaseLogicImpl.java trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFViewLogicImpl.java trunk/cartridges/andromda-webservice/src/main/java/org/andromda/cartridges/webservice/metafacades/WebServiceLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/ActivityGraphFacadeLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/ActorFacadeLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/ExtensionPointFacadeLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/FrontEndActionStateLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/FrontEndActivityGraphLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/FrontEndControllerOperationLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/FrontEndExceptionHandlerLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/FrontEndFinalStateLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/InteractionFacadeLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/ManageableEntityAssociationEndLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/ObjectFlowStateFacadeLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/ServiceLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/StateMachineFacadeLogicImpl.java trunk/metafacades/uml/emf/uml22/src/main/java/org/andromda/metafacades/emf/uml22/ValueObjectAssociationEndLogicImpl.java trunk/metafacades/uml/uml14/src/main/java/org/andromda/metafacades/uml14/AssociationEndFacadeLogicImpl.java trunk/metafacades/uml/uml14/src/main/java/org/andromda/metafacades/uml14/EntityAssociationEndLogicImpl.java trunk/metafacades/uml/uml14/src/main/java/org/andromda/metafacades/uml14/PackageFacadeLogicImpl.java trunk/translation-libraries/ocl/testsuite/src/main/java/org/andromda/translation/ocl/testsuite/TranslationTestProcessor.java Modified: trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsActionLogicImpl.java =================================================================== --- trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsActionLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsActionLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -16,12 +16,14 @@ import org.andromda.metafacades.uml.FilteredCollection; import org.andromda.metafacades.uml.FrontEndEvent; import org.andromda.metafacades.uml.FrontEndExceptionHandler; +import org.andromda.metafacades.uml.FrontEndFinalState; import org.andromda.metafacades.uml.FrontEndForward; import org.andromda.metafacades.uml.FrontEndParameter; import org.andromda.metafacades.uml.FrontEndUseCase; import org.andromda.metafacades.uml.ModelElementFacade; import org.andromda.metafacades.uml.ParameterFacade; import org.andromda.metafacades.uml.PseudostateFacade; +import org.andromda.metafacades.uml.Role; import org.andromda.metafacades.uml.StateVertexFacade; import org.andromda.metafacades.uml.TransitionFacade; import org.andromda.metafacades.uml.UMLProfile; @@ -40,26 +42,27 @@ public class StrutsActionLogicImpl extends StrutsActionLogic { + private static final long serialVersionUID = 34L; /** * All action states that make up this action, this includes all possible action states traversed * after a decision point too. */ - private Collection actionStates = null; + private Collection<StrutsActionState> actionStates = null; /** * All transitions leading into either a page or final state that originated from a call to this action. */ - private Map actionForwards = null; + private Map<StateVertexFacade, TransitionFacade> actionForwards = null; /** * All transitions leading into a decision point that originated from a call to this action. */ - private Collection decisionTransitions = null; + private Collection<TransitionFacade> decisionTransitions = null; /** * All transitions that can be traversed when calling this action. */ - private Collection transitions = null; + private Collection<TransitionFacade> transitions = null; /** * @param metaObject @@ -77,10 +80,10 @@ */ private void initializeCollections() { - actionStates = new LinkedHashSet(); - actionForwards = new HashMap(); - decisionTransitions = new LinkedHashSet(); - transitions = new LinkedHashSet(); + actionStates = new LinkedHashSet<StrutsActionState>(); + actionForwards = new HashMap<StateVertexFacade, TransitionFacade>(); + decisionTransitions = new LinkedHashSet<TransitionFacade>(); + transitions = new LinkedHashSet<TransitionFacade>(); collectTransitions(this, transitions); } @@ -110,16 +113,14 @@ else if ((target instanceof PseudostateFacade) && ((PseudostateFacade) target).isDecisionPoint()) { decisionTransitions.add(transition); - final Collection outcomes = target.getOutgoings(); - for (final Iterator iterator = outcomes.iterator(); iterator.hasNext();) + for (final TransitionFacade outcome : target.getOutgoings()) { - final TransitionFacade outcome = (TransitionFacade) iterator.next(); collectTransitions(outcome, processedTransitions); } } else if (target instanceof StrutsActionState) { - actionStates.add(target); + actionStates.add((StrutsActionState)target); final FrontEndForward forward = ((StrutsActionState) target).getForward(); if (forward != null) { @@ -128,10 +129,8 @@ } else // all the rest is ignored but outgoing transitions are further processed { - final Collection outcomes = target.getOutgoings(); - for (final Iterator iterator = outcomes.iterator(); iterator.hasNext();) + for (final TransitionFacade outcome : target.getOutgoings()) { - final TransitionFacade outcome = (TransitionFacade) iterator.next(); collectTransitions(outcome, processedTransitions); } } @@ -413,9 +412,9 @@ * are returned, otherwise it will return the users associated to the use-cases targeted by this * action (which may be none at all) */ - private Collection getRoleUsers() + private Collection<Role> getRoleUsers() { - final Collection roleUsers = new ArrayList(); + final Collection<Role> roleUsers = new ArrayList<Role>(); if (this.isUseCaseStart()) { @@ -427,12 +426,11 @@ } else { - for (final Iterator iterator = getActionForwards().iterator(); iterator.hasNext();) + for (final StrutsForward forward : getActionForwards()) { - final TransitionFacade transition = (TransitionFacade) iterator.next(); - if (transition.getTarget() instanceof StrutsFinalState) + if (forward.getTarget() instanceof StrutsFinalState) { - final FrontEndUseCase useCase = ((StrutsFinalState) transition.getTarget()).getTargetUseCase(); + final FrontEndUseCase useCase = ((StrutsFinalState) forward.getTarget()).getTargetUseCase(); if (useCase != null) { roleUsers.addAll(useCase.getRoles()); @@ -628,10 +626,8 @@ */ protected boolean handleIsValidationRequired() { - final Collection actionParameters = getActionParameters(); - for (final Iterator iterator = actionParameters.iterator(); iterator.hasNext();) + for (final StrutsParameter parameter : getActionParameters()) { - final StrutsParameter parameter = (StrutsParameter) iterator.next(); if (parameter.isValidationRequired()) { return true; @@ -645,10 +641,8 @@ */ protected boolean handleIsDateFieldPresent() { - final Collection actionParameters = getActionParameters(); - for (final Iterator iterator = actionParameters.iterator(); iterator.hasNext();) + for (final StrutsParameter parameter : getActionParameters()) { - StrutsParameter parameter = (StrutsParameter) iterator.next(); if (parameter.isDate()) { return true; @@ -662,10 +656,8 @@ */ protected boolean handleIsCalendarRequired() { - final Collection actionParameters = getActionParameters(); - for (final Iterator iterator = actionParameters.iterator(); iterator.hasNext();) + for (final StrutsParameter parameter : getActionParameters()) { - StrutsParameter parameter = (StrutsParameter) iterator.next(); if (parameter.isCalendarRequired()) { return true; @@ -836,12 +828,12 @@ final FrontEndUseCase useCase = this.getUseCase(); if (useCase != null) { - final Collection finalStates = useCase.getReferencingFinalStates(); + final Collection<FrontEndFinalState> finalStates = useCase.getReferencingFinalStates(); for (final Iterator finalStateIterator = finalStates.iterator(); finalStateIterator.hasNext();) { final Object finalStateObject = finalStateIterator.next(); - // we need to test for the type because a non struts-use-case final state might accidently - // we linking to this use-case (for example: the user temporarily wants to disable code generation + // we need to test for the type because a non struts-use-case final state might accidentally + // be linking to this use-case (for example: the user temporarily wants to disable code generation // for a specific use-case and is not removing the final-state to use-case link(s)) if (finalStateObject instanceof StrutsFinalState) { @@ -859,17 +851,13 @@ // if any action encountered by the execution of the complete action-graph path emits a forward // containing one or more parameters they need to be included as a form field too - final Collection actionStates = getActionStates(); - for (final Iterator iterator = actionStates.iterator(); iterator.hasNext();) + for (final StrutsActionState actionState : getActionStates()) { - final StrutsActionState actionState = (StrutsActionState) iterator.next(); final StrutsForward forward = (StrutsForward) actionState.getForward(); if (forward != null) { - final Collection forwardParameters = forward.getForwardParameters(); - for (final Iterator parameterIterator = forwardParameters.iterator(); parameterIterator.hasNext();) + for (final FrontEndParameter forwardParameter : forward.getForwardParameters()) { - final ModelElementFacade forwardParameter = (ModelElementFacade) parameterIterator.next(); formFieldMap.put(forwardParameter.getName(), forwardParameter); } } @@ -877,36 +865,26 @@ // add page variables for all pages/final-states targeted // also add the fields of the target page's actions (for preloading) - final Collection forwards = getActionForwards(); - for (final Iterator iterator = forwards.iterator(); iterator.hasNext();) + for (final StrutsForward forward : getActionForwards()) { - final StrutsForward forward = (StrutsForward) iterator.next(); final StateVertexFacade target = forward.getTarget(); if (target instanceof StrutsJsp) { final StrutsJsp jsp = (StrutsJsp) target; - final Collection pageVariables = jsp.getPageVariables(); - for (final Iterator pageVariableIterator = pageVariables.iterator(); pageVariableIterator.hasNext();) + for (final StrutsParameter facade : jsp.getPageVariables()) { - final ModelElementFacade facade = (ModelElementFacade) pageVariableIterator.next(); formFieldMap.put(facade.getName(), facade); } - final Collection allActionParameters = jsp.getAllActionParameters(); - for (final Iterator actionParameterIterator = allActionParameters.iterator(); - actionParameterIterator.hasNext();) + for (final FrontEndParameter facade : jsp.getAllActionParameters()) { - final ModelElementFacade facade = (ModelElementFacade) actionParameterIterator.next(); formFieldMap.put(facade.getName(), facade); } } else if (target instanceof StrutsFinalState) { // only add these if there is no parameter recorded yet with the same name - final Collection forwardParameters = forward.getForwardParameters(); - for (final Iterator forwardParameterIterator = forwardParameters.iterator(); - forwardParameterIterator.hasNext();) + for (final FrontEndParameter facade : forward.getForwardParameters()) { - final ModelElementFacade facade = (ModelElementFacade) forwardParameterIterator.next(); if (!formFieldMap.containsKey(facade.getName())) { formFieldMap.put(facade.getName(), facade); @@ -916,10 +894,8 @@ } // we do the action parameters in the end because they are allowed to overwrite existing properties - final Collection actionParameters = getActionParameters(); - for (final Iterator actionParameterIterator = actionParameters.iterator(); actionParameterIterator.hasNext();) + for (final StrutsParameter facade : getActionParameters()) { - final ModelElementFacade facade = (ModelElementFacade) actionParameterIterator.next(); formFieldMap.put(facade.getName(), facade); } @@ -1015,10 +991,8 @@ { Collection targetPages = new LinkedHashSet(); - Collection forwards = getActionForwards(); - for (final Iterator forwardIterator = forwards.iterator(); forwardIterator.hasNext();) + for (final StrutsForward forward : getActionForwards()) { - StrutsForward forward = (StrutsForward) forwardIterator.next(); if (forward.isEnteringPage()) { targetPages.add(forward.getTarget()); Modified: trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsActionStateLogicImpl.java =================================================================== --- trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsActionStateLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsActionStateLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -23,6 +23,7 @@ public class StrutsActionStateLogicImpl extends StrutsActionStateLogic { + private static final long serialVersionUID = 34L; /** * @param metaObject * @param context Modified: trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsAttributeLogicImpl.java =================================================================== --- trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsAttributeLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsAttributeLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -15,7 +15,7 @@ public class StrutsAttributeLogicImpl extends StrutsAttributeLogic { - + private static final long serialVersionUID = 34L; /** * @param metaObject * @param context Modified: trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsControllerLogicImpl.java =================================================================== --- trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsControllerLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsControllerLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -10,8 +10,6 @@ import org.andromda.metafacades.uml.OperationFacade; import org.andromda.metafacades.uml.ParameterFacade; - - /** * MetafacadeLogic implementation. * @@ -20,6 +18,7 @@ public class StrutsControllerLogicImpl extends StrutsControllerLogic { + private static final long serialVersionUID = 34L; /** * @param metaObject * @param context Modified: trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsControllerOperationLogicImpl.java =================================================================== --- trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsControllerOperationLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsControllerOperationLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -30,6 +30,7 @@ public class StrutsControllerOperationLogicImpl extends StrutsControllerOperationLogic { + private static final long serialVersionUID = 34L; /** * @param metaObject * @param context Modified: trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsManageableEntityAttributeLogicImpl.java =================================================================== --- trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsManageableEntityAttributeLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsManageableEntityAttributeLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -14,6 +14,7 @@ public class StrutsManageableEntityAttributeLogicImpl extends StrutsManageableEntityAttributeLogic { + private static final long serialVersionUID = 34L; /** * @param metaObject * @param context Modified: trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsUseCaseLogicImpl.java =================================================================== --- trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsUseCaseLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-bpm4struts/src/main/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsUseCaseLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -14,9 +14,13 @@ import org.andromda.cartridges.bpm4struts.Bpm4StrutsGlobals; import org.andromda.cartridges.bpm4struts.Bpm4StrutsProfile; import org.andromda.cartridges.bpm4struts.Bpm4StrutsUtils; +import org.andromda.metafacades.uml.ActionStateFacade; import org.andromda.metafacades.uml.ActivityGraphFacade; import org.andromda.metafacades.uml.FinalStateFacade; import org.andromda.metafacades.uml.FrontEndActivityGraph; +import org.andromda.metafacades.uml.FrontEndParameter; +import org.andromda.metafacades.uml.FrontEndUseCase; +import org.andromda.metafacades.uml.FrontEndView; import org.andromda.metafacades.uml.Role; import org.andromda.utils.StringUtilsHelper; import org.apache.commons.lang.StringUtils; @@ -147,10 +151,10 @@ */ protected String handleGetActionRoles() { - final Collection users = this.getRoles(); + final Collection<Role> users = this.getRoles(); final StringBuilder rolesBuffer = new StringBuilder(); boolean first = true; - for (final Iterator userIterator = users.iterator(); userIterator.hasNext();) + for (final Iterator<Role> userIterator = users.iterator(); userIterator.hasNext();) { if (first) { @@ -178,7 +182,7 @@ /** * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsUseCaseLogic#handleGetPages() */ - protected List handleGetPages() + protected List<FrontEndView> handleGetPages() { return this.getViews(); } @@ -186,16 +190,13 @@ /** * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsUseCaseLogic#handleGetAllPages() */ - protected List handleGetAllPages() + protected List<StrutsJsp> handleGetAllPages() { - final List pagesList = new ArrayList(); - final Collection allActionStates = getModel().getAllActionStates(); - - for (final Iterator actionStateIterator = allActionStates.iterator(); actionStateIterator.hasNext();) + final List<StrutsJsp> pagesList = new ArrayList<StrutsJsp>(); + for (final ActionStateFacade actionState : getModel().getAllActionStates()) { - final Object actionState = actionStateIterator.next(); if (actionState instanceof StrutsJsp) - pagesList.add(actionState); + pagesList.add((StrutsJsp)actionState); } return pagesList; } @@ -207,19 +208,15 @@ { final List formFields = new ArrayList(); // parameter names are supposed to be unique - final Collection pages = getPages(); - for (final Iterator pageIterator = pages.iterator(); pageIterator.hasNext();) + for (final StrutsJsp jsp : getPages()) { - final StrutsJsp jsp = (StrutsJsp)pageIterator.next(); - final Collection variables = jsp.getPageVariables(); - for (final Iterator variableIterator = variables.iterator(); variableIterator.hasNext();) + for (final StrutsParameter parameter : jsp.getPageVariables()) { - formFields.add(variableIterator.next()); + formFields.add(parameter); } - final Collection parameters = jsp.getAllActionParameters(); - for (final Iterator parameterIterator = parameters.iterator(); parameterIterator.hasNext();) + for (final FrontEndParameter parameter : jsp.getAllActionParameters()) { - formFields.add(parameterIterator.next()); + formFields.add(parameter); } } return formFields; @@ -230,10 +227,8 @@ */ protected boolean handleIsValidationRequired() { - final Collection allPages = this.getAllPages(); - for (final Iterator iterator = allPages.iterator(); iterator.hasNext();) + for (final StrutsJsp jsp : this.getAllPages()) { - final StrutsJsp jsp = (StrutsJsp)iterator.next(); if (jsp.isValidationRequired()) { return true; @@ -247,11 +242,9 @@ */ protected boolean handleIsApplicationValidationRequired() { - final Collection useCases = this.getAllUseCases(); - for (final Iterator iterator = useCases.iterator(); iterator.hasNext();) + for (final FrontEndUseCase useCase : this.getAllUseCases()) { - final StrutsUseCase useCase = (StrutsUseCase)iterator.next(); - if (useCase.isValidationRequired()) + if (((StrutsUseCase)useCase).isValidationRequired()) { return true; } @@ -286,7 +279,7 @@ /** * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsUseCaseLogic#handleGetPageVariables() */ - protected List handleGetPageVariables() + protected List<FrontEndParameter> handleGetPageVariables() { return this.getViewVariables(); } @@ -324,8 +317,8 @@ { UseCaseNode hierarchy = null; - final Collection allUseCases = this.getAllUseCases(); - for (final Iterator useCaseIterator = allUseCases.iterator(); useCaseIterator.hasNext();) + final Collection<FrontEndUseCase> allUseCases = this.getAllUseCases(); + for (final Iterator<FrontEndUseCase> useCaseIterator = allUseCases.iterator(); useCaseIterator.hasNext();) { final StrutsUseCase useCase = (StrutsUseCase)useCaseIterator.next(); if (useCase.isApplicationUseCase()) @@ -348,8 +341,8 @@ final FrontEndActivityGraph graph = useCase.getActivityGraph(); if (graph != null) { - final Collection finalStates = graph.getFinalStates(); - for (final Iterator finalStateIterator = finalStates.iterator(); finalStateIterator.hasNext();) + final Collection<FinalStateFacade> finalStates = graph.getFinalStates(); + for (final Iterator<FinalStateFacade> finalStateIterator = finalStates.iterator(); finalStateIterator.hasNext();) { final StrutsFinalState finalState = (StrutsFinalState)finalStateIterator.next(); final StrutsUseCase targetUseCase = (StrutsUseCase)finalState.getTargetUseCase(); @@ -402,9 +395,9 @@ UseCaseNode useCaseNode = null; final List<UseCaseNode> nodeList = Collections.list(root.breadthFirstEnumeration()); - for (final Iterator nodeIterator = nodeList.iterator(); nodeIterator.hasNext() && useCaseNode == null;) + for (final Iterator<UseCaseNode> nodeIterator = nodeList.iterator(); nodeIterator.hasNext() && useCaseNode == null;) { - UseCaseNode node = (UseCaseNode)nodeIterator.next(); + UseCaseNode node = nodeIterator.next(); if (useCase.equals(node.getUserObject())) { useCaseNode = node; @@ -453,11 +446,11 @@ protected Map handleGetAllMessages() { final boolean normalize = this.normalizeMessages(); - final Map messages = (normalize) ? new TreeMap() : new LinkedHashMap(); + final Map<String, String> messages = (normalize) ? new TreeMap() : new LinkedHashMap<String, String>(); if (this.isApplicationUseCase()) { - final List useCases = this.getAllUseCases(); + final List<FrontEndUseCase> useCases = this.getAllUseCases(); for (int i = 0; i < useCases.size(); i++) { // USECASE @@ -471,16 +464,14 @@ final StrutsAction action = (StrutsAction)actions.get(j); // FORWARDS - final List transitions = action.getTransitions(); - for (int l = 0; l < transitions.size(); l++) + for (StrutsForward forward : action.getTransitions()) { - final StrutsForward forward = (StrutsForward)transitions.get(l); messages.putAll(forward.getSuccessMessages()); messages.putAll(forward.getWarningMessages()); } // EXCEPTION FORWARDS - final List exceptions = action.getActionExceptions(); + final List<StrutsExceptionHandler> exceptions = action.getActionExceptions(); if (normalize) { @@ -493,9 +484,8 @@ } else { - for (int l = 0; l < exceptions.size(); l++) + for (final StrutsExceptionHandler exception : exceptions) { - final StrutsExceptionHandler exception = (StrutsExceptionHandler)exceptions.get(l); messages.put(action.getMessageKey() + '.' + exception.getExceptionKey(), "{0}"); } } @@ -558,7 +548,7 @@ messages.put(page.getOnlineHelpKey(), page.getOnlineHelpValue()); messages.put(page.getDocumentationKey(), page.getDocumentationValue()); - final List pageVariables = page.getPageVariables(); + final List<StrutsParameter> pageVariables = page.getPageVariables(); for (int k = 0; k < pageVariables.size(); k++) { // PAGE-VARIABLE @@ -584,7 +574,7 @@ // TABLE if (parameter.isTable()) { - final Collection columnNames = parameter.getTableColumnNames(); + final Collection<String> columnNames = parameter.getTableColumnNames(); for (final Iterator columnNameIterator = columnNames.iterator(); columnNameIterator.hasNext();) { @@ -630,8 +620,8 @@ for (int m = 0; m < optionKeys.size(); m++) { - messages.put(optionKeys.get(m), optionValues.get(m)); - messages.put(optionKeys.get(m) + ".title", optionValues.get(m)); + messages.put((String)optionKeys.get(m), (String)optionValues.get(m)); + messages.put((String)optionKeys.get(m) + ".title", (String)optionValues.get(m)); } } } Modified: trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFActionLogicImpl.java =================================================================== --- trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFActionLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFActionLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -14,6 +14,8 @@ import org.andromda.cartridges.jsf.JSFUtils; import org.andromda.metafacades.uml.EventFacade; import org.andromda.metafacades.uml.FrontEndAction; +import org.andromda.metafacades.uml.FrontEndControllerOperation; +import org.andromda.metafacades.uml.FrontEndParameter; import org.andromda.metafacades.uml.FrontEndView; import org.andromda.metafacades.uml.ModelElementFacade; import org.andromda.metafacades.uml.UseCaseFacade; @@ -176,8 +178,8 @@ */ protected String handleGetFormImplementationInterfaceList() { - final List deferredOperations = this.getDeferredOperations(); - for (final Iterator iterator = deferredOperations.iterator(); iterator.hasNext();) + final List<FrontEndControllerOperation> deferredOperations = this.getDeferredOperations(); + for (final Iterator<FrontEndControllerOperation> iterator = deferredOperations.iterator(); iterator.hasNext();) { // - remove any forms that don't have arguments final JSFControllerOperation operation = (JSFControllerOperation)iterator.next(); @@ -187,7 +189,7 @@ } } final StringBuilder list = new StringBuilder(); - for (final Iterator iterator = deferredOperations.iterator(); iterator.hasNext();) + for (final Iterator<FrontEndControllerOperation> iterator = deferredOperations.iterator(); iterator.hasNext();) { final JSFControllerOperation operation = (JSFControllerOperation)iterator.next(); list.append(operation.getFormName()); @@ -353,7 +355,7 @@ final JSFView view = (JSFView)this.getInput(); if (view != null) { - final List tables = view.getTables(); + final List<FrontEndParameter> tables = view.getTables(); for (int ctr = 0; ctr < tables.size() && tableLinkParameter == null; ctr++) { final Object object = tables.get(ctr); @@ -473,10 +475,10 @@ /** * @return otherActions */ - protected List handleGetOtherUseCaseFormActions() + protected List<FrontEndAction> handleGetOtherUseCaseFormActions() { - final List otherActions = new ArrayList(this.getUseCase().getActions()); - for (final Iterator iterator = otherActions.iterator(); iterator.hasNext();) + final List<FrontEndAction> otherActions = new ArrayList<FrontEndAction>(this.getUseCase().getActions()); + for (final Iterator<FrontEndAction> iterator = otherActions.iterator(); iterator.hasNext();) { final FrontEndAction action = (FrontEndAction)iterator.next(); @@ -504,9 +506,9 @@ * @return hiddenParameters * @see org.andromda.cartridges.jsf.metafacades.JSFAction#getHiddenParameters() */ - protected List handleGetHiddenParameters() + protected List<FrontEndParameter> handleGetHiddenParameters() { - final List hiddenParameters = new ArrayList(this.getParameters()); + final List<FrontEndParameter> hiddenParameters = new ArrayList<FrontEndParameter>(this.getParameters()); CollectionUtils.filter( hiddenParameters, new Predicate() Modified: trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFControllerLogicImpl.java =================================================================== --- trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFControllerLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFControllerLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -77,12 +77,12 @@ * @return references * @see org.andromda.cartridges.jsf.metafacades.JSFController#getSessionObjectReferences() */ - protected List handleGetSessionObjectReferences() + protected List<DependencyFacade> handleGetSessionObjectReferences() { - final List references = new ArrayList(this.getSourceDependencies()); - for (final Iterator iterator = references.iterator(); iterator.hasNext();) + final List<DependencyFacade> references = new ArrayList<DependencyFacade> (this.getSourceDependencies()); + for (final Iterator<DependencyFacade> iterator = references.iterator(); iterator.hasNext();) { - final ModelElementFacade targetElement = ((DependencyFacade)iterator.next()).getTargetElement(); + final ModelElementFacade targetElement = (iterator.next()).getTargetElement(); if (!(targetElement instanceof JSFSessionObject)) { iterator.remove(); Modified: trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFManageableEntityLogicImpl.java =================================================================== --- trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFManageableEntityLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFManageableEntityLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -8,6 +8,7 @@ import org.andromda.cartridges.jsf.JSFProfile; import org.andromda.cartridges.jsf.JSFUtils; import org.andromda.metafacades.uml.DependencyFacade; +import org.andromda.metafacades.uml.ManageableEntityAttribute; import org.andromda.metafacades.uml.ModelElementFacade; import org.andromda.metafacades.uml.Role; import org.andromda.metafacades.uml.UMLMetafacadeProperties; @@ -488,13 +489,14 @@ * @return manageableSearchAttributes * @see org.andromda.cartridges.jsf.metafacades.JSFManageableEntity#getManageableSearchAttributes() */ - protected Collection handleGetManageableSearchAttributes() + protected Collection<JSFManageableEntityAttribute> handleGetManageableSearchAttributes() { - final Collection coll = new ArrayList(); - for(final java.util.Iterator it=getManageableAttributes().iterator(); it.hasNext(); ){ - Object next = it.next(); - if(next instanceof JSFManageableEntityAttribute){ - final JSFManageableEntityAttribute attr=(JSFManageableEntityAttribute)next; + final Collection<JSFManageableEntityAttribute> coll = new ArrayList<JSFManageableEntityAttribute>(); + for(final ManageableEntityAttribute attribute : getManageableAttributes()) + { + if(attribute instanceof JSFManageableEntityAttribute) + { + final JSFManageableEntityAttribute attr=(JSFManageableEntityAttribute)attribute; if(!attr.isHidden()) coll.add(attr); } Modified: trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFParameterLogicImpl.java =================================================================== --- trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFParameterLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFParameterLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -18,6 +18,7 @@ import org.andromda.metafacades.uml.EventFacade; import org.andromda.metafacades.uml.FrontEndActivityGraph; import org.andromda.metafacades.uml.FrontEndForward; +import org.andromda.metafacades.uml.FrontEndParameter; import org.andromda.metafacades.uml.FrontEndView; import org.andromda.metafacades.uml.ModelElementFacade; import org.andromda.metafacades.uml.TransitionFacade; @@ -180,7 +181,7 @@ * @return getTableActions(true) * @see org.andromda.cartridges.jsf.metafacades.JSFParameter#getTableHyperlinkActions() */ - protected List handleGetTableHyperlinkActions() + protected List<JSFAction> handleGetTableHyperlinkActions() { return this.getTableActions(true); } @@ -191,27 +192,25 @@ * * @param hyperlink denotes on which type of actions to filter */ - private final List getTableActions(boolean hyperlink) + private final List<JSFAction> getTableActions(boolean hyperlink) { - final Set actions = new LinkedHashSet(); + final Set<JSFAction> actions = new LinkedHashSet<JSFAction>(); final String name = StringUtils.trimToNull(getName()); if (name != null && isTable()) { final JSFView view = (JSFView)this.getView(); - final Collection allUseCases = getModel().getAllUseCases(); - for (final Iterator useCaseIterator = allUseCases.iterator(); useCaseIterator.hasNext();) + final Collection<UseCaseFacade> allUseCases = getModel().getAllUseCases(); + for (final UseCaseFacade useCase : allUseCases) { - final UseCaseFacade useCase = (UseCaseFacade)useCaseIterator.next(); if (useCase instanceof JSFUseCase) { final FrontEndActivityGraph graph = ((JSFUseCase)useCase).getActivityGraph(); if (graph != null) { - final Collection transitions = graph.getTransitions(); - for (final Iterator transitionIterator = transitions.iterator(); transitionIterator.hasNext();) + final Collection<TransitionFacade> transitions = graph.getTransitions(); + for (final TransitionFacade transition : transitions) { - final TransitionFacade transition = (TransitionFacade)transitionIterator.next(); if (transition.getSource().equals(view) && transition instanceof JSFAction) { final JSFAction action = (JSFAction)transition; @@ -228,14 +227,14 @@ } } } - return new ArrayList(actions); + return new ArrayList<JSFAction>(actions); } /** * @return getTableActions(false) * @see org.andromda.cartridges.jsf.metafacades.JSFParameter#getTableFormActions() */ - protected List handleGetTableFormActions() + protected List<JSFAction> handleGetTableFormActions() { return this.getTableActions(false); } @@ -249,10 +248,11 @@ if (tableColumns.isEmpty()) { // try to preserve the order of the elements encountered + //final Map<String, JSFParameter> tableColumnsMap = new LinkedHashMap<String, JSFParameter>(); final Map tableColumnsMap = new LinkedHashMap(); // order is important - final List actions = new ArrayList(); + final List<JSFAction> actions = new ArrayList<JSFAction>(); // all table actions need the exact same parameters, just not always all of them actions.addAll(this.getTableFormActions()); @@ -261,16 +261,13 @@ // the user should not have modeled it that way (constraints will warn him/her) actions.addAll(this.getTableHyperlinkActions()); - for (final Iterator actionIterator = actions.iterator(); actionIterator.hasNext();) + for (final JSFAction action : actions) { - final JSFAction action = (JSFAction)actionIterator.next(); - final Collection actionParameters = action.getParameters(); - for (final Iterator parameterIterator = actionParameters.iterator(); parameterIterator.hasNext();) + for (final FrontEndParameter actionParameter : action.getParameters()) { - final Object object = parameterIterator.next(); - if (object instanceof JSFParameter) + if (actionParameter instanceof JSFParameter) { - final JSFParameter parameter = (JSFParameter)object; + final JSFParameter parameter = (JSFParameter)actionParameter; final String parameterName = parameter.getName(); if (parameterName != null) { @@ -292,10 +289,8 @@ } // for any missing parameters we just add the name of the column - final Collection columnNames = this.getTableColumnNames(); - for (final Iterator columnNameIterator = columnNames.iterator(); columnNameIterator.hasNext();) + for (final String columnName : this.getTableColumnNames()) { - final String columnName = (String)columnNameIterator.next(); if (!tableColumnsMap.containsKey(columnName)) { tableColumnsMap.put( @@ -305,9 +300,8 @@ } // return everything in the same order as it has been modeled (using the table tagged value) - for (final Iterator columnNameIterator = columnNames.iterator(); columnNameIterator.hasNext();) + for (final String columnObject : this.getTableColumnNames()) { - final Object columnObject = columnNameIterator.next(); tableColumns.add(tableColumnsMap.get(columnObject)); } } @@ -628,7 +622,7 @@ /** * Stores the initial value of each type. */ - private final Map initialValues = new HashMap(); + private final Map<String, String> initialValues = new HashMap<String, String>(); /** * @return constructDummyArray() @@ -1101,17 +1095,16 @@ * @return tableColumnActions * @see org.andromda.cartridges.jsf.metafacades.JSFParameter#getTableColumnActions(String) */ - protected List handleGetTableColumnActions(final String columnName) + protected List<JSFAction> handleGetTableColumnActions(final String columnName) { - final List columnActions = new ArrayList(); + final List<JSFAction> columnActions = new ArrayList<JSFAction>(); if (columnName != null) { - final Set actions = new LinkedHashSet(this.getTableHyperlinkActions()); + final Set<JSFAction> actions = new LinkedHashSet<JSFAction>(this.getTableHyperlinkActions()); actions.addAll(this.getTableFormActions()); - for (final Iterator iterator = actions.iterator(); iterator.hasNext();) + for (final JSFAction action : actions) { - final JSFAction action = (JSFAction)iterator.next(); if (columnName.equals(action.getTableLinkColumnName())) { columnActions.add(action); Modified: trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFUseCaseLogicImpl.java =================================================================== --- trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFUseCaseLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFUseCaseLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -13,12 +13,14 @@ import org.andromda.cartridges.jsf.JSFProfile; import org.andromda.cartridges.jsf.JSFUtils; import org.andromda.metafacades.uml.AssociationEndFacade; +import org.andromda.metafacades.uml.AttributeFacade; import org.andromda.metafacades.uml.ClassifierFacade; import org.andromda.metafacades.uml.DependencyFacade; import org.andromda.metafacades.uml.FrontEndAction; import org.andromda.metafacades.uml.FrontEndActivityGraph; import org.andromda.metafacades.uml.FrontEndFinalState; import org.andromda.metafacades.uml.FrontEndForward; +import org.andromda.metafacades.uml.FrontEndParameter; import org.andromda.metafacades.uml.FrontEndUseCase; import org.andromda.metafacades.uml.FrontEndView; import org.andromda.metafacades.uml.IncludeFacade; @@ -139,7 +141,7 @@ // where the application begins) if (this.isEntryUseCase()) { - final List useCases = this.getAllUseCases(); + final List<FrontEndUseCase> useCases = this.getAllUseCases(); for (int ctr = 0; ctr < useCases.size(); ctr++) { // - usecase @@ -148,7 +150,7 @@ useCase.getTitleKey(), useCase.getTitleValue()); - final List views = useCase.getViews(); + final List<FrontEndView> views = useCase.getViews(); for (int ctr2 = 0; ctr2 < views.size(); ctr2++) { // - view @@ -163,7 +165,7 @@ view.getDocumentationKey(), view.getDocumentationValue()); - final List viewVariables = view.getVariables(); + final List<FrontEndParameter> viewVariables = view.getVariables(); for (int ctr3 = 0; ctr3 < viewVariables.size(); ctr3++) { // - page variables @@ -195,7 +197,7 @@ } } - final List actions = useCase.getActions(); + final List<FrontEndAction> actions = useCase.getActions(); for (int ctr3 = 0; ctr3 < actions.size(); ctr3++) { // - action @@ -233,7 +235,7 @@ // - forwards - final List transitions = action.getTransitions(); + final List<FrontEndForward> transitions = action.getTransitions(); for (final Iterator iterator = transitions.iterator(); iterator.hasNext();) { final Object transition = iterator.next(); @@ -253,7 +255,7 @@ } // - action parameters - final List parameters = action.getParameters(); + final List<FrontEndParameter> parameters = action.getParameters(); for (int l = 0; l < parameters.size(); l++) { final Object object = parameters.get(l); @@ -280,10 +282,10 @@ final ClassifierFacade type = end.getType(); if (type != null) { - final Collection typeAttributes = type.getAttributes(); + final Collection<AttributeFacade> typeAttributes = type.getAttributes(); if (!attributes.isEmpty()) { - for (final Iterator attributeIterator = typeAttributes.iterator(); + for (final Iterator<AttributeFacade> attributeIterator = typeAttributes.iterator(); attributeIterator.hasNext();) { final JSFAttribute attribute = (JSFAttribute)attributeIterator.next(); @@ -305,8 +307,8 @@ // - submittable input table if (parameter.isInputTable()) { - final Collection columnNames = parameter.getTableColumnNames(); - for (final Iterator columnNameIterator = columnNames.iterator(); + final Collection<String> columnNames = parameter.getTableColumnNames(); + for (final Iterator<String> columnNameIterator = columnNames.iterator(); columnNameIterator.hasNext();) { final String columnName = (String)columnNameIterator.next(); @@ -417,7 +419,7 @@ /** * Collects all attribute messages into the given Map. * - * @param messages the Map in which messags are collected. + * @param messages the Map in which messages are collected. * @param attributes the attributes to collect the messages from. * @param resolvingTypes used to prevent endless recursion. */ @@ -441,7 +443,7 @@ /** * Collects all association end messages into the given Map. * - * @param messages the Map in which messags are collected. + * @param messages the Map in which messages are collected. * @param associationEnds the association ends to collect the messages from. * @param resolvingTypes used to prevent endless recursion. */ @@ -485,34 +487,30 @@ * @return actionForwards * @see org.andromda.cartridges.jsf.metafacades.JSFUseCase#getActionForwards() */ - protected List handleGetActionForwards() + protected List<JSFAction> handleGetActionForwards() { - final Set actionForwards = new LinkedHashSet(); - final List views = this.getViews(); - for (final Iterator iterator = views.iterator(); iterator.hasNext();) + final Set<JSFAction> actionForwards = new LinkedHashSet<JSFAction>(); + for (final FrontEndView view : this.getViews()) { - final JSFView view = (JSFView)iterator.next(); - actionForwards.addAll(view.getActionForwards()); + actionForwards.addAll(((JSFView)view).getActionForwards()); } - return new ArrayList(actionForwards); + return new ArrayList<JSFAction>(actionForwards); } /** * @return forwards * @see org.andromda.cartridges.jsf.metafacades.JSFUseCase#getForwards() */ - protected List handleGetForwards() + protected List<JSFForward> handleGetForwards() { - final Map forwards = new LinkedHashMap(); - for (final Iterator iterator = this.getActions().iterator(); iterator.hasNext();) + final Map<String, JSFForward> forwards = new LinkedHashMap<String, JSFForward>(); + for (final FrontEndAction action : this.getActions()) { - final FrontEndAction action = (FrontEndAction)iterator.next(); - for (final Iterator forwardIterator = action.getActionForwards().iterator(); forwardIterator.hasNext();) + for (final FrontEndForward forward : action.getActionForwards()) { - final Object forward = forwardIterator.next(); if (forward instanceof JSFForward) { - forwards.put(((ModelElementFacade)forward).getName(), forward); + forwards.put(forward.getName(), (JSFForward) forward); } } } @@ -524,20 +522,18 @@ * @see org.andromda.cartridges.jsf.metafacades.JSFUseCase#getAllForwards() */ @SuppressWarnings("unchecked") - protected List handleGetAllForwards() + protected List<ModelElementFacade> handleGetAllForwards() { final Map<String, ModelElementFacade> forwards = new LinkedHashMap<String, ModelElementFacade>(); - for (final Iterator iterator = this.getActionForwards().iterator(); iterator.hasNext();) + for (final JSFAction forward : this.getActionForwards()) { - final ModelElementFacade forward = (ModelElementFacade)iterator.next(); forwards.put(forward.getName(), forward); } - for (final Iterator iterator = this.getForwards().iterator(); iterator.hasNext();) + for (final JSFForward forward : this.getForwards()) { - final ModelElementFacade forward = (ModelElementFacade)iterator.next(); forwards.put(forward.getName(), forward); } - return new ArrayList(forwards.values()); + return new ArrayList<ModelElementFacade>(forwards.values()); } /** @@ -730,12 +726,12 @@ * @see org.andromda.cartridges.jsf.metafacades.JSFUseCase#getRegistrationUseCases() */ @SuppressWarnings("unchecked") - protected List handleGetRegistrationUseCases() + protected List<FrontEndUseCase> handleGetRegistrationUseCases() { - final List useCases = new ArrayList(this.getAllUseCases()); - for (final Iterator iterator = useCases.iterator(); iterator.hasNext();) + final List<FrontEndUseCase> useCases = new ArrayList<FrontEndUseCase>(this.getAllUseCases()); + for (final Iterator<FrontEndUseCase> iterator = useCases.iterator(); iterator.hasNext();) { - final Object useCase = iterator.next(); + final FrontEndUseCase useCase = iterator.next(); if (useCase instanceof JSFUseCase) { if (!((JSFUseCase)useCase).isRegistrationUseCase()) Modified: trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFViewLogicImpl.java =================================================================== --- trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFViewLogicImpl.java 2011-02-13 20:58:46 UTC (rev 14844) +++ trunk/cartridges/andromda-jsf/src/main/java/org/andromda/cartridges/jsf/metafacades/JSFViewLogicImpl.java 2011-02-14 05:26:37 UTC (rev 14845) @@ -10,6 +10,7 @@ import org.andromda.cartridges.jsf.JSFProfile; import org.andromda.cartridges.jsf.JSFUtils; import org.andromda.metafacades.uml.FrontEndAction; +import org.andromda.metafacades.uml.FrontEndForward; import org.andromda.metafacades.uml.FrontEndParameter; import org.andromda.metafacades.uml.ModelElementFacade; import org.andromda.metafacades.uml.UseCaseFacade; @@ -139,17 +140,16 @@ * @return forwards * @see org.andromda.cartridges.jsf.metafacades.JSFView#getForwards() */ - protected List handleGetForwards() + protected List<ModelElementFacade> handleGetForwards() { - final Map forwards = new LinkedHashMap(); + final Map<String, ModelElementFacade> forwards = new LinkedHashMap<String, ModelElementFacade>(); for (final Iterator iterator = this.getActions().iterator(); iterator.hasNext();) { final FrontEndAction action = (FrontEndAction)iterator.next(); if (action != null && !action.isUseCaseStart()) { - for (final Iterator forwardIterator = action.getActionForwards().iterator(); forwardIterator.hasNext();) + for (final FrontEndForward forward : action.getActionForwards()) { - final Object forward = forwardIterator.next(); if (forward instanceof JSFForward) { forwards.put(((JSFForward)forward).getName(), forward); @@ -161,23 +161,22 @@ } } } - return new ArrayList(forwards.values()); + return new ArrayList<ModelElementFacade>(forwards.values()); } /** * @return tables * @see org.andromda.cartridges.jsf.metafacades.JSFAction#isTableLink() */ - protected List handleGetTables() + protected List<JSFParameter> handleGetTables() ... [truncated message content] |