Fork me on GitHub

CPD Results

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

Duplications

File Line
com/sun/tlddoc/TagDirImplicitTagLibrary.java 157
com/sun/tlddoc/WARTagDirImplicitTagLibrary.java 153
Element tagFileElement = result.createElement( "tag-file" );
                    Element nameElement = result.createElement( "name" );
                    nameElement.appendChild( result.createTextNode( tagName ) );
                    tagFileElement.appendChild( nameElement );
                    Element pathElement = result.createElement( "path" );
                    pathElement.appendChild( result.createTextNode( tagPath ) );
                    tagFileElement.appendChild( pathElement );
                    taglibElement.appendChild( tagFileElement );
                }
            }
        }

        // Output implicit tag library, as a test.
        StringWriter buffer = new StringWriter();
        Transformer transformer =
            TransformerFactory.newInstance().newTransformer();
        transformer.transform( new DOMSource( result ),
            new StreamResult( buffer ) );
        result = documentBuilder.parse( new InputSource( new StringReader(
            buffer.toString() ) ) );

        return result;

    }
File Line
com/sun/tlddoc/JARTLDFileTagLibrary.java 82
com/sun/tlddoc/WARJARTLDFileTagLibrary.java 93
return jar.getAbsolutePath() + "!" + tldPath;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public InputStream getResource(String path)
        throws IOException
    {
        if( path.startsWith( "/" ) ) path = path.substring( 1 );

        return getInputStream( path );
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Document getTLDDocument(DocumentBuilder documentBuilder)
        throws IOException, SAXException, TransformerException
    {
        try( InputStream in = getInputStream( this.tldPath ) ) {
            if( in != null ) {
                return documentBuilder.parse( in );
            }
        }

        return null;
    }

    /**
     * Returns an input stream for reading the contents of the specified
     * JAR-file entry.
     *
     * @param path the path to the resource
     *
     * @return an input stream for reading the contents of the specified
     *         JAR-file entry
     *
     * @throws IOException if an I/O error has occurred
     */
    private InputStream getInputStream( String path )
        throws IOException
    {
        if( jarFile == null ) {