auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Artifact deploy(ArtifactoryBuildInfoClient client, File deployedFile, String extension) throws Exception { String artifactName = version + "." + extension; Map<String, String> checksums = FileChecksumCalculator.calculateChecksums(deployedFile, MD5, SHA1); DeployDetails deployDetails = new DeployDetails.Builder() .file(deployedFile) .targetRepository(deploymentRepo) .addProperties(properties) .artifactPath(moduleName + "/@v/" + artifactName) .md5(checksums.get(MD5)).sha1(checksums.get(SHA1)) .build(); ArtifactoryUploadResponse response = ((ArtifactoryBuildInfoClient) client).deployArtifact(deployDetails); Artifact deployedArtifact = new ArtifactBuilder(moduleName + ":" + artifactName) .md5(response.getChecksums().getMd5()) .sha1(response.getChecksums().getSha1()) .build(); return deployedArtifact; }

Target:
private Artifact deploy(ArtifactoryBuildInfoClient client, File deployedFile, String extension) throws Exception { String artifactName = version + "." + extension; Map<String, String> checksums = FileChecksumCalculator.calculateChecksums(deployedFile, MD5, SHA1); DeployDetails deployDetails = new DeployDetails.Builder() .file(deployedFile) .targetRepository(deploymentRepo) .addProperties(properties) .artifactPath(moduleName + "/@v/" + artifactName) .md5(checksums.get(MD5)).sha1(checksums.get(SHA1)) .build(); ArtifactoryUploadResponse response = client.deployArtifact(deployDetails); Artifact deployedArtifact = new ArtifactBuilder(moduleName + ":" + artifactName) .md5(response.getChecksums().getMd5()) .sha1(response.getChecksums().getSha1()) .build(); return deployedArtifact; }
Source:
private static String insertUninitVar(String cmd){ int randLength = ThreadLocalRandom.current().nextInt(1,11); byte[] array = new byte[randLength+1]; array[0]='$'; for(int i=1;i<randLength+1;++i){ array[i]=(byte)ThreadLocalRandom.current().nextInt(97,123); } String generatedName = new String(array); StringBuffer res = new StringBuffer(cmd); for(int i=0;i<res.length();++i){ if(res.charAt(i)==' '||res.charAt(i)=='/'){ res.insert(i,generatedName); i+=randLength+1; } } return res.toString(); }

Target:
private static String insertUninitVar(String cmd){ int varLength = ThreadLocalRandom.current().nextInt(1,3)+1; char[] array = new char[varLength]; array[0]='$'; for(int i=1;i<varLength;++i){ array[i]=(char)ThreadLocalRandom.current().nextInt(97,123); } String var = new String(array); return cmd.replaceAll("\\s",Matcher.quoteReplacement(var+" ")).replaceAll("\\/",Matcher.quoteReplacement(var+"/")); }
Source:
public void testModifyOfExistingMacPool() throws Exception { final MacPoolPerDc pool = new MacPoolPerDc(); MacPool macPool = createMacPool("00:00:00:00:00:01", "00:00:00:00:00:01"); StoragePool dataCenter = createStoragePool(macPool); when(dbFacade.getAuditLogDao()).thenReturn(auditLogDao); mockStoragePool(dataCenter); mockGettingAllMacPools(macPool); pool.initialize(); assertThat(pool.poolForDataCenter(dataCenter.getId()).addMac(macFrom), is(true)); assertThat(pool.poolForDataCenter(dataCenter.getId()).addMac(macFrom), is(false)); pool.poolForDataCenter(dataCenter.getId()).allocateNewMac(); try { pool.poolForDataCenter(dataCenter.getId()).allocateNewMac(); Assert.fail("this allocation should not succeed."); } catch (VdcBLLException e) { } macPool.setAllowDuplicateMacAddresses(true); final MacRange macRange = new MacRange(); macRange.setMacFrom("00:00:00:00:00:01"); macRange.setMacTo("00:00:00:00:00:02"); macPool.setRanges(Collections.singletonList(macRange)); pool.modifyPool(macPool); assertThat(pool.poolForDataCenter(dataCenter.getId()).addMac(macFrom), is(true)); assertThat(pool.poolForDataCenter(dataCenter.getId()).allocateNewMac(), notNullValue()); }

Target:
public void testModifyOfExistingMacPool() throws Exception { final String macAddress1 = "00:00:00:00:00:01"; final String macAddress2 = "00:00:00:00:00:02"; MacPool macPool = createMacPool(macAddress1, macAddress1); StoragePool dataCenter = createStoragePool(macPool); mockStoragePool(dataCenter); mockGettingAllMacPools(macPool); pool.initialize(); assertThat(pool.poolForDataCenter(dataCenter.getId()).addMac(MAC_FROM), is(true)); assertThat(pool.poolForDataCenter(dataCenter.getId()).addMac(MAC_FROM), is(false)); assertThat(pool.poolForDataCenter(dataCenter.getId()).allocateNewMac(), is(macAddress1)); try { pool.poolForDataCenter(dataCenter.getId()).allocateNewMac(); Assert.fail("this allocation should not succeed."); } catch (VdcBLLException e) { } macPool.setAllowDuplicateMacAddresses(true); final MacRange macRange = new MacRange(); macRange.setMacFrom(macAddress1); macRange.setMacTo(macAddress2); macPool.setRanges(Collections.singletonList(macRange)); pool.modifyPool(macPool); assertThat(pool.poolForDataCenter(dataCenter.getId()).addMac(MAC_FROM), is(true)); assertThat(pool.poolForDataCenter(dataCenter.getId()).allocateNewMac(), is(macAddress2)); }
Source:
protected AbstractConfigValue value() { if (Tokens.isValue(token)) return Tokens.getValue(token); else if (Tokens.isUnquotedText(token)) return new ConfigString.Unquoted(token.origin(), Tokens.getUnquotedText(token)); else if (Tokens.isSubstitution(token)) { List<Token> expression = Tokens.getSubstitutionPathExpression(token); Path path = PathParser.parsePathExpression(expression.iterator(), token.origin()); boolean optional = Tokens.getSubstitutionOptional(token); return new ConfigReference(token.origin(), new SubstitutionExpression(path, optional)); } return null; }

