auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private String resolveHostNetworkAddress(String networkName, Function<VdsNetworkInterface, String> ipFunction) { if (networkName == null) { return null; } return host.getInterfaces() .stream() .filter(new InterfaceByNetworkNamePredicate(networkName)) .map(ipFunction) <START> .filter(e -> e != null) <END> .findFirst() .orElse(null); }</code><technical_language>Please consider Objects::nonNull instead of lambda</technical_language>

Target:
private String resolveHostNetworkAddress(String networkName, Function<VdsNetworkInterface, String> ipFunction) { if (networkName == null) { return null; } return host.getInterfaces() .stream() .filter(new InterfaceByNetworkNamePredicate(networkName)) .map(ipFunction) .filter(Objects::nonNull) .findFirst() .orElse(null); }
Source:
<code>static void call(Button b, final String project) { b.setEnabled(false); new CreateChangeDialog(b, new Project.NameKey(project)) { { <START> sendButton.setText("Create"); message.setText("Insert the description of the change."); <END> } @Override public void onSend() { ChangeApi.createChange(project, getDestinationBranch(), message.getText(), new GerritCallback<ChangeInfo>() { @Override public void onSuccess(ChangeInfo result) { sent = true; hide(); Gerrit.display(PageLinks.toChange(result.legacy_id())); } @Override public void onFailure(Throwable caught) { enableButtons(true); super.onFailure(caught); } }); } }.center(); }</code><technical_language>hard-coding texts here, defined in a .properties file translated</technical_language>

Target:
static void call(Button b, final String project) { b.setEnabled(false); new CreateChangeDialog(b, new Project.NameKey(project)) { { sendButton.setText(Util.C.buttonCreate()); message.setText(Util.C.buttonCreateDescription()); } @Override public void onSend() { ChangeApi.createChange(project, getDestinationBranch(), message.getText(), new GerritCallback<ChangeInfo>() { @Override public void onSuccess(ChangeInfo result) { sent = true; hide(); Gerrit.display(PageLinks.toChange(result.legacy_id())); } @Override public void onFailure(Throwable caught) { enableButtons(true); super.onFailure(caught); } }); } }.center(); }
Source:
<code>private void addPolicies(EntitySpec<?> entitySpec, Object policies) { List<PolicySpec<?>> policySpecs = new ArrayList<PolicySpec<? extends Policy>>(); if (policies instanceof Iterable) { for (Object policy : (Iterable<Object>)policies) { if (policy instanceof Map) { String policyTypeName = ((Map<?, ?>) policy).get("policyType").toString(); Class<? extends Policy> policyType = null; try { <START> policyType = (Class<? extends Policy>) Class.forName(policyTypeName); <END> } catch (ClassNotFoundException e) { throw Exceptions.propagate(e); } policySpecs.add(PolicySpec.create(policyType) .configure((Map<?, ?>) ((Map<?, ?>) policy).get("brooklyn.config"))); } else { throw new IllegalArgumentException("policy should be map, not " + policy.getClass()); } } } else if (policies != null) { throw new IllegalArgumentException("policies body should be iterable, not " + policies.getClass()); } if (policySpecs.size() > 0) { entitySpec.policySpecs(policySpecs); } }</code><technical_language>this is done for entities. BasicBrooklynCatalog.loadClassByType load policies entity classes? BrooklynAssemblyTemplateInstantiator.loadEntityType, for a policy equivalent</technical_language>

Target:
private void addPolicies(EntitySpec<?> entitySpec, Object policies) { List<PolicySpec<?>> policySpecs = new ArrayList<PolicySpec<? extends Policy>>(); if (policies instanceof Iterable) { for (Object policy : (Iterable<Object>)policies) { if (policy instanceof Map) { String policyTypeName = ((Map<?, ?>) policy).get("policyType").toString(); Class<? extends Policy> policyType = null; try { policyType = (Class<? extends Policy>) Class.forName(policyTypeName); } catch (ClassNotFoundException e) { throw Exceptions.propagate(e); } policySpecs.add(toCorePolicySpec(policyType, (Map<?, ?>) ((Map<?, ?>) policy).get("brooklyn.config"))); } else { throw new IllegalArgumentException("policy should be map, not " + policy.getClass()); } } } else if (policies != null) { throw new IllegalArgumentException("policies body should be iterable, not " + policies.getClass()); } if (policySpecs.size() > 0) { entitySpec.policySpecs(policySpecs); } }
Source:
<code>public void testValidateUniqueProxyId() throws Exception { Settings settings = new Settings(); Proxy proxy = new Proxy(); String id = null; <START> proxy.setId(null); <END> proxy.setHost("www.example.com"); settings.addProxy( proxy ); settings.addProxy( proxy ); SimpleProblemCollector problems = new SimpleProblemCollector(); validator.validate( settings, problems ); assertEquals( 1, problems.messages.size() ); assertContains( problems.messages.get( 0 ), "'proxies.proxy.id' must be unique" + " but found duplicate proxy with id " + null); }</code><technical_language>test set null</technical_language>

Target:
public void testValidateUniqueProxyId() throws Exception { Settings settings = new Settings(); Proxy proxy = new Proxy(); String id = null; proxy.setId(id); proxy.setHost("www.example.com"); settings.addProxy( proxy ); settings.addProxy( proxy ); SimpleProblemCollector problems = new SimpleProblemCollector(); validator.validate( settings, problems ); assertEquals( 1, problems.messages.size() ); assertContains( problems.messages.get( 0 ), "'proxies.proxy.id' must be unique" + " but found duplicate proxy with id " + id); }
Source:
<code>private boolean continueWithNotice(Event event) { String nodeID = event.hasNodeid() ? String.valueOf(event.getNodeid()) : null; String ipAddr = event.getInterface(); String service = event.getService(); boolean continueNotice = false; <START> if(nodeID == null) { <END> return false; } if (nodeID == null || ipAddr == null || service == null || ipAddr.equals("0.0.0.0")) { LOG.debug("nodeID={} ipAddr={} service={}. Not checking DB, continuing...", nodeID, ipAddr, service); return true; } try { String notify = getNotificationManager().getServiceNoticeStatus(nodeID, ipAddr, service); if ("Y".equals(notify)) { continueNotice = true; LOG.debug("notify status for service on interface/node {}/{} is 'Y', continuing...", service, ipAddr, nodeID); } else { LOG.debug("notify status for service on interface/node {}/{} is {}, not continuing...", service, ipAddr, nodeID, notify); } } catch (Throwable e) { continueNotice = true; LOG.error("Not able to get notify status for service on interface/node {}/{}. Continuing notice... {}", service, ipAddr, nodeID, e.getMessage()); } return continueNotice; }</code><technical_language>if interface and/or service is null? run problem</technical_language>

