auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException { try { if (params instanceof OpenOrdersParamCurrencyPair == false) { <START> throw new CurrencyPairNotValidException("CurrencyPair is must be provided to get open orders."); <END> } OpenOrdersParamCurrencyPair pairParams = (OpenOrdersParamCurrencyPair) params; CurrencyPair pair = pairParams.getCurrencyPair(); if (pair == null) { throw new CurrencyPairNotValidException("CurrencyPair is must be provided to get open orders."); } List<LatokenOrder> latokenOpenOrders = getLatokenOpenOrders(pair, Integer.MAX_VALUE); return LatokenAdapters.adaptOpenOrders(latokenOpenOrders); } catch (LatokenException e) { throw LatokenErrorAdapter.adapt(e); } }</code><technical_language>/** * Exception indicating a request a {@link CurrencyPair} is supported * this exchange. * * @author bryant_harris */ public class CurrencyPairNotValidException extends ExchangeException { providing in a method requires is a think, ExchangeException</technical_language>

Target:
public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException { try { if (params instanceof OpenOrdersParamCurrencyPair == false) { throw new ExchangeException("CurrencyPair is must be provided to get open orders."); } OpenOrdersParamCurrencyPair pairParams = (OpenOrdersParamCurrencyPair) params; CurrencyPair pair = pairParams.getCurrencyPair(); if (pair == null) { throw new ExchangeException("CurrencyPair is must be provided to get open orders."); } List<LatokenOrder> latokenOpenOrders = getLatokenOpenOrders(pair, Integer.MAX_VALUE); return LatokenAdapters.adaptOpenOrders(this.exchange, latokenOpenOrders); } catch (LatokenException e) { throw LatokenErrorAdapter.adapt(e); } }
Source:
<code>private List<Object> search(Class<?> entityClass, FilterExpression filterExpression, Optional<Sorting> sorting, Optional<Pagination> pagination) { Query query; try { query = filterExpression.accept(new FilterExpressionToLuceneQuery(em, entityClass)); } catch (IllegalArgumentException e) { throw new InvalidPredicateException(e.getMessage()); } FullTextQuery fullTextQuery = em.createFullTextQuery(query, entityClass); if (mustSort(sorting, entityClass)) { fullTextQuery = fullTextQuery.setSort(buildSort(sorting.get(), entityClass)); } if (pagination.isPresent()) { fullTextQuery = fullTextQuery.setMaxResults(pagination.get().getLimit()); fullTextQuery = fullTextQuery.setFirstResult(pagination.get().getOffset()); } List<Object[]> results = fullTextQuery .setProjection(ProjectionConstants.THIS) .getResultList(); if (pagination.isPresent() && pagination.get().isGenerateTotals()) { pagination.get().setPageTotals(fullTextQuery.getResultSize()); } if (results.isEmpty()) { <START> return new ArrayList<>(); <END> } return results.stream() .map((result) -> { return result[0]; }).collect(Collectors.toList()); }</code><technical_language>java Collections.emptyList();</technical_language>

Target:
private List<Object> search(Class<?> entityClass, FilterExpression filterExpression, Optional<Sorting> sorting, Optional<Pagination> pagination) { Query query; try { query = filterExpression.accept(new FilterExpressionToLuceneQuery(em, entityClass)); } catch (IllegalArgumentException e) { throw new InvalidPredicateException(e.getMessage()); } FullTextQuery fullTextQuery = em.createFullTextQuery(query, entityClass); if (mustSort(sorting, entityClass)) { fullTextQuery = fullTextQuery.setSort(buildSort(sorting.get(), entityClass)); } if (pagination.isPresent()) { fullTextQuery = fullTextQuery.setMaxResults(pagination.get().getLimit()); fullTextQuery = fullTextQuery.setFirstResult(pagination.get().getOffset()); } List<Object[]> results = fullTextQuery .setProjection(ProjectionConstants.THIS) .getResultList(); if (pagination.isPresent() && pagination.get().isGenerateTotals()) { pagination.get().setPageTotals(fullTextQuery.getResultSize()); } if (results.isEmpty()) { return Collections.emptyList(); } return results.stream() .map((result) -> { return result[0]; }).collect(Collectors.toList()); }
Source:
<code>public static boolean isJunctionOrSymlink(File file) throws IOException { <START> return (file.exists() && (Kernel32.FILE_ATTRIBUTE_REPARSE_POINT & getWin32FileAttributes(file)) != 0); <END> }</code><technical_language>this call function avoid legacy code loading JNA</technical_language>

Target:
public static boolean isJunctionOrSymlink(File file) throws IOException { return Util.isSymlink(file); }
Source:
<code>private synchronized void logMostLikelyMissedJobs(List<JobDescriptor> jobs) { Date now = new Date(); jobs.stream() .map(jobDescriptor -> ((JobDescriptorImpl) jobDescriptor).getInternal()) .filter(job -> job.getJobDeadline().isPresent()) .filter(job -> { Date deadline = getEffectiveDeadline(job); Date expeFinish = getEffectiveExpectedExecutionTime(job, now); return deadline.compareTo(expeFinish) < 0; }) .forEach(job -> { if (!alreadyNotified.contains(job.getId())) { <START> final Date expectedFinishingTime = getEffectiveExpectedExecutionTime(job, now); <END> final Date effectiveDeadline = getEffectiveDeadline(job); LOGGER.warn(String.format("Job[id=%s] will most likely miss its deadline (expected finish: %s, after deadline: %s)", job.getId().value(), expectedFinishingTime, effectiveDeadline)); new JobMostLikelyMissedEmailNotification(job, expectedFinishingTime, effectiveDeadline).checkAndSend(); alreadyNotified.add(job.getId()); } }); }</code><technical_language>![MINOR](<LINK_1> 'Severity: MINOR') Remove this unused "expectedFinishingTime" local variable. [![rule](<LINK_0>](<LINK_2></technical_language>

Target:
private synchronized void logMostLikelyMissedJobs(List<JobDescriptor> jobs) { Date now = new Date(); jobs.stream() .map(jobDescriptor -> ((JobDescriptorImpl) jobDescriptor).getInternal()) .filter(job -> job.getJobDeadline().isPresent()) .filter(job -> job.getJobInfo().getStartTime() < 0) .filter(job -> { Date deadline = getEffectiveDeadline(job); Date expeFinish = getEffectiveExpectedExecutionTime(job, now); return deadline.compareTo(expeFinish) < 0; }) .forEach(job -> { if (!alreadyNotified.contains(job.getId())) { final Date expectedFinishingTime = getEffectiveExpectedExecutionTime(job, now); final Date effectiveDeadline = getEffectiveDeadline(job); LOGGER.warn(String.format("Job[id=%s] will most likely miss its deadline (expected finish: %s, after deadline: %s)", job.getId().value(), expectedFinishingTime, effectiveDeadline)); new JobMostLikelyMissedEmailNotification(job, expectedFinishingTime, effectiveDeadline).checkAndSend(); alreadyNotified.add(job.getId()); } }); }
Source:
<code>protected IStatus onePing(IServer server, Map<String, String> env) throws PollingException, IOException, TimeoutException { <START> String[] args = new String[] { CDKConstants.VAGRANT_CMD_STATUS }; <END> String vagrantcmdloc = MinishiftBinaryUtility.getMinishiftLocation(server); try { String[] lines = VagrantLaunchUtility.callMachineReadable( vagrantcmdloc, args, getWorkingDirectory(server), env); IStatus stat = parseOutput(lines); if( stat.isOK()) { checkOpenShiftHealth(server, 4000); return stat; } else { return stat; } } catch (VagrantTimeoutException vte) { List<String> inLines = vte.getInLines(); if (inLines != null) { String[] asArr = (String[]) inLines.toArray(new String[inLines.size()]); IStatus stat = parseOutput(asArr); if( stat.isOK()) { checkOpenShiftHealth(server, 4000); } else { return stat; } } CDKCoreActivator.pluginLog().logError("Unable to successfully complete a call to vagrant status. ", vte); throw vte; } }</code><technical_language>I is lots of code refereing Vagrant concept/naming need renamed in order for this code readable maintainable</technical_language>

Target:
protected IStatus onePing(IServer server, Map<String, String> env) throws PollingException, IOException, TimeoutException { String[] args = new String[] { CDKConstants.VAGRANT_CMD_STATUS }; String vagrantcmdloc = MinishiftBinaryUtility.getMinishiftLocation(server); try { String[] lines = CDKLaunchUtility.callMachineReadable( vagrantcmdloc, args, getWorkingDirectory(server), env); IStatus stat = parseOutput(lines); if( stat.isOK()) { checkOpenShiftHealth(server, 4000); return stat; } else { return stat; } } catch (CommandTimeoutException vte) { List<String> inLines = vte.getInLines(); if (inLines != null) { String[] asArr = (String[]) inLines.toArray(new String[inLines.size()]); IStatus stat = parseOutput(asArr); if( stat.isOK()) { checkOpenShiftHealth(server, 4000); } else { return stat; } } CDKCoreActivator.pluginLog().logError("Unable to successfully complete a call to vagrant status. ", vte); throw vte; } }
Source:
<code>public ArrayList<VdcActionParametersBase> buildParameters(List<VdsNetworkInterface> nics) { Set<Guid> nonUpdateableHosts = new HashSet<>(); ArrayList<VdcActionParametersBase> parameters = new ArrayList<>(); boolean vlanNetwork = NetworkUtils.isVlan(network); for (VdsNetworkInterface nic : nics) { SetupNetworksParameters setupNetworkParams = createSetupNetworksParameters(nic.getVdsId()); VdsNetworkInterface nicToConfigure = getNicToConfigure(setupNetworkParams.getInterfaces(), nic.getId()); <START> if (nicToConfigure == null) { <END> continue; } if (network.getName().equals(nicToConfigure.getNetworkName())) { nicToConfigure.setNetworkName(null); } else if (vlanNetwork) { VdsNetworkInterface vlan = getVlanDevice(setupNetworkParams, nicToConfigure); if (vlan == null) { nonUpdateableHosts.add(nic.getVdsId()); } else { setupNetworkParams.getInterfaces().remove(vlan); } } else { nonUpdateableHosts.add(nic.getVdsId()); continue; } parameters.add(setupNetworkParams); } reportNonUpdateableHosts(nonUpdateableHosts); return parameters; }</code><technical_language>this occur sending NICs labled label</technical_language>

Target:
public ArrayList<VdcActionParametersBase> buildParameters(List<VdsNetworkInterface> nics) { Set<Guid> nonUpdateableHosts = new HashSet<>(); ArrayList<VdcActionParametersBase> parameters = new ArrayList<>(); boolean vlanNetwork = NetworkUtils.isVlan(network); for (VdsNetworkInterface nic : nics) { SetupNetworksParameters setupNetworkParams = createSetupNetworksParameters(nic.getVdsId()); VdsNetworkInterface nicToConfigure = getNicToConfigure(setupNetworkParams.getInterfaces(), nic.getId()); if (network.getName().equals(nicToConfigure.getNetworkName())) { nicToConfigure.setNetworkName(null); } else if (vlanNetwork) { VdsNetworkInterface vlan = getVlanDevice(setupNetworkParams.getInterfaces(), nicToConfigure); if (vlan == null) { nonUpdateableHosts.add(nic.getVdsId()); } else { setupNetworkParams.getInterfaces().remove(vlan); } } else { nonUpdateableHosts.add(nic.getVdsId()); continue; } parameters.add(setupNetworkParams); } reportNonUpdateableHosts(nonUpdateableHosts); return parameters; }
Source:
<code><START> public void scheduleWithFixedDelay(Object instance, <END> String methodName, Class<?>[] inputTypes, Object[] inputParams, long initialDelay, long taskDelay, TimeUnit timeUnit) { executor.scheduleWithFixedDelay(getRunnable(instance, methodName), initialDelay, taskDelay, TimeUnit.SECONDS); }</code><technical_language>this implementing scheduleWithFixedDelay of SchedulerUtil interface? why's return type changed</technical_language>

Target:
public void scheduleWithFixedDelay(Object instance, String methodName, Class<?>[] inputTypes, Object[] inputParams, long initialDelay, long taskDelay, TimeUnit timeUnit) { executor.scheduleWithFixedDelay(getRunnable(instance, methodName, inputTypes, inputParams), initialDelay, taskDelay, TimeUnit.SECONDS); }
Source:
<code><START> public void close() throws IOException { <END> }</code><technical_language>set iis null is immediately this is closed if try re-use it? concerend of realizing correctly</technical_language>

Target:
public void close() throws IOException { this.iis = null; }
Source:
<code>private void parseInvalidationCache(XMLExtendedStreamReader reader, ConfigurationBuilderHolder holder, boolean template) throws XMLStreamException { String name = reader.getAttributeValue(null, Attribute.NAME.getLocalName()); String extend = reader.getAttributeValue(null, Attribute.EXTENDS.getLocalName()); ConfigurationBuilder builder = getConfigurationBuilder(holder, name, template, extend); CacheMode baseCacheMode = CacheMode.INVALIDATION_SYNC; builder.clustering().cacheMode(baseCacheMode); for (int i = 0; i < reader.getAttributeCount(); i++) { String value = replaceProperties(reader.getAttributeValue(i)); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case KEY_PARTITIONER_FACTORY: { <START> builder.clustering().hash().keyPartitionerFactory(Util.getInstance(value, holder.getClassLoader())); <END> break; } default: { this.parseClusteredCacheAttribute(reader, i, attribute, value, builder, baseCacheMode); } } } while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { Element element = Element.forName(reader.getLocalName()); switch (element) { default: { this.parseCacheElement(reader, element, holder); } } } }</code><technical_language>if (reader.getSchema().since(8, 2)) { builder.clustering().hash().keyPartitionerFactory(Util.getInstance(value, holder.getClassLoader())); } else { throw ParseUtils.unexpectedAttribute(reader,i); }</technical_language>

Target:
private void parseInvalidationCache(XMLExtendedStreamReader reader, ConfigurationBuilderHolder holder, boolean template) throws XMLStreamException { String name = reader.getAttributeValue(null, Attribute.NAME.getLocalName()); String extend = reader.getAttributeValue(null, Attribute.EXTENDS.getLocalName()); ConfigurationBuilder builder = getConfigurationBuilder(holder, name, template, extend); CacheMode baseCacheMode = CacheMode.INVALIDATION_SYNC; builder.clustering().cacheMode(baseCacheMode); for (int i = 0; i < reader.getAttributeCount(); i++) { String value = replaceProperties(reader.getAttributeValue(i)); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case KEY_PARTITIONER: { builder.clustering().hash().keyPartitioner(Util.getInstance(value, holder.getClassLoader())); break; } default: { this.parseClusteredCacheAttribute(reader, i, attribute, value, builder, baseCacheMode); } } } while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { Element element = Element.forName(reader.getLocalName()); switch (element) { default: { this.parseCacheElement(reader, element, holder); } } } }
Source:
<code>protected boolean deploymentsDiffer(DeploymentEntity deployment, DeploymentEntity saved) { if (deploymentBuilder.hasProjectManifestSet()) { <START> if (!deployment.getProjectReleaseVersion().equals(saved.getProjectReleaseVersion())) { <END> return true; } else { return !deploymentBuilder.getEnforcedAppVersion().equals(saved.getVersion()); } } else { if (deployment.getResources() == null || saved.getResources() == null) { return true; } Map<String, ResourceEntity> resources = deployment.getResources(); Map<String, ResourceEntity> savedResources = saved.getResources(); for (String resourceName : resources.keySet()) { ResourceEntity savedResource = savedResources.get(resourceName); if (savedResource == null) { return true; } if (!savedResource.isGenerated()) { ResourceEntity resource = resources.get(resourceName); byte[] bytes = resource.getBytes(); byte[] savedBytes = savedResource.getBytes(); if (!Arrays.equals(bytes, savedBytes)) { return true; } } } return false; } }</code><technical_language>if project release versions mismatch (returns true) appVersions match instead? Based logic enforces appVersion priority.. a problem in this scenario</technical_language>

Target:
protected boolean deploymentsDiffer(DeploymentEntity deployment, DeploymentEntity saved) { if (deploymentBuilder.hasEnforcedAppVersion()) { return deploymentsDifferWhenEnforcedAppVersionIsSet(saved); } else if (deploymentBuilder.hasProjectManifestSet()) { return deploymentsDifferWhenProjectManifestIsSet(deployment, saved); } else { return deploymentsDifferDefault(deployment, saved); } }
Source:
<code>public final Iterable<Row> evaluate(TransactionContext txnCtx, Input<List<Object>>[] arguments) { int numCols = arguments.length; Object[] cells = new Object[numCols]; RowN row = new RowN(cells); Iterator<Object>[] iteratorsPerColumn = iteratorsFrom(arguments); <START> return () -> new Iterator<>() { <END> @Override public boolean hasNext() { for (Iterator<Object> it : iteratorsPerColumn) { if (it.hasNext()) { return true; } } return false; } @Override public Row next() { if (!hasNext()) { throw new NoSuchElementException("No more rows"); } for (int i = 0; i < iteratorsPerColumn.length; i++) { Iterator<Object> iterator = iteratorsPerColumn[i]; cells[i] = iterator.hasNext() ? iterator.next() : null; } return row; } }; }</code><technical_language>share Iterable Iterator part unnest making iteratorsPerColumn a parameter</technical_language>

Target:
public final Iterable<Row> evaluate(TransactionContext txnCtx, Input<List<Object>>[] arguments) { return new ColumnOrientedRowsIterator(() -> iteratorsFrom(arguments)); }
Source:
<code>private void parseCommandLineAndGetKillJobParameters(String[] args) throws IOException, YarnException { GnuParser parser = new GnuParser(); CommandLine cli; try { cli = parser.parse(options, args); parametersHolder = ParametersHolder.createWithCmdLine(cli, Command.KILL_JOB); parametersHolder.updateParameters(clientContext); } catch (ParseException e) { printUsages(); <START> } <END> }</code><technical_language>Please print exception printing usage. is hard command is wrong</technical_language>

Target:
private void parseCommandLineAndGetKillJobParameters(String[] args) throws IOException, YarnException { GnuParser parser = new GnuParser(); CommandLine cli; try { cli = parser.parse(options, args); parametersHolder = ParametersHolder.createWithCmdLine(cli, Command.KILL_JOB); parametersHolder.updateParameters(clientContext); } catch (ParseException e) { LOG.error(("Error parsing command-line options: " + e.getMessage())); printUsages(); } }
Source:
<code>protected Map<Verify, Object> getArguments(ContainerRequestContext requestContext, Method method) { Map<Verify, Object> argMap = new LinkedHashMap<>(); Annotation[][] annotations = annotationLocator.getParameterAnnotations(method); Map<String, List<String>> pathParams = null; Map<String, List<String>> queryParams = null; <START> Map<String, List<String>> headers = null; <END> for (int i = 0; i < annotations.length; ++i) { Verify verify = null; Object value = null; for (Annotation annotation : annotations[i]) { if (annotation instanceof Verify) { verify = (Verify) annotation; } else { List<String> values = null; if (annotation instanceof PathParam) { if (pathParams == null) { pathParams = requestContext.getUriInfo().getPathParameters(true); } values = pathParams.get(((PathParam) annotation).value()); } else if (annotation instanceof QueryParam) { if (queryParams == null) { queryParams = requestContext.getUriInfo().getQueryParameters(true); } values = queryParams.get(((QueryParam) annotation).value()); } else if (annotation instanceof HeaderParam) { if (headers == null) { headers = requestContext.getHeaders(); } values = headers.get(((HeaderParam) annotation).value()); } if (values != null) { value = values.size() > 1 ? values : values.get(0); } } } if (verify != null) { if (!verify.nullable() && value == null) { throw new IllegalStateException("Null passed to a non-nullable Verify annotation."); } log.debug("ASSIGNING VALUE TO VERIFIED ARG: => {}", verify, value); argMap.put(verify, value); } } return argMap; }</code><technical_language>This enhanced for</technical_language>

Target:
protected Map<Verify, Object> getArguments(ContainerRequestContext requestContext, Method method) { Map<Verify, Object> argMap = new LinkedHashMap<>(); Annotation[][] annotations = annotationLocator.getParameterAnnotations(method); Map<String, List<String>> pathParams = null; Map<String, List<String>> queryParams = null; Map<String, List<String>> headers = null; for (int i = 0; i < annotations.length; ++i) { Verify verify = null; Object value = null; for (Annotation annotation : annotations[i]) { if (annotation instanceof Verify) { verify = (Verify) annotation; } else { List<String> values = null; if (annotation instanceof PathParam) { if (pathParams == null) { pathParams = requestContext.getUriInfo().getPathParameters(true); } values = pathParams.get(((PathParam) annotation).value()); } else if (annotation instanceof QueryParam) { if (queryParams == null) { queryParams = requestContext.getUriInfo().getQueryParameters(true); } values = queryParams.get(((QueryParam) annotation).value()); } else if (annotation instanceof HeaderParam) { if (headers == null) { headers = requestContext.getHeaders(); } values = headers.get(((HeaderParam) annotation).value()); } if (values != null) { value = values.size() > 1 ? values : values.get(0); } } } if (verify != null) { if (!verify.nullable() && value == null) { throw new IllegalStateException("Null passed to a non-nullable Verify annotation."); } argMap.put(verify, value); } } return argMap; }
Source:
<code>public String docs() { <START> return "boolean {locationArray} Returns the command in the Command Block at the given location."; <END> }</code><technical_language>this returns a string, a boolean</technical_language>

Target:
public String docs() { return "string {locationArray} Returns the command string in the Command Block at the given location."; }
Source:
<code>public ClusterSearchShardsResponse getSearchShards(String index, ElasticsearchTableDescription tableDescription) { TransportClient client = clients.get(tableDescription.getClusterName()); verify(client != null); ClusterSearchShardsRequest request = new ClusterSearchShardsRequest(index); <START> return client.admin().cluster().searchShards(request).actionGet(timeout.toMillis()); <END> }</code><technical_language>Please fix style of long chain of method calls: return client.admin() .cluster() .searchShards(request) .actionGet(timeout.toMillis());</technical_language>

Target:
public ClusterSearchShardsResponse getSearchShards(String index, ElasticsearchTableDescription tableDescription) { TransportClient client = clients.get(tableDescription.getClusterName()); verify(client != null, "TransportClient should not be null"); ClusterSearchShardsRequest request = new ClusterSearchShardsRequest(index); return client.admin() .cluster() .searchShards(request) .actionGet(timeout.toMillis()); }
Source:
<code>protected void updateLocation(final IGeoData geo) { try { boolean repaintRequired = false; if (overlayPosition == null && mapView != null) { overlayPosition = mapView.createAddPositionOverlay(activity); } <START> if ((overlayPosition != null && geo.getLocation() != null) && overlayPosition != null) { <END> overlayPosition.setCoordinates(geo.getLocation()); } if (geo.getCoords() != null) { if (followMyLocation) { myLocationInMiddle(geo); } else { repaintRequired = true; } } if (!Settings.isUseCompass() || geo.getSpeed() > 5) { overlayPosition.setHeading(geo.getBearing()); repaintRequired = true; } if (repaintRequired && mapView != null) { mapView.repaintRequired(overlayPosition); } } catch (Exception e) { Log.w("Failed to update location."); } }</code><technical_language>checking overlayPosition for null in this line</technical_language>

Target:
protected void updateLocation(final IGeoData geo) { try { boolean repaintRequired = false; if (overlayPosition == null && mapView != null) { overlayPosition = mapView.createAddPositionOverlay(activity); } if ((overlayPosition != null && geo.getLocation() != null)) { overlayPosition.setCoordinates(geo.getLocation()); } if (geo.getCoords() != null) { if (followMyLocation) { myLocationInMiddle(geo); } else { repaintRequired = true; } } if (!Settings.isUseCompass() || geo.getSpeed() > 5) { overlayPosition.setHeading(geo.getBearing()); repaintRequired = true; } if (repaintRequired && mapView != null) { mapView.repaintRequired(overlayPosition); } } catch (Exception e) { Log.w("Failed to update location."); } }
Source:
<code>public PaxosLeaderElectionService build() { return new PaxosLeaderElectionService( proposer, knowledge, potentialLeadersToHosts, acceptors, learners, executor, pingRateMs, randomWaitBeforeProposingLeadershipMs, noQuorumMaxDelayMs, leaderPingResponseWaitMs, eventRecorder); <START> } <END></code><technical_language>OK. do a preconditions-check this is non-negative? if a negative fail try generate range / in current impl, sleep for negative time</technical_language>

Target:
public PaxosLeaderElectionService build() { Preconditions.checkState(randomWaitBeforeProposingLeadershipMs >= 0, "randomWaitBeforeProposingLeadershipMs should be positive; was " + randomWaitBeforeProposingLeadershipMs); Preconditions.checkState(noQuorumMaxDelayMs >= 0, "noQuorumMaxDelayMs should be positive; was " + noQuorumMaxDelayMs); return new PaxosLeaderElectionService( proposer, knowledge, potentialLeadersToHosts, acceptors, learners, executor, pingRateMs, randomWaitBeforeProposingLeadershipMs, noQuorumMaxDelayMs, leaderPingResponseWaitMs, eventRecorder); }
Source:
<code>public DockerInternalRuntime getRuntime() throws InfrastructureException { <START> List<ContainerInfo> runningContainers = containers.find(identity); <END> if (runningContainers.isEmpty()) { return runtimeFactory.create(this); } DockerInternalRuntime runtime = runtimeFactory.create(this, runningContainers); try { consistencyChecker.check(environment, runtime); } catch (ValidationException x) { LOG.warn("Runtime '{}:{}' will be stopped as it is not consistent with its configuration. " + "The problem: {}", identity.getWorkspaceId(), identity.getEnvName(), x.getMessage()); stopAsync(runtime); throw new InfrastructureException(x.getMessage(), x); } return runtime; }</code><technical_language>a costly operation. cache runtime return in case is null</technical_language>

Target:
public DockerInternalRuntime getRuntime() throws InfrastructureException { List<ContainerListEntry> runningContainers = containers.find(identity); if (runningContainers.isEmpty()) { return runtimeFactory.create(this); } DockerInternalRuntime runtime = runtimeFactory.create(this, runningContainers); try { consistencyChecker.check(environment, runtime); runtime.checkServers(); } catch (InfrastructureException | ValidationException x) { LOG.warn("Runtime '{}:{}' will be stopped as it is not consistent with its configuration. " + "The problem: {}", identity.getWorkspaceId(), identity.getEnvName(), x.getMessage()); stopAsync(runtime); throw new InfrastructureException(x.getMessage(), x); } return runtime; }
Source:
<code>int nextStreamId() { int n; int o; do { o = streamId; n = o + 2; <START> } while (!STREAM_ID.compareAndSet(this, o, n)); <END> return n; }</code><technical_language>replace this STREAM_ID.addAndGet(this, 2)</technical_language>

Target:
int nextStreamId() { return STREAM_ID.addAndGet(this, 2); }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PatternDruidPredicateFactory that = (PatternDruidPredicateFactory) o; return Objects.equals(extractionFn, that.extractionFn) && <START> Objects.equals(pattern, that.pattern); <END> }</code><technical_language>Pattern implement equals(), Pattern.toString()</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PatternDruidPredicateFactory that = (PatternDruidPredicateFactory) o; return Objects.equals(extractionFn, that.extractionFn) && Objects.equals(pattern.toString(), that.pattern.toString()); }
Source:
<code>public static String getFrom() { String from = null; final StaplerRequest request = Stapler.getCurrentRequest(); if (request.getSession(false) != null) { from = (String) request.getSession().getAttribute("from"); } if (from == null) { from = request.getParameter("from"); } final String requestURI = request.getRequestURI(); if (from == null && requestURI != null && requestURI.compareTo("/loginError") != 0 && requestURI.compareTo("/login") != 0) { from = requestURI; } if (from == null || from.trim().isEmpty()) { from = "/"; } try { from = java.net.URLEncoder.encode(from, "UTF-8"); } catch (UnsupportedEncodingException e) { <START> from = "/"; <END> } return from; }</code><technical_language>happen btw</technical_language>