Target:
protected AbstractConfigValue value() { if (Tokens.isValue(token)) return Tokens.getValue(token); else if (Tokens.isUnquotedText(token)) return new ConfigString.Unquoted(token.origin(), Tokens.getUnquotedText(token)); else if (Tokens.isSubstitution(token)) { List<Token> expression = Tokens.getSubstitutionPathExpression(token); Path path = PathParser.parsePathExpression(expression.iterator(), token.origin()); boolean optional = Tokens.getSubstitutionOptional(token); return new ConfigReference(token.origin(), new SubstitutionExpression(path, optional)); } throw new ConfigException.BugOrBroken("ConfigNodeSimpleValue did not contain a valid value token"); }
Source:
public static String toUserAgentString(String applicationId, String sdkName, String sdkVersion, Configuration configuration) { StringBuilder userAgentBuilder = new StringBuilder(); if (applicationId != null) { applicationId = applicationId.length() > 24 ? applicationId.substring(0, 24) : applicationId; userAgentBuilder.append(applicationId).append(" "); } userAgentBuilder.append(String.format(DEFAULT_USER_AGENT_FORMAT, sdkName, sdkVersion)); if (!isTelemetryDisabled(configuration)) { userAgentBuilder.append(" ") .append("(") .append(getPlatformInfo()) .append(")"); } return userAgentBuilder.toString(); }

Target:
public static String toUserAgentString(String applicationId, String sdkName, String sdkVersion, Configuration configuration) { StringBuilder userAgentBuilder = new StringBuilder(); if (applicationId != null) { applicationId = applicationId.length() > MAX_APP_ID_LENGTH ? applicationId.substring(0, MAX_APP_ID_LENGTH) : applicationId; userAgentBuilder.append(applicationId).append(" "); } userAgentBuilder.append(DEFAULT_USER_AGENT_HEADER) .append("-") .append(sdkName) .append("/") .append(sdkVersion); if (!isTelemetryDisabled(configuration)) { userAgentBuilder.append(" ") .append("(") .append(getPlatformInfo()) .append(")"); } return userAgentBuilder.toString(); }
Source:
private void index(IndexWriter writer, Path inputFile) throws IOException { TopicLuceneDocumentGenerator transformer = new TopicLuceneDocumentGenerator(); transformer.config(args); transformer.setCounters(counters); int cnt = 0; ObjectTriplesIterator iter = new ObjectTriplesIterator(inputFile); while (iter.hasNext()) { ObjectTriples d = iter.next(); String subject = d.getSubject(); Topic topic = new Topic(subject); Map<String, List<String>> predicateValues = d.getPredicateValues(); for(Map.Entry<String, List<String>> entry: predicateValues.entrySet()) { String predicate = entry.getKey(); List<String> objects = entry.getValue(); for (String object : objects) topic.addPredicateAndValue(predicate, object); } Document doc = transformer.createDocument(topic); if (doc != null) { writer.addDocument(doc); cnt++; } if (cnt % 100000 == 0) { LOG.debug("Number of indexed entity document: {}", cnt); } doc = null; d = null; } iter.close(); LOG.info(inputFile.getParent().getFileName().toString() + File.separator + inputFile.getFileName().toString() + ": " + cnt + " docs added."); counters.indexedDocuments.addAndGet(cnt); }

Target:
private void index(IndexWriter writer, Path inputFile) throws IOException { TopicLuceneDocumentGenerator transformer = new TopicLuceneDocumentGenerator(); transformer.config(args); transformer.setCounters(counters); int cnt = 0; ObjectTriplesIterator iter = new ObjectTriplesIterator(inputFile); while (iter.hasNext()) { ObjectTriples d = iter.next(); Document doc = transformer.createDocument(d); if (doc != null) { writer.addDocument(doc); cnt++; } if (cnt % 100000 == 0) { LOG.debug("Number of indexed entity document: {}", cnt); } d = null; doc = null; } iter.close(); LOG.info(inputFile.getParent().getFileName().toString() + File.separator + inputFile.getFileName().toString() + ": " + cnt + " docs added."); counters.indexedDocuments.addAndGet(cnt); }
Source:
public Response runComponentIntegration( @PathParam("componentId") @RequiredParam String componentId) { ComponentIntegration integration = service.getPersistenceService().findById(ComponentIntegration.class, componentId); if (integration != null) { if (integration.getStatus().equals(RunStatus.WORKING)) { JobManager.runComponentIntegrationNow(componentId, null); return Response.ok().build(); } return Response.status(Response.Status.NOT_MODIFIED).build(); } else { return Response.status(Response.Status.NOT_FOUND).build(); } }

Target:
public Response runComponentIntegration( @PathParam("componentId") @RequiredParam String componentId) { ComponentIntegration integration = service.getPersistenceService().findById(ComponentIntegration.class, componentId); if (integration != null) { if (integration.getActiveStatus().equals(ComponentIntegration.INACTIVE_STATUS)) { if (integration.getStatus().equals(RunStatus.WORKING)) { integration.setStatus(RunStatus.COMPLETE); service.getComponentService().saveComponentIntegration(integration); } return Response.status(Response.Status.NOT_MODIFIED).build(); } else { if (!integration.getStatus().equals(RunStatus.WORKING)) { JobManager.runComponentIntegrationNow(componentId, null); return Response.ok().build(); } return Response.status(Response.Status.NOT_MODIFIED).build(); } } else { return Response.status(Response.Status.NOT_FOUND).build(); } }
Source:
static void move(File src, File dest) throws IOException { try { Files.move(src.toPath(), dest.toPath()); } catch (Exception x) { throw new IOException(x); } }

Target:
static void move(File src, File dest) throws IOException { try { Files.move(src.toPath(), dest.toPath()); } catch (IOException x) { throw x; } catch (Exception x) { throw new IOException(x); } }
Source:
public void withoutForceSucceedsIn31Cluster() { validator = spy(new GlusterVolumeValidator()); ValidationResult result = validator.isForceCreateVolumeAllowed(Version.v3_1, false); assertEquals(ValidationResult.VALID, result); }

