CPD Results

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

Duplications

FileLine
org/jomc/tools/modlet/ToolsModelProcessor.java635
org/jomc/tools/modlet/ToolsModelProvider.java702
    }

    /**
     * Gets the default source code file location for a given specification.
     * <p>If the specification provides a Java type name, this method returns a Java source code file location based on
     * that Java type name.</p>
     *
     * @param context The context to get the default location with.
     * @param modules The model to get the default location with.
     * @param specification The specification to get the default location for.
     *
     * @return The default location for {@code specification} or {@code null}.
     *
     * @throws NullPointerExeption if {@code context}, {@code modules} or {@code specification} is {@code null}.
     *
     * @see SourceFileType#getLocation()
     * @see Specification#getJavaTypeName()
     * @since 1.6
     */
    protected String getDefaultSourceFileLocation( final ModelContext context, final Modules modules,
                                                   final Specification specification )
    {
        if ( context == null )
        {
            throw new NullPointerException( "context" );
        }
        if ( modules == null )
        {
            throw new NullPointerException( "modules" );
        }
        if ( specification == null )
        {
            throw new NullPointerException( "specification" );
        }

        String location = null;

        try
        {
            if ( specification.getJavaTypeName() != null )
            {
                location = specification.getJavaTypeName().getQualifiedName().replace( '.', '/' ) + ".java";
            }
        }
        catch ( final ModelObjectException e )
        {
            context.log( Level.WARNING, getMessage( e ), null );
        }

        return location;
    }

    /**
     * Gets the default source code file location for a given implementation.
     * <p>If the implementation provides a Java type name, this method returns a Java source code file location based on
     * that Java type name.</p>
     *
     * @param context The context to get the default location with.
     * @param modules The model to get the default location with.
     * @param implementation The implementation to get the default location for.
     *
     * @return The default location for {@code implementation} or {@code null}.
     *
     * @throws NullPointerExeption if {@code context}, {@code modules} or {@code implementation} is {@code null}.
     *
     * @see SourceFileType#getLocation()
     * @see Implementation#getJavaTypeName()
     * @since 1.6
     */
    protected String getDefaultSourceFileLocation( final ModelContext context, final Modules modules,
                                                   final Implementation implementation )
    {
        if ( context == null )
        {
            throw new NullPointerException( "context" );
        }
        if ( modules == null )
        {
            throw new NullPointerException( "modules" );
        }
        if ( implementation == null )
        {
            throw new NullPointerException( "implementation" );
        }

        String location = null;

        try
        {
            if ( implementation.getJavaTypeName() != null )
            {
                location = implementation.getJavaTypeName().getQualifiedName().replace( '.', '/' ) + ".java";
            }
        }
        catch ( final ModelObjectException e )
        {
            context.log( Level.WARNING, getMessage( e ), null );
        }

        return location;
    }

    /**
     * Gets the default source section name for a given specification.
     * <p>If the specification provides a Java type name, this method returns a section name based on that Java type
     * name.</p>
     *
     * @param context The context to get the default section name with.
     * @param modules The model to get the default section name with.
     * @param specification The specification to get the default section name for.
     *
     * @return The default source section name for {@code specification} or {@code null}.
     *
     * @throws NullPointerExeption if {@code context}, {@code modules} or {@code specification} is {@code null}.
     *
     * @see SourceSectionType#getName()
     * @see Specification#getJavaTypeName()
     * @since 1.6
     */
    protected String getDefaultSourceSectionName( final ModelContext context, final Modules modules,
                                                  final Specification specification )
    {
        if ( context == null )
        {
            throw new NullPointerException( "context" );
        }
        if ( modules == null )
        {
            throw new NullPointerException( "modules" );
        }
        if ( specification == null )
        {
            throw new NullPointerException( "specification" );
        }

        String sectionName = null;

        try
        {
            final JavaTypeName javaTypeName = specification.getJavaTypeName();

            if ( javaTypeName != null )
            {
                sectionName = javaTypeName.getName( false );
            }
        }
        catch ( final ModelObjectException e )
        {
            context.log( Level.WARNING, getMessage( e ), null );
        }

        return sectionName;
    }

    /**
     * Gets the default source section name for a given implementation.
     * <p>If the implementation provides a Java type name, this method returns a section name based that Java type
     * name.</p>
     *
     * @param context The context to get the default section name with.
     * @param modules The model to get the default section name with.
     * @param implementation The implementation to get the default section name for.
     *
     * @return The default source section name for {@code implementation} or {@code null}.
     *
     * @throws NullPointerExeption if {@code context}, {@code modules} or {@code implementation} is {@code null}.
     *
     * @see SourceSectionType#getName()
     * @see Implementation#getJavaTypeName()
     * @since 1.6
     */
    protected String getDefaultSourceSectionName( final ModelContext context, final Modules modules,
                                                  final Implementation implementation )
    {
        if ( context == null )
        {
            throw new NullPointerException( "context" );
        }
        if ( modules == null )
        {
            throw new NullPointerException( "modules" );
        }
        if ( implementation == null )
        {
            throw new NullPointerException( "implementation" );
        }

        String sectionName = null;

        try
        {
            final JavaTypeName javaTypeName = implementation.getJavaTypeName();

            if ( javaTypeName != null )
            {
                sectionName = javaTypeName.getName( false );
            }
        }
        catch ( final ModelObjectException e )
        {
            context.log( Level.WARNING, getMessage( e ), null );
        }

        return sectionName;
    }
