Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,23 @@
toRemove.add((Class) klazzF.get(value));
}
}
Iterator<Class<?>> it = toRemove.iterator();
while (it.hasNext()) {
Class<?> klazz = it.next();
boolean isLogLevelFinestLoggable = LOGGER.isLoggable(Level.FINEST);
if (isLogLevelFinestLoggable) {

Check warning on line 253 in src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SecureGroovyScript.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 253 is only partially covered, one branch is missing
LOGGER.log(Level.FINE, "The log level FINEST is loggable, cleanUpGlobalClassValue will be slow, toRemove.size()={0}", toRemove.size());

Check warning on line 254 in src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SecureGroovyScript.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 254 is not covered by tests
}
List<Class<?>> toRemoveReally = new ArrayList<>();
for (Class<?> klazz : toRemove) {
ClassLoader encounteredLoader = klazz.getClassLoader();
if (encounteredLoader != loader) {
it.remove();
if (LOGGER.isLoggable(Level.FINEST)) {
LOGGER.log(Level.FINEST, "ignoring {0} with loader {1}", new Object[] {klazz, /* do not hold from LogRecord */String.valueOf(encounteredLoader)});
if (isLogLevelFinestLoggable) {

Check warning on line 260 in src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SecureGroovyScript.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 260 is only partially covered, one branch is missing
LOGGER.log(Level.FINEST, "ignoring {0} with loader {1}", new Object[]{klazz, /* do not hold from LogRecord */String.valueOf(encounteredLoader)});
}
} else {
toRemoveReally.add(klazz);
}
}
LOGGER.log(Level.FINE, "cleaning up {0} associated with {1}", new Object[] {toRemove.toString(), loader.toString()});
for (Class<?> klazz : toRemove) {
LOGGER.log(Level.FINE, "cleaning up {0} associated with {1}", new Object[] {toRemoveReally.toString(), loader.toString()});
for (Class<?> klazz : toRemoveReally) {
removeM.invoke(map, klazz);
}
}
Expand Down