Target:
public static String getFrom() { String from = null, returnValue = null; final StaplerRequest request = Stapler.getCurrentRequest(); if (request != null && request.getSession(false) != null) { from = (String) request.getSession().getAttribute("from"); } else if (request != null) { from = request.getParameter("from"); } if (from == null && request != null && request.getRequestURI() != null && !request.getRequestURI().equals("/loginError") && !request.getRequestURI().equals("/login")) { from = request.getRequestURI(); } if (StringUtils.isBlank(from)) { from = "/"; } from.trim(); try { returnValue = java.net.URLEncoder.encode(from, "UTF-8"); } catch (UnsupportedEncodingException e) { } return StringUtils.isBlank(returnValue) ? "/" : returnValue; }
Source:
<code>public void loadSegment(DataSegment segment, LoadPeonCallback callback) { synchronized (lock) { if (stopped) { log.warn( <START> "Server[%s] failed to load segment[%s] because load queue peon is stopped.", <END> serverId, segment.getIdentifier() ); callback.execute(); return; } SegmentHolder holder = segmentsToLoad.get(segment); if (holder == null) { log.info("Server[%s] to load segment[%s] queued.", serverId, segment.getIdentifier()); segmentsToLoad.put(segment, new LoadSegmentHolder(segment, callback)); processingExecutor.execute(this::doSegmentManagement); } else { holder.addCallback(callback); } } }</code><technical_language>Instead of "failed load", "cannot load" is a log message</technical_language>