FileLine
org/jomc/tools/modlet/ToolsModelProcessor.java220
org/jomc/tools/modlet/ToolsModelProvider.java232
    public ToolsModelProcessor()
    {
        super();
    }

    /**
     * Gets a flag indicating the processor is enabled by default.
     * <p>The default enabled flag is controlled by system property
     * {@code org.jomc.tools.modlet.ToolsModelProcessor.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,
                                                                  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 a flag indicating model object class path resolution is enabled by default.
     * <p>The model object class path resolution default enabled flag is controlled by system property
     * {@code org.jomc.tools.modlet.ToolsModelProcessor.defaultModelObjectClasspathResolutionEnabled} holding a value
     * indicating model object class path resolution is enabled by default. If that property is not set, the
     * {@code true} default is returned.</p>
     *
     * @return {@code true}, if model object class path resolution is enabled by default; {@code false}, if model object
     * class path resolution is disabled by default.
     *
     * @see #setDefaultModelObjectClasspathResolutionEnabled(java.lang.Boolean)
     */
    public static boolean isDefaultModelObjectClasspathResolutionEnabled()
    {
        if ( defaultModelObjectClasspathResolutionEnabled == null )
        {
            defaultModelObjectClasspathResolutionEnabled = Boolean.valueOf( System.getProperty(
                DEFAULT_MODEL_OBJECT_CLASSPATH_RESOLUTION_ENABLED_PROPERTY_NAME,
                Boolean.toString( DEFAULT_MODEL_OBJECT_CLASSPATH_RESOLUTION_ENABLED ) ) );

        }

        return defaultModelObjectClasspathResolutionEnabled;
    }

    /**
     * Sets the flag indicating model object class path resolution is enabled by default.
     *
     * @param value The new value of the flag indicating model object class path resolution is enabled by default or
     * {@code null}.
     *
     * @see #isDefaultModelObjectClasspathResolutionEnabled()
     */
    public static void setDefaultModelObjectClasspathResolutionEnabled( final Boolean value )
    {
        defaultModelObjectClasspathResolutionEnabled = value;
    }

    /**
     * Gets a flag indicating model object class path resolution is enabled.
     *
     * @return {@code true}, if model object class path resolution is enabled; {@code false}, if model object class path
     * resolution is disabled.
     *
     * @see #isDefaultModelObjectClasspathResolutionEnabled()
     * @see #setModelObjectClasspathResolutionEnabled(java.lang.Boolean)
     */
    public final boolean isModelObjectClasspathResolutionEnabled()
    {
        if ( this.modelObjectClasspathResolutionEnabled == null )
        {
            this.modelObjectClasspathResolutionEnabled = isDefaultModelObjectClasspathResolutionEnabled();
        }

        return this.modelObjectClasspathResolutionEnabled;
    }

    /**
     * Sets the flag indicating model object class path resolution is is enabled.
     *
     * @param value The new value of the flag indicating model object class path resolution is enabled or {@code null}.
     *
     * @see #isModelObjectClasspathResolutionEnabled()
     */
    public final void setModelObjectClasspathResolutionEnabled( final Boolean value )
    {
        this.modelObjectClasspathResolutionEnabled = value;
    }

    /**
     * Gets the head comment the processor is applying by default.
     * <p>The default head comment is controlled by system property
     * {@code org.jomc.tools.modlet.ToolsModelProcessor.defaultHeadComment} holding the head comment the processor is
     * applying by default. If that property is not set, the {@code //} default is returned.</p>
     *
     * @return The head comment the processor is applying by default or {@code null}.
     *
     * @see #setDefaultHeadComment(java.lang.String)
     * @since 1.6
     */
    public static String getDefaultHeadComment()
    {
        if ( defaultHeadComment == null )
        {
            defaultHeadComment = System.getProperty( DEFAULT_HEAD_COMMENT_PROPERTY_NAME, DEFAULT_HEAD_COMMENT );
        }

        return defaultHeadComment;
    }

    /**
     * Sets the head comment the processor is applying by default.
     *
     * @param value The new head comment the processor is applying by default or {@code null}.
     *
     * @see #getDefaultHeadComment()
     * @since 1.6
     */
    public static void setDefaultHeadComment( final String value )
    {
        defaultHeadComment = value;
    }

    /**
     * Gets the head comment the processor is applying.
     *
     * @return The head comment the processor is applying or {@code null}.
     *
     * @see #getDefaultHeadComment()
     * @see #setDefaultHeadComment(java.lang.String)
     * @since 1.6
     */
    public final String getHeadComment()
    {
        if ( this.headComment == null )
        {
            this.headComment = getDefaultHeadComment();
        }

        return this.headComment;
    }

    /**
     * Sets the head comment the processor is applying.
     *
     * @param value The new head comment the processor is applying or {@code null}.
     *
     * @see #getHeadComment()
     * @since 1.6
     */
    public final void setHeadComment( final String value )
    {
        this.headComment = value;
    }

    /**
     * Gets the tail comment the processor is applying by default.
     * <p>The default tail comment is controlled by system property
     * {@code org.jomc.tools.modlet.ToolsModelProcessor.defaultTailComment} holding the tail comment the processor is
     * applying by default. If that property is not set, the {@code null} default is returned.</p>
     *
     * @return The tail comment the processor is applying by default or {@code null}.
     *
     * @see #setDefaultTailComment(java.lang.String)
     * @since 1.6
     */
    public static String getDefaultTailComment()
    {
        if ( defaultTailComment == null )
        {
            defaultTailComment = System.getProperty( DEFAULT_TAIL_COMMENT_PROPERTY_NAME, DEFAULT_TAIL_COMMENT );
        }

        return defaultTailComment;
    }

    /**
     * Sets the tail comment the processor is applying by default.
     *
     * @param value The new tail comment the processor is applying by default or {@code null}.
     *
     * @see #getDefaultTailComment()
     * @since 1.6
     */
    public static void setDefaultTailComment( final String value )
    {
        defaultTailComment = value;
    }

    /**
     * Gets the tail comment the processor is applying.
     *
     * @return The tail comment the processor is applying or {@code null}.
     *
     * @see #getDefaultTailComment()
     * @see #setDefaultTailComment(java.lang.String)
     * @since 1.6
     */
    public final String getTailComment()
    {
        if ( this.tailComment == null )
        {
            this.tailComment = getDefaultTailComment();
        }

        return this.tailComment;
    }

    /**
     * Sets the tail comment the processor is applying.
     *
     * @param value The new tail comment the processor is applying or {@code null}.
     *
     * @see #getTailComment()
     * @since 1.6
     */
    public final void setTailComment( final String value )
    {
        this.tailComment = value;
    }

    /**
     * {@inheritDoc}
     *
     * @see #isEnabled()
     * @see #isModelObjectClasspathResolutionEnabled()
     * @see #getHeadComment()
     * @see #getTailComment()
     * @see #ENABLED_ATTRIBUTE_NAME
     * @see #MODEL_OBJECT_CLASSPATH_RESOLUTION_ENABLED_ATTRIBUTE_NAME
     * @see #HEAD_COMMENT_ATTRIBUTE_NAME
     * @see #TAIL_COMMENT_ATTRIBUTE_NAME
     */
    public Model processModel( final ModelContext context, final Model model ) throws ModelException
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java916
org/jomc/tools/modlet/ToolsModelValidator.java968
                for ( final SourceFileType s : sourceFileType )
                {
                    report.getDetails().add( new ModelValidationReport.Detail(
                        "IMPLEMENTATION_DEPENDENCY_SOURCE_FILE_CONSTRAINT", Level.SEVERE, getMessage(
                            "dependencySourceFileConstraint", module.getName(), implementation.getIdentifier(),
                            d.getName(), s.getIdentifier() ),
                        new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                    if ( this.isValidateJava() )
                    {
                        for ( final TemplateParameterType p : s.getTemplateParameter() )
                        {
                            try
                            {
                                p.getJavaValue( context.getClassLoader() );
                            }
                            catch ( final ModelObjectException e )
                            {
                                final String message = getMessage( e );

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

                                report.getDetails().add( new ModelValidationReport.Detail(
                                    "IMPLEMENTATION_DEPENDENCY_SOURCE_FILE_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                                    Level.SEVERE, getMessage(
                                        "dependencySourceFileTemplateParameterJavaValueConstraint",
                                        module.getName(), implementation.getIdentifier(), d.getName(),
                                        s.getIdentifier(), p.getName(),
                                        message != null && message.length() > 0 ? " " + message : "" ),
                                    new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                            }
                        }
                    }

                    this.validateTemplateParameters(
                        report, context, s.getSourceSections(),
                        "IMPLEMENTATION_DEPENDENCY_SOURCE_FILE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                        new org.jomc.model.ObjectFactory().createImplementation( implementation ),
                        "dependencySourceFileSectionTemplateParameterJavaValueConstraint",
                        module.getName(), implementation.getIdentifier(), d.getName(), s.getIdentifier() );

                }
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java1155
org/jomc/tools/modlet/ToolsModelValidator.java1207
                for ( final SourceFileType s : sourceFileType )
                {
                    report.getDetails().add( new ModelValidationReport.Detail(
                        "IMPLEMENTATION_MESSAGE_SOURCE_FILE_CONSTRAINT", Level.SEVERE, getMessage(
                            "messageSourceFileConstraint", module.getName(), implementation.getIdentifier(),
                            m.getName(), s.getIdentifier() ),
                        new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                    if ( this.isValidateJava() )
                    {
                        for ( final TemplateParameterType p : s.getTemplateParameter() )
                        {
                            try
                            {
                                p.getJavaValue( context.getClassLoader() );
                            }
                            catch ( final ModelObjectException e )
                            {
                                final String message = getMessage( e );

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

                                report.getDetails().add( new ModelValidationReport.Detail(
                                    "IMPLEMENTATION_MESSAGE_SOURCE_FILE_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                                    Level.SEVERE, getMessage(
                                        "messageSourceFileTemplateParameterJavaValueConstraint",
                                        module.getName(), implementation.getIdentifier(), m.getName(),
                                        s.getIdentifier(), p.getName(),
                                        message != null && message.length() > 0 ? " " + message : "" ),
                                    new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                            }
                        }
                    }

                    this.validateTemplateParameters(
                        report, context, s.getSourceSections(),
                        "IMPLEMENTATION_MESSAGE_SOURCE_FILE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                        new org.jomc.model.ObjectFactory().createImplementation( implementation ),
                        "messageSourceFileSectionTemplateParameterJavaValueConstraint",
                        module.getName(), implementation.getIdentifier(), m.getName(), s.getIdentifier() );

                }
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java1029
org/jomc/tools/modlet/ToolsModelValidator.java1081
                for ( final SourceSectionType s : sourceSectionType )
                {
                    report.getDetails().add( new ModelValidationReport.Detail(
                        "IMPLEMENTATION_DEPENDENCY_SOURCE_SECTION_CONSTRAINT", Level.SEVERE, getMessage(
                            "dependencySourceSectionConstraint", module.getName(), implementation.getIdentifier(),
                            d.getName(), s.getName() ),
                        new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                    if ( this.isValidateJava() )
                    {
                        for ( final TemplateParameterType p : s.getTemplateParameter() )
                        {
                            try
                            {
                                p.getJavaValue( context.getClassLoader() );
                            }
                            catch ( final ModelObjectException e )
                            {
                                final String message = getMessage( e );

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

                                report.getDetails().add( new ModelValidationReport.Detail(
                                    "IMPLEMENTATION_DEPENDENCY_SOURCE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                                    Level.SEVERE, getMessage(
                                        "dependencySourceSectionTemplateParameterJavaValueConstraint",
                                        module.getName(), implementation.getIdentifier(), d.getName(),
                                        s.getName(), p.getName(),
                                        message != null && message.length() > 0 ? " " + message : "" ),
                                    new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                            }
                        }
                    }

                    this.validateTemplateParameters(
                        report, context, s.getSourceSections(),
                        "IMPLEMENTATION_DEPENDENCY_SOURCE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                        new org.jomc.model.ObjectFactory().createImplementation( implementation ),
                        "dependencySourceSectionTemplateParameterJavaValueConstraint",
                        module.getName(), implementation.getIdentifier(), d.getName() );

                }
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java1268
org/jomc/tools/modlet/ToolsModelValidator.java1320
                for ( final SourceSectionType s : sourceSectionType )
                {
                    report.getDetails().add( new ModelValidationReport.Detail(
                        "IMPLEMENTATION_MESSAGE_SOURCE_SECTION_CONSTRAINT", Level.SEVERE, getMessage(
                            "messageSourceSectionConstraint", module.getName(), implementation.getIdentifier(),
                            m.getName(), s.getName() ),
                        new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                    if ( this.isValidateJava() )
                    {
                        for ( final TemplateParameterType p : s.getTemplateParameter() )
                        {
                            try
                            {
                                p.getJavaValue( context.getClassLoader() );
                            }
                            catch ( final ModelObjectException e )
                            {
                                final String message = getMessage( e );

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

                                report.getDetails().add( new ModelValidationReport.Detail(
                                    "IMPLEMENTATION_MESSAGE_SOURCE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                                    Level.SEVERE, getMessage(
                                        "messageSourceSectionTemplateParameterJavaValueConstraint",
                                        module.getName(), implementation.getIdentifier(), m.getName(),
                                        s.getName(), p.getName(),
                                        message != null && message.length() > 0 ? " " + message : "" ),
                                    new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                            }
                        }
                    }

                    this.validateTemplateParameters(
                        report, context, s.getSourceSections(),
                        "IMPLEMENTATION_MESSAGE_SOURCE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                        new org.jomc.model.ObjectFactory().createImplementation( implementation ),
                        "messageSourceSectionTemplateParameterJavaValueConstraint",
                        module.getName(), implementation.getIdentifier(), m.getName() );

                }
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java784
org/jomc/tools/modlet/ToolsModelValidator.java834
            for ( final SourceSectionType s : sourceSectionType )
            {
                report.getDetails().add( new ModelValidationReport.Detail(
                    "IMPLEMENTATION_SOURCE_SECTION_CONSTRAINT", Level.SEVERE, getMessage(
                        "implementationSourceSectionConstraint", module.getName(), implementation.getIdentifier(),
                        s.getName() ), new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
                                "IMPLEMENTATION_SOURCE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT", Level.SEVERE,
                                getMessage( "implementationSourceSectionTemplateParameterJavaValueConstraint",
                                            module.getName(), implementation.getIdentifier(),
                                            s.getName(), p.getName(),
                                            message != null && message.length() > 0 ? " " + message : "" ),
                                new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                        }
                    }
                }

                this.validateTemplateParameters(
                    report, context, s.getSourceSections(),
                    "IMPLEMENTATION_SOURCE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                    new org.jomc.model.ObjectFactory().createImplementation( implementation ),
                    "implementationSourceSectionTemplateParameterJavaValueConstraint",
                    module.getName(), implementation.getIdentifier() );

            }
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java1509
org/jomc/tools/modlet/ToolsModelValidator.java1559
            for ( final SourceSectionType s : sourceSectionType )
            {
                report.getDetails().add( new ModelValidationReport.Detail(
                    "SPECIFICATION_SOURCE_SECTION_CONSTRAINT", Level.SEVERE, getMessage(
                        "specificationSourceSectionConstraint", specification.getIdentifier(), s.getName() ),
                    new org.jomc.model.ObjectFactory().createSpecification( specification ) ) );

                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
                                "SPECIFICATION_SOURCE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                                Level.SEVERE, getMessage(
                                    "specificationSourceSectionTemplateParameterJavaValueConstraint",
                                    module.getName(), specification.getIdentifier(), s.getName(), p.getName(),
                                    message != null && message.length() > 0 ? " " + message : "" ),
                                new org.jomc.model.ObjectFactory().createSpecification( specification ) ) );

                        }
                    }
                }

                this.validateTemplateParameters(
                    report, context, s.getSourceSections(),
                    "SPECIFICATION_SOURCE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                    new org.jomc.model.ObjectFactory().createSpecification( specification ),
                    "specificationSourceSectionTemplateParameterJavaValueConstraint",
                    module.getName(), specification.getIdentifier() );

            }
FileLine
org/jomc/tools/ClassFileProcessor.java2621
org/jomc/tools/ResourceFileProcessor.java550
            randomAccessFile = new RandomAccessFile( classFile, "rw" );
            fileChannel = randomAccessFile.getChannel();
            fileLock = fileChannel.lock();
            fileChannel.truncate( bytes.length );
            fileChannel.position( 0L );
            fileChannel.write( ByteBuffer.wrap( bytes ) );
            fileChannel.force( true );
            suppressExceptionOnClose = false;
        }
        finally
        {
            this.releaseAndClose( fileLock, fileChannel, randomAccessFile, suppressExceptionOnClose );
        }
    }

    private void releaseAndClose( final FileLock fileLock, final FileChannel fileChannel,
                                  final Closeable closeable, final boolean suppressExceptions )
        throws IOException
    {
        try
        {
            if ( fileLock != null )
            {
                fileLock.release();
            }
        }
        catch ( final IOException e )
        {
            if ( suppressExceptions )
            {
                this.log( Level.SEVERE, null, e );
            }
            else
            {
                throw e;
            }
        }
        finally
        {
            try
            {
                if ( fileChannel != null )
                {
                    fileChannel.close();
                }
            }
            catch ( final IOException e )
            {
                if ( suppressExceptions )
                {
                    this.log( Level.SEVERE, null, e );
                }
                else
                {
                    throw e;
                }
            }
            finally
            {
                try
                {
                    if ( closeable != null )
                    {
                        closeable.close();
                    }
                }
                catch ( final IOException e )
                {
                    if ( suppressExceptions )
                    {
                        this.log( Level.SEVERE, null, e );
                    }
                    else
                    {
                        throw e;
                    }
                }
            }
        }
    }

    private static String getMessage( final String key, final Object... arguments )
    {
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java219
org/jomc/tools/modlet/ToolsModelValidator.java267
            for ( final SourceFileType s : sourceFileType )
            {
                report.getDetails().add( new ModelValidationReport.Detail(
                    "MODEL_SOURCE_FILE_CONSTRAINT", Level.SEVERE, getMessage(
                        "modelSourceFileConstraint", model.getIdentifier(), s.getIdentifier() ),
                    new ObjectFactory().createSourceFile( s ) ) );

                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
                                "MODEL_SOURCE_FILE_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT", Level.SEVERE, getMessage(
                                    "modelSourceFileTemplateParameterJavaValueConstraint", model.getIdentifier(),
                                    s.getIdentifier(), p.getName(),
                                    message != null && message.length() > 0 ? " " + message : "" ),
                                new ObjectFactory().createSourceFile( s ) ) );

                        }
                    }
                }

                this.validateTemplateParameters( report, context, s.getSourceSections(),
                                                 "MODEL_SOURCE_FILE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                                                 new ObjectFactory().createSourceFile( s ),
                                                 "modelSourceFileSectionTemplateParameterJavaValueConstraint",
                                                 model.getIdentifier(), s.getIdentifier() );

            }
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java426
org/jomc/tools/modlet/ToolsModelValidator.java475
            for ( final SourceFileType s : sourceFileType )
            {
                report.getDetails().add( new ModelValidationReport.Detail(
                    "MODULE_SOURCE_FILE_CONSTRAINT", Level.SEVERE, getMessage(
                        "moduleSourceFileConstraint", module.getName(), s.getIdentifier() ),
                    new ObjectFactory().createSourceFile( s ) ) );

                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
                                "MODULE_SOURCE_FILE_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT", Level.SEVERE, getMessage(
                                    "moduleSourceFileTemplateParameterJavaValueConstraint", module.getName(),
                                    s.getIdentifier(), p.getName(),
                                    message != null && message.length() > 0 ? " " + message : "" ),
                                new ObjectFactory().createSourceFile( s ) ) );

                        }
                    }
                }

                this.validateTemplateParameters(
                    report, context, s.getSourceSections(),
                    "MODULE_SOURCE_FILE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                    new ObjectFactory().createSourceFile( s ),
                    "moduleSourceFileSectionTemplateParameterJavaValueConstraint",
                    module.getName(), s.getIdentifier() );

            }
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java532
org/jomc/tools/modlet/ToolsModelValidator.java581
            for ( final SourceSectionType s : sourceSectionType )
            {
                report.getDetails().add( new ModelValidationReport.Detail(
                    "MODULE_SOURCE_SECTION_CONSTRAINT", Level.SEVERE, getMessage(
                        "moduleSourceSectionConstraint", module.getName(), s.getName() ),
                    new ObjectFactory().createSourceSection( s ) ) );

                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
                                "MODULE_SOURCE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT", Level.SEVERE,
                                getMessage( "moduleSourceSectionTemplateParameterJavaValueConstraint",
                                            module.getName(), s.getName(), p.getName(),
                                            message != null && message.length() > 0 ? " " + message : "" ),
                                new ObjectFactory().createSourceSection( s ) ) );

                        }
                    }
                }

                this.validateTemplateParameters(
                    report, context, s.getSourceSections(),
                    "MODULE_SOURCE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                    new ObjectFactory().createSourceSection( s ),
                    "moduleSourceSectionTemplateParameterJavaValueConstraint",
                    module.getName(), s.getName() );

            }
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java666
org/jomc/tools/modlet/ToolsModelValidator.java740
            for ( final SourceFileType s : sourceFileType )
            {
                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
                                "IMPLEMENTATION_SOURCE_FILE_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT", Level.SEVERE,
                                getMessage( "implementationSourceFileTemplateParameterJavaValueConstraint",
                                            module.getName(), implementation.getIdentifier(),
                                            s.getIdentifier(), p.getName(),
                                            message != null && message.length() > 0 ? " " + message : "" ),
                                new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                        }
                    }
                }

                this.validateTemplateParameters(
                    report, context, s.getSourceSections(),
                    "IMPLEMENTATION_SOURCE_FILE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                    new org.jomc.model.ObjectFactory().createImplementation( implementation ),
                    "implementationSourceFileSectionTemplateParameterJavaValueConstraint",
                    module.getName(), implementation.getIdentifier(), s.getIdentifier() );

            }
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java1391
org/jomc/tools/modlet/ToolsModelValidator.java1455
            for ( final SourceFileType s : sourceFileType )
            {
                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
                                "SPECIFICATION_SOURCE_FILE_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                                Level.SEVERE, getMessage(
                                    "specificationSourceFileTemplateParameterJavaValueConstraint",
                                    module.getName(), specification.getIdentifier(), s.getIdentifier(), p.getName(),
                                    message != null && message.length() > 0 ? " " + message : "" ),
                                new org.jomc.model.ObjectFactory().createSpecification( specification ) ) );

                        }
                    }
                }

                this.validateTemplateParameters(
                    report, context, s.getSourceSections(),
                    "SPECIFICATION_SOURCE_FILE_SECTION_TEMPLATE_PARAMETER_JAVA_VALUE_CONSTRAINT",
                    new org.jomc.model.ObjectFactory().createSpecification( specification ),
                    "specificationSourceFileSectionTemplateParameterJavaValueConstraint",
                    module.getName(), specification.getIdentifier(), s.getIdentifier() );

            }
