auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void transformers_2_0_0(ChainedTransformationDescriptionBuilder parentBuilder) { AttributeTransformationDescriptionBuilder attributeBuilder = parentBuilder.createBuilder(VERSION_2_0_0, VERSION_1_0_0).getAttributeBuilder(); attributeBuilder.setDiscard(DiscardAttributeChecker.UNDEFINED, RECOVERY_USERNAME_ATTRIBUTE, RECOVERY_PASSWORD_ATTRIBUTE, RECOVERY_AUTHENTICATION_CONTEXT, RECOVERY_CREDENTIAL_REFERENCE); attributeBuilder.addRejectCheck(RejectAttributeChecker.DEFINED, RECOVERY_USERNAME_ATTRIBUTE, RECOVERY_PASSWORD_ATTRIBUTE, RECOVERY_AUTHENTICATION_CONTEXT, RECOVERY_CREDENTIAL_REFERENCE); attributeBuilder.addRejectCheck(new RejectAttributeChecker.SimpleAcceptAttributeChecker(ModelNode.FALSE), RECOVERY); }

Target:
private static void transformers_2_0_0(ChainedTransformationDescriptionBuilder parentBuilder) { ResourceTransformationDescriptionBuilder resourceTransformation = parentBuilder.createBuilder(VERSION_2_0_0, VERSION_1_0_0); AttributeTransformationDescriptionBuilder xaAttributeBuilder = resourceTransformation.addChildResource(pathElement("xa-datasource")).getAttributeBuilder(); xaAttributeBuilder.setDiscard(DiscardAttributeChecker.ALWAYS, RECOVERY_USERNAME_ATTRIBUTE, RECOVERY_PASSWORD_ATTRIBUTE, RECOVERY_AUTHENTICATION_CONTEXT, RECOVERY_CREDENTIAL_REFERENCE); xaAttributeBuilder.setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(ModelNode.FALSE), RECOVERY ); xaAttributeBuilder.addRejectCheck(RejectAttributeChecker.ALL, RECOVERY); }
Source:
public void update(Bounds bounds, double zoom) { int minRank = (int) (Math.max(bounds.getMinX() / RANK_WIDTH, 0)); int maxRank = (int) (RANK_WIDTH + bounds.getMaxX() / RANK_WIDTH); if (minRank < lastLoaded.getX() || maxRank > lastLoaded.getY()) { minRank = Math.min(Math.max(minRank, 0), graph.getMaxRank()); maxRank = Math.min(Math.max(minRank, maxRank), graph.getMaxRank()); minRankProperty().set(minRank); maxRankProperty().set(maxRank); lastLoaded = new Range(minRank / 2, maxRank * 2); loadContent(new Range(lastLoaded.getX(), lastLoaded.getY()), zoom); } }

Target:
public void update(Bounds bounds, double zoom) { int minRank = (int) (Math.max(bounds.getMinX() / RANK_WIDTH, 0)); int maxRank = (int) (RANK_WIDTH + bounds.getMaxX() / RANK_WIDTH); minRank = Math.min(Math.max(minRank, 0), graph.getMaxRank()); maxRank = Math.min(Math.max(minRank, maxRank), graph.getMaxRank()); minRankProperty().set(minRank); maxRankProperty().set(maxRank); loadContent(new Range(minRank, maxRank), zoom); }
Source:
public void addIndex(final UUID applicationId,final String indexSuffix,final int shards,final int replicas){ EntityIndex entityIndex = getManagerCache().getEntityIndex(CpNamingUtils.getApplicationScope(applicationId)); if(entityIndex instanceof AliasedEntityIndex) { ((AliasedEntityIndex)entityIndex).addIndex(indexSuffix, shards, replicas); } }

Target:
public void addIndex(final UUID applicationId,final String indexSuffix,final int shards,final int replicas){ EntityIndex entityIndex = getManagerCache().getEntityIndex(CpNamingUtils.getApplicationScope(applicationId)); entityIndex.addIndex(indexSuffix, shards, replicas); }
Source:
@Override public int score(Capabilities capabilites) { int score = 0; if(capabilites.getCapability(PLATFORM_NAME) != null) { score++; } return score; }

Target:
@Override public int score(Capabilities capabilites) { int score = 0; if (capabilites.getCapability(PLATFORM_NAME) != null) { score++; } String browserName = capabilites.getBrowserName(); if (browserName.equals(BrowserType.CHROME) || browserName.equals(BrowserType.ANDROID) || browserName.equals(BrowserType.SAFARI)) { score++; } return score; }
Source:
public static JFreeChart createXYStepChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); DateAxis xAxis = new DateAxis(xAxisLabel); NumberAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); XYToolTipGenerator toolTipGenerator = null; if (tooltips) { toolTipGenerator = new StandardXYToolTipGenerator(); } XYURLGenerator urlGenerator = null; if (urls) { urlGenerator = new StandardXYURLGenerator(); } XYItemRenderer renderer = new XYFilteringStepRenderer(toolTipGenerator, urlGenerator); XYPlotWithFiltering plot = new XYPlotWithFiltering(dataset, xAxis, yAxis, null); plot.setRenderer(renderer); plot.setOrientation(orientation); plot.setDomainCrosshairVisible(false); plot.setRangeCrosshairVisible(false); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); ChartFactory.getChartTheme().apply(chart); return chart; }

Target:
public static JFreeChart createXYStepChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); final DateAxis xAxis = new DateAxis(xAxisLabel); final NumberAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); final XYItemRenderer renderer = new XYFilteringStepRenderer(null, null); final XYPlotWithFiltering plot = new XYPlotWithFiltering(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); plot.setDomainCrosshairVisible(false); plot.setRangeCrosshairVisible(false); final JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); ChartFactory.getChartTheme().apply(chart); return chart; }
Source:
private Map<String, Attribute> getCachedOwnAttrs() { if (cachedOwnAttrs == null) { cachedOwnAttrs = newLinkedHashMap(); getEntities(ATTRIBUTES, Attribute.class) .forEach(attr -> cachedOwnAttrs.put(attr.getName(), attr)); } return cachedOwnAttrs; }