Target:
public void loadSegment(DataSegment segment, LoadPeonCallback callback) { synchronized (lock) { if (stopped) { log.warn( "Server[%s] cannot load segment[%s] because load queue peon is stopped.", serverId, segment.getIdentifier() ); callback.execute(); return; } SegmentHolder holder = segmentsToLoad.get(segment); if (holder == null) { log.info("Server[%s] to load segment[%s] queued.", serverId, segment.getIdentifier()); segmentsToLoad.put(segment, new LoadSegmentHolder(segment, callback)); processingExecutor.execute(this::doSegmentManagement); } else { holder.addCallback(callback); } } }
Source:
<code><START> public void shouldNotBeConfiguredIfUsernameAndPasswordAreNull() throws Exception { <END> boolean isConfigured = notConfiguredInstance.isConfigured(); assertThat(isConfigured, is(false)); }</code><technical_language>good test (just) password null</technical_language>

Target:
public void shouldNotBeConfiguredIfUsernameAndPasswordAreNull() { boolean isConfigured = notConfiguredInstance.isConfigured(); assertThat(isConfigured, is(false)); }
Source:
<code>private Map<String, Pair<String, String>> getSharedLocksForVmDisk() { Map<String, Pair<String, String>> sharedLocks = new HashMap<>(); if (vmsForDisk != null) { <START> for (Pair<VM, VmDevice> vmForDisk : vmsForDisk) { <END> sharedLocks.put(vmForDisk.getFirst().getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM, EngineMessage.ACTION_TYPE_FAILED_VM_IS_LOCKED)); } } return sharedLocks; }</code><technical_language>If mistaken getSharedLocks() is called validate() part, in case vmsForDisk populated attached VMs get lock for VMs</technical_language>