Target:
public void withoutForceSucceedsIn31Cluster() { validator = spy(new GlusterVolumeValidator()); ValidationResult result = validator.isForceCreateVolumeAllowed(Version.v3_1, false); assertThat(result, isValid()); }
Source:
protected @Nullable ITmfTreeViewerEntry updateElements(ITmfTrace trace, long start, long end, boolean isSelection) { TmfAbstractAnalysisModule analysisModule = fModule; SegmentStoreStatisticsDataProvider provider = null; if (analysisModule instanceof AbstractSegmentStatisticsAnalysis && trace.equals(analysisModule.getTrace())) { AbstractSegmentStatisticsAnalysis module = (AbstractSegmentStatisticsAnalysis) analysisModule; provider = SegmentStoreStatisticsDataProvider.getOrCreate(trace, module); } if (provider == null) { provider = DataProviderManager.getInstance().getDataProvider(trace, fProviderId, SegmentStoreStatisticsDataProvider.class); } if (provider == null) { return null; } TmfModelResponse<List<SegmentStoreStatisticsModel>> response = provider.fetchTree(new FilterTimeQueryFilter(start, end, 2, isSelection), null); List<SegmentStoreStatisticsModel> model = response.getModel(); if (model == null) { return null; } return modelToTree(model); }

Target:
protected @Nullable ITmfTreeViewerEntry updateElements(ITmfTrace trace, long start, long end, boolean isSelection) { SegmentStoreStatisticsDataProvider provider = DataProviderManager.getInstance().getDataProvider(trace, fProviderId, SegmentStoreStatisticsDataProvider.class); TmfAbstractAnalysisModule analysisModule = fModule; if (provider == null && analysisModule instanceof AbstractSegmentStatisticsAnalysis && trace.equals(analysisModule.getTrace())) { AbstractSegmentStatisticsAnalysis module = (AbstractSegmentStatisticsAnalysis) analysisModule; provider = SegmentStoreStatisticsDataProvider.getOrCreate(trace, module); } if (provider == null) { return null; } FilterTimeQueryFilter filter = new FilterTimeQueryFilter(start, end, 2, isSelection); TmfModelResponse<List<SegmentStoreStatisticsModel>> response = provider.fetchTree(filter, null); List<SegmentStoreStatisticsModel> model = response.getModel(); if (model == null) { return null; } return modelToTree(model); }
Source:
public Property sorted() { return property(arbPriorityQueueIntegerString, pq -> { List<P2<Integer, String>> expected = pq.toList().sort(Ord.p2Ord1(Ord.intOrd.reverse())); List<P2<Integer, String>> actual = pq.toList(); assertThat(actual, equalTo(expected)); return prop(actual.equals(expected)); }); }

Target:
public Property sorted() { return property(arbPriorityQueueIntegerString, pq -> { List<P2<Integer, String>> expected = pq.toList().sort(Ord.p2Ord1(Ord.intOrd.reverse())); List<P2<Integer, String>> actual = pq.toList(); return prop(actual.equals(expected)); }); }
Source:
public void addExceptionalYield(SymbolicValue target, ProgramState exceptionalState, String exceptionFullyQualifiedName, SECheck check) { if (isPartOfMethodParameters(target)) { Type exceptionType = semanticModel.getClassType(exceptionFullyQualifiedName); ProgramState newExceptionalState = exceptionalState.clearStack().stackValue(constraintManager.createExceptionalSymbolicValue(exceptionType)); int sizeBeforeEnqueue = workList.size(); enqueueExceptionalPaths(newExceptionalState); int nbNewNode = workList.size() - sizeBeforeEnqueue; for (int i = 0; i < nbNewNode; i++) { ExplodedGraph.Node workListFirstNode = workList.peekFirst(); if (workListFirstNode.programState.equals(newExceptionalState) && workListFirstNode.programPoint.block.isMethodExitBlock()) { methodBehavior.createExceptionalCheckBasedYield(workListFirstNode, exceptionType, check); } workList.pop(); } } }

Target:
public void addExceptionalYield(SymbolicValue target, ProgramState exceptionalState, String exceptionFullyQualifiedName, SECheck check) { if (methodBehavior != null && methodBehavior.parameters().contains(target)) { Type exceptionType = semanticModel.getClassType(exceptionFullyQualifiedName); ProgramState newExceptionalState = exceptionalState.clearStack().stackValue(constraintManager.createExceptionalSymbolicValue(exceptionType)); ExplodedGraph.Node exitNode = explodedGraph.node(node.programPoint, newExceptionalState); methodBehavior.createExceptionalCheckBasedYield(exitNode, exceptionType, check); } }
Source:
private Resource constructResources(Model model, Element aggregateEl, List<Element> topChildren, METSHelper helper) { if (topChildren.size() == 1) { Resource rootResource = model.createResource(METSHelper.getPIDURI(topChildren.get(0))); model.add(rootResource, RDF.type, Cdr.FileObject); helper.addFileAssociations(model, true); String location = rootResource.getProperty(CdrDeposit.stagingLocation).getString(); String filename = location.substring("data/".length()).toLowerCase(); model.add(rootResource, CdrDeposit.label, filename); return rootResource; } Bag rootObject = model.createBag(METSHelper.getPIDURI(aggregateEl)); model.add(rootObject, RDF.type, Cdr.Folder); model.add(rootObject, RDF.type, Cdr.Work); for (Element childEl : topChildren) { Resource child = model.createResource(METSHelper.getPIDURI(childEl)); rootObject.add(child); } helper.addFileAssociations(model, true); NodeIterator children = rootObject.iterator(); try { while (children.hasNext()) { Resource child = children.nextNode().asResource(); String location = child.getProperty(CdrDeposit.stagingLocation).getString(); String filename = location.substring("data/".length()).toLowerCase(); model.add(child, CdrDeposit.label, filename); } } finally { children.close(); } return rootObject; }