Target:
private Map<String, Attribute> getCachedOwnAttrs() { if (cachedOwnAttrs == null) { cachedOwnAttrs = new LinkedHashMap<>(); getEntities(ATTRIBUTES, Attribute.class) .forEach(attr -> cachedOwnAttrs.put(attr.getName(), attr)); } return cachedOwnAttrs; }
Source:
public ResultScanner getScanner(Scan scan) throws IOException { LOG.trace("getScanner(Scan)"); com.google.cloud.bigtable.grpc.scanner.ResultScanner<FlatRow> scanner = null; try { scanner = client.readFlatRows(hbaseAdapter.adapt(scan)); if (hasWhileMatchFilter(scan.getFilter())) { return Adapters.BIGTABLE_WHILE_MATCH_RESULT_RESULT_SCAN_ADAPTER.adapt(scanner); } return Adapters.BIGTABLE_RESULT_SCAN_ADAPTER.adapt(scanner); } catch (Throwable throwable) { LOG.error("Encountered exception when executing getScanner.", throwable); if (scanner != null) { scanner.close(); } throw new IOException( makeGenericExceptionMessage( "getScanner", options.getProjectId(), tableName.getQualifierAsString()), throwable); } }

Target:
public ResultScanner getScanner(Scan scan) throws IOException { LOG.trace("getScanner(Scan)"); try { com.google.cloud.bigtable.grpc.scanner.ResultScanner<FlatRow> scanner = client.readFlatRows(hbaseAdapter.adapt(scan)); if (hasWhileMatchFilter(scan.getFilter())) { return Adapters.BIGTABLE_WHILE_MATCH_RESULT_RESULT_SCAN_ADAPTER.adapt(scanner); } return Adapters.BIGTABLE_RESULT_SCAN_ADAPTER.adapt(scanner); } catch (Throwable throwable) { LOG.error("Encountered exception when executing getScanner.", throwable); throw new IOException( makeGenericExceptionMessage( "getScanner", options.getProjectId(), tableName.getQualifierAsString()), throwable); } }
Source:
private String getAnnotationNameFromExportFileElement(final Element e) { return ExportFileName.decodeAnnotationClassNameFromExportFileName(e.asType().toString()); }

Target:
private String getAnnotationNameFromExportFileElement(final Element e) { final TypeElement typeElement = (TypeElement) e; return ExportFileName.decodeAnnotationClassNameFromExportFileName(typeElement.getQualifiedName().toString()); }
Source:
private List<Workflow> getBioworkflows(User user) { return serviceDAO.findMyEntries(user.getId()).stream().map(BioWorkflow.class::cast).collect(Collectors.toList()); }

Target:
private List<Workflow> getBioworkflows(User user) { return workflowDAO.findMyEntries(user.getId()).stream().map(BioWorkflow.class::cast).collect(Collectors.toList()); }
Source:
public Mono<ConfigurationSetting> getSetting(String key, String label, OffsetDateTime asOfDateTime) { return withContext(context -> getSetting(new ConfigurationSetting().setKey(key).setLabel(label), asOfDateTime, false, context)).map(response -> response.getValue()); }

Target:
public Mono<ConfigurationSetting> getSetting(String key, String label, OffsetDateTime asOfDateTime) { return withContext(context -> getSetting(new ConfigurationSetting().setKey(key).setLabel(label), asOfDateTime, false, context)) .flatMap(response -> Mono.justOrEmpty(response.getValue())); }
Source:
public boolean evaluate(HttpServletRequest request, HttpServletResponse response, Instance instance) { boolean evalSuccess; if(request.getSession().getAttribute(instance.sessionKey) == null){ if(instance.comparison.equals(IS_NOT)){ evalSuccess = true; }else { evalSuccess = false; } } else { String sessionActualValue = request.getSession().getAttribute(instance.sessionKey).toString(); if(instance.comparison == EXISTS) { evalSuccess = EXISTS.perform(sessionActualValue); } else { if(instance.comparison != REGEX) { evalSuccess = instance.comparison.perform(sessionActualValue.toLowerCase(), instance.sessionValue.toLowerCase()); } else { evalSuccess = REGEX.perform(sessionActualValue, instance.sessionValue); } } } return evalSuccess; }

Target:
public boolean evaluate(HttpServletRequest request, HttpServletResponse response, Instance instance) { boolean evalSuccess; if(request.getSession().getAttribute(instance.sessionKey) == null){ evalSuccess = instance.comparison.equals(IS_NOT); } else { String sessionActualValue = request.getSession().getAttribute(instance.sessionKey).toString(); if(instance.comparison == EXISTS) { evalSuccess = EXISTS.perform(sessionActualValue); } else { if(instance.comparison != REGEX) { evalSuccess = instance.comparison.perform(sessionActualValue.toLowerCase(), instance.sessionValue.toLowerCase()); } else { evalSuccess = REGEX.perform(sessionActualValue, instance.sessionValue); } } } return evalSuccess; }
Source:
public static BootConfigValidationResult validateBootConfig(BootConfig config) { if (config == null) { return new BootConfigValidationResult(false, "No boot config provided."); } if (SalesforceSDKManager.getInstance().isHybrid()) { String startPage = config.getStartPage(); if (startPage == null) { return new BootConfigValidationResult(false, "No start page configured."); } if (config.isLocal() && config.isStartPageAbsoluteUrl()) { return new BootConfigValidationResult(false, "Local start page should not be absolute URL."); } if (!config.isLocal()) { if (config.shouldAuthenticate()) { if (config.isStartPageAbsoluteUrl()) { return new BootConfigValidationResult(false, "Cannot authenticate using an absolute URL for start page."); } } else { if (!config.isStartPageAbsoluteUrl()) { return new BootConfigValidationResult(false, "Cannot configure relative URL start page with deferred authentication."); } } } return new BootConfigValidationResult(true); } else { return new BootConfigValidationResult(true); } }