Target:
private Map<String, Pair<String, String>> getSharedLocksForVmDisk() { Map<String, Pair<String, String>> lockMap = new HashMap<>(); if (getDiskImage() != null) { List<Pair<VM, VmDevice>> vmsForDisk = vmDao.getVmsWithPlugInfo(getDiskImage().getId()); if (!vmsForDisk.isEmpty()) { for (Pair<VM, VmDevice> pair : vmsForDisk) { lockMap.put(pair.getFirst().getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM, EngineMessage.ACTION_TYPE_FAILED_VM_IS_LOCKED)); } } } return lockMap; }
Source:
<code>private void load(AlluxioURI filePath, int replication) throws IOException, AlluxioException { URIStatus status = mFileSystem.getStatus(filePath); if (status.isFolder()) { <START> ListStatusPOptions options = ListStatusPOptions.newBuilder().setRecursive(true).build(); <END> mFileSystem.listStatusInStream(filePath, options).forEach( uriStatus -> { if (!uriStatus.isFolder()) { addJob(uriStatus, replication); } }); } else { addJob(status, replication); } }</code><technical_language>is a tradeoff for this recursive listing. locking more of tree for longer recursive listing (especially if sync interval triggered)</technical_language>

Target:
private void load(AlluxioURI filePath, int replication) throws IOException, AlluxioException { ListStatusPOptions options = ListStatusPOptions.newBuilder().setRecursive(true).build(); mFileSystem.iterateStatus(filePath, options, uriStatus -> { if (!uriStatus.isFolder()) { addJob(uriStatus, replication); } }); }
Source:
<code>public void saveStateShouldThrowIllegalArgumentExceptionWhenStateIsNull() { <START> given(statesRepository.save(stateEntity)).willThrow(IllegalArgumentException.class); <END> statesService.saveState(null, FIRST_ID); }</code><technical_language>this unnecessary</technical_language>

