private void locationChanged(Item item, String oldName, String newName) { if (item instanceof Job) { Job p = Jenkins.getInstance().getItemByFullName(newName, Job.class); if (p != null) { RunList<? extends Run> builds = p.getBuilds(); for (Run build : builds) { Collection<Fingerprint> fingerprints = build.getBuildFingerprints(); for (Fingerprint f : fingerprints) { try { f.rename(oldName, newName); } catch (IOException e) { logger.log(Level.WARNING, "Failed to update fingerprint record " + f.getFileName() + " when " + oldName + " was renamed to " + newName, e); } } } } } } }
private void locationChanged(Item item, String oldName, String newName) { if (item instanceof AbstractProject) { AbstractProject p = Jenkins.getInstance().getItemByFullName(newName, AbstractProject.class); if (p != null) { RunList builds = p.getBuilds(); for (Object build : builds) { if (build instanceof AbstractBuild) { Collection<Fingerprint> fingerprints = ((AbstractBuild)build).getBuildFingerprints(); for (Fingerprint f : fingerprints) { try { f.rename(oldName, newName); } catch (IOException e) { logger.log(Level.WARNING, "Failed to update fingerprint record " + f.getFileName() + " when " + oldName + " was renamed to " + newName, e); } } } } } } } }