Target:
private boolean continueWithNotice(Event event) { String nodeID = event.hasNodeid() ? String.valueOf(event.getNodeid()) : null; String ipAddr = event.getInterface(); String service = event.getService(); boolean continueNotice = false; if (nodeID == null || ipAddr == null || service == null || ipAddr.equals("0.0.0.0")) { LOG.debug("nodeID={} ipAddr={} service={}. Not checking DB, continuing...", nodeID, ipAddr, service); return true; } try { String notify = getNotificationManager().getServiceNoticeStatus(nodeID, ipAddr, service); if ("Y".equals(notify)) { continueNotice = true; LOG.debug("notify status for service on interface/node {}/{} is 'Y', continuing...", service, ipAddr, nodeID); } else { LOG.debug("notify status for service on interface/node {}/{} is {}, not continuing...", service, ipAddr, nodeID, notify); } } catch (Throwable e) { continueNotice = true; LOG.error("Not able to get notify status for service on interface/node {}/{}. Continuing notice... {}", service, ipAddr, nodeID, e.getMessage()); } return continueNotice; }
Source:
<code><START> public int requestThrottleInflight() { <END> if (requestThrottler != null) { return requestThrottler.getInflight(); } return 0; }</code><technical_language>consider this private called elsewhere</technical_language>

Target:
private int requestThrottleInflight() { if (requestThrottler != null) { return requestThrottler.getInflight(); } return 0; }
Source:
<code>public static int findNodeId(Cluster cluster, HostMatcher matcher) { if(isSingleLocalCluster(cluster, matcher)) { int nodeId = cluster.getNodeIds().iterator().next(); logger.info(" Cluster is a single local node cluster. Node Id " + nodeId); return nodeId; } List<Node> matches = Lists.newArrayList(); for(Node node: cluster.getNodes()) { if(matcher.match(node)) { logger.info(node.briefToString() + " matched the current cluster "); matches.add(node); } } if(matches.isEmpty()) { throw new VoldemortApplicationException(" No nodes in the cluster matched the current node " + Arrays.toString(cluster.getNodes().toArray())); } else if ( matches.size() > 1) { throw new VoldemortApplicationException(" More than one node matched " + Arrays.toString(matches.toArray())); } else { <START> logger.info(" computed node Id match successfully " + matches.get(0).briefToString()); <END> return matches.get(0).getId(); } }</code><technical_language>I this in logs</technical_language>

Target:
public static int findNodeId(Cluster cluster, HostMatcher matcher) { logger.info(" Using Matcher " + matcher.getDebugInfo()); if(isSingleLocalCluster(cluster, matcher)) { int nodeId = cluster.getNodeIds().iterator().next(); logger.info(" Cluster is a single local node cluster. Node Id " + nodeId); return nodeId; } List<Node> matches = Lists.newArrayList(); for(Node node: cluster.getNodes()) { if(matcher.match(node)) { logger.info(node.briefToString() + " matched the current cluster "); matches.add(node); } } if(matches.isEmpty()) { throw new VoldemortApplicationException(" No nodes in the cluster matched the current node " + Arrays.toString(cluster.getNodes().toArray())); } else if ( matches.size() > 1) { String errorMessage = " More than one node matched " + Arrays.toString(matches.toArray()); logger.error(errorMessage); throw new VoldemortApplicationException(errorMessage); } else { logger.info(" computed node Id match successfully " + matches.get(0).briefToString()); return matches.get(0).getId(); } }
Source:
<code>default int getSizeOfProperty(JsonObject object) throws DataException { <START> if (object != null) { <END> try { JsonArray jsonArray = (JsonArray) object.get(this.toString()); return jsonArray.size(); } catch (RuntimeException e) { throw new DataException("Not possible to retrieve size of array for key " + this.toString() + ". Exception: " + e.getMessage()); } } return 0; }</code><technical_language>add a null check in other methods access JsonObject in way? switch Objects.nonNull call</technical_language>

Target:
default int getSizeOfProperty(JsonObject object) throws DataException { if (Objects.nonNull(object)) { try { return object.getJsonArray(this.toString()).size(); } catch (ClassCastException | NullPointerException e) { throw new DataException("Not possible to retrieve size of array for key " + this.toString() + ". Exception: " + e.getMessage()); } } return 0; }
Source:
<code>protected void introDefaultInstance(CodeWriter writer, EntityType model, String defaultName) throws IOException { <START> String simpleName = !defaultName.isEmpty() ? defaultName : variableNameFunction.apply(model); <END> Type queryType = typeMappings.getPathType(model, model, true); String alias = simpleName; if (keywords.contains(simpleName.toUpperCase())) { alias += "1"; } writer.publicStaticFinal(queryType, simpleName, NEW + queryType.getSimpleName() + "(\"" + alias + "\")"); }</code><technical_language>need preserve escaping functionality of getUncapSimpleName(), reason for QPublic QPrivate issues (public private variable names)</technical_language>

Target:
protected void introDefaultInstance(CodeWriter writer, EntityType model, String defaultName) throws IOException { String simpleName = !defaultName.isEmpty() ? defaultName : model.getModifiedSimpleName(); Type queryType = typeMappings.getPathType(model, model, true); String alias = simpleName; if (keywords.contains(simpleName.toUpperCase())) { alias += "1"; } writer.publicStaticFinal(queryType, simpleName, NEW + queryType.getSimpleName() + "(\"" + alias + "\")"); }
Source:
<code>private boolean internalValidateAndSetQuota() { <START> if (isInternalExecution()) { <END> return true; } if (getStoragePool() == null && getActionType().getQuotaDependency() != VdcActionType.QuotaDependency.NONE) { log.error("Command: " + this.getClass().getName() + ". Storage pool is not available for quota calculation. "); return false; } QuotaConsumptionParametersWrapper quotaConsumptionParametersWrapper = new QuotaConsumptionParametersWrapper(this, getReturnValue().getCanDoActionMessages()); quotaConsumptionParametersWrapper.setParameters(getQuotaConsumptionParameters()); return true; }</code><technical_language>explain</technical_language>