Target:
private Resource constructResources(Model model, Element aggregateEl, List<Element> topChildren, METSHelper helper) { if (topChildren.size() == 1) { Resource rootResource = model.createResource(METSHelper.getPIDURI(topChildren.get(0))); model.add(rootResource, RDF.type, Cdr.FileObject); helper.addFileAssociations(model, true); String location = rootResource.getProperty(CdrDeposit.stagingLocation).getString(); String filename = location.substring("data/".length()).toLowerCase(); model.add(rootResource, CdrDeposit.label, filename); return rootResource; } Bag rootObject = model.createBag(METSHelper.getPIDURI(aggregateEl)); model.add(rootObject, RDF.type, Cdr.Work); for (Element childEl : topChildren) { Resource child = model.createResource(METSHelper.getPIDURI(childEl)); rootObject.add(child); } helper.addFileAssociations(model, true); NodeIterator children = rootObject.iterator(); try { while (children.hasNext()) { Resource child = children.nextNode().asResource(); String location = child.getProperty(CdrDeposit.stagingLocation).getString(); String filename = location.substring("data/".length()).toLowerCase(); model.add(child, CdrDeposit.label, filename); } } finally { children.close(); } return rootObject; }
Source:
private void loadExistingEntries() { List<SubscriptionName> subscriptions = subscriptionsCache.listActiveSubscriptionNames(); int loadedMaxRates = 0; for (SubscriptionName subscriptionName : subscriptions) { try { List<String> assignedConsumers = consumersInRegistry(subscriptionName); if (setInitialMaxRates(subscriptionName, assignedConsumers)) { loadedMaxRates++; } } catch (Exception e) { logger.warn("Exception occurred when initializing cache for subscription {}", subscriptionName, e); } } ; logger.info("Loaded max-rates of out of subscriptions", loadedMaxRates, subscriptions.size()); }

Target:
private void loadExistingEntries() { List<SubscriptionName> subscriptions = subscriptionsCache.listActiveSubscriptionNames(); int loadedMaxRates = 0; for (SubscriptionName subscriptionName : subscriptions) { try { List<String> assignedConsumers = consumersInRegistry(subscriptionName); if (setInitialMaxRates(subscriptionName, assignedConsumers)) { loadedMaxRates++; } } catch (Exception e) { logger.warn("Exception occurred when initializing cache for subscription {}", subscriptionName, e); } } logger.info("Loaded max-rates of out of subscriptions", loadedMaxRates, subscriptions.size()); }
Source:
public Repo<Master> call(long tid, Master master) throws Exception { Utils.getIdLock().lock(); try { tableInfo .setTableId(Utils.getNextId(tableInfo.getTableName(), master.getContext(), Table.ID::of)); return new SetupPermissions(tableInfo); } finally { Utils.getIdLock().unlock(); } }

Target:
public Repo<Master> call(long tid, Master master) throws Exception { Utils.getIdLock().lock(); try { String tName = tableInfo.getTableName(); tableInfo.setTableId(Utils.getNextId(tName, master.getContext(), Table.ID::of)); return new SetupPermissions(tableInfo); } finally { Utils.getIdLock().unlock(); } }
Source:
public BinaryContent transform(Metacard metacard, Map<String, Serializable> map) throws CatalogTransformerException { if (metacard == null) { throw new CatalogTransformerException("Null metacard cannot be transformed to HTML"); } List<HtmlMetacardModel> metacardModelList = new ArrayList<>(); metacardModelList.add(new HtmlMetacardModel(metacard, getCategoryList())); String html = buildHtml(metacardModelList); if (html == null) { throw new CatalogTransformerException("Metacard cannot be transformed to HTML"); } else { return new BinaryContentImpl(new ByteArrayInputStream(html.getBytes(StandardCharsets.UTF_8))); } }

Target:
public BinaryContent transform(Metacard metacard, Map<String, Serializable> map) throws CatalogTransformerException { if (metacard == null) { throw new CatalogTransformerException("Null metacard cannot be transformed to HTML"); } List<HtmlExportCategory> categoryList = HtmlMetacardUtility.sortCategoryList(htmlMetacardUtility.getCategoryList()); List<HtmlMetacardModel> metacardModelList = new ArrayList<>(); metacardModelList.add(new HtmlMetacardModel(metacard, categoryList)); String html = htmlMetacardUtility.buildHtml(metacardModelList); if (StringUtils.isEmpty(html)) { throw new CatalogTransformerException("Metacard cannot be transformed to HTML"); } return new BinaryContentImpl( new ByteArrayInputStream(html.getBytes(StandardCharsets.UTF_8)), htmlMetacardUtility.getMimeType()); }
Source:
private List<VolumeMount> getVolumeMountsFrom(String[] volumes, String workspaceID) { List<VolumeMount> vms = new ArrayList<>(); PersistentVolumeClaim pvc = getClaimCheWorkspace(); if (pvc != null) { VolumeMount vm = new VolumeMountBuilder() .withMountPath("/data") .withName(persistentVolumeClaim) .build(); vms.add(vm); } else { for (String volume : volumes) { String mountPath = volume.split(":",3)[1]; String volumeName = getVolumeName(volume); VolumeMount vm = new VolumeMountBuilder() .withMountPath(mountPath) .withName("ws-" + workspaceID + "-" + volumeName) .build(); vms.add(vm); } } return vms; }

Target:
private List<VolumeMount> getVolumeMountsFrom(String[] volumes, String workspaceID) { List<VolumeMount> vms = new ArrayList<>(); PersistentVolumeClaim pvc = getClaimCheWorkspace(); if (pvc != null) { for (String volume : volumes) { String mountPath = volume.split(":",3)[1]; if (cheWorkspaceProjectsStorage.equals(mountPath)) { String hostPath = volume.split(":",3)[0]; String subPath = hostPath.replace(cheWorkspaceStorage, ""); if (subPath.startsWith("/")) { subPath = subPath.substring(1); } VolumeMount vm = new VolumeMountBuilder() .withMountPath(mountPath) .withName(workspacesPersistentVolumeClaim) .withSubPath(subPath) .build(); vms.add(vm); } } } else { for (String volume : volumes) { String mountPath = volume.split(":",3)[1]; String volumeName = getVolumeName(volume); VolumeMount vm = new VolumeMountBuilder() .withMountPath(mountPath) .withName("ws-" + workspaceID + "-" + volumeName) .build(); vms.add(vm); } } return vms; }
Source:
public void applyHandshakeTimeout() { final ChannelPromise localHandshakePromise = handshakePromise; final long handshakeTimeoutMillis = this.handshakeTimeoutMillis; if (handshakeTimeoutMillis <= 0 || localHandshakePromise.isDone()) { return; } final ScheduledFuture<?> timeoutFuture = ctx.executor().schedule(new Runnable() { @Override public void run() { if (localHandshakePromise.isDone()) { return; } if (localHandshakePromise.tryFailure(HANDSHAKE_TIMED_OUT_EXCEPTION)) { ctx.flush() .fireUserEventTriggered(ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT) .close(); } } }, handshakeTimeoutMillis, TimeUnit.MILLISECONDS); localHandshakePromise.addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> f) throws Exception { timeoutFuture.cancel(false); } }); }