Target:
public static void validateBootConfig(BootConfig config) { if (config == null) { throw new BootConfigException("No boot config provided."); } if (SalesforceSDKManager.getInstance().isHybrid()) { String startPage = config.getStartPage(); if (startPage == null) { throw new BootConfigException("No start page configured."); } if (config.isLocal() && config.isStartPageAbsoluteUrl()) { throw new BootConfigException("Local start page should not be absolute URL."); } if (!config.isLocal() && config.shouldAuthenticate() && config.isStartPageAbsoluteUrl()) { throw new BootConfigException("Cannot authenticate using an absolute URL for start page."); } if (!config.isLocal() && !config.shouldAuthenticate() && !config.isStartPageAbsoluteUrl()) { throw new BootConfigException("Cannot configure relative URL start page with deferred authentication."); } } }
Source:
public void marshal(ITypeMarshalBuffer buffer) throws CoreException { final short SECOND_LAST_FLAG= ITypeMarshalBuffer.LAST_FLAG / 2; final int kind= getKind().ordinal(); final int shiftedKind= kind * ITypeMarshalBuffer.FIRST_FLAG; final int modifiers= getModifiers(); short firstBytes = (short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind); if (modifiers != 0) firstBytes |= ITypeMarshalBuffer.LAST_FLAG; if (getAssociatedNumericalValue() != null) firstBytes |= SECOND_LAST_FLAG; buffer.putShort(firstBytes); if (modifiers != 0) buffer.putByte((byte) modifiers); if (getAssociatedNumericalValue() != null) buffer.putLong(getAssociatedNumericalValue()); }

Target:
public void marshal(ITypeMarshalBuffer buffer) throws CoreException { final int kind= getKind().ordinal(); final int shiftedKind= kind * ITypeMarshalBuffer.FIRST_FLAG; final int modifiers= getModifiers(); short firstBytes = (short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind); if (modifiers != 0) firstBytes |= ITypeMarshalBuffer.LAST_FLAG; if (fAssociatedValue != null) firstBytes |= ITypeMarshalBuffer.SECOND_LAST_FLAG; buffer.putShort(firstBytes); if (modifiers != 0) buffer.putByte((byte) modifiers); if (fAssociatedValue != null) buffer.putLong(getAssociatedNumericalValue()); }
Source:
public void destroyServerStore(String name) throws ClusterException { unRegisterStoreStatistics(name); final ServerStoreImpl store = stores.remove(name); if (store == null) { throw new InvalidStoreException("Clustered tier '" + name + "' does not exist"); } else { releaseDedicatedPool(name, store.getPageSource()); store.close(); } stateRepositoryManager.destroyStateRepository(name); }

Target:
public void destroyServerStore(String name) throws ClusterException { final ServerStoreImpl store = stores.remove(name); unRegisterStoreStatistics(store); if (store == null) { throw new InvalidStoreException("Clustered tier '" + name + "' does not exist"); } else { releaseDedicatedPool(name, store.getPageSource()); store.close(); } stateRepositoryManager.destroyStateRepository(name); }
Source:
private synchronized void restoreFilterActivation() { SafeRunner.run(new NavigatorSafeRunnable() { @Override public void run() throws Exception { CommonFilterDescriptor[] visibleFilterDescriptors = CommonFilterDescriptorManager.getInstance().findVisibleFilters(contentService); for (CommonFilterDescriptor filterDescription : visibleFilterDescriptors) { if (!filterDescription.isVisibleInUi() && filterDescription.isActiveByDefault()) { activeFilters.add(filterDescription.getId()); } } IEclipsePreferences prefs = NavigatorContentService.getPreferencesRoot(); if (prefs.get(getFilterActivationPreferenceKey(), null) != null) { String activatedFiltersPreferenceValue = prefs.get( getFilterActivationPreferenceKey(), null); String[] activeFilterIds = activatedFiltersPreferenceValue.split(DELIM); for (int i = 0; i < activeFilterIds.length; i++) { activeFilters.add(activeFilterIds[i]); } } else { for (CommonFilterDescriptor filterDescription : visibleFilterDescriptors) { if (filterDescription.isVisibleInUi() && filterDescription.isActiveByDefault()) { activeFilters.add(filterDescription.getId()); } } } } }); }

Target:
private synchronized void restoreFilterActivation() { SafeRunner.run(new NavigatorSafeRunnable() { @Override public void run() throws Exception { CommonFilterDescriptor[] visibleFilterDescriptors = CommonFilterDescriptorManager.getInstance() .findVisibleFilters(contentService); for (CommonFilterDescriptor filterDescription : visibleFilterDescriptors) { if (!filterDescription.isVisibleInUi() && filterDescription.isActiveByDefault()) { activeFilters.add(filterDescription.getId()); } } IEclipsePreferences prefs = NavigatorContentService.getPreferencesRoot(); if (prefs.get(getFilterActivationPreferenceKey(), null) != null) { String activatedFiltersPreferenceValue = prefs.get( getFilterActivationPreferenceKey(), null); String[] activeFilterIds = activatedFiltersPreferenceValue.split(DELIM); for (String activeFilterId : activeFilterIds) { if (activeFilterId.isEmpty()) { continue; } activeFilters.add(activeFilterId); } } else { for (CommonFilterDescriptor filterDescription : visibleFilterDescriptors) { if (filterDescription.isVisibleInUi() && filterDescription.isActiveByDefault()) { activeFilters.add(filterDescription.getId()); } } } } }); }
Source:
public Map<String, Object> getVariables() { Map<String, Object> result = new HashMap<>(); variables.values().stream() .filter(v -> !(v instanceof CaseVariableInstance)) .forEach(v -> result.put(v.name(), v.getReference().get())); return Collections.unmodifiableMap(result); }

