CPD Results

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

Duplications

File Line
org/codehaus/plexus/archiver/bzip2/BZip2Archiver.java 30
org/codehaus/plexus/archiver/snappy/SnappyArchiver.java 33
    private BZip2Compressor compressor = new BZip2Compressor();

    @Override
    public void execute()
        throws ArchiverException, IOException
    {
        if ( !checkForced() )
        {
            return;
        }

        ResourceIterator iter = getResources();
        if ( !iter.hasNext() )
        {
            throw new EmptyArchiveException( "archive cannot be empty" );
        }
        ArchiveEntry entry = iter.next();
        if ( iter.hasNext() )
        {
            throw new ArchiverException( "There is more than one file in input." );
        }
        compressor.setSource( entry.getResource() );
        compressor.setDestFile( getDestFile() );
        compressor.compress();
    }

    @Override
    public boolean isSupportingForced()
    {
        return true;
    }

    @Override
    protected void close()
    {
        compressor.close();
    }

    @Override
    protected String getArchiveType()
    {
        return "bzip2";
File Line
org/codehaus/plexus/archiver/bzip2/BZip2Archiver.java 33
org/codehaus/plexus/archiver/gzip/GZipArchiver.java 33
org/codehaus/plexus/archiver/snappy/SnappyArchiver.java 36
    public void execute()
        throws ArchiverException, IOException
    {
        if ( !checkForced() )
        {
            return;
        }

        ResourceIterator iter = getResources();
        if ( !iter.hasNext() )
        {
            throw new EmptyArchiveException( "archive cannot be empty" );
        }
        ArchiveEntry entry = iter.next();
        if ( iter.hasNext() )
        {
            throw new ArchiverException( "There is more than one file in input." );
        }
        compressor.setSource( entry.getResource() );
        compressor.setDestFile( getDestFile() );
        compressor.compress();
    }

    @Override
    public boolean isSupportingForced()
    {
        return true;
    }

    @Override
    protected void close()
    {
        compressor.close();
    }

    @Override
    protected String getArchiveType()
    {
        return "bzip2";
File Line
org/codehaus/plexus/archiver/gzip/GZipArchiver.java 32
org/codehaus/plexus/archiver/xz/XZArchiver.java 38
    @Override
    protected void execute()
        throws ArchiverException, IOException
    {
        if ( !checkForced() )
        {
            return;
        }

        ResourceIterator iter = getResources();
        if ( !iter.hasNext() )
        {
            throw new EmptyArchiveException( "archive cannot be empty" );
        }
        ArchiveEntry entry = iter.next();
        if ( iter.hasNext() )
        {
            throw new ArchiverException( "There is more than one file in input." );
        }
        compressor.setSource( entry.getResource() );
        compressor.setDestFile( getDestFile() );
        compressor.compress();
    }

    @Override
    public boolean isSupportingForced()
    {
        return true;
    }

    @Override
    protected void close()
File Line
org/codehaus/plexus/archiver/bzip2/BZip2Archiver.java 33
org/codehaus/plexus/archiver/snappy/SnappyArchiver.java 36
org/codehaus/plexus/archiver/xz/XZArchiver.java 39
    public void execute()
        throws ArchiverException, IOException
    {
        if ( !checkForced() )
        {
            return;
        }

        ResourceIterator iter = getResources();
        if ( !iter.hasNext() )
        {
            throw new EmptyArchiveException( "archive cannot be empty" );
        }
        ArchiveEntry entry = iter.next();
        if ( iter.hasNext() )
        {
            throw new ArchiverException( "There is more than one file in input." );
        }
        compressor.setSource( entry.getResource() );
        compressor.setDestFile( getDestFile() );
        compressor.compress();
    }

    @Override
    public boolean isSupportingForced()
    {
        return true;
    }

    @Override
    protected void close()