Source:
protected void handleVerifyUnverify(String entry, String versionName, String verifySource, boolean unverifyRequest, boolean isScript) { String action = "verify"; if (unverifyRequest) { action = "unverify"; } boolean toOverwrite = true; try { DockstoreTool tool = containersApi.getContainerByToolPath(entry); List<Tag> tags = tool.getTags(); Tag tagToUpdate = null; for (Tag tag : tags) { if (tag.getName().equals(versionName)) { tagToUpdate = tag; break; } } if (tagToUpdate == null) { errorMessage(versionName + " is not a valid tag for " + entry, Client.CLIENT_ERROR); } VerifyRequest verifyRequest = new VerifyRequest(); if (unverifyRequest) { verifyRequest.setVerify(false); verifyRequest.setVerifiedSource(null); } else { if (tagToUpdate.getVerified() && !isScript) { Scanner scanner = new Scanner(System.in, "utf-8"); out("The tag " + versionName + " has already been verified by \'" + tagToUpdate.getVerifiedSource() + "\'"); out("Would you like to overwrite this with \'" + verifySource + "\'? (y/n)"); String overwrite = scanner.nextLine(); if (overwrite.toLowerCase().equals("y")) { verifyRequest.setVerify(true); verifyRequest.setVerifiedSource(verifySource); } else { toOverwrite = false; } } else { verifyRequest.setVerify(true); verifyRequest.setVerifiedSource(verifySource); } } if (toOverwrite) { List<Tag> result = containerTagsApi.verifyToolTag(tool.getId(), tagToUpdate.getId(), verifyRequest); if (unverifyRequest) { out("Tag " + versionName + " has been unverified."); } else { out("Tag " + versionName + " has been verified by \'" + verifySource + "\'"); } } } catch (ApiException ex) { exceptionMessage(ex, "Unable to " + action + " tag " + versionName, Client.API_ERROR); } }

Target:
protected void handleVerifyUnverify(String entry, String versionName, String verifySource, boolean unverifyRequest, boolean isScript) { boolean toOverwrite = true; try { DockstoreTool tool = containersApi.getContainerByToolPath(entry); List<Tag> tags = tool.getTags(); Tag tagToUpdate = tags .stream() .filter((Tag u) -> u.getName().equals(versionName)) .findFirst() .get(); if (tagToUpdate == null) { errorMessage(versionName + " is not a valid tag for " + entry, Client.CLIENT_ERROR); } VerifyRequest verifyRequest = new VerifyRequest(); if (unverifyRequest) { verifyRequest.setVerify(false); verifyRequest.setVerifiedSource(null); } else { if (tagToUpdate.getVerified() && !isScript) { Scanner scanner = new Scanner(System.in, "utf-8"); out("The tag " + versionName + " has already been verified by \'" + tagToUpdate.getVerifiedSource() + "\'"); out("Would you like to overwrite this with \'" + verifySource + "\'? (y/n)"); String overwrite = scanner.nextLine(); if (overwrite.toLowerCase().equals("y")) { verifyRequest.setVerify(true); verifyRequest.setVerifiedSource(verifySource); } else { toOverwrite = false; } } else { verifyRequest.setVerify(true); verifyRequest.setVerifiedSource(verifySource); } } if (toOverwrite) { List<Tag> result = containerTagsApi.verifyToolTag(tool.getId(), tagToUpdate.getId(), verifyRequest); if (unverifyRequest) { out("Tag " + versionName + " has been unverified."); } else { out("Tag " + versionName + " has been verified by \'" + verifySource + "\'"); } } } catch (ApiException ex) { exceptionMessage(ex, "Unable to " + (unverifyRequest ? "unverify" : "verify") + " tag " + versionName, Client.API_ERROR); } }