Omit stacktraces on ClassNotFoundException in PluginStrategy classloading (#4957)

* Omit stacktraces on ClassNotFoundException in PluginStrategy classloading

* Modify implementation to not fill in stacktraces by default

* Apply suggestions from code review

* Restrict withFillInStackTracesOnClassNotFoundException() at Beta API
This commit is contained in:
Oleg Nenashev authored and GitHub committed 2020-10-12 11:21:38 +02:00
1 parent 1131c031c0
commit b62b6dd830
4 files changed
+96 -4

No files matched your search

+7 -2
View File
@@ -1213,8 +1213,13 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
LOGGER.info("Falling back to ClassicPluginStrategy");
}
// default and fallback
return new ClassicPluginStrategy(this);
// Default and fallback strategy
// The default Plugin Manager implementation does not propagate/log stacktraces for ClassNotFoundExceptions,
// hence stacktraces are omitted by default for better performance.
boolean fillInClassNotFoundExceptionStackTraces =SystemProperties.getBoolean(
ClassicPluginStrategy.class.getName() + ".fillInClassNotFoundExceptionStackTraces", false);
return new ClassicPluginStrategy(this)
.withFillInStackTracesOnClassNotFoundException(fillInClassNotFoundExceptionStackTraces);
}
public PluginStrategy getPluginStrategy() {