Target:
public Map<String, Object> getVariables() { Map<String, Object> result = new HashMap<>(); variables.values().stream() .filter(v -> !(v instanceof CaseVariableInstance)) .filter(v -> v.getReference().get() != null) .forEach(v -> result.put(v.name(), v.getReference().get())); return Collections.unmodifiableMap(result); }
Source:
protected void AddVmInterfaces() { String macRegex = "^(\\p{XDigit}{2}:){5}\\p{XDigit}{2}$"; List<VmNetworkInterface> interfaces = getVmTemplate().getInterfaces(); String networkName; for (VmNetworkInterface iface : interfaces) { if (iface.getId() == null) { iface.setId(Guid.NewGuid()); } networkName = iface.getNetworkName(); iface.setVmId(getVmTemplateId()); VmNetworkInterface iDynamic = new VmNetworkInterface(); VmNetworkStatistics iStat = new VmNetworkStatistics(); iDynamic.setStatistics(iStat); iDynamic.setId(iface.getId()); iStat.setId(iface.getId()); iStat.setVmId(getVmTemplateId()); iDynamic.setVmTemplateId(getVmTemplateId()); iDynamic.setName(iface.getName()); if (VmInterfaceManager.isValidVmNetwork(iface, getVmTemplate().getvds_group_id())) { iDynamic.setNetworkName(networkName); } else { log.warnFormat("Imported template interface {0} has an invalid network name {1}, network name was set to empty string" , iface.getName(), networkName); iDynamic.setNetworkName(StringUtils.EMPTY); } iDynamic.setSpeed(iface.getSpeed()); iDynamic.setType(iface.getType()); if (StringHelper.isNullOrEmpty(iface.getMacAddress())) { iface.setMacAddress(MacPoolManager.getInstance().allocateNewMac()); } if (!Regex.IsMatch(iface.getMacAddress(), macRegex)) { AuditLogableBase logable = new AuditLogableBase(); logable.AddCustomValue("MacAddress", iface.getMacAddress()); logable.AddCustomValue("IfaceName", iface.getName()); AuditLogDirector.log(logable, AuditLogType.IMPORTEXPORT_IMPORT_INTERFACES_WITH_INVALID_MAC_ADDRESS); } DbFacade.getInstance().getVmNetworkInterfaceDAO().save(iDynamic); getCompensationContext().snapshotNewEntity(iDynamic); DbFacade.getInstance().getVmNetworkStatisticsDAO().save(iStat); getCompensationContext().snapshotNewEntity(iStat); } }

Target:
protected void AddVmInterfaces() { List<VmNetworkInterface> interfaces = getVmTemplate().getInterfaces(); String networkName; for (VmNetworkInterface iface : interfaces) { if (iface.getId() == null) { iface.setId(Guid.NewGuid()); } networkName = iface.getNetworkName(); iface.setVmId(getVmTemplateId()); VmNetworkInterface iDynamic = new VmNetworkInterface(); VmNetworkStatistics iStat = new VmNetworkStatistics(); iDynamic.setStatistics(iStat); iDynamic.setId(iface.getId()); iStat.setId(iface.getId()); iStat.setVmId(getVmTemplateId()); iDynamic.setVmTemplateId(getVmTemplateId()); iDynamic.setName(iface.getName()); if (VmInterfaceManager.isValidVmNetwork(iface, getVmTemplate().getvds_group_id())) { iDynamic.setNetworkName(networkName); } else { log.warnFormat("Imported template interface {0} has an invalid network name {1}, network name was set to empty string" , iface.getName(), networkName); iDynamic.setNetworkName(StringUtils.EMPTY); } iDynamic.setSpeed(iface.getSpeed()); iDynamic.setType(iface.getType()); validateImportMacAddress(iface); DbFacade.getInstance().getVmNetworkInterfaceDAO().save(iDynamic); getCompensationContext().snapshotNewEntity(iDynamic); DbFacade.getInstance().getVmNetworkStatisticsDAO().save(iStat); getCompensationContext().snapshotNewEntity(iStat); } }
Source:
public void run() { try { final RecoveryInfo recoveryInfo = proxyToMaster.getRecoveringGroups(taskHostname); while (true) { if (recoveryInfo.getRecoveryGroupList().isEmpty()) { isRecoveryRunning.set(false); break; } else { final List<Future> futureList = new ArrayList<>(); for (final String recoveryGroup : recoveryInfo.getRecoveryGroupList()) { futureList.add(singleThreadedExecutorService.submit(new RecoveryRunner(recoveryGroup, checkpointManager))); } futureList.get(futureList.size() - 1).get(); } } } catch (final AvroRemoteException | InterruptedException | ExecutionException e) { e.printStackTrace(); } }

