CPD Results

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

Duplications

File Line
org/apache/maven/plugin/assembly/utils/AssemblyFormatUtils.java 197
org/apache/maven/plugin/assembly/utils/AssemblyFormatUtils.java 411
            interpolator.addValueSource( new PrefixedPropertiesValueSource(
                                                                            InterpolationConstants.PROJECT_PROPERTIES_PREFIXES,
                                                                            mainProject.getProperties(), true ) );
        }

        Properties commandLineProperties = System.getProperties();
        if ( session != null )
        {
            commandLineProperties = new Properties();
            if ( session.getExecutionProperties() != null )
            {
                commandLineProperties.putAll( session.getExecutionProperties() );
            }

            if ( session.getUserProperties() != null )
            {
                commandLineProperties.putAll( session.getUserProperties() );
            }
        }

        // 7
        interpolator.addValueSource( new PropertiesBasedValueSource( commandLineProperties ) );

        try
        {
            // 8
            interpolator.addValueSource( new PrefixedPropertiesValueSource( Collections.singletonList( "env." ),
                                                                            CommandLineUtils.getSystemEnvVars( false ),
                                                                            true ) );
        }
        catch ( final IOException e )
        {
            throw new AssemblyFormattingException( "Failed to retrieve OS environment variables. Reason: "
                + e.getMessage(), e );
        }

        try
        {
            value = interpolator.interpolate( value );
        }
        catch ( final InterpolationException e )
        {
            throw new AssemblyFormattingException( "Failed to interpolate output directory. Reason: " + e.getMessage(),
File Line
org/apache/maven/plugin/assembly/format/FileFormatter.java 100
org/apache/maven/plugin/assembly/format/ReaderFormatter.java 53
                new MavenFileFilterRequest( source, target, true, configSource.getProject(), configSource.getFilters(),
                                            isPropertiesFile, encoding, configSource.getMavenSession(), null );
            filterRequest.setEscapeString( escapeString );

            // if these are NOT set, just use the defaults, which are '${*}' and '@'.
            if ( delimiters != null && !delimiters.isEmpty() )
            {
                LinkedHashSet<String> delims = new LinkedHashSet<String>();
                for ( String delim : delimiters )
                {
                    if ( delim == null )
                    {
                        // FIXME: ${filter:*} could also trigger this condition. Need a better long-term solution.
                        delims.add( "${*}" );
                    }
                    else
                    {
                        delims.add( delim );
                    }
                }

                filterRequest.setDelimiters( delims );
            }
            else
            {
                filterRequest.setDelimiters( filterRequest.getDelimiters() );
            }

            filterRequest.setInjectProjectBuildFilters( configSource.isIncludeProjectBuildFilters() );