CPD Results

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

Duplications

FileLine
org\jomc\model\modlet\DefaultModelValidator.java1335
org\jomc\model\modlet\DefaultModelValidator.java1481
                                               moduleOfImpl.getName(), m.getName(),
                                               overriddenImplementation.getIdentifier(),
                                               moduleOfMessage.getName(), getNodePathString( overriddenMessage ) );

                                }
                            }

                            retainFinalNodes( overriddenMessages );

                            for ( final InheritanceModel.Node<Message> overriddenMessage : overriddenMessages )
                            {
                                Implementation overriddenImplementation = overriddenMessage.getImplementation();
                                if ( overriddenMessage.getClassDeclaration() != null )
                                {
                                    overriddenImplementation = overriddenMessage.getClassDeclaration();
                                }

                                final Module moduleOfMessage = validationContext.getModules().getModuleOfImplementation(
                                    overriddenImplementation.getIdentifier() );

                                addDetail( validationContext.getReport(),
                                           "IMPLEMENTATION_MESSAGE_INHERITANCE_CONSTRAINT",
                                           Level.SEVERE, new ObjectFactory().createImplementation( impl ),
                                           "implementationMessageFinalConstraint", impl.getIdentifier(),
                                           moduleOfImpl.getName(), m.getName(),
FileLine
org\jomc\model\modlet\DefaultModelValidator.java1269
org\jomc\model\modlet\DefaultModelValidator.java3214
                                               moduleOfImpl.getName(), m.getName(), t.getLanguage(),
                                               message != null && message.length() > 0 ? " " + message : "" );

                                }

                                if ( validationContext.isValidateJava() )
                                {
                                    try
                                    {
                                        new MessageFormat( t.getValue(), new Locale( t.getLanguage() ) );
                                    }
                                    catch ( final IllegalArgumentException e )
                                    {
                                        final String message = getMessage( e );

                                        if ( validationContext.getModelContext().isLoggable( Level.FINE ) )
                                        {
                                            validationContext.getModelContext().log( Level.FINE, message, e );
                                        }

                                        addDetail( validationContext.getReport(),
FileLine
org\jomc\model\modlet\DefaultModelValidator.java415
org\jomc\model\modlet\DefaultModelValidator.java1269
org\jomc\model\modlet\DefaultModelValidator.java3215
                                           "moduleMessageTemplateMimeTypeConstraint", m.getName(), msg.getName(),
                                           t.getLanguage(),
                                           message != null && message.length() > 0 ? " " + message : "" );

                            }

                            if ( validationContext.isValidateJava() )
                            {
                                try
                                {
                                    new MessageFormat( t.getValue(), new Locale( t.getLanguage() ) );
                                }
                                catch ( final IllegalArgumentException e )
                                {
                                    final String message = getMessage( e );

                                    if ( validationContext.getModelContext().isLoggable( Level.FINE ) )
                                    {
                                        validationContext.getModelContext().log( Level.FINE, message, e );
                                    }

                                    addDetail( validationContext.getReport(), "MODULE_MESSAGE_TEMPLATE_CONSTRAINT",
FileLine
org\jomc\model\modlet\DefaultModelProcessor.java140
org\jomc\model\modlet\DefaultModelProvider.java169
    public DefaultModelProcessor()
    {
        super();
    }

    /**
     * Gets a flag indicating the processor is enabled by default.
     * <p>The default enabled flag is controlled by system property
     * {@code org.jomc.model.modlet.DefaultModelProcessor.defaultEnabled} holding a value indicating the processor is
     * enabled by default. If that property is not set, the {@code true} default is returned.</p>
     *
     * @return {@code true}, if the processor is enabled by default; {@code false}, if the processor is disabled by
     * default.
     *
     * @see #setDefaultEnabled(java.lang.Boolean)
     */
    public static boolean isDefaultEnabled()
    {
        if ( defaultEnabled == null )
        {
            defaultEnabled =
                Boolean.valueOf( System.getProperty( DEFAULT_ENABLED_PROPERTY_NAME,
                                                     System.getProperty( DEPRECATED_DEFAULT_ENABLED_PROPERTY_NAME,
                                                                         Boolean.toString( DEFAULT_ENABLED ) ) ) );

        }

        return defaultEnabled;
    }

    /**
     * Sets the flag indicating the processor is enabled by default.
     *
     * @param value The new value of the flag indicating the processor is enabled by default or {@code null}.
     *
     * @see #isDefaultEnabled()
     */
    public static void setDefaultEnabled( final Boolean value )
    {
        defaultEnabled = value;
    }

    /**
     * Gets a flag indicating the processor is enabled.
     *
     * @return {@code true}, if the processor is enabled; {@code false}, if the processor is disabled.
     *
     * @see #isDefaultEnabled()
     * @see #setEnabled(java.lang.Boolean)
     */
    public final boolean isEnabled()
    {
        if ( this.enabled == null )
        {
            this.enabled = isDefaultEnabled();
        }

        return this.enabled;
    }

    /**
     * Sets the flag indicating the processor is enabled.
     *
     * @param value The new value of the flag indicating the processor is enabled or {@code null}.
     *
     * @see #isEnabled()
     */
    public final void setEnabled( final Boolean value )
    {
        this.enabled = value;
    }

    /**
     * Gets the default location searched for transformer resources.
     * <p>The default transformer location is controlled by system property
     * {@code org.jomc.model.modlet.DefaultModelProcessor.defaultTransformerLocation} holding the location to search for
     * transformer resources by default. If that property is not set, the {@code META-INF/jomc.xsl} default is
     * returned.</p>
     *
     * @return The location searched for transformer resources by default.
     *
     * @see #setDefaultTransformerLocation(java.lang.String)
     */
    public static String getDefaultTransformerLocation()
FileLine
org\jomc\model\modlet\DefaultModelValidator.java1318
org\jomc\model\modlet\DefaultModelValidator.java1464
                            if ( !( m.isOverride() || overriddenMessages.isEmpty() ) )
                            {
                                for ( final InheritanceModel.Node<Message> overriddenMessage : overriddenMessages )
                                {
                                    Implementation overriddenImplementation = overriddenMessage.getImplementation();
                                    if ( overriddenMessage.getClassDeclaration() != null )
                                    {
                                        overriddenImplementation = overriddenMessage.getClassDeclaration();
                                    }

                                    final Module moduleOfMessage =
                                        validationContext.getModules().getModuleOfImplementation(
                                        overriddenImplementation.getIdentifier() );

                                    addDetail( validationContext.getReport(), "IMPLEMENTATION_MESSAGE_OVERRIDE_WARNING",
                                               Level.WARNING, new ObjectFactory().createImplementation( impl ),
                                               "implementationMessageOverrideWarning", impl.getIdentifier(),
                                               moduleOfImpl.getName(), m.getName(),
FileLine
org\jomc\model\modlet\DefaultModelValidator.java1744
org\jomc\model\modlet\DefaultModelValidator.java1816
                                }
                            }

                            retainFinalNodes( overriddenProperties );

                            for ( final InheritanceModel.Node<Property> overriddenProperty : overriddenProperties )
                            {
                                Implementation overriddenImplementation = overriddenProperty.getImplementation();
                                if ( overriddenProperty.getClassDeclaration() != null )
                                {
                                    overriddenImplementation = overriddenProperty.getClassDeclaration();
                                }

                                final Module moduleOfProperty =
                                    validationContext.getModules().getModuleOfImplementation(
                                    overriddenImplementation.getIdentifier() );

                                addDetail( validationContext.getReport(),
                                           "IMPLEMENTATION_PROPERTY_INHERITANCE_CONSTRAINT",
                                           Level.SEVERE, new ObjectFactory().createImplementation( impl ),
                                           "implementationPropertyFinalConstraint", impl.getIdentifier(),
                                           moduleOfImpl.getName(), p.getName(),
FileLine
org\jomc\model\modlet\DefaultModelValidator.java671
org\jomc\model\modlet\DefaultModelValidator.java1655
org\jomc\model\modlet\DefaultModelValidator.java2899
org\jomc\model\modlet\DefaultModelValidator.java3469
                                       "modulePropertyJavaVariableNameConstraint", m.getName(), p.getName(),
                                       message != null && message.length() > 0 ? " " + message : "" );

                        }

                        try
                        {
                            p.getJavaValue( validationContext.getModelContext().getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

                            if ( validationContext.getModelContext().isLoggable( Level.FINE ) )
                            {
                                validationContext.getModelContext().log( Level.FINE, message, e );
                            }

                            addDetail( validationContext.getReport(), "MODULE_PROPERTY_JAVA_VALUE_CONSTRAINT",