Package net.minecraftforge.logging
Class CrashReportAnalyser
java.lang.Object
net.minecraftforge.logging.CrashReportAnalyser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidanalyseCrashReport(Throwable throwable, StackTraceElement[] uncategorizedStackTrace) Tries to analyze the given exception and uncategorized stacktrace of the crash report.static StringappendSuspectedMods(Throwable throwable, StackTraceElement[] uncategorizedStackTrace) Tries to cache, analyze and append the suspected mods for this crash to the crash report.private static voidblameIfPresent(StackTraceElement stackTraceElement) private static voidblameIfPresent(String className, String... position) private static voidbuildSuspectedModsSection(StringBuilder stringBuilder) Converts the suspected mod(s) for this crash to a String to be added to the crash report, including the mods name, its id, version and an issues link if available, as well as the position where the exception occurred (either the stacktrace element or the mixin class and its target(s))private static voidIterates over all loaded mods, resolving and caching their package names with the correspondingIModInfo.private static StringfindMatchingPackage(String className) Checks if the beginning of the given class name is contained in thePACKAGE_MOD_CACHEprivate static org.spongepowered.asm.mixin.transformer.meta.MixinMergedfindMixinMerged(StackTraceElement element) private static org.spongepowered.asm.mixin.extensibility.IMixinInfogetMixinInfo(StackTraceElement element) Tries to identify any applied mixin for the class and method provided by the stacktrace element.private static voididentifyByClass(StackTraceElement stackTraceElement) private static voididentifyByMixins(StackTraceElement stackTraceElement) private static voidscanStacktrace(StackTraceElement[] stackTrace) Checks the given stacktrace for any occurrence of the package names cached in thePACKAGE_MOD_CACHE, including mixin classes.private static voidscanThrowable(Throwable throwable) Checks the stacktrace of the given throwable and all its children for any occurrence of the package names cached in thePACKAGE_MOD_CACHE, including mixin classes.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
PACKAGE_MOD_CACHE
-
SUSPECTED_MODS
-
-
Constructor Details
-
CrashReportAnalyser
private CrashReportAnalyser()
-
-
Method Details
-
appendSuspectedMods
public static String appendSuspectedMods(Throwable throwable, StackTraceElement[] uncategorizedStackTrace) Tries to cache, analyze and append the suspected mods for this crash to the crash report. -
analyseCrashReport
private static void analyseCrashReport(Throwable throwable, StackTraceElement[] uncategorizedStackTrace) Tries to analyze the given exception and uncategorized stacktrace of the crash report. It checks the stacktrace for any occurrence of the package names cached in thePACKAGE_MOD_CACHE, including mixin classes. -
buildSuspectedModsSection
Converts the suspected mod(s) for this crash to a String to be added to the crash report, including the mods name, its id, version and an issues link if available, as well as the position where the exception occurred (either the stacktrace element or the mixin class and its target(s)) -
scanThrowable
Checks the stacktrace of the given throwable and all its children for any occurrence of the package names cached in thePACKAGE_MOD_CACHE, including mixin classes. -
scanStacktrace
Checks the given stacktrace for any occurrence of the package names cached in thePACKAGE_MOD_CACHE, including mixin classes. -
cacheModList
private static void cacheModList()Iterates over all loaded mods, resolving and caching their package names with the correspondingIModInfo. -
identifyByClass
-
identifyByMixins
-
blameIfPresent
-
blameIfPresent
-
findMatchingPackage
Checks if the beginning of the given class name is contained in thePACKAGE_MOD_CACHE- Returns:
- the package name of the class or null if it is not present in the cache
-
findMixinMerged
@Nullable private static org.spongepowered.asm.mixin.transformer.meta.MixinMerged findMixinMerged(StackTraceElement element) -
getMixinInfo
@Nullable private static org.spongepowered.asm.mixin.extensibility.IMixinInfo getMixinInfo(StackTraceElement element) Tries to identify any applied mixin for the class and method provided by the stacktrace element.- Parameters:
element- the stacktrace element to check- Returns:
- the
IMixinInfofor the class and method or null if there is no mixin applied at this position
-