The following document contains the results of PMD's CPD 5.0.5.
File | Line |
---|---|
org/apache/maven/archetype/creator/FilesetArchetypeCreator.java | 809 |
org/apache/maven/archetype/creator/FilesetArchetypeCreator.java | 1031 |
private void createArchetypePom( Model pom, File archetypeFilesDirectory, Properties pomReversedProperties, File initialPomFile, boolean preserveCData, boolean keepParent ) throws IOException { File outputFile = FileUtils.resolveFile( archetypeFilesDirectory, Constants.ARCHETYPE_POM ); if ( preserveCData ) { getLogger().debug( "Preserving CDATA parts of pom" ); File inputFile = FileUtils.resolveFile( archetypeFilesDirectory, Constants.ARCHETYPE_POM + ".tmp" ); FileUtils.copyFile( initialPomFile, inputFile ); Reader in = null; Writer out = null; try { in = ReaderFactory.newXmlReader( inputFile ); String initialcontent = IOUtil.toString( in ); String content = getReversedContent( initialcontent, pomReversedProperties ); outputFile.getParentFile().mkdirs(); out = WriterFactory.newXmlWriter( outputFile ); IOUtil.copy( content, out ); } finally { IOUtil.close( in ); IOUtil.close( out ); } inputFile.delete(); } else { if ( !keepParent ) |
File | Line |
---|---|
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1793 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 2061 |
iterateProfile( innerCount, root, value.getProfiles(), "profiles", "profile" ); findAndReplaceSimpleLists( innerCount, root, value.getModules(), "modules", "module" ); iterateRepository( innerCount, root, value.getRepositories(), "repositories", "repository" ); iterateRepository( innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository" ); iterateDependency( innerCount, root, value.getDependencies(), "dependencies", "dependency" ); findAndReplaceXpp3DOM( innerCount, root, "reports", (Xpp3Dom) value.getReports() ); updateReporting( value.getReporting(), "reporting", innerCount, root ); updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root ); updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root ); findAndReplaceProperties( innerCount, root, "properties", value.getProperties() ); } // -- void updateModel(Model, String, Counter, Element) /** * Method updateModelBase. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateModelBase( ModelBase value, String xmlTag, Counter counter, Element element ) |
File | Line |
---|---|
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1793 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1819 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 2061 |
iterateProfile( innerCount, root, value.getProfiles(), "profiles", "profile" ); findAndReplaceSimpleLists( innerCount, root, value.getModules(), "modules", "module" ); iterateRepository( innerCount, root, value.getRepositories(), "repositories", "repository" ); iterateRepository( innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository" ); iterateDependency( innerCount, root, value.getDependencies(), "dependencies", "dependency" ); findAndReplaceXpp3DOM( innerCount, root, "reports", (Xpp3Dom) value.getReports() ); updateReporting( value.getReporting(), "reporting", innerCount, root ); updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root ); updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root ); findAndReplaceProperties( innerCount, root, "properties", value.getProperties() ); } // -- void updateModel(Model, String, Counter, Element) |
File | Line |
---|---|
org/apache/maven/archetype/common/util/FileCharsetDetector.java | 64 |
org/apache/maven/archetype/common/util/FileCharsetDetector.java | 127 |
byte[] buf = new byte[1024]; int len; boolean done = false; boolean isAscii = true; while ( ( len = imp.read( buf, 0, buf.length ) ) != -1 ) { // Check if the stream is only ascii. if ( isAscii ) { isAscii = det.isAscii( buf, len ); } // DoIt if non-ascii and not done yet. if ( !isAscii && !done ) { done = det.DoIt( buf, len, false ); found = done; } } det.DataEnd(); if ( !isFound() ) { String[] prob = det.getProbableCharsets(); if ( prob.length > 0 ) { charset = prob[0]; } } if ( isAscii ) { charset = "ASCII"; } } |
File | Line |
---|---|
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1387 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1413 |
iterateExtension( innerCount, root, value.getExtensions(), "extensions", "extension" ); findAndReplaceSimpleElement( innerCount, root, "defaultGoal", value.getDefaultGoal(), null ); iterateResource( innerCount, root, value.getResources(), "resources", "resource" ); iterateResource( innerCount, root, value.getTestResources(), "testResources", "testResource" ); findAndReplaceSimpleElement( innerCount, root, "directory", value.getDirectory(), null ); findAndReplaceSimpleElement( innerCount, root, "finalName", value.getFinalName(), null ); findAndReplaceSimpleLists( innerCount, root, value.getFilters(), "filters", "filter" ); updatePluginManagement( value.getPluginManagement(), "pluginManagement", innerCount, root ); iteratePlugin( innerCount, root, value.getPlugins(), "plugins", "plugin" ); } // end if } // -- void updateBuild(Build, String, Counter, Element) /** * Method updateBuildBase. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateBuildBase( BuildBase value, String xmlTag, Counter counter, Element element ) |
File | Line |
---|---|
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1478 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1572 |
Counter innerCount = new Counter( counter.getDepth() + 1 ); findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null ); findAndReplaceSimpleElement( innerCount, root, "email", value.getEmail(), null ); findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null ); findAndReplaceSimpleElement( innerCount, root, "organization", value.getOrganization(), null ); findAndReplaceSimpleElement( innerCount, root, "organizationUrl", value.getOrganizationUrl(), null ); findAndReplaceSimpleLists( innerCount, root, value.getRoles(), "roles", "role" ); findAndReplaceSimpleElement( innerCount, root, "timezone", value.getTimezone(), null ); findAndReplaceProperties( innerCount, root, "properties", value.getProperties() ); } // -- void updateContributor(Contributor, String, Counter, Element) /** * Method updateDependency. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateDependency( Dependency value, String xmlTag, Counter counter, Element element ) |
File | Line |
---|---|
org/apache/maven/archetype/common/MavenJDOMWriter.java | 384 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 440 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 496 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 552 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 608 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 664 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 720 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 776 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 832 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 888 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 944 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1000 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1056 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1112 |
org/apache/maven/archetype/common/MavenJDOMWriter.java | 1168 |
protected void iterateContributor( Counter counter, Element parent, java.util.Collection list, java.lang.String parentTag, java.lang.String childTag ) { boolean shouldExist = ( list != null ) && ( list.size() > 0 ); Element element = updateElement( counter, parent, parentTag, shouldExist ); if ( shouldExist ) { Iterator it = list.iterator(); Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator(); if ( !elIt.hasNext() ) { elIt = null; } Counter innerCount = new Counter( counter.getDepth() + 1 ); while ( it.hasNext() ) { |
File | Line |
---|---|
org/apache/maven/archetype/common/util/XMLOutputter.java | 1579 |
org/apache/maven/archetype/common/util/XMLOutputter.java | 1665 |
break; default: if ( strategy.shouldEscape( ch ) ) { entity = "&#x" + Integer.toHexString( ch ) + ";"; } else { entity = null; } break; } if ( buffer == null ) { if ( entity != null ) { // An entity occurred, so we'll have to use StringBuffer // (allocate room for it plus a few more entities). buffer = new StringBuffer( str.length() + 20 ); // Copy previous skipped characters and fall through // to pickup current character buffer.append( str.substring( 0, i ) ); buffer.append( entity ); } } else { if ( entity == null ) { buffer.append( ch ); } else { buffer.append( entity ); } } } // If there were any entities, return the escaped characters // that we put in the StringBuffer. Otherwise, just return // the unmodified input string. return ( buffer == null ) ? str : buffer.toString(); } /** * This will take the three pre-defined entities in XML 1.0 * (used specifically in XML elements) and convert their character * representation to the appropriate entity reference, suitable for * XML element content. * * @param str <code>String</code> input to escape. * @return <code>String</code> with escaped content. */ public String escapeElementEntities( String str ) |
File | Line |
---|---|
org/apache/maven/archetype/creator/FilesetArchetypeCreator.java | 749 |
org/apache/maven/archetype/creator/FilesetArchetypeCreator.java | 1239 |
boolean packaged, String packageName ) throws IOException { String packageAsDirectory = StringUtils.replace( packageName, ".", File.separator ); getLogger().debug( "Package as Directory: Package:" + packageName + "->" + packageAsDirectory ); for ( String inputFileName : fileSetResources ) { String outputFileName = packaged ? StringUtils.replace( inputFileName, packageAsDirectory + File.separator, "" ) : inputFileName; getLogger().debug( "InputFileName:" + inputFileName ); getLogger().debug( "OutputFileName:" + outputFileName ); File outputFile = new File( archetypeFilesDirectory, outputFileName ); File inputFile = new File( basedir, inputFileName ); |