public class ClassNameConflictAnalyzer extends Object
Can identify classes with the same name in different code layers or in code layers and a parent class loader.
Constructor and Description |
---|
ClassNameConflictAnalyzer() |
Modifier and Type | Method and Description |
---|---|
static Map<String,List<Code>> |
getAllClassNamesMap(List<Code> codeLayers)
gets a map of class name to a list of all
Code layers
that contain a class with that name. |
static Map<String,List<Code>> |
getSameClassNamesInMultipleCodeLayersMap(List<Code> codeLayers)
gets a map of class name to a list of all
Code layers
that contain a class with that name, but only if the class name
occurs more than once in the code layers. |
static Map<String,List<Code>> |
getSameClassNamesInParentAndCodeLayersMap(ClassLoader parent,
List<Code> codeLayers)
gets a map of class name to a list of all
Code layers
that contain a class with that name, but only if the class name
occurs also in the given parent class loader. |
public static Map<String,List<Code>> getAllClassNamesMap(List<Code> codeLayers)
Code
layers
that contain a class with that name.codeLayers
- code layersNullPointerException
- if code layers are nullpublic static Map<String,List<Code>> getSameClassNamesInMultipleCodeLayersMap(List<Code> codeLayers)
Code
layers
that contain a class with that name, but only if the class name
occurs more than once in the code layers.codeLayers
- code layersNullPointerException
- if code layers are nullpublic static Map<String,List<Code>> getSameClassNamesInParentAndCodeLayersMap(ClassLoader parent, List<Code> codeLayers)
Code
layers
that contain a class with that name, but only if the class name
occurs also in the given parent class loader.
Note that this method tries to load all of these classes by name from the parent class loader.
parent
- parent class loadercodeLayers
- code layersNullPointerException
- if the parent class loader or code layers are null