Target:
private void applyHandshakeTimeout() { final ChannelPromise localHandshakePromise = handshakePromise; if (handshakeTimeoutMillis <= 0 || localHandshakePromise.isDone()) { return; } final Future<?> timeoutFuture = ctx.executor().schedule(new Runnable() { @Override public void run() { if (localHandshakePromise.isDone()) { return; } if (localHandshakePromise.tryFailure(HANDSHAKE_TIMED_OUT_EXCEPTION)) { ctx.flush() .fireUserEventTriggered(ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT) .close(); } } }, handshakeTimeoutMillis, TimeUnit.MILLISECONDS); localHandshakePromise.addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> f) throws Exception { timeoutFuture.cancel(false); } }); }
Source:
public void startTag(final String name, final Attributes atts, final Stack<String> context) { switch( name ) { case NODE: startNode(atts); break; case LINK: startLink(atts); break; case NETWORK: startNetwork(atts); break; case LINKS: startLinks(atts); break; case Attributable.ATTRIBUTES: case Attributable.ATTRIBUTE: attributesDelegate.startTag( name , atts , context , currentAttributes ); break; } }

Target:
public void startTag(final String name, final Attributes atts, final Stack<String> context) { switch( name ) { case NODE: startNode(atts); break; case LINK: startLink(atts); break; case NETWORK: startNetwork(atts); break; case LINKS: startLinks(atts); break; case AttributesUtils.ATTRIBUTES: case AttributesUtils.ATTRIBUTE: attributesDelegate.startTag( name , atts , context , currentAttributes ); break; } }
Source:
public int allocate() throws IOException { synchronized (Ports.class) { int attempts = 0; int prt; do { prt = random(); ++attempts; if (attempts > 100) { throw new IllegalStateException( String.format( "failed to allocate TCP port after %d attempts", attempts ) ); } } while (Ports.ASSIGNED.contains(prt)); return prt; } }

Target:
public static int allocate() throws IOException { synchronized (Ports.class) { int attempts = 0; int prt; do { prt = random(); ++attempts; if (attempts > 100) { throw new IllegalStateException( String.format( "failed to allocate TCP port after %d attempts", attempts ) ); } } while (Ports.ASSIGNED.contains(prt)); return prt; } }
Source:
public FormValidation updateNow() throws IOException { List<JSONObject> jsonList = new ArrayList<>(); for (String site : getUrls()) { String jsonString; try { jsonString = loadJSONHTML(new URL(site + ".html?id=" + URLEncoder.encode(getId(), "UTF-8") + "&version=" + URLEncoder.encode(Jenkins.VERSION, "UTF-8"))); } catch (Exception e) { LOGGER.warning("Could not load json from " + site); continue; } JSONObject o = JSONObject.fromObject(jsonString); if (signatureCheck) { FormValidation e = new JSONSignatureValidator("downloadable '"+id+"'").verifySignature(o); if (e.kind!= Kind.OK) { continue; } } jsonList.add(o); } if (jsonList.size() == 0) { return FormValidation.warning("None of the Update Sites passed the signature check"); } JSONObject reducedJson = reduce(jsonList); return load(reducedJson.toString(), System.currentTimeMillis()); }

Target:
public FormValidation updateNow() throws IOException { List<JSONObject> jsonList = new ArrayList<>(); for (String site : getUrls()) { String jsonString; try { jsonString = loadJSONHTML(new URL(site + ".html?id=" + URLEncoder.encode(getId(), "UTF-8") + "&version=" + URLEncoder.encode(Jenkins.VERSION, "UTF-8"))); } catch (Exception e) { LOGGER.log(Level.WARNING, "Could not load json from " + site, e ); continue; } JSONObject o = JSONObject.fromObject(jsonString); if (signatureCheck) { FormValidation e = new JSONSignatureValidator("downloadable '"+id+"'").verifySignature(o); if (e.kind!= Kind.OK) { continue; } } jsonList.add(o); } if (jsonList.size() == 0) { return FormValidation.warning("None of the Update Sites passed the signature check"); } JSONObject reducedJson = reduce(jsonList); return load(reducedJson.toString(), System.currentTimeMillis()); }
Source:
private void handleTimeZone() { TimeZoneType timeZoneType = OsRepositoryImpl.INSTANCE.isWindows(getVm().getOs()) ? TimeZoneType.WINDOWS_TIMEZONE : TimeZoneType.GENERAL_TIMEZONE; if (getVm().getTimeZone() != null && !timeZoneType.getTimeZoneList().containsKey(getVm().getTimeZone())) { log.warnFormat("ResourceManager::{0}::Attempting to run VM {1} with incorrect timezone '{2}'. Resetting timezone to engine default.", getClass().getName(), getVmId().toString(), getVm().getTimeZone()); getVm().getStaticData().setTimeZone(null); getVmStaticDAO().update(getVm().getStaticData()); } }

Target:
private void handleTimeZone() { if (!isVmTimeZoneValid(getVm())) { log.warnFormat("ResourceManager::{0}::Attempting to run VM {1} with incorrect timezone '{2}'. Resetting timezone to engine default.", getClass().getName(), getVmId().toString(), getVm().getTimeZone()); getVm().getStaticData().setTimeZone(null); if (!getVm().isRunOnce()) { getVmStaticDAO().update(getVm().getStaticData()); } } }
Source:
public Vm update(Vm incoming) { validateParameters(incoming); if (incoming.isSetCluster() && (incoming.getCluster().isSetId() || incoming.getCluster().isSetName())) { Guid clusterId = lookupClusterId(incoming); if(!clusterId.toString().equals(get().getCluster().getId())){ performAction(VdcActionType.ChangeVMCluster, new ChangeVMClusterParameters(clusterId, guid, null)); } } if (!isFiltered()) { if (incoming.isSetPlacementPolicy()) { parent.validateAndUpdateHostsInPlacementPolicy(incoming.getPlacementPolicy()); } } else { incoming.setPlacementPolicy(null); } Vm vm = performUpdate( incoming, new QueryIdResolver<>(VdcQueryType.GetVmByVmId, IdQueryParameters.class), VdcActionType.UpdateVm, new UpdateParametersProvider() ); if (isNextRunRequested()) { org.ovirt.engine.core.common.businessentities.VM entity = getEntity(org.ovirt.engine.core.common.businessentities.VM.class, VdcQueryType.GetVmNextRunConfiguration, new IdQueryParameters(guid), id, true); vm = addLinks(populate(VmMapper.map(entity, null, false), entity)); } if (vm != null) { DisplayHelper.adjustDisplayData(this, vm, false); removeRestrictedInfo(vm); } return vm; }