Target:
private boolean internalValidateAndSetQuota() { if (isInternalExecution()) { return true; } if (getStoragePool() == null && isQuotaDependant()) { log.error("Command: " + this.getClass().getName() + ". Storage pool is not available for quota calculation. "); return false; } QuotaConsumptionParametersWrapper quotaConsumptionParametersWrapper = new QuotaConsumptionParametersWrapper(this, getReturnValue().getCanDoActionMessages()); quotaConsumptionParametersWrapper.setParameters(getQuotaConsumptionParameters()); return true; }
Source:
<code>protected void executeCommand() { if (getParameters().getRefresh() || getSessionDataContainer().isSsoOvirtAppApiScope(getParameters().getSessionId())) { getSessionDataContainer().updateSessionLastActiveTime(getParameters().getSessionId()); } if (validatePermissions()) { if (validateInputs()) { long start = System.currentTimeMillis(); try { returnValue.setSucceeded(true); executeQueryCommand(); } catch (RuntimeException ex) { returnValue.setSucceeded(false); Throwable th = ex instanceof EngineException ? ex : ex.getCause(); if (th instanceof EngineException) { EngineException vdcExc = (EngineException) th; if (vdcExc.getErrorCode() != null && !vdcExc.isUseRootCause()) { returnValue.setExceptionString(vdcExc.getErrorCode().toString()); } else { <START> returnValue.setExceptionString(vdcExc.isUseRootCause() ? ExceptionUtils.getRootCauseMessage(vdcExc) : vdcExc.getMessage()); <END> } log.error("Query '{}' failed: {}", getClass().getSimpleName(), vdcExc.isUseRootCause() ? ExceptionUtils.getRootCauseMessage(vdcExc) : vdcExc.getMessage()); log.error("Exception", vdcExc); } else { returnValue.setExceptionString(ex.getMessage()); log.error("Query '{}' failed: {}", getClass().getSimpleName(), ex.getMessage()); log.error("Exception", ex); } } finally { log.debug("Query took ms", getCommandName(), System.currentTimeMillis() - start); } } else { log.error("Query execution failed due to invalid inputs: {}", returnValue.getExceptionString()); } } else { String errMessage = "Query execution failed due to insufficient permissions."; log.error(errMessage); returnValue.setExceptionString(errMessage); } }</code><technical_language>this logic moved 'vdcExc.getMessage()'</technical_language>

Target:
protected void executeCommand() { if (getParameters().getRefresh() || getSessionDataContainer().isSsoOvirtAppApiScope(getParameters().getSessionId())) { getSessionDataContainer().updateSessionLastActiveTime(getParameters().getSessionId()); } if (validatePermissions()) { if (validateInputs()) { long start = System.currentTimeMillis(); try { returnValue.setSucceeded(true); executeQueryCommand(); } catch (RuntimeException ex) { returnValue.setSucceeded(false); Throwable th = ex instanceof EngineException ? ex : ex.getCause(); if (th instanceof EngineException) { EngineException vdcExc = (EngineException) th; if (vdcExc.getErrorCode() != null && !vdcExc.isUseRootCause()) { returnValue.setExceptionString(vdcExc.getErrorCode().toString()); } else { returnValue.setExceptionString(vdcExc.getMessage()); } log.error("Query '{}' failed: {}", getClass().getSimpleName(), vdcExc.getMessage()); log.error("Exception", vdcExc); } else { returnValue.setExceptionString(ex.getMessage()); log.error("Query '{}' failed: {}", getClass().getSimpleName(), ex.getMessage()); log.error("Exception", ex); } } finally { log.debug("Query took ms", getCommandName(), System.currentTimeMillis() - start); } } else { log.error("Query execution failed due to invalid inputs: {}", returnValue.getExceptionString()); } } else { String errMessage = "Query execution failed due to insufficient permissions."; log.error(errMessage); returnValue.setExceptionString(errMessage); } }
Source:
<code>public void perform(GraphRewrite event, EvaluationContext context) { List<FileModel> inputPaths = WindupConfigurationService.getConfigurationModel(event.getGraphContext()) .getInputPaths(); <START> if (Iterables.size(inputPaths) > 1) <END> { createGlobalAppDependencyGraphReport(event.getGraphContext()); } inputPaths.stream() .filter(inputPath -> !ProjectModel.TYPE_VIRTUAL.equals(inputPath.getProjectModel().getProjectType())) .forEach(inputPath -> createSingleAppDependencyGraphReport(event.getGraphContext(), inputPath.getProjectModel())); }</code><technical_language>this Iterables.size instead of a simple inputPaths.size() ? choices "null protected"</technical_language>

Target:
public void perform(GraphRewrite event, EvaluationContext context) { List<FileModel> inputPaths = WindupConfigurationService.getConfigurationModel(event.getGraphContext()) .getInputPaths(); if (inputPaths.size() > 1) { createGlobalAppDependencyGraphReport(event.getGraphContext()); } inputPaths.stream() .filter(inputPath -> !ProjectModel.TYPE_VIRTUAL.equals(inputPath.getProjectModel().getProjectType())) .forEach(inputPath -> createSingleAppDependencyGraphReport(event.getGraphContext(), inputPath.getProjectModel())); }
Source:
<code>public void loadBuildData(@NotNull Properties properties) { loadBuildVersionAndTimeData(properties); loadBuildHostData(properties); <START> loadBuildNumber(System.getenv(), properties); <END> }</code><technical_language>Change loadBuildNumber(System.getenv(), properties); loadBuildNumber(properties); BuildServerDataProvider a reference env..</technical_language>