Target:
public void saveStateShouldThrowIllegalArgumentExceptionWhenStateIsNull() { statesService.saveState(null, FIRST_ID); }
Source:
<code>void submitComments( Run<?, ?> build, PrintStream logger, String jenkinsRootUrl, List<JiraIssue> issues, JiraSession session, boolean useWikiStyleComments, boolean recordScmChanges, String groupVisibility, String roleVisibility) throws RestClientException { List<JiraIssue> copy = new ArrayList<JiraIssue>(issues); for (JiraIssue issue : copy) { logger.println(Messages.Updater_Updating(issue.id)); try { session.addComment( issue.id, createComment(build, useWikiStyleComments, jenkinsRootUrl, recordScmChanges, issue), groupVisibility, roleVisibility ); <START> if(!labels.isEmpty()) <END> session.addLabels(issue.id, labels); } catch (RestClientException e) { if (e.getStatusCode().or(0).equals(404)) { logger.println(issue.id + " - JIRA issue not found. Dropping comment from update queue."); } if (e.getStatusCode().or(0).equals(403)) { logger.println(issue.id + " - Jenkins JIRA user does not have permissions to comment on this issue. Preserving comment for future update."); continue; } if (e.getStatusCode().or(0).equals(401)) { logger.println(issue.id + " - Jenkins JIRA authentication problem. Preserving comment for future update."); continue; } logger.println(Messages.Updater_FailedToCommentOnIssue(issue.id)); logger.println(e.getLocalizedMessage()); } issues.remove(issue); } }</code><technical_language>brackets for if, space if</technical_language>

