Package com.sk89q.worldguard.bukkit.util
Class ClassSourceValidator
java.lang.Object
com.sk89q.worldguard.bukkit.util.ClassSourceValidator
Validates that certain specified classes came from the same source as
a plugin.
This is copied from the same class in WorldEdit because unfortunately
trying to use WorldEdit's means we're susceptible to getting a bad version
of this class if another plugin shades it....which is exactly what we're
trying to detect and report.
-
Constructor Summary
ConstructorDescriptionClassSourceValidator
(org.bukkit.plugin.Plugin plugin) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionfindMismatches
(List<Class<?>> classes) Return a map of classes that been loaded from a different source.void
reportMismatches
(List<Class<?>> classes) Reports classes that have come from a different source.
-
Constructor Details
-
ClassSourceValidator
public ClassSourceValidator(org.bukkit.plugin.Plugin plugin) Create a new instance.- Parameters:
plugin
- The plugin
-
-
Method Details
-
findMismatches
Return a map of classes that been loaded from a different source.- Parameters:
classes
- A list of classes to check- Returns:
- The results
-
reportMismatches
Reports classes that have come from a different source.The warning is emitted to the log.
- Parameters:
classes
- The list of classes to check
-