/** * Finds all class files that have more than one version on the classpath * * @param classpathResources - the list of classpath resources * @param excludeSameSizeDups - true if only duplicates of different class sizes are considered * @return - the list of class files that have multiple versions */ public List<ClasspathResource> findClassFileDuplicates( List<ClasspathResource> classpathResources, boolean excludeSameSizeDups) { List<ClasspathResource> classFilesWithDuplicates = ClasspathResources.findResourcesWithDuplicates(classpathResources, excludeSameSizeDups); return ClasspathResources.filterClassFilesOnly(classFilesWithDuplicates); }
/** * Finds a list of all classpath resources that contain duplicates. * * <p>A duplicate classpath resource can be for example a configuration file such as log4.xml, * that exists by accident multiple times on the classpath. * * @param excludeSameSizeDups - excludes from the reports files for which all classpath versions * have the same size * @return classpath resources that have multiple versions on the classpath */ public List<ClasspathResource> findAllResourcesWithDuplicates(boolean excludeSameSizeDups) { List<ClasspathResource> resourceFiles = findAllClasspathResources(); return ClasspathResources.findResourcesWithDuplicates(resourceFiles, excludeSameSizeDups); }