Target:
void submitComments( Run<?, ?> build, PrintStream logger, String jenkinsRootUrl, List<JiraIssue> issues, JiraSession session, boolean useWikiStyleComments, boolean recordScmChanges, String groupVisibility, String roleVisibility) throws RestClientException { List<JiraIssue> copy = new ArrayList<JiraIssue>(issues); for (JiraIssue issue : copy) { logger.println(Messages.Updater_Updating(issue.id)); try { session.addComment( issue.id, createComment(build, useWikiStyleComments, jenkinsRootUrl, recordScmChanges, issue), groupVisibility, roleVisibility ); if (!labels.isEmpty()) { session.addLabels(issue.id, labels); } } catch (RestClientException e) { if (e.getStatusCode().or(0).equals(404)) { logger.println(issue.id + " - JIRA issue not found. Dropping comment from update queue."); } if (e.getStatusCode().or(0).equals(403)) { logger.println(issue.id + " - Jenkins JIRA user does not have permissions to comment on this issue. Preserving comment for future update."); continue; } if (e.getStatusCode().or(0).equals(401)) { logger.println(issue.id + " - Jenkins JIRA authentication problem. Preserving comment for future update."); continue; } logger.println(Messages.Updater_FailedToCommentOnIssue(issue.id)); logger.println(e.getLocalizedMessage()); } issues.remove(issue); } }
Source:
<code>public static String getGroupIdsFromUser(DirectoryUser directoryUser) { StringBuilder sb = new StringBuilder(); Set<DirectoryGroup> groupsSet = new HashSet<DirectoryGroup>(); flatGroups(groupsSet, directoryUser.getGroups()); List<DirectoryGroup> groupsList = new ArrayList<DirectoryGroup>(groupsSet); <START> Collections.sort(groupsList, new Comparator<DirectoryGroup>() { <END> @Override public int compare(DirectoryGroup o1, DirectoryGroup o2) { return o1.getId().compareTo(o2.getId()) != 0 ? o1.getId().compareTo(o2.getId()) : o1.getDirectoryName().compareTo(o2.getDirectoryName()); } }); DbGroupDAO dao = DbFacade.getInstance().getDbGroupDao(); if (groupsSet != null) { boolean first = true; for (DirectoryGroup group : groupsSet) { DbGroup dbGroup = dao.getByExternalId(group.getDirectoryName(), group.getId()); if (!first) { sb.append(","); } else { first = false; } sb.append(dbGroup != null ? dbGroup.getId() : Guid.Empty); } } return sb.toString(); }</code><technical_language>do this groupsList</technical_language>

