Fork me on GitHub

CPD Results

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

Duplications

File Line
jnlp/sample/servlet/JnlpFileHandler.java 135
jnlp/sample/servlet/JnlpFileHandler.java 210
        JnlpFileEntry jnlpFile = (JnlpFileEntry) _jnlpFiles.get( reqUrl );

        if ( jnlpFile != null && jnlpFile.getLastModified() == lastModified )
        {
            // Entry found in cache, so return it
            return jnlpFile.getResponse();
        }

        // Read information from WAR file
        long timeStamp = lastModified;
        String mimeType = _servletContext.getMimeType( path );
        if ( mimeType == null )
        {
            mimeType = JNLP_MIME_TYPE;
        }

        StringBuilder jnlpFileTemplate = new StringBuilder();
        URLConnection conn = resource.openConnection();
        BufferedReader br = new BufferedReader( new InputStreamReader( conn.getInputStream(), "UTF-8" ) );
        String line = br.readLine();
        if ( line != null && line.startsWith( "TS:" ) )
        {
            timeStamp = parseTimeStamp( line.substring( 3 ) );
            _log.addDebug( "Timestamp: " + timeStamp + " " + new Date( timeStamp ) );
            if ( timeStamp == 0 )
            {
                _log.addWarning( "servlet.log.warning.notimestamp", path );
                timeStamp = lastModified;
            }
            line = br.readLine();
        }
        while ( line != null )
        {
            jnlpFileTemplate.append( line );
            line = br.readLine();
        }

        String jnlpFileContent = specializeJnlpTemplate( dreq.getHttpRequest(), path, jnlpFileTemplate.toString() );
File Line
jnlp/sample/servlet/ResourceCatalog.java 565
jnlp/sample/servlet/ResourceCatalog.java 611
        XMLParsing.visitElements( root, "<resource>", new XMLParsing.ElementVisitor()
        {
            public void visitElement( XMLNode node )
            {
                XMLNode pattern = XMLParsing.findElementPath( node, "<pattern>" );
                if ( pattern == null )
                {
                    _log.addWarning( "servlet.log.warning.xml.missing-pattern", versionRes.getPath() );
                }
                else
                {
                    // Parse pattern
                    String name = XMLParsing.getElementContent( pattern, "<name>", "" );
                    String versionId = XMLParsing.getElementContent( pattern, "<version-id>" );
                    String[] os = XMLParsing.getMultiElementContent( pattern, "<os>" );
                    String[] arch = XMLParsing.getMultiElementContent( pattern, "<arch>" );
                    String[] locale = XMLParsing.getMultiElementContent( pattern, "<locale>" );
                    // Get return request
                    String file = XMLParsing.getElementContent( node, "<file>" );