Target:
public void run() { try { while (true) { final RecoveryInfo recoveryInfo = proxyToMaster.getRecoveringGroups(taskHostname); LOG.log(Level.INFO, "Recovering groups: {0}", recoveryInfo.getRecoveryGroupList().toString()); if (recoveryInfo.getRecoveryGroupList().isEmpty()) { isRecoveryRunning.set(false); break; } else { final List<Future> futureList = new ArrayList<>(); for (final String recoveryGroup : recoveryInfo.getRecoveryGroupList()) { futureList.add(singleThreadedExecutorService.submit(new RecoveryRunner(recoveryGroup, checkpointManager))); } futureList.get(futureList.size() - 1).get(); } } } catch (final AvroRemoteException | InterruptedException | ExecutionException e) { e.printStackTrace(); } }
Source:
public PlanNode optimize(PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { Optional<ApplyNode> applyNode = searchFrom(plan).where(ApplyNode.class::isInstance).findFirst(); Optional<LateralJoinNode> lateralJoinNode = searchFrom(plan).where(LateralJoinNode.class::isInstance).findFirst(); if (applyNode.isPresent()) { throw error(applyNode.get().getCorrelation(), applyNode.get().getOriginSubquery()); } else if (lateralJoinNode.isPresent()) { throw error(lateralJoinNode.get().getCorrelation(), lateralJoinNode.get().getOriginSubquery()); } return plan; }

Target:
public PlanNode optimize(PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { searchFrom(plan).where(ApplyNode.class::isInstance) .findFirst() .ifPresent(node -> { ApplyNode applyNode = (ApplyNode) node; throw error(applyNode.getCorrelation(), applyNode.getOriginSubquery()); }); searchFrom(plan).where(LateralJoinNode.class::isInstance) .findFirst() .ifPresent(node -> { LateralJoinNode lateralJoinNode = (LateralJoinNode) node; throw error(lateralJoinNode.getCorrelation(), lateralJoinNode.getOriginSubquery()); }); return plan; }
Source:
static SMRRecord deserializeFromBuffer(ByteBuf b, CorfuRuntime rt) { SMRRecord record = new SMRRecord(); short methodLength = b.readShort(); byte[] methodBytes = new byte[methodLength]; b.readBytes(methodBytes, 0, methodLength); record.SMRMethod = new String(methodBytes); record.serializerType = Serializers.getSerializer(b.readByte()); byte numArguments = b.readByte(); Object[] arguments = new Object[numArguments]; for (byte arg = 0; arg < numArguments; arg++) { int len = b.readInt(); ByteBuf objBuf = b.slice(b.readerIndex(), len); arguments[arg] = record.serializerType.deserialize(objBuf, rt); b.skipBytes(len); } record.SMRArguments = arguments; return record; }

Target:
static SMRRecord deserializeFromBuffer(ByteBuf b, CorfuRuntime rt) { SMRRecord record = new SMRRecord(); short methodLength = b.readShort(); byte[] methodBytes = new byte[methodLength]; b.readBytes(methodBytes, 0, methodLength); record.SMRMethod = new String(methodBytes, DEFAULT_CHAR_SET); record.serializerType = Serializers.getSerializer(b.readByte()); byte numArguments = b.readByte(); Object[] arguments = new Object[numArguments]; for (byte arg = 0; arg < numArguments; arg++) { int len = b.readInt(); ByteBuf objBuf = b.slice(b.readerIndex(), len); arguments[arg] = record.serializerType.deserialize(objBuf, rt); b.skipBytes(len); } record.SMRArguments = arguments; return record; }
Source:
protected void beforeInvoke() throws Exception { disposedOperators = false; LOG.debug("Initializing {}.", getName()); operatorChain = new OperatorChain<>(this, recordWriter); headOperator = operatorChain.getHeadOperator(); init(); if (canceled) { throw new CancelTaskException(); } LOG.debug("Invoking {}", getName()); actionExecutor.runThrowing(() -> { operatorChain.initializeStateAndOpenOperators(createStreamTaskStateInitializer()); ResultPartitionWriter[] writers = getEnvironment().getAllWriters(); if (writers != null) { for (ResultPartitionWriter writer : writers) { writer.initializeState(); } } }); isRunning = true; }

Target:
protected void beforeInvoke() throws Exception { disposedOperators = false; LOG.debug("Initializing {}.", getName()); operatorChain = new OperatorChain<>(this, recordWriter); headOperator = operatorChain.getHeadOperator(); init(); if (canceled) { throw new CancelTaskException(); } LOG.debug("Invoking {}", getName()); actionExecutor.runThrowing(() -> { operatorChain.initializeStateAndOpenOperators(createStreamTaskStateInitializer()); ResultPartitionWriter[] writers = getEnvironment().getAllWriters(); if (writers != null) { for (ResultPartitionWriter writer : writers) { writer.initializeState(ChannelStateReader.NO_OP); } } }); isRunning = true; }
Source:
public Iterable<Directive> process(final XML xml) { final Directives directives = new Directives() .xpath("/talk/daemon[not(started)]") .strict(1); final XML node = xml.node("/p/entry[@key='assets']/entry"); if(StartsDaemon.IMAGE.equals(node.xpath(" StartsDaemon.deprecate(directives); } final Directives dirs = directives .add("started").set(new Time().iso()).up(); try { final String dir = this.run(xml); dirs.add("dir").set(dir); } catch (final IOException ex) { dirs.add("ended").set(new Time().iso()).up() .add("code").set("128").up() .add("tail").set(ex.getLocalizedMessage()); Logger.warn(this, "%[exception]s", ex); } return dirs; }

Target:
public Iterable<Directive> process(final XML xml) { final Directives dirs = new Directives() .xpath("/talk/daemon[not(started)]") .strict(1) .add("started").set(new Time().iso()).up(); try { final String dir = this.run(xml); dirs.add("dir").set(dir); } catch (final IOException ex) { dirs.add("ended").set(new Time().iso()).up() .add("code").set("128").up() .add("tail").set(ex.getLocalizedMessage()); Logger.warn(this, "%[exception]s", ex); } return dirs; }
Source:
public OUT readRecord(OUT reuse, byte[] bytes, int offset, int numBytes) { if(this.lineDelimiterIsLinebreak == true && bytes[offset + numBytes -1] == "\r".getBytes(Charsets.UTF_8)[0]) { numBytes--; } if (parseRecord(parsedValues, bytes, offset, numBytes)) { for (int i = 0; i < parsedValues.length; i++) { reuse.setField(parsedValues[i], i); } return reuse; } else { return null; } }

Target:
public OUT readRecord(OUT reuse, byte[] bytes, int offset, int numBytes) { if(this.lineDelimiterIsLinebreak == true && bytes[offset + numBytes -1] == '\r' ) { numBytes--; } if (parseRecord(parsedValues, bytes, offset, numBytes)) { for (int i = 0; i < parsedValues.length; i++) { reuse.setField(parsedValues[i], i); } return reuse; } else { return null; } }
Source:
public static String listUsers(final IEssentials ess, final List<User> users, final String seperator) { final StringBuilder groupString = new StringBuilder(); Collections.sort(users); boolean needComma = false; for (final User user : users) { if (needComma) { groupString.append(seperator); } needComma = true; if (user.isAfk()) { groupString.append(tl("listAfkTag")); } if (user.isHidden()) { groupString.append(tl("listHiddenTag")); } user.setDisplayNick(); groupString.append(user.getDisplayName()); final String strippedNick = FormatUtil.stripEssentialsFormat(user.getNickname()); if (ess.getSettings().realNamesOnList() && strippedNick != null && !strippedNick.equals(user.getName())) { groupString.append(" (").append(user.getName()).append(")"); } groupString.append(ChatColor.WHITE.toString()); } return groupString.toString(); }

Target:
public static String listUsers(final IEssentials ess, final List<User> users, final String seperator) { final StringBuilder groupString = new StringBuilder(); Collections.sort(users); boolean needComma = false; for (final User user : users) { if (needComma) { groupString.append(seperator); } needComma = true; if (user.isAfk()) { groupString.append(tl("listAfkTag")); } if (user.isHidden()) { groupString.append(tl("listHiddenTag")); } user.setDisplayNick(); groupString.append(user.getDisplayName()); final String strippedNick = FormatUtil.stripFormat(user.getNickname()); if (ess.getSettings().realNamesOnList() && strippedNick != null && !strippedNick.equals(user.getName())) { groupString.append(" (").append(user.getName()).append(")"); } groupString.append(ChatColor.WHITE.toString()); } return groupString.toString(); }
Source:
private ResourceEstimates parseResourceEstimate(HttpServletRequest servletRequest) { ResourceEstimateBuilder builder = new ResourceEstimateBuilder(); for (String header : splitSessionHeader(servletRequest.getHeaders(PRESTO_RESOURCE_ESTIMATE))) { List<String> nameValue = Splitter.on('=').limit(2).trimResults().splitToList(header); assertRequest(nameValue.size() == 2, "Invalid %s header", PRESTO_RESOURCE_ESTIMATE); String name = nameValue.get(0); long value; try { value = Long.parseLong(nameValue.get(1)); } catch (NumberFormatException ignored) { throw badRequest(format("Expected integral value for resource estimate %s", name)); } if (name.equalsIgnoreCase(ResourceEstimates.EXECUTION_TIME_MILLIS)) { builder.setExecutionTimeMillis(value); } else if (name.equalsIgnoreCase(ResourceEstimates.CPU_TIME_MILLIS)) { builder.setCpuTimeMillis(value); } else if (name.equalsIgnoreCase(ResourceEstimates.PEAK_MEMORY_BYTES)) { builder.setPeakMemoryBytes(value); } else { throw badRequest(format("Unsupported resource estimate %s", name)); } } return builder.build(); }

Target:
private ResourceEstimates parseResourceEstimate(HttpServletRequest servletRequest) { ResourceEstimateBuilder builder = new ResourceEstimateBuilder(); for (String header : splitSessionHeader(servletRequest.getHeaders(PRESTO_RESOURCE_ESTIMATE))) { List<String> nameValue = Splitter.on('=').limit(2).trimResults().splitToList(header); assertRequest(nameValue.size() == 2, "Invalid %s header", PRESTO_RESOURCE_ESTIMATE); String name = nameValue.get(0); String value = nameValue.get(1); try { switch (name.toUpperCase()) { case ResourceEstimates.EXECUTION_TIME: builder.setExecutionTime(Duration.valueOf(value)); break; case ResourceEstimates.CPU_TIME: builder.setCpuTime(Duration.valueOf(value)); break; case ResourceEstimates.PEAK_MEMORY: builder.setPeakMemory(DataSize.valueOf(value)); break; default: throw badRequest(format("Unsupported resource name %s", name)); } } catch (IllegalArgumentException e) { throw badRequest(format("Unsupported format for resource estimate '%s': %s", value, e)); } } return builder.build(); }
Source:
default <A> A getAttribute(String name) { return (A) getAttributes().get(name); }

Target:
default <A> List<A> getAttribute(String name) { return (List<A>) getAttributes().get(name); }
Source:
private void internalDeleteBundleAndDependenciesThrowRuntime(final String bundleId, final User user, final int currentCount, final int bundleSleepCount, final long millisBundleSleep) { try { this.internalDeleteBundleAndDependencies(bundleId, user); if (currentCount % bundleSleepCount == 0) { DateUtil.sleep(millisBundleSleep); } } catch (DotDataException e) { throw new DotRuntimeException(e); } }

Target:
private void internalDeleteBundleAndDependenciesThrowRuntime(final String bundleId, final User user, final int currentCount, final int bundleSleepCount, final long millisBundleSleep) { try { this.internalDeleteBundleAndDependencies(bundleId, user); if (currentCount % bundleSleepCount == 0) { DateUtil.sleep(millisBundleSleep); } } catch (DotDataException e) { Logger.error(this,"Error Removing bundle: " + bundleId + " by the user :" + user.getUserId(),e); throw new DotRuntimeException(e); } }
Source:
public void executesInParallel() { final AtomicInteger count = new AtomicInteger(ParallelizerTest.COUNT); new Runnable() { @Override @Parallel(threads = ParallelizerTest.COUNT) public void run() { count.decrementAndGet(); } } .run(); MatcherAssert.assertThat(count.get(), Matchers.equalTo(0)); }

Target:
public void executesInParallel() { final AtomicInteger count = new AtomicInteger(Tv.TEN); new Runnable() { @Override @Parallel(threads = Tv.TEN) public void run() { count.decrementAndGet(); } } .run(); MatcherAssert.assertThat(count.get(), Matchers.equalTo(0)); }
Source:
public static byte[] inputStreamToBytes(final InputStream inputStream) throws IOException { ByteArrayOutputStream bufferedArray = new ByteArrayOutputStream(); int nRead; byte[] buffer = new byte[4096]; while ((nRead = inputStream.read(buffer, 0, buffer.length)) != -1) { bufferedArray.write(buffer, 0, nRead); } return bufferedArray.toByteArray(); }

Target:
public static byte[] inputStreamToBytes(final InputStream inputStream) throws IOException { ByteArrayOutputStream bufferedArray = new ByteArrayOutputStream(); int nRead; byte[] buffer = new byte[512]; while ((nRead = inputStream.read(buffer, 0, buffer.length)) != -1) { bufferedArray.write(buffer, 0, nRead); } return bufferedArray.toByteArray(); }
Source:
private void iterateOverHigherLevelMetadata(DocStructInterface enricher, Map<String, Map<String, MetadataInterface>> higherLevelMetadata) { for (Entry<String, Map<String, MetadataInterface>> availableHigherMetadata : higherLevelMetadata .entrySet()) { String enrichable = availableHigherMetadata.getKey(); boolean addable = false; List<MetadataTypeInterface> addableTypesNotNull = enricher.getAddableMetadataTypes(); if (addableTypesNotNull == null) { addableTypesNotNull = Collections.emptyList(); } for (MetadataTypeInterface addableMetadata : addableTypesNotNull) { if (addableMetadata.getName().equals(enrichable)) { addable = true; break; } } if (!addable) { continue; } there: for (Entry<String, MetadataInterface> higherElement : availableHigherMetadata.getValue() .entrySet()) { List<MetadataInterface> amNotNull = enricher.getAllMetadata(); if (amNotNull == null) { amNotNull = Collections.emptyList(); } for (MetadataInterface existentMetadata : amNotNull) { if (existentMetadata.getMetadataType().getName().equals(enrichable) && existentMetadata.getValue().equals(higherElement.getKey())) { continue there; } } try { enricher.addMetadata(higherElement.getValue()); } catch (UGHException e) { Helper.setErrorMessage("errorAdding", new Object[] {Helper.getTranslation("metadata") }, logger, e); } } } }

Target:
private void iterateOverHigherLevelMetadata(DocStructInterface enricher, Map<String, Map<String, MetadataInterface>> higherLevelMetadata) { for (Entry<String, Map<String, MetadataInterface>> availableHigherMetadata : higherLevelMetadata .entrySet()) { String enrichable = availableHigherMetadata.getKey(); boolean addable = false; List<MetadataTypeInterface> addableTypesNotNull = enricher.getAddableMetadataTypes(); if (Objects.isNull(addableTypesNotNull)) { addableTypesNotNull = Collections.emptyList(); } for (MetadataTypeInterface addableMetadata : addableTypesNotNull) { if (addableMetadata.getName().equals(enrichable)) { addable = true; break; } } if (!addable) { continue; } there: for (Entry<String, MetadataInterface> higherElement : availableHigherMetadata.getValue() .entrySet()) { List<MetadataInterface> amNotNull = enricher.getAllMetadata(); if (Objects.isNull(amNotNull)) { amNotNull = Collections.emptyList(); } for (MetadataInterface existentMetadata : amNotNull) { if (existentMetadata.getMetadataType().getName().equals(enrichable) && existentMetadata.getValue().equals(higherElement.getKey())) { continue there; } } try { enricher.addMetadata(higherElement.getValue()); } catch (UGHException e) { Helper.setErrorMessage("errorAdding", new Object[] {Helper.getTranslation("metadata") }, logger, e); } } } }
Source:
public void applyWithChildContextPublisherCompleted() { AtomicBoolean fluxCompleted = new AtomicBoolean(false); final FluxSinkRecorder<CoreEvent> emitter = new FluxSinkRecorder<>(); Flux.create(emitter) .transform(pub -> { return applyWithChildContext(pub, pubInner -> pubInner, Optional.empty()); }) .subscribe(event -> { }, e -> { }, () -> fluxCompleted.set(true)); emitter.complete(); assertThat(fluxCompleted.get(), is(true)); }

Target:
public void applyWithChildContextPublisherCompleted() { AtomicBoolean fluxCompleted = new AtomicBoolean(false); final FluxSinkRecorder<CoreEvent> emitter = new FluxSinkRecorder<>(); Flux.create(emitter) .transform(pub -> applyWithChildContext(pub, pubInner -> pubInner, Optional.empty())) .subscribe(event -> { }, e -> { }, () -> fluxCompleted.set(true)); emitter.complete(); assertThat(fluxCompleted.get(), is(true)); }
Source:
protected void checkOperations(DistributionSnapshot snapshot) throws IOException { List<OperationInfo> ops = snapshot.getOperations(); Collections.sort(ops, new Comparator<OperationInfo>() { @Override public int compare(OperationInfo arg0, OperationInfo arg1) { return arg0.getId().compareTo(arg1.getId()); } }); StringBuilder sb = new StringBuilder(); for (OperationInfo op : ops) { sb.append(represent(op)); } checkContentEquals("apidoc_snapshot/operations.txt", sb.toString()); }

Target:
protected void checkOperations(DistributionSnapshot snapshot) throws IOException { List<OperationInfo> ops = snapshot.getOperations(); Collections.sort(ops, Comparator.comparing(OperationInfo::getId)); StringBuilder sb = new StringBuilder(); ops.forEach(op -> sb.append(represent(op))); checkContentEquals("apidoc_snapshot/operations.txt", sb.toString()); }
Source:
public @Nullable String toString() { return String.valueOf(fValue); }

Target:
public @Nullable String toString() { return fValue; }
Source:
public StoreDescriptor(String dataDir) throws IOException { File storeDescriptorFile = new File(dataDir, StoreDescriptor.STORE_DESCRIPTOR); if (storeDescriptorFile.exists()) { DataInputStream dataInputStream = new DataInputStream(new FileInputStream(storeDescriptorFile)); short version = dataInputStream.readShort(); switch (version) { case VERSION_0: String incarnationId = Utils.readIntString(dataInputStream); this.incarnationId = UUID.fromString(incarnationId); break; default: throw new IllegalArgumentException("Unrecognized version in StoreDescriptor: " + version); } } else { this.incarnationId = UUID.randomUUID(); storeDescriptorFile.createNewFile(); DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(storeDescriptorFile)); dataOutputStream.write(toBytes()); dataOutputStream.close(); } }

Target:
StoreDescriptor(String dataDir) throws IOException { File storeDescriptorFile = new File(dataDir, STORE_DESCRIPTOR_FILENAME); if (storeDescriptorFile.exists()) { CrcInputStream crcStream = new CrcInputStream(new FileInputStream(storeDescriptorFile)); DataInputStream stream = new DataInputStream(crcStream); short version = stream.readShort(); switch (version) { case VERSION_0: String incarnationIdStr = Utils.readIntString(stream); incarnationId = UUID.fromString(incarnationIdStr); long crc = crcStream.getValue(); long crcValueInFile = stream.readLong(); if (crc != crcValueInFile) { throw new IllegalStateException( "CRC mismatch for StoreDescriptor. CRC of the stream " + crc + ", CRC from file " + crcValueInFile); } break; default: throw new IllegalArgumentException("Unrecognized version in StoreDescriptor: " + version); } } else { incarnationId = UUID.randomUUID(); File tempFile = new File(dataDir, STORE_DESCRIPTOR_FILENAME + ".tmp"); File actual = new File(dataDir, STORE_DESCRIPTOR_FILENAME); if (tempFile.createNewFile()) { FileOutputStream fileStream = new FileOutputStream(tempFile); CrcOutputStream crc = new CrcOutputStream(fileStream); DataOutputStream writer = new DataOutputStream(crc); writer.write(toBytes()); long crcValue = crc.getValue(); writer.writeLong(crcValue); fileStream.getChannel().force(true); if (!tempFile.renameTo(actual)) { throw new IllegalStateException( "File " + tempFile.getAbsolutePath() + " renaming to " + actual.getAbsolutePath() + " failed "); } } else { throw new IllegalStateException("File " + tempFile.getAbsolutePath() + " creation failed "); } } }
Source:
public void tearDown() { if (fModule != null) { fModule.close(); } if (fTrace != null) { fTrace.dispose(); File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(fTrace)); deleteDirectory(suppDir); } }

Target:
public void tearDown() { fModule.close(); if (fTrace != null) { fTrace.dispose(); File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(fTrace)); deleteDirectory(suppDir); } }
Source:
public String getWSAddressingAction() { return "urn:ihe:iti:xdr:2007:X12RealTimeRequestMessage"; }

Target:
public String getWSAddressingAction() { return "RealTimeTransaction"; }
Source:
private Response(Builder builder) { checkState(builder.status >= 100 && builder.status < 600, "Invalid status code: %s", builder.status); checkState(builder.request != null, "original request is required"); this.status = builder.status; this.request = builder.request; this.reason = builder.reason; this.headers = (builder.headers != null) ? Collections.unmodifiableMap(caseInsensitiveCopyOf(builder.headers)) : new LinkedHashMap<>(); this.body = builder.body; }

Target:
private Response(Builder builder) { checkState(builder.request != null, "original request is required"); this.status = builder.status; this.request = builder.request; this.reason = builder.reason; this.headers = (builder.headers != null) ? Collections.unmodifiableMap(caseInsensitiveCopyOf(builder.headers)) : new LinkedHashMap<>(); this.body = builder.body; }
Source:
void writeEntityStatusOfAggregate() { LifecycleFlags status = LifecycleFlags.newBuilder() .setArchived(true) .build(); storage.writeLifecycleFlags(id, status); Optional<LifecycleFlags> readStatus = storage.readLifecycleFlags(id); Truth8.assertThat(readStatus) .hasValue(status); }

Target:
void writeEntityStatusOfAggregate() { LifecycleFlags status = LifecycleFlags.newBuilder() .setArchived(true) .build(); storage.writeLifecycleFlags(id, status); Optional<LifecycleFlags> readStatus = storage.readLifecycleFlags(id); assertThat(readStatus) .hasValue(status); }
Source:
private void assertTaskFormModelIsCorrect(TaskFormModel taskFormModel, String processId, String taskName) { assertEquals(processId, taskFormModel.getProcessId()); final String EXPECTED_FORM_NAME = Parser.xmlParser().parseInput(taskName, "") + BPMNVariableUtils.TASK_FORM_SUFFIX; assertEquals(EXPECTED_FORM_NAME, taskFormModel.getFormName()); }

Target:
private void assertTaskFormModelIsCorrect(TaskFormModel taskFormModel, String processId, String taskName) { assertEquals(processId, taskFormModel.getProcessId()); final String EXPECTED_FORM_NAME = taskName + BPMNVariableUtils.TASK_FORM_SUFFIX; assertEquals(EXPECTED_FORM_NAME, taskFormModel.getFormName()); }
Source:
private boolean hasMetatypesForService( Map<String, Object> service, Set<MetaTypeInformation> metatypeInformations) { String id = (String) service.get("id"); Boolean isFactory = (Boolean) service.get("factory"); if (id == null || isFactory == null) { return false; } Stream<MetaTypeInformation> infoStream = metatypeInformations.stream().filter(Objects::nonNull); return (isFactory ? infoStream.map(MetaTypeInformation::getFactoryPids) : infoStream.map(MetaTypeInformation::getPids)) .filter(Objects::nonNull) .flatMap(Arrays::stream) .anyMatch(id::equals); }

Target:
private boolean hasMetatypesForService( Map<String, Object> service, Set<MetaTypeInformation> metatypeInformations) { String id = (String) service.get("id"); if (id == null) { return false; } Boolean isFactory = (Boolean) service.get("factory"); if (isFactory == null) { return false; } Stream<MetaTypeInformation> infoStream = metatypeInformations.stream().filter(Objects::nonNull); return (isFactory ? infoStream.map(MetaTypeInformation::getFactoryPids) : infoStream.map(MetaTypeInformation::getPids)) .filter(Objects::nonNull) .flatMap(Arrays::stream) .anyMatch(id::equals); }
Source:
public void onStart() { super.onStart(); if (config.getFabricConfig().getKitsConfig().getBranchConfig().isEnabled()) { Branch branch = Branch.getInstance(getApplicationContext()); branch.initSession(new Branch.BranchReferralInitListener() { @Override public void onInitFinished(JSONObject referringParams, BranchError error) { if (error == null) { } else { logger.error(new Exception("Branch not configured properly, error:\n" + error.getMessage()), true); } } }, this.getIntent().getData(), this); finish(); } }

Target:
public void onStart() { super.onStart(); if (Config.FabricBranchConfig.isBranchEnabled(config.getFabricConfig())) { final Branch branch = Branch.getInstance(getApplicationContext()); branch.initSession(new Branch.BranchReferralInitListener() { @Override public void onInitFinished(JSONObject referringParams, BranchError error) { if (error == null) { } else { logger.error(new Exception("Branch not configured properly, error:\n" + error.getMessage()), true); } } }, this.getIntent().getData(), this); finish(); } }
Source:
@Override public String toString() { final StringBuilder outputStreamStats = new StringBuilder( "OutputStream Statistics{"); outputStreamStats.append(IOStatisticsLogging.ioStatisticsSourceToString(ioStatisticsStore)); outputStreamStats.append("}"); return outputStreamStats.toString(); }

Target:
@Override public String toString() { final StringBuilder outputStreamStats = new StringBuilder( "OutputStream Statistics{"); outputStreamStats.append(ioStatisticsStore.toString()); outputStreamStats.append("}"); return outputStreamStats.toString(); }
Source:
public void testInvalidCassandraHostsFailsValidation() { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, "something"); BluefloodServiceStarterException ex = null; try { BluefloodServiceStarter.validateCassandraHosts(); } catch (BluefloodServiceStarterException e) { ex = e; } assertNotNull(ex); assertEquals(-1, ex.getStatus()); }

Target:
public void testInvalidCassandraHostsFailsValidation() { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, "something"); BluefloodServiceStarter.validateCassandraHosts(); }