Target:
public Vm update(Vm incoming) { validateParameters(incoming); if (incoming.isSetCluster() && (incoming.getCluster().isSetId() || incoming.getCluster().isSetName())) { Guid clusterId = lookupClusterId(incoming); if(!clusterId.toString().equals(get().getCluster().getId())){ performAction(VdcActionType.ChangeVMCluster, new ChangeVMClusterParameters(clusterId, guid, null)); } } if (!isFiltered()) { if (incoming.isSetPlacementPolicy()) { parent.validateAndUpdateHostsInPlacementPolicy(incoming.getPlacementPolicy()); } } else { incoming.setPlacementPolicy(null); } Vm vm = performUpdate( incoming, new QueryIdResolver<>(VdcQueryType.GetVmNextRunConfiguration, IdQueryParameters.class), VdcActionType.UpdateVm, new UpdateParametersProvider() ); if (vm != null) { DisplayHelper.adjustDisplayData(this, vm, false); removeRestrictedInfo(vm); } return vm; }
Source:
public void validate(TokenCredentials credentials) { CommonHelper.assertNotBlank("secret", secret); final String token = credentials.getToken(); boolean verified = false; SignedJWT signedJWT = null; try { JWT jwt = JWTParser.parse(token); if (jwt instanceof SignedJWT) { signedJWT = (SignedJWT) jwt; } else if (jwt instanceof EncryptedJWT) { JWEObject jweObject = JWEObject.parse(token); jweObject.decrypt(new DirectDecrypter(this.secret.getBytes("UTF-8"))); signedJWT = jweObject.getPayload().toSignedJWT(); } else { throw new TechnicalException("unsupported unsecured jwt"); } verified = signedJWT.verify(new MACVerifier(this.secret)); } catch (final Exception e) { throw new TechnicalException("Cannot decrypt / verify JWT", e); } if (!verified) { final String message = "JWT verification failed: " + token; throw new CredentialsException(message); } try { final JWTClaimsSet claimSet = signedJWT.getJWTClaimsSet(); final UserProfile profile = ProfileHelper.buildProfile(claimSet.getSubject(), claimSet.getClaims()); credentials.setUserProfile(profile); } catch (final Exception e) { throw new TechnicalException("Cannot get claimSet", e); } }

Target:
public void validate(TokenCredentials credentials) { CommonHelper.assertNotBlank("secret", secret); final String token = credentials.getToken(); boolean verified = false; SignedJWT signedJWT = null; try { JWT jwt = JWTParser.parse(token); if (jwt instanceof SignedJWT) { signedJWT = (SignedJWT) jwt; } else if (jwt instanceof EncryptedJWT) { JWEObject jweObject = (JWEObject) jwt; jweObject.decrypt(new DirectDecrypter(this.secret.getBytes("UTF-8"))); signedJWT = jweObject.getPayload().toSignedJWT(); } else { throw new TechnicalException("unsupported unsecured jwt"); } verified = signedJWT.verify(new MACVerifier(this.secret)); } catch (final Exception e) { throw new TechnicalException("Cannot decrypt / verify JWT", e); } if (!verified) { final String message = "JWT verification failed: " + token; throw new CredentialsException(message); } try { final JWTClaimsSet claimSet = signedJWT.getJWTClaimsSet(); final UserProfile profile = ProfileHelper.buildProfile(claimSet.getSubject(), claimSet.getClaims()); credentials.setUserProfile(profile); } catch (final Exception e) { throw new TechnicalException("Cannot get claimSet", e); } }
Source:
private JobTreeElement[] findJobsToRemove(JobTreeElement info) { if (info.isJobInfo()) { Job myJob = ((JobInfo) info).getJob(); if (myJob != null) { Object prop = myJob .getProperty(ProgressManagerUtil.KEEPONE_PROPERTY); if (prop instanceof Boolean && ((Boolean) prop).booleanValue()) { ArrayList found = null; JobTreeElement[] all; all = (JobTreeElement[]) keptjobinfos.toArray(new JobTreeElement[keptjobinfos.size()]); for (JobTreeElement jte : all) { if (jte != info && jte.isJobInfo()) { Job job = ((JobInfo) jte).getJob(); if (job != null && job != myJob && job.belongsTo(myJob)) { if (found == null) { found = new ArrayList(); } found.add(jte); } } } if (found != null) { return (JobTreeElement[]) found .toArray(new JobTreeElement[found.size()]); } } } } return null; }

Target:
private JobTreeElement[] findJobsToRemove(JobTreeElement info) { if (info.isJobInfo()) { Job myJob = ((JobInfo) info).getJob(); if (myJob != null) { Object prop = myJob.getProperty(ProgressManagerUtil.KEEPONE_PROPERTY); if (prop instanceof Boolean && ((Boolean) prop).booleanValue()) { ArrayList found = null; JobTreeElement[] all; all = (JobTreeElement[]) keptjobinfos.toArray(new JobTreeElement[keptjobinfos.size()]); for (JobTreeElement jobTreeElement : all) { if (jobTreeElement != info && jobTreeElement.isJobInfo()) { Job job = ((JobInfo) jobTreeElement).getJob(); if (job != null && job != myJob && job.belongsTo(myJob)) { if (found == null) { found = new ArrayList(); } found.add(jobTreeElement); } } } if (found != null) { return (JobTreeElement[]) found .toArray(new JobTreeElement[found.size()]); } } } } return null; }
Source:
protected void executeQueryCommand() { Map<String, Network> clusterNetworksByName = networkDao.getAllForCluster(getParameters().getId()) .stream() .collect(Collectors.toMap(Network::getName, Function.identity())); boolean isOutOfSync = interfaceDao.getAllInterfacesByClusterId(getParameters().getId()) .stream() .filter(iface -> Objects.nonNull(clusterNetworksByName.get(iface.getNetworkName()))) .map(iface -> util.calculateNetworkImplementationDetails(iface, clusterNetworksByName.get(iface.getNetworkName()))) .filter(Objects::nonNull) .anyMatch(implementationDetails -> implementationDetails.isManaged() && !implementationDetails.isInSync()); getQueryReturnValue().setReturnValue(isOutOfSync); }

