File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
core/src/main/java/hudson Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,14 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
218218 */
219219 /* private final */ static int CHECK_UPDATE_ATTEMPTS ;
220220
221+ /**
222+ * Class name prefixes to skip in the class loading
223+ */
224+ private static final String [] CLASS_PREFIXES_TO_SKIP = {
225+ "SimpleTemplateScript" , // cf. groovy.text.SimpleTemplateEngine
226+ "groovy.tmp.templates.GStringTemplateScript" , // Leaks on classLoader in some cases, see JENKINS-75879
227+ };
228+
221229 static {
222230 try {
223231 // Secure initialization
@@ -2409,8 +2417,10 @@ public UberClassLoader(List<PluginWrapper> activePlugins) {
24092417
24102418 @ Override
24112419 protected Class <?> findClass (String name ) throws ClassNotFoundException {
2412- if (name .startsWith ("SimpleTemplateScript" )) { // cf. groovy.text.SimpleTemplateEngine
2413- throw new ClassNotFoundException ("ignoring " + name );
2420+ for (String namePrefixToSkip : CLASS_PREFIXES_TO_SKIP ) {
2421+ if (name .startsWith (namePrefixToSkip )) {
2422+ throw new ClassNotFoundException ("ignoring " + name );
2423+ }
24142424 }
24152425 return loaded .computeIfAbsent (name , this ::computeValue ).orElseThrow (() -> new ClassNotFoundException (name ));
24162426 }
You can’t perform that action at this time.
0 commit comments