CPD Results

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

Duplications

FileLine
org\codehaus\mojo\wagon\shared\SelectorUtils.java66
org\codehaus\mojo\wagon\shared\SelectorUtils.java148
    public static boolean matchPatternStart( String pattern, String str, boolean isCaseSensitive )
    {
        // When str starts with a separator, pattern has to start with a
        // separator.
        // When pattern starts with a separator, str has to start with a
        // separator.
        if ( str.startsWith( "/" ) != pattern.startsWith( "/" ) )
        {
            return false;
        }

        Vector patDirs = tokenizePath( pattern );
        Vector strDirs = tokenizePath( str );

        int patIdxStart = 0;
        int patIdxEnd = patDirs.size() - 1;
        int strIdxStart = 0;
        int strIdxEnd = strDirs.size() - 1;

        // up to first '**'
        while ( patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd )
        {
            String patDir = (String) patDirs.elementAt( patIdxStart );
            if ( patDir.equals( "**" ) )
            {
                break;
            }
            if ( !match( patDir, (String) strDirs.elementAt( strIdxStart ), isCaseSensitive ) )
            {