Class ClasspathJarDuplicateClassFinder
- java.lang.Object
-
- com.atlassian.confluence.util.classpath.ClasspathJarDuplicateClassFinder
-
- All Implemented Interfaces:
DuplicateClassFinder
public class ClasspathJarDuplicateClassFinder extends Object implements DuplicateClassFinder
Finds duplicate classes in JARs in the classpath of the thread context classloader.
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.collections.PredicateEXCLUDE_KNOWN_DUPLICATESstatic Set<String>KNOWN_DUPLICATE_CLASSESstatic List<String>KNOWN_DUPLICATE_PACKAGESA list of prefixes of class file paths to exclude.
-
Constructor Summary
Constructors Constructor Description ClasspathJarDuplicateClassFinder()ClasspathJarDuplicateClassFinder(org.apache.commons.collections.Predicate classFileNamePredicate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SortedSet<String>getClassFileNames(JarSet jars)SortedSet<String>getClassNames(JarSet jars)Set<JarSet>getJarSetsWithCommonClasses()SortedSet<String>getPackageNames(JarSet jars)static booleanisKnownDuplicate(String classFileName)
-
-
-
Field Detail
-
KNOWN_DUPLICATE_PACKAGES
public static final List<String> KNOWN_DUPLICATE_PACKAGES
A list of prefixes of class file paths to exclude. For example, "javax/transaction/" will exclude everything in the javax.transaction package and all subpackages too.
-
EXCLUDE_KNOWN_DUPLICATES
public static final org.apache.commons.collections.Predicate EXCLUDE_KNOWN_DUPLICATES
-
-
Method Detail
-
getJarSetsWithCommonClasses
public Set<JarSet> getJarSetsWithCommonClasses()
- Specified by:
getJarSetsWithCommonClassesin interfaceDuplicateClassFinder
-
getClassFileNames
public SortedSet<String> getClassFileNames(JarSet jars)
- Specified by:
getClassFileNamesin interfaceDuplicateClassFinder
-
getPackageNames
public SortedSet<String> getPackageNames(JarSet jars)
- Specified by:
getPackageNamesin interfaceDuplicateClassFinder
-
getClassNames
public SortedSet<String> getClassNames(JarSet jars)
- Specified by:
getClassNamesin interfaceDuplicateClassFinder
-
isKnownDuplicate
public static boolean isKnownDuplicate(String classFileName)
-
-