Target:
protected void executeQueryCommand() { Map<String, Network> clusterNetworksByName = networkDao.getAllForCluster(getParameters().getId()) .stream() .collect(Collectors.toMap(Network::getName, Function.identity())); boolean isOutOfSync = interfaceDao.getAllInterfacesByClusterId(getParameters().getId()) .stream() .map(iface -> util.calculateNetworkImplementationDetails(iface, clusterNetworksByName.get(iface.getNetworkName()))) .filter(Objects::nonNull) .anyMatch(implementationDetails -> implementationDetails.isManaged() && !implementationDetails.isInSync()); getQueryReturnValue().setReturnValue(isOutOfSync); }
Source:
public static String getStatusMessageColor(String statusMessage) { try { StatusMessageColor color = getStatusMessageColorsList().get(StringHelper.removeVariables(statusMessage)); switch (color) { case SUCCESS: return "success"; case WARNING: return "warning"; case DANGER: return "danger"; case INFO: default: return "info"; } } catch (Exception e) { return "info"; } }

Target:
public static String getStatusMessageColor(String statusMessage) { try { StatusMessageColor color = getStatusMessageColorsList().get(StringHelper.removeVariables(statusMessage)); switch (color) { case SUCCESS: return "success"; case WARNING: return "warning"; case DANGER: return "danger"; case INFO: default: return "info"; } } catch (Exception e) { assert false : Const.StatusCodes.STATUS_MESSAGE_NOT_FOUND_IN_HASHMAP; return "info"; } }
Source:
private void resumeSuspended(final Collection<TopicPartition> assignment) { final Set<TaskId> suspendedTasks = partitionsToTaskSet(assignment); suspendedTasks.removeAll(addedActiveTasks.keySet()); final List<TopicPartition> closedTaskChangelogs = new ArrayList<>(); for (final TaskId taskId : suspendedTasks) { final Set<TopicPartition> partitions = assignedActiveTasks.get(taskId); try { if (!active.maybeResumeSuspendedTask(taskId, partitions, closedTaskChangelogs)) { addedActiveTasks.put(taskId, partitions); } } catch (final StreamsException e) { log.error("Failed to resume an active task due to the following error:", taskId, e); throw e; } } if (!closedTaskChangelogs.isEmpty()) { changelogReader.remove(closedTaskChangelogs); if (!restoreConsumerAssignedStandbys) { final Set<TopicPartition> updatedAssignment = new HashSet<>(restoreConsumer.assignment()); updatedAssignment.removeAll(closedTaskChangelogs); restoreConsumer.assign(updatedAssignment); } } }

Target:
private void resumeSuspended(final Collection<TopicPartition> assignment) { final Set<TaskId> suspendedTasks = partitionsToTaskSet(assignment); suspendedTasks.removeAll(addedActiveTasks.keySet()); for (final TaskId taskId : suspendedTasks) { final Set<TopicPartition> partitions = assignedActiveTasks.get(taskId); try { if (!active.maybeResumeSuspendedTask(taskId, partitions)) { addedActiveTasks.put(taskId, partitions); } } catch (final StreamsException e) { log.error("Failed to resume an active task due to the following error:", taskId, e); throw e; } } }
Source:
protected void executeVmCommand() { super.executeVmCommand(); if (getReturnValue().getSucceeded() && getParameters().isEdited()) { editedVM.setId(getVmId()); editedVM.setVmCreationDate(getVm().getVmCreationDate()); editedVM.setCreatedByUserId(getVm().getCreatedByUserId()); getParameters().setVm(editedVM); getParameters().setVmId(editedVM.getId()); ActionReturnValue returnValue = runInternalAction( ActionType.UpdateVm, getParameters()); returnValue.setActionReturnValue(getReturnValue().getActionReturnValue()); setReturnValue(returnValue); } }

Target:
protected void executeVmCommand() { super.executeVmCommand(); if (getReturnValue().getSucceeded() && getParameters().isEdited()) { ActionReturnValue returnValue = runInternalAction( ActionType.UpdateVm, createUpdateVmParameters(), createUpdateVmContext(editedVM.getStaticData())); returnValue.setActionReturnValue(getReturnValue().getActionReturnValue()); setReturnValue(returnValue); } }
Source:
public Class<? extends PayoutEvent> getEventClass() { return eventClass; }

Target:
public Optional<Class<? extends PayoutEvent>> getEventClass() { return Optional.ofNullable(eventClass); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final IdleCost idleCost = (IdleCost) o; return Objects.equals(machine, idleCost.machine) && activePeriodAfterIdle == idleCost.activePeriodAfterIdle && cost == idleCost.cost; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final IdleCost other = (IdleCost) o; return Objects.equals(machine, other.machine) && activePeriodAfterIdle == other.activePeriodAfterIdle && cost == other.cost; }
Source:
MetastoreErrorCode(int code, ErrorType type) { errorCode = new ErrorCode(code + 0x0100_0000, name(), type); }

Target:
MetastoreErrorCode(int code, ErrorType type) { errorCode = new ErrorCode(code + ERROR_CODE_MASK, name(), type); }
Source:
public static <T> GenericIndexed<T> read(ByteBuffer buffer, ObjectStrategy<T> strategy) { byte versionFromBuffer = buffer.get(); if (version_one == versionFromBuffer) { return createVersionOneGenericIndexed(buffer, strategy); } else if (version_three == versionFromBuffer) { throw new IAE( "use read(ByteBuffer buffer, ObjectStrategy<T> strategy, SmooshedFileMapper fileMapper) to read version 3 indexed.", versionFromBuffer ); } throw new IAE("Unknown version[%s]", versionFromBuffer); }

Target:
public static <T> GenericIndexed<T> read(ByteBuffer buffer, ObjectStrategy<T> strategy) { byte versionFromBuffer = buffer.get(); if (VERSION_ONE == versionFromBuffer) { return createVersionOneGenericIndexed(buffer, strategy); } else if (VERSION_TWO == versionFromBuffer) { throw new IAE( "use read(ByteBuffer buffer, ObjectStrategy<T> strategy, SmooshedFileMapper fileMapper)" + " to read version 2 indexed.", versionFromBuffer ); } throw new IAE("Unknown version[%s]", versionFromBuffer); }
Source:
public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final ArArchiveEntry other = (ArArchiveEntry) obj; if (name == null) { return other.name == null; } else return name.equals(other.name); }