Target:
public void loadBuildData(@NotNull Properties properties) { loadBuildVersionAndTimeData(properties); loadBuildHostData(properties); loadBuildNumber(properties); }
Source:
<code>public MaxwellKafkaProducer(MaxwellContext context, Properties kafkaProperties, String kafkaTopic) { super(context); this.queue = new ArrayBlockingQueue<>(100); <START> BlockingQueue<Runnable> runQueue = new ArrayBlockingQueue<>(100); <END> this.worker = new MaxwellKafkaProducerWorker(context, kafkaProperties, kafkaTopic, this.queue); Thread thread = new Thread(this.worker, "maxwell-kafka-worker"); thread.setDaemon(true); thread.start(); }</code><technical_language>Is runQueue anywhere</technical_language>

Target:
public MaxwellKafkaProducer(MaxwellContext context, Properties kafkaProperties, String kafkaTopic) { super(context); this.queue = new ArrayBlockingQueue<>(100); this.worker = new MaxwellKafkaProducerWorker(context, kafkaProperties, kafkaTopic, this.queue); Thread thread = new Thread(this.worker, "maxwell-kafka-worker"); thread.setDaemon(true); thread.start(); }
Source:
<code>protected @Nonnull Set<String> loadPluginsFromWar(@Nonnull String fromPath, @CheckForNull FilenameFilter filter) { Set<String> names = new HashSet(); ServletContext context = Jenkins.getInstance().servletContext; Set<String> plugins = Util.fixNull((Set<String>) context.getResourcePaths(fromPath)); Set<URL> copiedPlugins = new HashSet<>(); <START> Set<URL> dependencies = new HashSet<>(); <END> for( String pluginPath : plugins) { String fileName = pluginPath.substring(pluginPath.lastIndexOf('/')+1); if(fileName.length()==0) { continue; } try { names.add(fileName); URL url = context.getResource(pluginPath); if (filter != null) { if (!filter.accept(new File(url.getFile()), fileName)) { continue; } } copyBundledPlugin(url, fileName); copiedPlugins.add(url); try { addDependencies(url, fromPath, dependencies); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to resolve dependencies for the bundled plugin " + fileName, e); } } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to extract the bundled plugin "+fileName,e); } } for (URL dependency : dependencies) { if (copiedPlugins.contains(dependency)) { continue; } String fileName = new File(dependency.getFile()).getName(); try { names.add(fileName); copyBundledPlugin(dependency, fileName); copiedPlugins.add(dependency); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to extract the bundled dependency plugin " + fileName, e); } } return names; }</code><technical_language>URL in hashset</technical_language>

Target:
protected @Nonnull Set<String> loadPluginsFromWar(@Nonnull String fromPath, @CheckForNull FilenameFilter filter) { Set<String> names = new HashSet(); ServletContext context = Jenkins.getInstance().servletContext; Set<String> plugins = Util.fixNull((Set<String>) context.getResourcePaths(fromPath)); Set<URL> copiedPlugins = new HashSet<>(); Set<URL> dependencies = new HashSet<>(); for( String pluginPath : plugins) { String fileName = pluginPath.substring(pluginPath.lastIndexOf('/')+1); if(fileName.length()==0) { continue; } try { URL url = context.getResource(pluginPath); if (filter != null && url != null) { if (!filter.accept(new File(url.getFile()).getParentFile(), fileName)) { continue; } } names.add(fileName); copyBundledPlugin(url, fileName); copiedPlugins.add(url); try { addDependencies(url, fromPath, dependencies); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to resolve dependencies for the bundled plugin " + fileName, e); } } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to extract the bundled plugin "+fileName,e); } } for (URL dependency : dependencies) { if (copiedPlugins.contains(dependency)) { continue; } String fileName = new File(dependency.getFile()).getName(); try { names.add(fileName); copyBundledPlugin(dependency, fileName); copiedPlugins.add(dependency); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to extract the bundled dependency plugin " + fileName, e); } } return names; }
Source:
<code>public List<ScanFilter> getScanFilters() { List<ScanFilter> scanFilterList = new ArrayList<>(); try { scanFilterList.addAll( GenericFilterUtility.getScanFilter( incTagList.getSelectedValuesList(), excTagList.getSelectedValuesList(), TagScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.getScanFilter( methodList.getSelectedValuesList(), null, MethodScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.getScanFilter( codeList.getSelectedValuesList(), null, HttpStatusCodeScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.getScanFilter( strToRegexList(regexInc.getText()), strToRegexList(regexExc.getText()), UrlPatternScanFilter::new)); <START> } catch (PatternSyntaxException e1) { <END> throw e1; } return scanFilterList; }</code><technical_language>catch re-throw</technical_language>

Target:
public List<ScanFilter> getScanFilters() { List<ScanFilter> scanFilterList = new ArrayList<>(); scanFilterList.addAll( GenericFilterUtility.createScanFilter( incTagList.getSelectedValuesList(), excTagList.getSelectedValuesList(), TagScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.createScanFilter( methodList.getSelectedValuesList(), null, MethodScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.createScanFilter( codeList.getSelectedValuesList(), null, HttpStatusCodeScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.createScanFilter( strToRegexList(regexInc.getText()), strToRegexList(regexExc.getText()), UrlPatternScanFilter::new)); return scanFilterList; }
Source:
<code><START> public List<UpgradeCheck> getFilteredUpgradeChecks(UpgradePack upgradePack) throws AmbariException { <END> List<UpgradeCheck> upgradeChecks = new ArrayList<>(); upgradeChecks.addAll(m_builtInChecks); Set<UpgradeCheck> pluginChecks = m_pluginChecks.get(upgradePack); if (null == pluginChecks) { pluginChecks = new TreeSet<>(new PreUpgradeCheckComparator()); m_pluginChecks.put(upgradePack, pluginChecks); List<String> pluginCheckClassNames = upgradePack.getPrerequisiteChecks(); if (null != pluginCheckClassNames && !pluginCheckClassNames.isEmpty()) { StackId ownerStackId = upgradePack.getOwnerStackId(); StackInfo stackInfo = metainfoProvider.get().getStack(ownerStackId); ClassLoader classLoader = stackInfo.getLibraryClassLoader(); if (null != classLoader) { for (String pluginCheckClassName : pluginCheckClassNames) { try { Class<? extends UpgradeCheck> upgradeCheckClass = (Class<? extends UpgradeCheck>) classLoader.loadClass( pluginCheckClassName); pluginChecks.add(upgradeCheckClass.newInstance()); LOG.info("Registered pre-upgrade check for stack {}", upgradeCheckClass, ownerStackId); } catch (Exception exception) { LOG.error("Unable to load the upgrade check {}", pluginCheckClassName, exception); } } } else { LOG.error( "Unable to perform the following upgrade checks because no libraries could be loaded for the stack: {}", ownerStackId, StringUtils.join(pluginCheckClassNames, ",")); } } } final Set<UpgradeCheck> combinedUpgradeChecks = new TreeSet<>(new PreUpgradeCheckComparator()); combinedUpgradeChecks.addAll(m_builtInChecks); combinedUpgradeChecks.addAll(pluginChecks); return new LinkedList<>(combinedUpgradeChecks); }</code><technical_language>ability parameterize some classes upgrade pack. Do need consider case defines Ambari class properties? open a jira if this is need allow</technical_language>

Target:
public List<UpgradeCheck> getFilteredUpgradeChecks(UpgradePack upgradePack) throws AmbariException { List<UpgradeCheck> builtInRequiredChecks = new ArrayList<>(); for (UpgradeCheck builtInCheck : m_builtInChecks) { if (isBuiltInCheckRequired(builtInCheck, upgradePack.getType())) { builtInRequiredChecks.add(builtInCheck); } } Set<UpgradeCheck> pluginChecks = m_pluginChecks.get(upgradePack); if (null == pluginChecks) { pluginChecks = new TreeSet<>(new PreUpgradeCheckComparator()); m_pluginChecks.put(upgradePack, pluginChecks); List<String> pluginCheckClassNames = upgradePack.getPrerequisiteChecks(); if (null != pluginCheckClassNames && !pluginCheckClassNames.isEmpty()) { loadPluginUpgradeChecksFromStack(upgradePack, pluginChecks); } } final Set<UpgradeCheck> combinedUpgradeChecks = new TreeSet<>(new PreUpgradeCheckComparator()); combinedUpgradeChecks.addAll(builtInRequiredChecks); combinedUpgradeChecks.addAll(pluginChecks); return new LinkedList<>(combinedUpgradeChecks); }
Source:
<code>public void TestLoadConfig() { ApplicationRunnerMain.ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerMain.ApplicationRunnerCommandLine(); OptionSet options = cmdLine.parser().parse( "--config-loader-factory", "org.apache.samza.config.loaders.PropertiesConfigLoaderFactory", "--config-loader-properties", "path=" + getClass().getResource("/test.properties").getPath(), "-config", String.format("%s=%s", ApplicationConfig.APP_CLASS, MockStreamApplication.class.getName()), "-config", String.format("app.runner.class=%s", TestApplicationRunnerInvocationCounts.class.getName())); Config actual = cmdLine.loadConfig(options); <START> assertEquals(4, actual.size()); assertEquals("org.apache.samza.config.loaders.PropertiesConfigLoaderFactory", actual.get(JobConfig.CONFIG_LOADER_FACTORY)); assertEquals( getClass().getResource("/test.properties").getPath(), actual.get(ConfigLoaderFactory.CONFIG_LOADER_PROPERTIES_PREFIX + "path")); assertEquals(MockStreamApplication.class.getName(), actual.get(ApplicationConfig.APP_CLASS)); assertEquals(TestApplicationRunnerInvocationCounts.class.getName(), actual.get("app.runner.class")); <END> }</code><technical_language>Minor suggestion: Instead of needing check size individual entry, build expected config map do equals check</technical_language>

Target:
public void TestLoadConfig() { ApplicationRunnerMain.ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerMain.ApplicationRunnerCommandLine(); OptionSet options = cmdLine.parser().parse( "--config-loader-factory", "org.apache.samza.config.loaders.PropertiesConfigLoaderFactory", "--config-loader-properties", "path=" + getClass().getResource("/test.properties").getPath(), "-config", String.format("%s=%s", ApplicationConfig.APP_CLASS, MockStreamApplication.class.getName()), "-config", String.format("app.runner.class=%s", TestApplicationRunnerInvocationCounts.class.getName())); Config actual = cmdLine.loadConfig(options); Config expected = new MapConfig(ImmutableMap.of( JobConfig.CONFIG_LOADER_FACTORY, "org.apache.samza.config.loaders.PropertiesConfigLoaderFactory", ConfigLoaderFactory.CONFIG_LOADER_PROPERTIES_PREFIX + "path", getClass().getResource("/test.properties").getPath(), ApplicationConfig.APP_CLASS, MockStreamApplication.class.getName(), "app.runner.class", TestApplicationRunnerInvocationCounts.class.getName())); assertEquals(expected, actual); }
Source:
<code>CompletableFuture<Acknowledge> runApplicationAndShutdownClusterAsync( final DispatcherGateway dispatcher, final ScheduledExecutor scheduledExecutor) { applicationCompletionFuture = runApplicationAsync(dispatcher, scheduledExecutor, false); return applicationCompletionFuture .handle((r, t) -> { final ApplicationStatus applicationStatus; if (t != null) { <START> applicationStatus = t instanceof CancellationException <END> ? ApplicationStatus.CANCELED : ApplicationStatus.FAILED; LOG.warn("Application {}: ", applicationStatus, t); } else { applicationStatus = ApplicationStatus.SUCCEEDED; LOG.info("Application completed SUCCESSFULLY"); } return dispatcher.shutDownCluster(applicationStatus); }) .thenCompose(Function.identity()); }</code><technical_language>I tested a YARN cluster, effect here. i cancel Flink job, application status is FAILED</technical_language>

Target:
CompletableFuture<Acknowledge> runApplicationAndShutdownClusterAsync( final DispatcherGateway dispatcher, final ScheduledExecutor scheduledExecutor) { applicationCompletionFuture = fixJobIdAndRunApplicationAsync(dispatcher, scheduledExecutor); return applicationCompletionFuture .handle((r, t) -> { final ApplicationStatus applicationStatus; if (t != null) { final Optional<JobCancellationException> cancellationException = ExceptionUtils.findThrowable(t, JobCancellationException.class); if (cancellationException.isPresent()) { applicationStatus = ApplicationStatus.CANCELED; } else if (t instanceof CancellationException) { applicationStatus = ApplicationStatus.UNKNOWN; } else { applicationStatus = ApplicationStatus.FAILED; } LOG.warn("Application {}: ", applicationStatus, t); } else { applicationStatus = ApplicationStatus.SUCCEEDED; LOG.info("Application completed SUCCESSFULLY"); } return dispatcher.shutDownCluster(applicationStatus); }) .thenCompose(Function.identity()); }
Source:
<code>CloseableIterator<RepresentativeReadIndexer> representativeReadIndicesIterator() { <START> return this.representativeReadIndicesForDuplicates.iterator(); <END> }</code><technical_language>this. here? delete elsewhere</technical_language>

Target:
CloseableIterator<RepresentativeReadIndexer> representativeReadIndicesIterator() { return representativeReadIndicesForDuplicates.iterator(); }
Source:
<code>public synchronized void add(byte[] data, int offset, int count) throws IOException { <START> if (data == null) throw new NullPointerException("data == null"); <END> if ((offset | count) < 0 || count > data.length - offset) { throw new IndexOutOfBoundsException(); } expandIfNecessary(count); boolean wasEmpty = isEmpty(); int position = wasEmpty ? HEADER_LENGTH : wrapPosition(last.position + Element.HEADER_LENGTH + last.length); Element newLast = new Element(position, count); writeInt(buffer, 0, count); ringWrite(newLast.position, buffer, 0, Element.HEADER_LENGTH); ringWrite(newLast.position + Element.HEADER_LENGTH, data, offset, count); int firstPosition = wasEmpty ? newLast.position : first.position; writeHeader(fileLength, elementCount + 1, firstPosition, newLast.position); last = newLast; elementCount++; if (wasEmpty) first = last; }</code><technical_language>conventions from, this consistent other places as: if (data == null) { throw new NullPointerException("data == null"); }</technical_language>

Target:
public synchronized void add(byte[] data, int offset, int count) throws IOException { if (data == null) { throw new NullPointerException("data == null"); } if ((offset | count) < 0 || count > data.length - offset) { throw new IndexOutOfBoundsException(); } expandIfNecessary(count); boolean wasEmpty = isEmpty(); int position = wasEmpty ? HEADER_LENGTH : wrapPosition(last.position + Element.HEADER_LENGTH + last.length); Element newLast = new Element(position, count); writeInt(buffer, 0, count); ringWrite(newLast.position, buffer, 0, Element.HEADER_LENGTH); ringWrite(newLast.position + Element.HEADER_LENGTH, data, offset, count); int firstPosition = wasEmpty ? newLast.position : first.position; writeHeader(fileLength, elementCount + 1, firstPosition, newLast.position); last = newLast; elementCount++; if (wasEmpty) first = last; }
Source:
<code>public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof ClientResources) { ClientResources cr = (ClientResources) bean; <START> if (cr.tracing() == null) { <END> return cr.mutate().tracing(BraveTracing.create(this.tracing)).build(); } } return bean; }</code><technical_language>tracing() is null. If tracing is disable, cr.tracing().isEnabled() returns false. I remove condition configure tracing. Conditionality happen a level</technical_language>

Target:
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof ClientResources) { ClientResources cr = (ClientResources) bean; if (!cr.tracing().isEnabled()) { if (log.isDebugEnabled()) { log.debug( "Lettuce ClientResources bean is auto-configured to enable tracing."); } return cr.mutate().tracing(BraveTracing.create(this.tracing)).build(); } if (log.isDebugEnabled()) { log.debug( "Lettuce ClientResources bean is skipped for auto-configuration because tracing was already enabled."); } } return bean; }
Source:
<code>public void testContrib() throws Exception { <START> deployContrib("org.nuxeo.ecm.core.api.tests", "OSGI-INF/test-pathsegment-contrib.xml"); <END> applyInlineDeployments(); PathSegmentService service = Framework.getService(PathSegmentService.class); assertNotNull(service); DocumentModel doc = DocumentModelProxy.newDocumentModel("My Document"); assertEquals("my-document", service.generatePathSegment(doc)); }</code><technical_language>pushInlineDeployments</technical_language>

Target:
public void testContrib() throws Exception { pushInlineDeployments("org.nuxeo.ecm.core.api.tests:OSGI-INF/test-pathsegment-contrib.xml"); PathSegmentService service = Framework.getService(PathSegmentService.class); assertNotNull(service); DocumentModel doc = DocumentModelProxy.newDocumentModel("My Document"); assertEquals("my-document", service.generatePathSegment(doc)); }
Source:
<code>@Override protected void cleanup() { <START> _agsPub.watch(null); <END> TargetSelection.deafTo(getContextTargetObsComp(), selectionListener); getDataObject().removePropertyChangeListener(TargetObsComp.TARGET_ENV_PROP, primaryButtonUpdater); getDataObject().removePropertyChangeListener(TargetObsComp.TARGET_ENV_PROP, guidingPanelUpdater); super.cleanup(); }</code><technical_language>This weird, watch null</technical_language>

Target:
@Override protected void cleanup() { _agsPub.unwatch(); TargetSelection.deafTo(getContextTargetObsComp(), selectionListener); getDataObject().removePropertyChangeListener(TargetObsComp.TARGET_ENV_PROP, primaryButtonUpdater); getDataObject().removePropertyChangeListener(TargetObsComp.TARGET_ENV_PROP, guidingPanelUpdater); super.cleanup(); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mSceneView= findViewById(R.id.sceneView); Portal portal = new Portal(getResources().getString(R.string.portal_url), false); <START> PortalItem portalItem = new PortalItem(portal, "a13c3c3540144967bc933cb5e498b8e4"); <END> ArcGISScene scene = new ArcGISScene(portalItem); mSceneView.setScene(scene); }</code><technical_language>extract string item_id</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mSceneView= findViewById(R.id.sceneView); Portal portal = new Portal(getResources().getString(R.string.portal_url), false); PortalItem portalItem = new PortalItem(portal, getString(R.string.item_id)); ArcGISScene scene = new ArcGISScene(portalItem); mSceneView.setScene(scene); }
Source:
<code>public static String mapToApi(FeedScopedId arg) { if (arg == null) { return null; } <START> return arg.getFeedId() + ":" + arg.getId(); <END> }</code><technical_language>SEPARATOR constant here</technical_language>

Target:
public static String mapToApi(FeedScopedId arg) { if (arg == null) { return null; } return arg.getFeedId() + SEPARATOR + arg.getId(); }
Source:
<code>public static boolean isLocalVariableDef(DetailAST node) { boolean localVariableDef = false; if (TokenUtil.isOfType(node, TokenTypes.VARIABLE_DEF)) { final DetailAST parent = node.getParent(); localVariableDef = TokenUtil.isOfType(parent, TokenTypes.SLIST, TokenTypes.FOR_INIT, TokenTypes.FOR_EACH_CLAUSE); } if (TokenUtil.isOfType(node, TokenTypes.PARAMETER_DEF)) { final DetailAST parent = node.getParent(); localVariableDef = TokenUtil.isOfType(parent.getType(), TokenTypes.LITERAL_CATCH); } <START> if (TokenUtil.isOfType(node, TokenTypes.RESOURCE)) { <END> localVariableDef = true; } return localVariableDef; }</code><technical_language>please restore single node verification ==, is more concise shorter performance is better</technical_language>

Target:
public static boolean isLocalVariableDef(DetailAST node) { boolean localVariableDef = false; if (node.getType() == TokenTypes.VARIABLE_DEF) { final DetailAST parent = node.getParent(); localVariableDef = TokenUtil.isOfType(parent, TokenTypes.SLIST, TokenTypes.FOR_INIT, TokenTypes.FOR_EACH_CLAUSE); } if (node.getType() == TokenTypes.PARAMETER_DEF) { final DetailAST parent = node.getParent(); localVariableDef = parent.getType() == TokenTypes.LITERAL_CATCH; } if (node.getType() == TokenTypes.RESOURCE) { localVariableDef = true; } return localVariableDef; }
Source:
<code>public static String printParameterSummary(final PlottingDetails pdp) { final StringBuilder sb = new StringBuilder(); sb.append("Output:\n<LI>Spectra "); <START> switch (pdp.getPlotLimits()) { <END> case AUTO: sb.append("autoscaled."); break; default: sb.append("plotted over range " + pdp.getPlotWaveL()*1000 + " - " + pdp.getPlotWaveU()*1000); } sb.append("\n"); return sb.toString(); }</code><technical_language>Do need a switch this is overcomplicating if...else a ternary expression? (Sorry if of repeated... I thought I a mistake.)</technical_language>

Target:
public static String printParameterSummary(final PlottingDetails pdp) { final StringBuilder sb = new StringBuilder(); sb.append("Output:\n<LI>Spectra "); switch (pdp.getPlotLimits()) { case AUTO: sb.append("autoscaled."); break; case USER: sb.append("plotted over range " + pdp.getPlotWaveL()*1000 + " - " + pdp.getPlotWaveU()*1000); default: throw new Error(); } sb.append("\n"); return sb.toString(); }
Source:
<code>private static void checkLiteralEvaluatedButNotUsed(@NotNull AnnotationHolder holder, @NotNull PsiElement element, String message) { PsiElement parent = element.getParent(); if (element instanceof GoFunctionLit) { if (parent instanceof GoCallExpr) return; } else if (element instanceof GoStringLiteral || element instanceof GoLiteral) { if (parent instanceof GoIndexOrSliceExpr || parent instanceof GoConditionalExpr) { return; } } parent = PsiTreeUtil.getParentOfType(element, GoLeftHandExprList.class, GoArgumentList.class); if (parent == null) return; if (parent instanceof GoArgumentList) return; if (parent instanceof GoLeftHandExprList && ((GoLeftHandExprList)parent).getExpressionList().size() != 1) { return; } if (element instanceof GoFunctionLit) { element = ((GoFunctionLit)element).getFunc(); <START> } else { <END> if (parent.getParent().getParent() instanceof GoSwitchStatement) return; } holder.createErrorAnnotation(element, message + " literal evaluated but not used"); }</code><technical_language>Code style</technical_language>

Target:
private static void checkLiteralEvaluatedButNotUsed(@NotNull AnnotationHolder holder, @NotNull PsiElement element, String message) { PsiElement parent = element.getParent(); if (element instanceof GoFunctionLit) { if (parent instanceof GoCallExpr) return; } else if (element instanceof GoStringLiteral || element instanceof GoLiteral) { if (parent instanceof GoIndexOrSliceExpr || parent instanceof GoConditionalExpr) { return; } } parent = PsiTreeUtil.getParentOfType(element, GoLeftHandExprList.class, GoArgumentList.class); if (parent == null) return; if (parent instanceof GoArgumentList) return; if (parent instanceof GoLeftHandExprList && ((GoLeftHandExprList)parent).getExpressionList().size() != 1) { return; } if (element instanceof GoFunctionLit) { element = ((GoFunctionLit)element).getFunc(); } else if (parent.getParent().getParent() instanceof GoSwitchStatement) { return; } holder.createErrorAnnotation(element, message + " literal evaluated but not used"); }
Source:
<code><START> public int hashCode() { <END> final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((registry == null) ? 0 : registry.hashCode()); result = prime * result + ((version == null) ? 0 : version.hashCode()); return result; }</code><technical_language>hashCode simpler java @Override public int hashCode() { return Objects.hash(getRegistry(), getId(), getVersion()); } OK current well</technical_language>

Target:
public int hashCode() { return Objects.hash(getRegistry(), getId(), getVersion()); }
Source:
<code>private <R extends Row,T> ListenableFuture<Object> issueRowRequest( final Row row, final Batch.Callback<T> callback, final Object[] results, final int index) { LOG.trace("issueRowRequest(Row, Batch.Callback, Object[], index"); SettableFuture<Object> resultFuture = SettableFuture.create(); results[index] = null; ListenableFuture<? extends GeneratedMessage> future = null; try { future = issueRequest(row); } catch (InterruptedException e) { <START> future = Futures.immediateFailedFuture(e); <END> } Futures.addCallback(future, new RpcResultFutureCallback<T, GeneratedMessage>( row, callback, index, results, resultFuture, ROW_RESULT_CONVERTER), service); return resultFuture; }</code><technical_language>return immediately if this fails</technical_language>

Target:
private <R extends Row, T> ListenableFuture<Object> issueRowRequest(final Row row, final Batch.Callback<T> callback, final Object[] results, final int index) throws InterruptedException { LOG.trace("issueRowRequest(Row, Batch.Callback, Object[], index"); SettableFuture<Object> resultFuture = SettableFuture.create(); results[index] = null; ListenableFuture<? extends GeneratedMessage> future = issueRequest(row); Futures.addCallback(future, new RpcResultFutureCallback<T, GeneratedMessage>( row, callback, index, results, resultFuture, ROW_RESULT_CONVERTER), service); return resultFuture; }
Source:
<code>public void sendAdvertisedRefs(RefAdvertiser adv) throws IOException, ServiceMayNotContinueException { if (advertiseError != null) { adv.writeOne("ERR " + advertiseError); return; } try { advertiseRefsHook.advertiseRefs(this); } catch (ServiceMayNotContinueException fail) { if (fail.getMessage() != null) { adv.writeOne("ERR " + fail.getMessage()); fail.setOutput(); } throw fail; } adv.init(db); adv.advertiseCapability(CAPABILITY_SIDE_BAND_64K); adv.advertiseCapability(CAPABILITY_DELETE_REFS); adv.advertiseCapability(CAPABILITY_REPORT_STATUS); if (allowQuiet) adv.advertiseCapability(CAPABILITY_QUIET); String nonce = getPushCertificateParser().getAdvertiseNonce(); if (nonce != null) { adv.advertiseCapability(nonce); } if (db.getRefDatabase().performsAtomicTransactions()) adv.advertiseCapability(CAPABILITY_ATOMIC); if (allowOfsDelta) adv.advertiseCapability(CAPABILITY_OFS_DELTA); if (allowPushOptions) { adv.advertiseCapability(CAPABILITY_PUSH_OPTIONS); } adv.advertiseCapability(OPTION_AGENT, UserAgent.get()); Map<String, Ref> advertisedOrDefaultRefs = getAdvertisedOrDefaultRefs(); <START> if (advertisedOrDefaultRefs != null) { <END> adv.send(advertisedOrDefaultRefs.values()); } for (ObjectId obj : advertisedHaves) adv.advertiseHave(obj); if (adv.isEmpty()) adv.advertiseId(ObjectId.zeroId(), "capabilities^{}"); adv.end(); }</code><technical_language>I this null</technical_language>

Target:
public void sendAdvertisedRefs(RefAdvertiser adv) throws IOException, ServiceMayNotContinueException { if (advertiseError != null) { adv.writeOne("ERR " + advertiseError); return; } try { advertiseRefsHook.advertiseRefs(this); } catch (ServiceMayNotContinueException fail) { if (fail.getMessage() != null) { adv.writeOne("ERR " + fail.getMessage()); fail.setOutput(); } throw fail; } adv.init(db); adv.advertiseCapability(CAPABILITY_SIDE_BAND_64K); adv.advertiseCapability(CAPABILITY_DELETE_REFS); adv.advertiseCapability(CAPABILITY_REPORT_STATUS); if (allowQuiet) adv.advertiseCapability(CAPABILITY_QUIET); String nonce = getPushCertificateParser().getAdvertiseNonce(); if (nonce != null) { adv.advertiseCapability(nonce); } if (db.getRefDatabase().performsAtomicTransactions()) adv.advertiseCapability(CAPABILITY_ATOMIC); if (allowOfsDelta) adv.advertiseCapability(CAPABILITY_OFS_DELTA); if (allowPushOptions) { adv.advertiseCapability(CAPABILITY_PUSH_OPTIONS); } adv.advertiseCapability(OPTION_AGENT, UserAgent.get()); adv.send(getAdvertisedOrDefaultRefs().values()); for (ObjectId obj : advertisedHaves) adv.advertiseHave(obj); if (adv.isEmpty()) adv.advertiseId(ObjectId.zeroId(), "capabilities^{}"); adv.end(); }
Source:
<code>private static @Nullable Long nullableNumberToLong(@Nullable Number number) { if (number == null) { return null; } <START> <END> return Long.valueOf(number.longValue()); }</code><technical_language>elvis notation</technical_language>

Target:
private static @Nullable Long nullableNumberToLong(@Nullable Number number) { return number == null ? null : Long.valueOf(number.longValue()); }
Source:
<code>private boolean <START> hasEditableFields() { <END> Stack<Control> stack = new Stack<>(); stack.push(this); while (!stack.isEmpty()) { Control currentCtrl = stack.pop(); if ((currentCtrl.style & SWT.READ_ONLY) != 0) { return false; } if (currentCtrl instanceof Composite) { for (Control child : ((Composite) currentCtrl).getChildren()) { stack.push(child); } } } return true; }</code><technical_language>discuss this part get office, for get a understanding of this patch</technical_language>

Target:
private boolean hasEditableFields() { Stack<Control> stack = new Stack<>(); stack.push(this); while (!stack.isEmpty()) { Control currentCtrl = stack.pop(); if ((currentCtrl instanceof StyledText || currentCtrl instanceof Text || currentCtrl instanceof Combo) && (currentCtrl.style & SWT.READ_ONLY) == 0) { return true; } if (currentCtrl instanceof Composite) { for (Control child : ((Composite) currentCtrl).getChildren()) { stack.push(child); } } } return false; }
Source:
<code>private Consumer<Future<String>> assertAllLocksAcquiredCorrectly() { return result -> { try { String assertionError = result.get( SECONDS_TO_RUN * 100, TimeUnit.SECONDS ); if ( assertionError != null ) { fail( assertionError ); } } catch ( InterruptedException | ExecutionException | TimeoutException e ) { <START> throw Exceptions.launderedException( e ); <END> } }; }</code><technical_language>Exceptions.launderedException is removed, avoid calling here. wrap throw RuntimeException</technical_language>

Target:
private Consumer<Future<String>> assertAllLocksAcquiredCorrectly() { return result -> { try { String assertionError = result.get( SECONDS_TO_RUN * 100, TimeUnit.SECONDS ); if ( assertionError != null ) { fail( assertionError ); } } catch ( InterruptedException | ExecutionException | TimeoutException e ) { throw new RuntimeException( e ); } }; }