CPD Results

The following document contains the results of PMD's CPD 3.9.

Duplications

FileLine
org/andromda/cartridges/jsf/metafacades/JSFUseCaseLogicImpl.java153
org/andromda/cartridges/jsf/metafacades/JSFUseCaseLogicImpl.java277
                            final Object object = parameters.get(l);
                            if (object instanceof JSFParameter)
                            {
                                final JSFParameter parameter = (JSFParameter)object;
                                final Collection attributes = parameter.getAttributes();
                                if (!attributes.isEmpty())
                                {
                                    for (final Iterator iterator = attributes.iterator(); iterator.hasNext();)
                                    {
                                        final JSFAttribute attribute = (JSFAttribute)iterator.next();
                                        messages.put(
                                            attribute.getMessageKey(),
                                            attribute.getMessageValue());
                                    }
                                }
                                final Collection associationEnds = parameter.getNavigableAssociationEnds();
                                if (!associationEnds.isEmpty())
                                {
                                    for (final Iterator iterator = associationEnds.iterator(); iterator.hasNext();)
                                    {
                                        final AssociationEndFacade end = (AssociationEndFacade)iterator.next();
                                        final ClassifierFacade type = end.getType();
                                        if (type != null)
                                        {
                                            final Collection typeAttributes = type.getAttributes();
                                            if (!attributes.isEmpty())
                                            {
                                                for (final Iterator attributeIterator = typeAttributes.iterator();
                                                    attributeIterator.hasNext();)
                                                {
                                                    final JSFAttribute attribute = (JSFAttribute)attributeIterator.next();
                                                    messages.put(
                                                        attribute.getMessageKey(),
                                                        attribute.getMessageValue());
                                                }
                                            }
                                        }
                                    }
                                }
                                messages.put(
                                    parameter.getMessageKey(),
                                    parameter.getMessageValue());

FileLine
org/andromda/cartridges/jsf/metafacades/JSFAttributeLogicImpl.java323
org/andromda/cartridges/jsf/metafacades/JSFParameterLogicImpl.java554
                final Collection views = this.getAction().getTargetViews();
                for (final Iterator iterator = views.iterator(); iterator.hasNext() && !selectable;)
                {
                    final FrontEndView view = (FrontEndView)iterator.next();
                    final Collection parameters = view.getAllActionParameters();
                    for (final Iterator parameterIterator = parameters.iterator();
                        parameterIterator.hasNext() && !selectable;)
                    {
                        final Object object = parameterIterator.next();
                        if (object instanceof JSFParameter)
                        {
                            final JSFParameter parameter = (JSFParameter)object;
                            final String parameterName = parameter.getName();
                            final ClassifierFacade parameterType = parameter.getType();
                            if (parameterType != null)
                            {
                                final String parameterTypeName = parameterType.getFullyQualifiedName();
                                if (name.equals(parameterName) && typeName.equals(parameterTypeName))
                                {
                                    selectable =
                                        parameter.isInputMultibox() || parameter.isInputSelect() ||
                                        parameter.isInputRadio();
                                }
                            }
                        }
                    }
                }
            }
        }
        else if (this.isControllerOperationArgument())

FileLine
org/andromda/cartridges/jsf/metafacades/JSFAttributeLogicImpl.java640
org/andromda/cartridges/jsf/metafacades/JSFParameterLogicImpl.java948
                final Collection views = this.getAction().getTargetViews();
                for (final Iterator iterator = views.iterator(); iterator.hasNext() && !required;)
                {
                    final FrontEndView view = (FrontEndView)iterator.next();
                    final Collection parameters = view.getAllActionParameters();
                    for (final Iterator parameterIterator = parameters.iterator();
                        parameterIterator.hasNext() && !required;)
                    {
                        final Object object = parameterIterator.next();
                        if (object instanceof JSFParameter)
                        {
                            final JSFParameter parameter = (JSFParameter)object;
                            final String parameterName = parameter.getName();
                            final ClassifierFacade parameterType = parameter.getType();
                            if (parameterType != null)
                            {
                                final String parameterTypeName = parameterType.getFullyQualifiedName();
                                if (name.equals(parameterName) && typeName.equals(parameterTypeName))
                                {
                                    required = parameter.isInputTable();
                                }
                            }
                        }
                    }
                }
            }
        }
        else if (this.isControllerOperationArgument())

FileLine
org/andromda/cartridges/jsf/metafacades/JSFActionLogicImpl.java700
org/andromda/cartridges/jsf/metafacades/JSFForwardLogicImpl.java65
    }
    
    protected boolean handleIsSuccessMessagesPresent()
    {
        return !this.getSuccessMessages().isEmpty();
    }

    protected boolean handleIsWarningMessagesPresent()
    {
        return !this.getWarningMessages().isEmpty();
    }
    
    /**
     * Collects specific messages in a map.
     *
     * @param taggedValue the tagged value from which to read the message
     * @return maps message keys to message values, but only those that match the arguments
     *         will have been recorded
     */
    private Map getMessages(String taggedValue)
    {
        Map messages;

        final Collection taggedValues = this.findTaggedValues(taggedValue);
        if (taggedValues.isEmpty())
        {
            messages = Collections.EMPTY_MAP;
        }
        else
        {
            messages = new LinkedHashMap(); // we want to keep the order

            for (final Iterator iterator = taggedValues.iterator(); iterator.hasNext();)
            {
                final String value = (String)iterator.next();
                messages.put(StringUtilsHelper.toResourceMessageKey(value), value);
            }
        }

        return messages;
    }

    protected Map handleGetSuccessMessages()
    {
        return this.getMessages(JSFProfile.TAGGEDVALUE_ACTION_SUCCESS_MESSAGE);
    }

    protected Map handleGetWarningMessages()
    {
        return this.getMessages(JSFProfile.TAGGEDVALUE_ACTION_WARNING_MESSAGE);
    }