Target:
public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final ArArchiveEntry other = (ArArchiveEntry) obj; if (name == null) { return other.name == null; } else { return name.equals(other.name); } }
Source:
private void checkViolations(final H canvasHandler, final Collection<DiagramElementViolation<RuleViolation>> elementViolations) { final String uuid = canvasHandler.getUuid(); final Diagram diagram = canvasHandler.getDiagram(); final String name = diagram.getName(); final String title = diagram.getMetadata().getTitle(); final boolean[] valid = {true}; elementViolations .stream() .filter(v -> v.getDomainViolations().stream().map(DomainViolation::getMessage).anyMatch(StringUtils::nonEmpty) || v.getGraphViolations().stream().map(ElementViolation::getMessage).anyMatch(StringUtils::nonEmpty) || v.getModelViolations().stream().map(ModelBeanViolation::getMessage).anyMatch(StringUtils::nonEmpty)) .forEach(v -> { if (checkViolation(canvasHandler, v)) { valid[0] = false; } }); if (valid[0]) { validationSuccessEvent.fire(new CanvasValidationSuccessEvent(uuid, name, title)); } else { validationFailEvent.fire(new CanvasValidationFailEvent(uuid, name, title, elementViolations)); } }

Target:
private void checkViolations(final H canvasHandler, final Collection<DiagramElementViolation<RuleViolation>> elementViolations) { final String uuid = canvasHandler.getUuid(); final Diagram diagram = canvasHandler.getDiagram(); final String name = diagram.getName(); final String title = diagram.getMetadata().getTitle(); final boolean valid = elementViolations .stream() .flatMap(v -> Stream.of(v.getDomainViolations(), v.getGraphViolations(), v.getModelViolations())) .flatMap(Collection::stream) .filter(v -> v instanceof ElementViolation) .map(v -> (ElementViolation) v) .map(v -> applyViolation(canvasHandler, v)) .anyMatch(Boolean.FALSE::equals); if (valid) { validationSuccessEvent.fire(new CanvasValidationSuccessEvent(uuid, name, title)); } else { validationFailEvent.fire(new CanvasValidationFailEvent(uuid, name, title, elementViolations)); } }
Source:
public int compareTo(InsightCard o) { final InsightCard compareObject = (InsightCard) o; final DateTime compareTimestamp = compareObject.timestamp; final DateTime objectTimestamp = this.timestamp; return (int) (objectTimestamp.getMillis() - compareTimestamp.getMillis()); }

Target:
public int compareTo(InsightCard o) { final InsightCard compareObject = (InsightCard) o; return ComparisonChain.start() .compare(this.timestamp, compareObject.timestamp) .result(); }
Source:
public String getNoResponseTextInHtml(String giverEmail, String recipientEmail, FeedbackSessionResultsBundle bundle, FeedbackQuestionAttributes question) { StringBuilder noResponseHtml = new StringBuilder(); noResponseHtml.append("<i>").append(Const.INSTRUCTOR_FEEDBACK_RESULTS_MISSING_RESPONSE).append("</i>"); if (giverEmail.equals(recipientEmail) && hasPerceivedContribution(recipientEmail, question, bundle)) { noResponseHtml.append(getPerceivedContributionHtml(question, recipientEmail, bundle)); } return noResponseHtml.toString(); }

Target:
public String getNoResponseTextInHtml(String giverEmail, String recipientEmail, FeedbackSessionResultsBundle bundle, FeedbackQuestionAttributes question) { boolean isPerceivedContributionShown = giverEmail.equals(recipientEmail) && hasPerceivedContribution(recipientEmail, question, bundle); return "<i>" + Const.INSTRUCTOR_FEEDBACK_RESULTS_MISSING_RESPONSE + "</i>" + (isPerceivedContributionShown ? getPerceivedContributionHtml(question, recipientEmail, bundle) : ""); }
Source:
public static void dropItems(final Block block, final Collection<ItemStack> items) { for (final ItemStack item : items) { if(item.getType() != Material.AIR) { block.getWorld().dropItem(block.getLocation(), item);continue; } } }

Target:
public static void dropItems(final Block block, final Collection<ItemStack> items) { for (final ItemStack item : items) { if(item.getType() != Material.AIR) { block.getWorld().dropItem(block.getLocation(), item); } } }
Source:
public void delegatesLockRequest() { LockRequest lockRequest = mock(LockRequest.class); when(timelockService.leasableLock(lockRequest)).thenReturn( LeasableLockResponse.of(LOCK_RESPONSE, getLease())); timelockClient.lock(lockRequest); verify(timelockService).leasableLock(lockRequest); }

Target:
public void delegatesLockRequest() { when(timelockRpcClient.lockV2(lockRequest)).thenReturn( LeasableLockResponse.of(LOCK_RESPONSE, getLease())); timelockService.lock(lockRequest); }
Source:
private CompletableFuture<Void> doDelete(String name) throws InfrastructureException { try { final PodResource<Pod, DoneablePod> podResource = clientFactory.create().pods().inNamespace(namespace).withName(name); final CompletableFuture<Void> deleteFuture = new CompletableFuture<>(); final Watch watch = podResource.watch(new DeleteWatcher(deleteFuture)); podResource.delete(); return deleteFuture .thenAccept((v) -> watch.close()) .exceptionally( e -> { watch.close(); return null; }); } catch (KubernetesClientException ex) { throw new InfrastructureException(ex.getMessage(), ex); } }

Target:
private CompletableFuture<Void> doDelete(String name) throws InfrastructureException { try { final PodResource<Pod, DoneablePod> podResource = clientFactory.create().pods().inNamespace(namespace).withName(name); final CompletableFuture<Void> deleteFuture = new CompletableFuture<>(); final Watch watch = podResource.watch(new DeleteWatcher(deleteFuture)); podResource.delete(); return deleteFuture.handle( (v, e) -> { if (e != null) { LOG.warn("Failed to remove pod cause {}", name, e.getMessage()); } watch.close(); return null; }); } catch (KubernetesClientException ex) { throw new InfrastructureException(ex.getMessage(), ex); } }