CPD Results

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

Duplications

FileLine
org/apache/geronimo/genesis/logging/DelegatingLog.java109
org/apache/geronimo/genesis/logging/MavenPluginLog.java101
    }

    public void debug(final Object object) {
        getLog().debug(createMessage(object));
    }

    public void debug(final Object object, final Throwable throwable) {
        getLog().debug(createMessage(object), throwable);
    }

    public void info(final Object object) {
        getLog().info(createMessage(object));
    }

    public void info(final Object object, final Throwable throwable) {
        getLog().info(createMessage(object), throwable);
    }

    public void warn(final Object object) {
        getLog().warn(createMessage(object));
    }

    public void warn(final Object object, final Throwable throwable) {
        getLog().warn(createMessage(object), throwable);
    }

    public void error(final Object object) {
        getLog().error(createMessage(object));
    }

    public void error(final Object object, final Throwable throwable) {
        getLog().error(createMessage(object), throwable);
    }

    public void fatal(final Object object) {
        error(object);
    }

    public void fatal(final Object object, final Throwable throwable) {
        error(object, throwable);
    }
}

FileLine
org/apache/geronimo/genesis/ant/AntHelper.java90
org/apache/geronimo/genesis/ant/AntMojoSupport.java68
        MavenAntLoggerAdapter antLogger = new MavenAntLoggerAdapter(log);
        antLogger.setEmacsMode(true);
        antLogger.setOutputPrintStream(System.out);
        antLogger.setErrorPrintStream(System.err);
        
        if (log.isDebugEnabled()) {
            antLogger.setMessageOutputLevel(Project.MSG_VERBOSE);
        }
        else {
            antLogger.setMessageOutputLevel(Project.MSG_INFO);
        }
        
        ant.addBuildListener(antLogger);
    }
    
    protected void setProperty(final String name, Object value) {
        assert name != null;
        assert value != null;

        String valueAsString = String.valueOf(value);

        if (log.isDebugEnabled()) {
            log.debug("Setting property: " + name + "=" + valueAsString);
        }

        Property prop = (Property)createTask("property");
        prop.setName(name);
        prop.setValue(valueAsString);
        prop.execute();
    }

FileLine
org/apache/geronimo/genesis/ant/CommonsLoggingAntLoggerAdapter.java38
org/apache/geronimo/genesis/ant/MavenAntLoggerAdapter.java39
    public MavenAntLoggerAdapter(final Log log) {
        super();
        
        assert log != null;
        
        this.log = log;
    }
    
    protected void printMessage(final String message, final PrintStream stream, final int priority) {
        assert message != null;
        assert stream != null;

        switch (priority) {
            case Project.MSG_ERR:
                log.error(message);
                break;

            case Project.MSG_WARN:
                log.warn(message);
                break;

            case Project.MSG_INFO:
                log.info(message);
                break;

            case Project.MSG_VERBOSE:
            case Project.MSG_DEBUG:
                log.debug(message);
                break;
        }
    }
}