Source:
public void dynamicLoad(File arc, boolean removeExisting, @CheckForNull List<PluginWrapper> batch) throws IOException, InterruptedException, RestartRequiredException { try (ACLContext context = ACL.as(ACL.SYSTEM)) { LOGGER.info("Attempting to dynamic load "+arc); PluginWrapper p = null; String sn; try { sn = strategy.getShortName(arc); } catch (AbstractMethodError x) { LOGGER.log(WARNING, "JENKINS-12753 fix not active: {0}", x.getMessage()); p = strategy.createPluginWrapper(arc); sn = p.getShortName(); } PluginWrapper pw = getPlugin(sn); if (pw!=null) { if (removeExisting) { for (Iterator<PluginWrapper> i = plugins.iterator(); i.hasNext();) { pw = i.next(); if(sn.equals(pw.getShortName())) { i.remove(); break; } } } else { throw new RestartRequiredException(Messages._PluginManager_PluginIsAlreadyInstalled_RestartRequired(sn)); } } if (p == null) { p = strategy.createPluginWrapper(arc); } if (p.supportsDynamicLoad()== YesNoMaybe.NO) throw new RestartRequiredException(Messages._PluginManager_PluginDoesntSupportDynamicLoad_RestartRequired(sn)); plugins.add(p); if (p.isActive()) activePlugins.add(p); synchronized (((UberClassLoader) uberClassLoader).loaded) { ((UberClassLoader) uberClassLoader).loaded.clear(); } CustomClassFilter.Contributed.load(); try { p.resolvePluginDependencies(); strategy.load(p); if (batch != null) { batch.add(p); } else { start(Collections.singletonList(p)); } } catch (Exception e) { failedPlugins.add(new FailedPlugin(sn, e)); activePlugins.remove(p); plugins.remove(p); throw new IOException("Failed to install "+ sn +" plugin",e); } LOGGER.info("Plugin " + p.getShortName()+":"+p.getVersion() + " dynamically installed"); } }

Target:
public void dynamicLoad(File arc, boolean removeExisting, @CheckForNull List<PluginWrapper> batch) throws IOException, InterruptedException, RestartRequiredException { try (ACLContext context = ACL.as(ACL.SYSTEM)) { LOGGER.log(FINE, "Attempting to dynamic load {0}", arc); PluginWrapper p = null; String sn; try { sn = strategy.getShortName(arc); } catch (AbstractMethodError x) { LOGGER.log(WARNING, "JENKINS-12753 fix not active: {0}", x.getMessage()); p = strategy.createPluginWrapper(arc); sn = p.getShortName(); } PluginWrapper pw = getPlugin(sn); if (pw!=null) { if (removeExisting) { for (Iterator<PluginWrapper> i = plugins.iterator(); i.hasNext();) { pw = i.next(); if(sn.equals(pw.getShortName())) { i.remove(); break; } } } else { throw new RestartRequiredException(Messages._PluginManager_PluginIsAlreadyInstalled_RestartRequired(sn)); } } if (p == null) { p = strategy.createPluginWrapper(arc); } if (p.supportsDynamicLoad()== YesNoMaybe.NO) throw new RestartRequiredException(Messages._PluginManager_PluginDoesntSupportDynamicLoad_RestartRequired(sn)); plugins.add(p); if (p.isActive()) activePlugins.add(p); synchronized (((UberClassLoader) uberClassLoader).loaded) { ((UberClassLoader) uberClassLoader).loaded.clear(); } CustomClassFilter.Contributed.load(); try { p.resolvePluginDependencies(); strategy.load(p); if (batch != null) { batch.add(p); } else { start(Collections.singletonList(p)); } } catch (Exception e) { failedPlugins.add(new FailedPlugin(sn, e)); activePlugins.remove(p); plugins.remove(p); throw new IOException("Failed to install "+ sn +" plugin",e); } LOGGER.log(FINE, "Plugin {0}:{1} dynamically {2}", new Object[] {p.getShortName(), p.getVersion(), batch != null ? "loaded but not yet started" : "installed"}); } }