Target:
public static String getGroupIdsFromUser(DirectoryUser directoryUser) { StringBuilder sb = new StringBuilder(); Set<DirectoryGroup> groupsSet = new HashSet<DirectoryGroup>(); flatGroups(groupsSet, directoryUser.getGroups()); List<DirectoryGroup> groupsList = new ArrayList<DirectoryGroup>(groupsSet); Collections.sort(groupsList, new Comparator<DirectoryGroup>() { @Override public int compare(DirectoryGroup o1, DirectoryGroup o2) { return o1.getId().compareTo(o2.getId()) != 0 ? o1.getId().compareTo(o2.getId()) : o1.getDirectoryName().compareTo(o2.getDirectoryName()); } }); DbGroupDAO dao = DbFacade.getInstance().getDbGroupDao(); if (groupsSet != null) { boolean first = true; for (DirectoryGroup group : groupsList) { DbGroup dbGroup = dao.getByExternalId(group.getDirectoryName(), group.getId()); if (!first) { sb.append(","); } else { first = false; } sb.append(dbGroup != null ? dbGroup.getId() : Guid.Empty); } } return sb.toString(); }
Source:
<code>public static ClientInfo getClientInfo() { info.setSdkVersion(config.getSdkVersion()); return info; <START> } <END></code><technical_language>This means time user calls getClientInfo(), override SDK version config.getSdkVersion(). If want enforce SDK version, I creating a constructor in ClientInfo, rid of setSdkVersion(), SDK version immutable (final). If want allow SDK users override SDK version (which unlikely), moving info.setSdkVersion() a static initalizer. For example: private static final ClientInfo CLIENT_INFO = new ClientInfo(); { info.setSdkVersion(config.getSdkVersion); } some variant thereof</technical_language>

Target:
public static ClientInfo getClientInfo() { return info; }
Source:
<code>public void editTitleTest() throws Exception { String title = "new title"; document.addContent(new Element("mods", MODS_V3_NS) .addContent(new Element("titleInfo", MODS_V3_NS) .addContent(new Element("title", MODS_V3_NS).setText("original title")))); when(binaryObj.getBinaryStream()).thenReturn(convertDocumentToStream(document)); service.editTitle(agent, pid, title); verify(operationsMessageSender).sendUpdateDescriptionOperation(anyString(), pidsCaptor.capture()); Collection<PID> pids = pidsCaptor.getValue(); <START> assertEquals(pids.size(), 1); <END> assertTrue(pids.contains(pid)); }</code><technical_language>switch order of parameters, expected first. need do in other test methods too</technical_language>

Target:
public void editTitleTest() throws Exception { String title = "new title"; document.addContent(new Element("mods", MODS_V3_NS) .addContent(new Element("titleInfo", MODS_V3_NS) .addContent(new Element("title", MODS_V3_NS).setText("original title")))); when(binaryObj.getBinaryStream()).thenReturn(convertDocumentToStream(document)); service.editTitle(agent, pid, title); verify(operationsMessageSender).sendUpdateDescriptionOperation(anyString(), pidsCaptor.capture()); Collection<PID> pids = pidsCaptor.getValue(); assertEquals(1, pids.size()); assertTrue(pids.contains(pid)); Document updatedDoc = getUpdatedDescriptionDocument(); assertTrue(hasTitleValue(updatedDoc, title)); }
Source:
<code>protected void broadcastPrepare(TxInvocationContext context, PrepareCommand command) { try { <START> boolean async = cacheConfiguration.clustering().cacheMode() == CacheMode.REPL_ASYNC; <END> rpcManager.invokeRemotely(null, command, rpcManager.getDefaultRpcOptions(!async)); } finally { transactionRemotelyPrepared(context); } }</code><technical_language>!cacheMode.isSynchronous()</technical_language>

Target:
protected void broadcastPrepare(TxInvocationContext context, PrepareCommand command) { try { boolean sync = cacheConfiguration.clustering().cacheMode().isSynchronous(); rpcManager.invokeRemotely(null, command, rpcManager.getDefaultRpcOptions(sync)); } finally { transactionRemotelyPrepared(context); } }
Source:
<code>private void moveVdsToUp(VDS vds) { vds.setNonOperationalReason(null); DbFacade.getInstance().getVdsDynamicDao().update(vds.getDynamicData()); HostStoragePoolParametersBase tempVar = new HostStoragePoolParametersBase(vds); <START> Backend.getInstance().runInternalAction(VdcActionType.InitVdsOnUp, tempVar); <END> }</code><technical_language>calling this command move host up. need of a activate host a flag attested i thought non-operational reason i is cleared in ActivateVds command</technical_language>

Target:
private void moveVdsToUp(VDS vds) { trustedVdses.add(vds.getId()); vds.setStatus(VDSStatus.Up); DbFacade.getInstance().getVdsDynamicDao().update(vds.getDynamicData()); }
Source:
<code>protected void quitDefaultWebDriver() { if (driver != null) { try { <START> driver.get("about:config"); <END> driver.quit(); } finally { driver = null; } } }</code><technical_language>[x] need this? Please re-consider based #768</technical_language>

Target:
protected void quitDefaultWebDriver() { if (driver != null) { try { driver.quit(); } finally { driver = null; } } }
Source:
<code>public ResponseEntity<String> delete(@PathVariable("id") Long id) { try { userUtil.extractLoggedAppUserFromDatabase(); Counterparty counterparty = counterpartyDao.findOne(id); if(counterparty == null){ throw new NotFoundException("Counterparty not found"); } <START> counterpartyDao.delete(id); <END> counterpartyDao.flush(); } catch (EmptyResultDataAccessException emptyResultDataAccessException) { throw new NotFoundException(emptyResultDataAccessException.getMessage()); } return new ResponseEntity<>("Counterparty deleted", HttpStatus.NO_CONTENT); }</code><technical_language>check if Counterparty deleted belongs logged AppUser</technical_language>