FileLine
org/jomc/tools/modlet/ToolsModelProcessor.java865
org/jomc/tools/modlet/ToolsModelProcessor.java1039
            throw new NullPointerException( "specification" );
        }
        if ( sourceFilesType == null )
        {
            throw new NullPointerException( "sourceFilesType" );
        }

        String contextHeadComment = this.getHeadComment();
        if ( ( DEFAULT_HEAD_COMMENT != null
               ? DEFAULT_HEAD_COMMENT.equals( contextHeadComment )
               : contextHeadComment == null )
             && context.getAttribute( HEAD_COMMENT_ATTRIBUTE_NAME ) instanceof String )
        {
            contextHeadComment = (String) context.getAttribute( HEAD_COMMENT_ATTRIBUTE_NAME );
        }

        if ( contextHeadComment != null && contextHeadComment.length() == 0 )
        {
            contextHeadComment = null;
        }

        String contextTailComment = this.getTailComment();
        if ( ( DEFAULT_TAIL_COMMENT != null
               ? DEFAULT_TAIL_COMMENT.equals( contextTailComment )
               : contextTailComment == null )
             && context.getAttribute( TAIL_COMMENT_ATTRIBUTE_NAME ) instanceof String )
        {
            contextTailComment = (String) context.getAttribute( TAIL_COMMENT_ATTRIBUTE_NAME );
        }

        if ( contextTailComment != null && contextTailComment.length() == 0 )
        {
            contextTailComment = null;
        }

        for ( int i = 0, s0 = sourceFilesType.getSourceFile().size(); i < s0; i++ )
        {
            final SourceFileType s = sourceFilesType.getSourceFile().get( i );

            if ( s.getTemplate() == null )
            {
                s.setTemplate( SPECIFICATION_TEMPLATE );
FileLine
org/jomc/tools/ClassFileProcessor.java2148
org/jomc/tools/ClassFileProcessor.java2515
                                     final File classesDirectory ) throws IOException, ModelObjectException
    {
        if ( specification.isClassDeclaration() && specification.getJavaTypeName() != null )
        {
            final String classLocation =
                specification.getJavaTypeName().getClassName().replace( '.', File.separatorChar ) + ".class";

            final File classFile = new File( classesDirectory, classLocation );

            if ( !classesDirectory.isDirectory() )
            {
                throw new IOException( getMessage( "directoryNotFound", classesDirectory.getAbsolutePath() ) );
            }
            if ( !classFile.isFile() )
            {
                throw new IOException( getMessage( "fileNotFound", classFile.getAbsolutePath() ) );
            }
            if ( !( classFile.canRead() && classFile.canWrite() ) )
            {
                throw new IOException( getMessage( "fileAccessDenied", classFile.getAbsolutePath() ) );
            }

            if ( this.isLoggable( Level.INFO ) )
            {
                this.log( Level.INFO, getMessage( "committing", classFile.getAbsolutePath() ), null );
FileLine
org/jomc/tools/ClassFileProcessor.java2182
org/jomc/tools/ClassFileProcessor.java2550
                                     final File classesDirectory ) throws IOException, ModelObjectException
    {
        if ( implementation.isClassDeclaration() && implementation.getJavaTypeName() != null )
        {
            final String classLocation =
                implementation.getJavaTypeName().getClassName().replace( '.', File.separatorChar ) + ".class";

            final File classFile = new File( classesDirectory, classLocation );

            if ( !classesDirectory.isDirectory() )
            {
                throw new IOException( getMessage( "directoryNotFound", classesDirectory.getAbsolutePath() ) );
            }
            if ( !classFile.isFile() )
            {
                throw new IOException( getMessage( "fileNotFound", classFile.getAbsolutePath() ) );
            }
            if ( !( classFile.canRead() && classFile.canWrite() ) )
            {
                throw new IOException( getMessage( "fileAccessDenied", classFile.getAbsolutePath() ) );
            }

            if ( this.isLoggable( Level.INFO ) )
            {
                this.log( Level.INFO, getMessage( "committing", classFile.getAbsolutePath() ), null );
FileLine
org/jomc/tools/ClassFileProcessor.java2153
org/jomc/tools/ClassFileProcessor.java2187
                specification.getJavaTypeName().getClassName().replace( '.', File.separatorChar ) + ".class";

            final File classFile = new File( classesDirectory, classLocation );

            if ( !classesDirectory.isDirectory() )
            {
                throw new IOException( getMessage( "directoryNotFound", classesDirectory.getAbsolutePath() ) );
            }
            if ( !classFile.isFile() )
            {
                throw new IOException( getMessage( "fileNotFound", classFile.getAbsolutePath() ) );
            }
            if ( !( classFile.canRead() && classFile.canWrite() ) )
            {
                throw new IOException( getMessage( "fileAccessDenied", classFile.getAbsolutePath() ) );
            }

            if ( this.isLoggable( Level.INFO ) )
            {
                this.log( Level.INFO, getMessage( "committing", classFile.getAbsolutePath() ), null );
            }

            final JavaClass javaClass = this.readJavaClass( classFile );
            this.commitModelObjects( specification, marshaller, javaClass );
FileLine
org/jomc/tools/ClassFileProcessor.java2257
org/jomc/tools/ClassFileProcessor.java2299
                specification.getJavaTypeName().getClassName().replace( '.', File.separatorChar ) + ".class";

            final File classFile = new File( classesDirectory, classLocation );

            if ( !classesDirectory.isDirectory() )
            {
                throw new IOException( getMessage( "directoryNotFound", classesDirectory.getAbsolutePath() ) );
            }
            if ( !classFile.isFile() )
            {
                throw new IOException( getMessage( "fileNotFound", classFile.getAbsolutePath() ) );
            }
            if ( !classFile.canRead() )
            {
                throw new IOException( getMessage( "fileAccessDenied", classFile.getAbsolutePath() ) );
            }

            if ( this.isLoggable( Level.INFO ) )
            {
                this.log( Level.INFO, getMessage( "validating", classFile.getAbsolutePath() ), null );
            }

            final JavaClass javaClass = this.readJavaClass( classFile );

            report.getDetails().addAll(
                this.validateModelObjects( specification, unmarshaller, javaClass ).getDetails() );
FileLine
org/jomc/tools/ClassFileProcessor.java2520
org/jomc/tools/ClassFileProcessor.java2555
                specification.getJavaTypeName().getClassName().replace( '.', File.separatorChar ) + ".class";

            final File classFile = new File( classesDirectory, classLocation );

            if ( !classesDirectory.isDirectory() )
            {
                throw new IOException( getMessage( "directoryNotFound", classesDirectory.getAbsolutePath() ) );
            }
            if ( !classFile.isFile() )
            {
                throw new IOException( getMessage( "fileNotFound", classFile.getAbsolutePath() ) );
            }
            if ( !( classFile.canRead() && classFile.canWrite() ) )
            {
                throw new IOException( getMessage( "fileAccessDenied", classFile.getAbsolutePath() ) );
            }

            if ( this.isLoggable( Level.INFO ) )
            {
                this.log( Level.INFO, getMessage( "transforming", classFile.getAbsolutePath() ), null );
            }

            final JavaClass javaClass = this.readJavaClass( classFile );
            this.transformModelObjects( specification, marshaller, unmarshaller, javaClass, transformers );
FileLine
org/jomc/tools/modlet/ToolsModelProcessor.java534
org/jomc/tools/modlet/ToolsModelProvider.java546
            final Modules modules = ModelHelper.getModules( processed );

            if ( modules != null )
            {
                Module classpathModule = null;
                if ( contextModelObjectClasspathResolutionEnabled )
                {
                    classpathModule = modules.getClasspathModule( Modules.getDefaultClasspathModuleName(),
                                                                  context.getClassLoader() );

                    if ( classpathModule != null
                         && modules.getModule( Modules.getDefaultClasspathModuleName() ) == null )
                    {
                        modules.getModule().add( classpathModule );
                    }
                    else
                    {
                        classpathModule = null;
                    }
                }

                if ( modules.getSpecifications() != null )
                {
                    for ( int i = 0, s0 = modules.getSpecifications().getSpecification().size(); i < s0; i++ )
                    {
                        final Specification specification = modules.getSpecifications().getSpecification().get( i );
                        final SourceFileType sourceFileType = specification.getAnyObject( SourceFileType.class );
                        final SourceFilesType sourceFilesType = specification.getAnyObject( SourceFilesType.class );

                        if ( sourceFileType != null )
FileLine
org/jomc/tools/modlet/ToolsModelProvider.java940
org/jomc/tools/modlet/ToolsModelProvider.java1062
            throw new NullPointerException( "specification" );
        }

        String contextHeadComment = this.getHeadComment();
        if ( ( DEFAULT_HEAD_COMMENT != null
               ? DEFAULT_HEAD_COMMENT.equals( contextHeadComment )
               : contextHeadComment == null )
             && context.getAttribute( HEAD_COMMENT_ATTRIBUTE_NAME ) instanceof String )
        {
            contextHeadComment = (String) context.getAttribute( HEAD_COMMENT_ATTRIBUTE_NAME );
        }

        if ( contextHeadComment != null && contextHeadComment.length() == 0 )
        {
            contextHeadComment = null;
        }

        String contextTailComment = this.getTailComment();
        if ( ( DEFAULT_TAIL_COMMENT != null
               ? DEFAULT_TAIL_COMMENT.equals( contextTailComment )
               : contextTailComment == null )
             && context.getAttribute( TAIL_COMMENT_ATTRIBUTE_NAME ) instanceof String )
        {
            contextTailComment = (String) context.getAttribute( TAIL_COMMENT_ATTRIBUTE_NAME );
        }

        if ( contextTailComment != null && contextTailComment.length() == 0 )
        {
            contextTailComment = null;
        }

        final Set<String> uniqueSectionNames = new HashSet<String>( 16 );
        final Set<String> sectionNames = new HashSet<String>( 16 );
FileLine
org/jomc/tools/JomcTool.java1691
org/jomc/tools/JomcTool.java1753
        String methodParameterName = null;

        if ( str != null )
        {
            final int len = str.length();
            final StringBuilder builder = new StringBuilder( len );
            boolean uc = false;

            for ( int i = 0; i < len; i++ )
            {
                final char c = str.charAt( i );
                final String charString = Character.toString( c );

                if ( builder.length() > 0 )
                {
                    if ( Character.isJavaIdentifierPart( c ) )
                    {
                        builder.append( uc ? charString.toUpperCase( this.getLocale() ) : charString );
                        uc = false;
                    }
                    else
                    {
                        uc = true;
                    }
                }
                else if ( Character.isJavaIdentifierStart( c ) )
                {
                    builder.append( charString.toLowerCase( this.getLocale() ) );
                }
            }
FileLine
org/jomc/tools/ClassFileProcessor.java2153
org/jomc/tools/ClassFileProcessor.java2555
                specification.getJavaTypeName().getClassName().replace( '.', File.separatorChar ) + ".class";

            final File classFile = new File( classesDirectory, classLocation );

            if ( !classesDirectory.isDirectory() )
            {
                throw new IOException( getMessage( "directoryNotFound", classesDirectory.getAbsolutePath() ) );
            }
            if ( !classFile.isFile() )
            {
                throw new IOException( getMessage( "fileNotFound", classFile.getAbsolutePath() ) );
            }
            if ( !( classFile.canRead() && classFile.canWrite() ) )
            {
                throw new IOException( getMessage( "fileAccessDenied", classFile.getAbsolutePath() ) );
            }

            if ( this.isLoggable( Level.INFO ) )
            {
                this.log( Level.INFO, getMessage( "committing", classFile.getAbsolutePath() ), null );
FileLine
org/jomc/tools/ClassFileProcessor.java2187
org/jomc/tools/ClassFileProcessor.java2520
                implementation.getJavaTypeName().getClassName().replace( '.', File.separatorChar ) + ".class";

            final File classFile = new File( classesDirectory, classLocation );

            if ( !classesDirectory.isDirectory() )
            {
                throw new IOException( getMessage( "directoryNotFound", classesDirectory.getAbsolutePath() ) );
            }
            if ( !classFile.isFile() )
            {
                throw new IOException( getMessage( "fileNotFound", classFile.getAbsolutePath() ) );
            }
            if ( !( classFile.canRead() && classFile.canWrite() ) )
            {
                throw new IOException( getMessage( "fileAccessDenied", classFile.getAbsolutePath() ) );
            }

            if ( this.isLoggable( Level.INFO ) )
            {
                this.log( Level.INFO, getMessage( "committing", classFile.getAbsolutePath() ), null );
FileLine
org/jomc/tools/modlet/ToolsModelProcessor.java869
org/jomc/tools/modlet/ToolsModelProcessor.java1043
org/jomc/tools/modlet/ToolsModelProvider.java940
org/jomc/tools/modlet/ToolsModelProvider.java1062
            throw new NullPointerException( "sourceFilesType" );
        }

        String contextHeadComment = this.getHeadComment();
        if ( ( DEFAULT_HEAD_COMMENT != null
               ? DEFAULT_HEAD_COMMENT.equals( contextHeadComment )
               : contextHeadComment == null )
             && context.getAttribute( HEAD_COMMENT_ATTRIBUTE_NAME ) instanceof String )
        {
            contextHeadComment = (String) context.getAttribute( HEAD_COMMENT_ATTRIBUTE_NAME );
        }

        if ( contextHeadComment != null && contextHeadComment.length() == 0 )
        {
            contextHeadComment = null;
        }

        String contextTailComment = this.getTailComment();
        if ( ( DEFAULT_TAIL_COMMENT != null
               ? DEFAULT_TAIL_COMMENT.equals( contextTailComment )
               : contextTailComment == null )
             && context.getAttribute( TAIL_COMMENT_ATTRIBUTE_NAME ) instanceof String )
        {
            contextTailComment = (String) context.getAttribute( TAIL_COMMENT_ATTRIBUTE_NAME );
        }

        if ( contextTailComment != null && contextTailComment.length() == 0 )
        {
            contextTailComment = null;
        }
FileLine
org/jomc/tools/ClassFileProcessor.java409
org/jomc/tools/ClassFileProcessor.java1040
            final ObjectFactory of = new ObjectFactory();

            Dependencies dependencies = this.getModules().getDependencies( implementation.getIdentifier() );
            if ( dependencies == null )
            {
                dependencies = new Dependencies();
            }

            Properties properties = this.getModules().getProperties( implementation.getIdentifier() );
            if ( properties == null )
            {
                properties = new Properties();
            }

            Messages messages = this.getModules().getMessages( implementation.getIdentifier() );
            if ( messages == null )
            {
                messages = new Messages();
            }

            Specifications specifications = this.getModules().getSpecifications( implementation.getIdentifier() );
            if ( specifications == null )
            {
                specifications = new Specifications();
            }
FileLine
org/jomc/tools/modlet/ToolsModelProvider.java1144
org/jomc/tools/modlet/ToolsModelProvider.java1173
                final String sectionName = this.getDefaultSourceSectionName( context, modules, specification );

                if ( sectionName != null )
                {
                    if ( !sectionNames.contains( sectionName ) )
                    {
                        sectionNames.add( sectionName );

                        s = new SourceSectionType();
                        s.setName( sectionName );
                        s.setIndentationLevel( 1 );
                        s.setEditable( true );
                        sourceFileType.getSourceSections().getSourceSection().add( s );
                    }
                    else if ( uniqueSectionNames.add( sectionName ) )
                    {
                        final Module module = modules.getModuleOfImplementation( implementation.getIdentifier() );
                        context.log( Level.WARNING, getMessage( "implementationSectionNameUniqueness",
                                                                implementation.getIdentifier(),
                                                                module.getName(),
                                                                sourceFileType.getIdentifier(),
                                                                sectionName ),
                                     null );

                    }
                }
FileLine
org/jomc/tools/ClassFileProcessor.java1666
org/jomc/tools/ClassFileProcessor.java1882
                this.log( Level.WARNING, getMessage( "specificationNotFound", specification.getIdentifier() ), null );
            }
        }
        catch ( final JAXBException e )
        {
            String message = getMessage( e );
            if ( message == null && e.getLinkedException() != null )
            {
                message = getMessage( e.getLinkedException() );
            }

            // JDK: As of JDK 6, "new IOException( message, cause )".
            throw (IOException) new IOException( message ).initCause( e );
        }
        catch ( final TransformerException e )
        {
            String message = getMessage( e );
            if ( message == null && e.getException() != null )
            {
                message = getMessage( e.getException() );
            }

            // JDK: As of JDK 6, "new IOException( message, cause )".
            throw (IOException) new IOException( message ).initCause( e );
        }
    }

    /**
     * Transforms model objects of a given implementation of the modules of the instance.
     *
     * @param implementation The implementation to process.
     * @param marshaller The marshaller to use for transforming model objects.
     * @param unmarshaller The unmarshaller to use for transforming model objects.
     * @param javaClass The java class to transform model object of.
     * @param transformers The transformers to use for transforming the model objects.
     *
     * @throws NullPointerException if {@code implementation}, {@code marshaller}, {@code unmarshaller},
     * {@code javaClass} or {@code transformers} is {@code null}.
     * @throws IOException if transforming model objects fails.
     */
    public void transformModelObjects( final Implementation implementation, final Marshaller marshaller,
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java921
org/jomc/tools/modlet/ToolsModelValidator.java973
org/jomc/tools/modlet/ToolsModelValidator.java1160
org/jomc/tools/modlet/ToolsModelValidator.java1212
                            d.getName(), s.getIdentifier() ),
                        new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                    if ( this.isValidateJava() )
                    {
                        for ( final TemplateParameterType p : s.getTemplateParameter() )
                        {
                            try
                            {
                                p.getJavaValue( context.getClassLoader() );
                            }
                            catch ( final ModelObjectException e )
                            {
                                final String message = getMessage( e );

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

                                report.getDetails().add( new ModelValidationReport.Detail(
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java1034
org/jomc/tools/modlet/ToolsModelValidator.java1086
org/jomc/tools/modlet/ToolsModelValidator.java1273
org/jomc/tools/modlet/ToolsModelValidator.java1325
                            d.getName(), s.getName() ),
                        new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                    if ( this.isValidateJava() )
                    {
                        for ( final TemplateParameterType p : s.getTemplateParameter() )
                        {
                            try
                            {
                                p.getJavaValue( context.getClassLoader() );
                            }
                            catch ( final ModelObjectException e )
                            {
                                final String message = getMessage( e );

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

                                report.getDetails().add( new ModelValidationReport.Detail(
FileLine
org/jomc/tools/ClassFileProcessor.java2383
org/jomc/tools/ClassFileProcessor.java2444
                this.log( Level.INFO, getMessage( "validatingSpecification", specification.getIdentifier() ), null );
            }

            InputStream in = null;
            JavaClass javaClass = null;
            boolean suppressExceptionOnClose = true;

            try
            {
                in = classUrl.openStream();
                javaClass = new ClassParser( in, classUrl.toExternalForm() ).parse();
                suppressExceptionOnClose = false;
            }
            finally
            {
                try
                {
                    if ( in != null )
                    {
                        in.close();
                    }
                }
                catch ( final IOException e )
                {
                    if ( suppressExceptionOnClose )
                    {
                        this.log( Level.SEVERE, getMessage( e ), e );
                    }
                    else
                    {
                        throw e;
                    }
                }
            }

            report.getDetails().addAll(
                this.validateModelObjects( specification, unmarshaller, javaClass ).getDetails() );
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java788
org/jomc/tools/modlet/ToolsModelValidator.java838
org/jomc/tools/modlet/ToolsModelValidator.java1034
org/jomc/tools/modlet/ToolsModelValidator.java1086
org/jomc/tools/modlet/ToolsModelValidator.java1273
org/jomc/tools/modlet/ToolsModelValidator.java1325
                        "implementationSourceSectionConstraint", module.getName(), implementation.getIdentifier(),
                        s.getName() ), new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java662
org/jomc/tools/modlet/ToolsModelValidator.java1387
        final List<SourceSectionsType> sourceSectionsType = implementation.getAnyObjects( SourceSectionsType.class );

        if ( sourceFileType != null )
        {
            for ( final SourceFileType s : sourceFileType )
            {
                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java738
org/jomc/tools/modlet/ToolsModelValidator.java1453
            for ( final SourceFilesType l : sourceFilesType )
            {
                for ( final SourceFileType s : l.getSourceFile() )
                {
                    if ( this.isValidateJava() )
                    {
                        for ( final TemplateParameterType p : s.getTemplateParameter() )
                        {
                            try
                            {
                                p.getJavaValue( context.getClassLoader() );
                            }
                            catch ( final ModelObjectException e )
                            {
                                final String message = getMessage( e );

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

                                report.getDetails().add( new ModelValidationReport.Detail(
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java223
org/jomc/tools/modlet/ToolsModelValidator.java271
org/jomc/tools/modlet/ToolsModelValidator.java430
org/jomc/tools/modlet/ToolsModelValidator.java479
                        "modelSourceFileConstraint", model.getIdentifier(), s.getIdentifier() ),
                    new ObjectFactory().createSourceFile( s ) ) );

                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java328
org/jomc/tools/modlet/ToolsModelValidator.java536
org/jomc/tools/modlet/ToolsModelValidator.java585
                        "modelSourceSectionConstraint", model.getIdentifier(), s.getName() ),
                    new ObjectFactory().createSourceSection( s ) ) );

                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
FileLine
org/jomc/tools/modlet/ToolsModelValidator.java789
org/jomc/tools/modlet/ToolsModelValidator.java839
org/jomc/tools/modlet/ToolsModelValidator.java921
org/jomc/tools/modlet/ToolsModelValidator.java973
org/jomc/tools/modlet/ToolsModelValidator.java1034
org/jomc/tools/modlet/ToolsModelValidator.java1086
org/jomc/tools/modlet/ToolsModelValidator.java1160
org/jomc/tools/modlet/ToolsModelValidator.java1212
org/jomc/tools/modlet/ToolsModelValidator.java1273
org/jomc/tools/modlet/ToolsModelValidator.java1325
                        s.getName() ), new org.jomc.model.ObjectFactory().createImplementation( implementation ) ) );

                if ( this.isValidateJava() )
                {
                    for ( final TemplateParameterType p : s.getTemplateParameter() )
                    {
                        try
                        {
                            p.getJavaValue( context.getClassLoader() );
                        }
                        catch ( final ModelObjectException e )
                        {
                            final String message = getMessage( e );

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

                            report.getDetails().add( new ModelValidationReport.Detail(
FileLine
org/jomc/tools/ClassFileProcessor.java2150
org/jomc/tools/ClassFileProcessor.java2254
org/jomc/tools/ClassFileProcessor.java2517
        if ( specification.isClassDeclaration() && specification.getJavaTypeName() != null )
        {
            final String classLocation =
                specification.getJavaTypeName().getClassName().replace( '.', File.separatorChar ) + ".class";

            final File classFile = new File( classesDirectory, classLocation );

            if ( !classesDirectory.isDirectory() )
            {
                throw new IOException( getMessage( "directoryNotFound", classesDirectory.getAbsolutePath() ) );
            }
            if ( !classFile.isFile() )
            {
                throw new IOException( getMessage( "fileNotFound", classFile.getAbsolutePath() ) );
            }
            if ( !( classFile.canRead() && classFile.canWrite() ) )
FileLine
org/jomc/tools/ClassFileProcessor.java2184
org/jomc/tools/ClassFileProcessor.java2296
org/jomc/tools/ClassFileProcessor.java2552
        if ( implementation.isClassDeclaration() && implementation.getJavaTypeName() != null )
        {
            final String classLocation =
                implementation.getJavaTypeName().getClassName().replace( '.', File.separatorChar ) + ".class";

            final File classFile = new File( classesDirectory, classLocation );

            if ( !classesDirectory.isDirectory() )
            {
                throw new IOException( getMessage( "directoryNotFound", classesDirectory.getAbsolutePath() ) );
            }
            if ( !classFile.isFile() )
            {
                throw new IOException( getMessage( "fileNotFound", classFile.getAbsolutePath() ) );
            }
            if ( !( classFile.canRead() && classFile.canWrite() ) )