Target:
public ResponseEntity<String> delete(@PathVariable("id") Long id) { try { userUtil.extractLoggedAppUserFromDatabase(); Counterparty counterparty = counterpartyDao.findOne(id); if(counterparty == null){ throw new NotFoundException("Counterparty not found"); } AppUser loggedUser = userUtil.extractLoggedAppUserFromDatabase(); if(loggedUser.getUserId() != counterparty.getUser().getUserId()){ throw new BadRequestException("Bad request!"); } counterpartyDao.delete(id); counterpartyDao.flush(); } catch (EmptyResultDataAccessException emptyResultDataAccessException) { throw new NotFoundException(emptyResultDataAccessException.getMessage()); } return new ResponseEntity<>("Counterparty deleted", HttpStatus.NO_CONTENT); }
Source:
<code>public void acceptsNoContentLengthOnClosedConnection() throws Exception { final String text = "Close Test"; final ByteArrayOutputStream output = new ByteArrayOutputStream(); final ServerSocket server = new ServerSocket(0); try { new Thread( new Runnable() { @Override public void run() { try { new BkBasic(new TkText(text)).accept( server.accept() ); } catch (final IOException exception) { throw new IllegalStateException(exception); } } } ).start(); final Socket socket = new Socket( server.getInetAddress(), server.getLocalPort() ); try { socket.getOutputStream().write( Joiner.on(BkBasicTest.CRLF).join( BkBasicTest.POST, BkBasicTest.HOST, "Connection: Close", "", <START> BkBasicTest.HELLO_WORLD <END> ).getBytes() ); final InputStream input = socket.getInputStream(); final byte[] buffer = new byte[4096]; for (int count = input.read(buffer); count != -1; count = input.read(buffer)) { output.write(buffer, 0, count); } } finally { socket.close(); } } finally { server.close(); } MatcherAssert.assertThat( output.toString(), Matchers.containsString(text) ); }</code><technical_language>@dalifreire change this string else is specific this test</technical_language>

Target:
public void acceptsNoContentLengthOnClosedConnection() throws Exception { final String text = "Close Test"; final ByteArrayOutputStream output = new ByteArrayOutputStream(); final ServerSocket server = new ServerSocket(0); final String greetings = "Hi everyone"; try { new Thread( new Runnable() { @Override public void run() { try { new BkBasic(new TkText(text)).accept( server.accept() ); } catch (final IOException exception) { throw new IllegalStateException(exception); } } } ).start(); final Socket socket = new Socket( server.getInetAddress(), server.getLocalPort() ); try { socket.getOutputStream().write( Joiner.on(BkBasicTest.CRLF).join( BkBasicTest.POST, BkBasicTest.HOST, "Connection: Close", "", greetings ).getBytes() ); final InputStream input = socket.getInputStream(); final byte[] buffer = new byte[4096]; for (int count = input.read(buffer); count != -1; count = input.read(buffer)) { output.write(buffer, 0, count); } } finally { socket.close(); } } finally { server.close(); } MatcherAssert.assertThat( output.toString(), Matchers.containsString(text) ); }
Source:
<code>protected void setPaymentAccountsCellFactory() { paymentAccountsListView.setCellFactory(new Callback<>() { @Override public ListCell<PaymentAccount> call(ListView<PaymentAccount> list) { return new ListCell<>() { final InfoAutoTooltipLabel label = new InfoAutoTooltipLabel("", ContentDisplay.RIGHT); final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON); final Button removeButton = new AutoTooltipButton("", icon); final AnchorPane pane = new AnchorPane(label, removeButton); { label.setLayoutY(5); removeButton.setId("icon-button"); AnchorPane.setRightAnchor(removeButton, 0d); } @Override public void updateItem(final PaymentAccount item, boolean empty) { super.updateItem(item, empty); if (item != null && !empty) { label.setText(item.getAccountName()); boolean needsSigning = PaymentMethod.hasChargebackRisk(item.getPaymentMethod(), item.getTradeCurrencies()); if (needsSigning) { AccountAgeWitnessService.SignState signState = accountAgeWitnessService.getSignState(accountAgeWitnessService.getMyWitness( item.paymentAccountPayload)); String info = StringUtils.capitalize(signState.getPresentation()); switch (signState) { case PEER_SIGNER: case ARBITRATOR: <START> case PEER_LIMIT_LIFTED: case PEER_INITIAL: <END> label.setIcon(MaterialDesignIcon.APPROVAL, info); break; default: label.setIcon(MaterialDesignIcon.ALERT_CIRCLE_OUTLINE, info); } } else { label.hideIcon(); } removeButton.setOnAction(e -> onDeleteAccount(item)); setGraphic(pane); } else { setGraphic(null); } } }; } }); }</code><technical_language>discussed show approval icon for signer accounts. other state user trade caution</technical_language>

Target:
protected void setPaymentAccountsCellFactory() { paymentAccountsListView.setCellFactory(new Callback<>() { @Override public ListCell<PaymentAccount> call(ListView<PaymentAccount> list) { return new ListCell<>() { final InfoAutoTooltipLabel label = new InfoAutoTooltipLabel("", ContentDisplay.RIGHT); final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON); final Button removeButton = new AutoTooltipButton("", icon); final AnchorPane pane = new AnchorPane(label, removeButton); { label.setLayoutY(5); removeButton.setId("icon-button"); AnchorPane.setRightAnchor(removeButton, 0d); } @Override public void updateItem(final PaymentAccount item, boolean empty) { super.updateItem(item, empty); if (item != null && !empty) { label.setText(item.getAccountName()); boolean needsSigning = PaymentMethod.hasChargebackRisk(item.getPaymentMethod(), item.getTradeCurrencies()); if (needsSigning) { AccountAgeWitnessService.SignState signState = accountAgeWitnessService.getSignState(accountAgeWitnessService.getMyWitness( item.paymentAccountPayload)); String info = StringUtils.capitalize(signState.getPresentation()); switch (signState) { case PEER_SIGNER: case ARBITRATOR: label.setIcon(MaterialDesignIcon.APPROVAL, info); break; default: label.setIcon(MaterialDesignIcon.ALERT_CIRCLE_OUTLINE, info); } } else { label.hideIcon(); } removeButton.setOnAction(e -> onDeleteAccount(item)); setGraphic(pane); } else { setGraphic(null); } } }; } }); }