auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void restartRmAndCheckFinalState(boolean nodesShouldBeRecreated) throws Exception { rmHelper = new RMTHelper(); startRmWithConfig(RESTART_CONFIG); <START> Assert.assertFalse("Nodes preservation should not be activated on RM restart for the test", <END> PAResourceManagerProperties.RM_PRESERVE_NODES_ON_EXIT.getValueAsBoolean()); assertThat(rmHelper.isRMStarted()).isTrue(); RMMonitorEventReceiver resourceManagerMonitor = (RMMonitorEventReceiver) resourceManager; ArrayList<RMNodeSourceEvent> nodeSourceEvent = resourceManagerMonitor.getInitialState().getNodeSource(); assertThat(nodeSourceEvent.size()).isEqualTo(1); assertThat(nodeSourceEvent.get(0).getSourceName()).isEqualTo(NODE_SOURCE_NAME); if (nodesShouldBeRecreated) { rmHelper.waitForAnyMultipleNodeEvent(RMEventType.NODE_STATE_CHANGED, TestSSHInfrastructureV2.NB_NODES); } Set<String> allNodes = resourceManagerMonitor.getState().getAllNodes(); assertThat(allNodes.size()).isEqualTo(TestSSHInfrastructureV2.NB_NODES); Set<String> nodeSourceNames = new HashSet<>(); nodeSourceNames.add(NODE_SOURCE_NAME); Set<String> aliveNodeUrls = resourceManager.listAliveNodeUrls(nodeSourceNames); assertThat(aliveNodeUrls.size()).isEqualTo(TestSSHInfrastructureV2.NB_NODES); BooleanWrapper lockSucceeded = resourceManager.lockNodes(allNodes); assertThat(lockSucceeded).isEqualTo(new BooleanWrapper(true)); BooleanWrapper unlockSucceeded = resourceManager.unlockNodes(allNodes); assertThat(unlockSucceeded).isEqualTo(new BooleanWrapper(true)); }</code><technical_language>Replace Assert.assertFalse assertThat library in class</technical_language>

Target:
private void restartRmAndCheckFinalState(boolean nodesShouldBeRecreated) throws Exception { rmHelper = new RMTHelper(); startRmWithConfig(RESTART_CONFIG); assertThat(PAResourceManagerProperties.RM_PRESERVE_NODES_ON_EXIT.getValueAsBoolean()).isFalse(); assertThat(rmHelper.isRMStarted()).isTrue(); RMMonitorEventReceiver resourceManagerMonitor = (RMMonitorEventReceiver) resourceManager; ArrayList<RMNodeSourceEvent> nodeSourceEvent = resourceManagerMonitor.getInitialState().getNodeSource(); assertThat(nodeSourceEvent.size()).isEqualTo(1); assertThat(nodeSourceEvent.get(0).getSourceName()).isEqualTo(NODE_SOURCE_NAME); if (nodesShouldBeRecreated) { rmHelper.waitForAnyMultipleNodeEvent(RMEventType.NODE_STATE_CHANGED, TestSSHInfrastructureV2.NB_NODES); } Set<String> allNodes = resourceManagerMonitor.getState().getAllNodes(); assertThat(allNodes.size()).isEqualTo(TestSSHInfrastructureV2.NB_NODES); Set<String> nodeSourceNames = new HashSet<>(); nodeSourceNames.add(NODE_SOURCE_NAME); Set<String> aliveNodeUrls = resourceManager.listAliveNodeUrls(nodeSourceNames); assertThat(aliveNodeUrls.size()).isEqualTo(TestSSHInfrastructureV2.NB_NODES); BooleanWrapper lockSucceeded = resourceManager.lockNodes(allNodes); assertThat(lockSucceeded).isEqualTo(new BooleanWrapper(true)); BooleanWrapper unlockSucceeded = resourceManager.unlockNodes(allNodes); assertThat(unlockSucceeded).isEqualTo(new BooleanWrapper(true)); }
Source:
<code>public void createEnhancementTest() throws Exception { <START> mvFile = moveDir.newFile(fileName + ".PNG"); <END> mvFile.deleteOnExit(); processor.process(exchange); assertTrue(mvFile.exists()); }</code><technical_language>Hmm, a bit confused, this test is testing supposed be. I need re-examine some parts of workflow for derivatives</technical_language>

Target:
public void createEnhancementTest() throws Exception { mvFile = new File(finalDir.getAbsolutePath() + "/"+ fileName + ".PNG"); processor.process(exchange); assertTrue(mvFile.exists()); }
Source:
<code>public FunctionRequirements requirements( SwaptionTrade trade, Set<Measure> measures, CalculationParameters parameters, ReferenceData refData) { Swaption product = trade.getProduct(); IborIndex index = product.getIndex(); SwaptionMarketLookup swaptionLookup = parameters.getParameter(SwaptionMarketLookup.class); <START> FunctionRequirements swaptionReqs = swaptionLookup.requirements(ImmutableSet.of(index)); <END> ImmutableSet<MarketDataKey<?>> valueReqs = ImmutableSet.<MarketDataKey<?>>builder() .add(DiscountCurveKey.of(product.getCurrency())) .add(IborIndexCurveKey.of(index)) .addAll(swaptionReqs.getSingleValueRequirements()) .build(); return FunctionRequirements.builder() .singleValueRequirements(valueReqs) .timeSeriesRequirements(IndexRateKey.of(index)) .outputCurrencies(product.getCurrency()) .build(); }</code><technical_language>This SwaptionMarketLookup.requirements a varargs parameter</technical_language>

Target:
public FunctionRequirements requirements( SwaptionTrade trade, Set<Measure> measures, CalculationParameters parameters, ReferenceData refData) { Swaption product = trade.getProduct(); IborIndex index = product.getIndex(); SwaptionMarketDataLookup swaptionLookup = parameters.getParameter(SwaptionMarketDataLookup.class); FunctionRequirements swaptionReqs = swaptionLookup.requirements(index); ImmutableSet<MarketDataKey<?>> valueReqs = ImmutableSet.<MarketDataKey<?>>builder() .add(DiscountCurveKey.of(product.getCurrency())) .add(IborIndexCurveKey.of(index)) .addAll(swaptionReqs.getSingleValueRequirements()) .build(); return FunctionRequirements.builder() .singleValueRequirements(valueReqs) .timeSeriesRequirements(IndexRateKey.of(index)) .outputCurrencies(product.getCurrency()) .build(); }
Source:
<code>private boolean readNeedsLock(InvocationContext ctx, FlagAffectedCommand command) { return ctx.isInTxScope() && ctx.isOriginLocal() && <START> command.hasAnyFlag(FlagBitSets.FORCE_WRITE_LOCK) && <END> !hasSkipLocking(command); }</code><technical_language>command.getFlagBitSet() & (FlagBitSets.FORCE_WRITE_LOCK | FlagBitSets.SKIP_LOCKING) == FlagBitSets.FORCE_WRITE_LOCK throw exception flags together</technical_language>

Target:
private boolean readNeedsLock(InvocationContext ctx, FlagAffectedCommand command) { if (ctx.isInTxScope() && ctx.isOriginLocal()) { boolean forceWriteLock = command.hasAnyFlag(FlagBitSets.FORCE_WRITE_LOCK); if (forceWriteLock && hasSkipLocking(command)) { throw log.invalidForceWriteLockAndSkipLockingFlags(); } return forceWriteLock; } else { return false; } }
Source:
<code>public EmbeddedDatabaseInfo getEmbeddedDatabaseInfo(Stack stack) { if (stack.getCluster().getEmbeddedDatabaseOnAttachedDisk()) { int volumeCount = calculateVolumeCountOnGatewayGroup(stack); return new EmbeddedDatabaseInfo(volumeCount > 0, volumeCount); } else { return new EmbeddedDatabaseInfo(false, 0); <START> } <END> }</code><technical_language>This simplified passing volume count calculate true/false in constructor. This reduce code duplication well</technical_language>

Target:
public EmbeddedDatabaseInfo getEmbeddedDatabaseInfo(Stack stack) { if (stack.getCluster().getEmbeddedDatabaseOnAttachedDisk()) { int volumeCount = calculateVolumeCountOnGatewayGroup(stack); return new EmbeddedDatabaseInfo(volumeCount); } else { return new EmbeddedDatabaseInfo(0); } }
Source:
<code>public static String typeNameFor(final Type type) { String typeName = typeNameLookup.get(type); if (typeName == null) { Class<?> clazz = (Class<?>) type; if ("java.time.LocalDate".equals(clazz.getName())) { typeName = "date"; } else if ("java.time.LocalDateTime".equals(clazz.getName())) { typeName = "date-time"; } } return typeName; <START> } <END></code><technical_language>tests cover this method! :open_mouth:</technical_language>

Target:
public static String typeNameFor(final Type type) { return typeNameLookup.get(type); }
Source:
<code>public VariableDeclarator setType(final Type type) { assertNotNull(type); notifyPropertyChange(ObservableProperty.TYPE, this.type, type); if (this.getParentNode().isPresent() && this.getParentNode().get() instanceof NodeWithVariables) { NodeWithVariables nodeWithVariables = (NodeWithVariables)this.getParentNode().get(); Type currentMaxCommonType = nodeWithVariables.getMaximumCommonType(); <START> List<Type> types = new LinkedList<>(); <END> int index = nodeWithVariables.getVariables().indexOf(this); for (int i=0;i<nodeWithVariables.getVariables().size();i++) { if (i == index) { types.add(type); } else { types.add(nodeWithVariables.getVariable(i).getType()); } } Type newMaxCommonType = NodeWithVariables.maximumCommonType(types); ((Node)nodeWithVariables).notifyPropertyChange(ObservableProperty.MAXIMUM_COMMON_TYPE, currentMaxCommonType, newMaxCommonType); } if (this.type != null) { this.type.setParentNode(null); } this.type = type; setAsParentNodeOf(type); return this; }</code><technical_language>this a generated method? I disapprove of adding exceptions generators :(</technical_language>

Target:
public VariableDeclarator setType(final Type type) { assertNotNull(type); notifyPropertyChange(ObservableProperty.TYPE, this.type, type); if (this.type != null) this.type.setParentNode(null); this.type = type; setAsParentNodeOf(type); return this; }
Source:
<code>public Map<String, Object> getDeliveryAnnotations() { if (deliveryAnnotations == null) { <START> this.deliveryAnnotations = new HashMap<>(); <END> } return deliveryAnnotations; }</code><technical_language>Inconsistent of this. do instantiation in constructor final. do .getDeliveryAnnotations() serialising deserialising, saving time</technical_language>

Target:
public Map<String, Object> getDeliveryAnnotations() { return deliveryAnnotations; }
Source:
<code>static void addMptrToDiv(LinkedMetsResource link, DivType div) { div.setORDER(link.getOrder()); Mptr mptr = new Mptr(); if (ALLOWED_LOCTYPE_VALUES.contains(link.getLoctype())) { mptr.setLOCTYPE(link.getLoctype()); } else { mptr.setLOCTYPE(OTHER); mptr.setOTHERLOCTYPE(Objects.toString(link.getLoctype())); } <START> mptr.setHref(link.getUri().toASCIIString()); <END> div.getMptr().add(mptr); }</code><technical_language>do convert asciistring</technical_language>

Target:
static void addMptrToDiv(LinkedMetsResource link, DivType div) { div.setORDER(link.getOrder()); Mptr mptr = new Mptr(); if (AllowedLoctypeValues.contains(link.getLoctype())) { mptr.setLOCTYPE(link.getLoctype()); } else { mptr.setLOCTYPE(AllowedLoctypeValues.OTHER.toString()); mptr.setOTHERLOCTYPE(Objects.toString(link.getLoctype())); } mptr.setHref(link.getUri().toASCIIString()); div.getMptr().add(mptr); }
Source:
<code>protected Pair<Boolean, EngineFault> runConnectionStorageToDomain(StorageDomain storageDomain, Guid vdsId, int type) { Guid poolId = Guid.Empty; if (storageDomain.getStoragePoolId() != null) { poolId = storageDomain.getStoragePoolId(); <START> } <END> return runConnectionStorageToDomain(storageDomain, vdsId, type, null, poolId); }</code><technical_language>pass storageDomain.getStoragePoolId(), called method is handling null pool id, please change rebase patch. other good me</technical_language>

Target:
protected Pair<Boolean, EngineFault> runConnectionStorageToDomain(StorageDomain storageDomain, Guid vdsId, int type) { return runConnectionStorageToDomain(storageDomain, vdsId, type, null, storageDomain.getStoragePoolId()); }
Source:
<code>private static String removeNonDefault(String key, Map<String, String> options, Map<String, String> defaults) { String defaultValue = defaults.get(key); if (options.containsKey(key)) { String value = options.remove(key); <START> if (!defaultValue.equals(value)) { <END> return value; } } return null; }</code><technical_language>NPE I mistaken -- defaultValue</technical_language>

Target:
private static String removeNonDefault(String key, Map<String, String> options, Map<String, String> defaults) { String defaultValue = defaults.get(key); if (options.containsKey(key)) { String value = options.remove(key); if (defaultValue == null || !defaultValue.equals(value)) { return value; } } return null; }
Source:
<code>private JobAttempt newJob(AlluxioURI filePath, int replication) { <START> final ClientContext clientContext = ClientContext.create(mFsContext.getPathConf(filePath)); <END> if (mClient == null) { mClient = JobMasterClient.Factory.create( JobMasterClientContext.newBuilder(clientContext).build()); } JobAttempt jobAttempt = new JobAttempt(new LoadConfig(filePath.getPath(), replication), new CountingRetry(3)); jobAttempt.run(); return jobAttempt; }</code><technical_language>Do need path-conf here</technical_language>

Target:
private JobAttempt newJob(AlluxioURI filePath, int replication) { JobAttempt jobAttempt = new JobAttempt(new LoadConfig(filePath.getPath(), replication), new CountingRetry(3)); jobAttempt.run(); return jobAttempt; }
Source:
<code>@Test public void testFilterRedundant() { assertModel(MODEL) .query( "select * from zips where state > 'CA' and state < 'PZ' and state = 'OK'") .runs() .queryContains( mongoChecker( <START> "{\n" <END> + " \"$match\": {\n" + " \"state\": \"OK\"\n" + " }\n" + "}", "{$project: {CITY: '$city', LONGITUDE: '$loc[0]', LATITUDE: '$loc[1]', POP: '$pop', STATE: '$state', ID: '$_id'}}")); }</code><technical_language>please clarify reason of this change</technical_language>

Target:
@Test public void testFilterRedundant() { assertModel(MODEL) .query( "select * from zips where state > 'CA' and state < 'AZ' and state = 'OK'") .runs() .queryContains(mongoChecker()); }
Source:
<code>public Double evaluate(final Double x) { <START> final CapFloorIbor capStrike = _capStandard.withStrike(x); <END> return presentValueStandard(capStrike, _curves).getAmount(_capStandard.getCurrency()); }</code><technical_language>This faster if CapFloorIbor a MulticurveProviderInterface, cached constant values (fwd, df, t) called BlackFormulaRepository.price strike volatility</technical_language>

Target:
public Double evaluate(final Double x) { return presentValueStandard(_forward, x, _expiry, _capStandard.isCap(), _df, _capStandard.getNotional(), _capStandard.getPaymentYearFraction()); }
Source:
<code>private int getIndexOfTableForColumn(QueryModel model, CharSequence column, int dot, int position) throws SqlException { <START> column = Chars.toLowerCase(column); <END> ObjList<QueryModel> joinModels = model.getJoinModels(); int index = -1; if (dot == -1) { for (int i = 0, n = joinModels.size(); i < n; i++) { if (joinModels.getQuick(i).getAliasToColumnMap().excludes(column)) { continue; } if (index != -1) { throw SqlException.ambiguousColumn(position); } index = i; } if (index == -1) { throw SqlException.invalidColumn(position, column); } } else { index = model.getAliasIndex(column, 0, dot); if (index == -1) { throw SqlException.$(position, "Invalid table name or alias"); } if (joinModels.getQuick(index).getAliasToColumnMap().excludes(column, dot + 1, column.length())) { throw SqlException.invalidColumn(position, column); } } return index; }</code><technical_language>unnecessary</technical_language>

Target:
private int getIndexOfTableForColumn(QueryModel model, CharSequence column, int dot, int position) throws SqlException { ObjList<QueryModel> joinModels = model.getJoinModels(); int index = -1; if (dot == -1) { for (int i = 0, n = joinModels.size(); i < n; i++) { if (joinModels.getQuick(i).getAliasToColumnMap().excludes(column)) { continue; } if (index != -1) { throw SqlException.ambiguousColumn(position); } index = i; } if (index == -1) { throw SqlException.invalidColumn(position, column); } } else { index = model.getAliasIndex(column, 0, dot); if (index == -1) { throw SqlException.$(position, "Invalid table name or alias"); } if (joinModels.getQuick(index).getAliasToColumnMap().excludes(column, dot + 1, column.length())) { throw SqlException.invalidColumn(position, column); } } return index; }
Source:
<code>public ThrowableProblem getCause() { final Throwable cause = super.getCause(); if (cause == null) { return null; } <START> checkState(cause instanceof ThrowableProblem, "Expected throwable problem cause, but got %s", cause); <END> return (ThrowableProblem) cause; }</code><technical_language>check in constructor instead? give a stacktrace find error</technical_language>

Target:
public ThrowableProblem getCause() { return (ThrowableProblem) super.getCause(); }
Source:
<code>private void printAdditionalContext(Context additionalContext, String adminConsoleURL, String webContextRoot) { if ("/".equals(webContextRoot)) { webContextRoot = ""; } <START> if (additionalContext != null && !"".equals(additionalContext.getContextName()) && <END> !"null".equals(additionalContext.getContextName())) { int index = adminConsoleURL.lastIndexOf("carbon"); String defContextUrl = adminConsoleURL.substring(0, index); if (!"".equals(webContextRoot)) { defContextUrl = defContextUrl.replace(webContextRoot, ""); } defContextUrl += additionalContext.getContextName(); if (additionalContext.getDescription() != null) { if (additionalContext.getProtocol() != null && "http".equals(additionalContext.getProtocol())) { log.info(additionalContext.getDescription() + " : " + CarbonUIUtil.https2httpURL(defContextUrl)); } else { log.info(additionalContext.getDescription() + " : " + defContextUrl); } } else { log.info("Default Context : " + defContextUrl); } } }</code><technical_language>change this !additionalContext.getContextName().isEmpty()</technical_language>

Target:
private void printAdditionalContext(Context additionalContext, String adminConsoleURL, String webContextRoot) { if (webContextRoot == null || webContextRoot.isEmpty()) { log.error("WebContextRoot can't be null or empty. It should be either '/' or '/<some value>'"); return; } if ("/".equals(webContextRoot)) { webContextRoot = ""; } if (additionalContext != null && !"".equals(additionalContext.getContextName()) && !"null".equals(additionalContext.getContextName())) { int index = adminConsoleURL.lastIndexOf("carbon"); String defContextUrl = adminConsoleURL.substring(0, index); if (!"".equals(webContextRoot)) { defContextUrl = defContextUrl.replace(webContextRoot, ""); } defContextUrl += additionalContext.getContextName(); if (additionalContext.getDescription() != null) { if (additionalContext.getProtocol() != null && "http".equals(additionalContext.getProtocol())) { log.info(additionalContext.getDescription() + " : " + CarbonUIUtil.https2httpURL(defContextUrl)); } else { log.info(additionalContext.getDescription() + " : " + defContextUrl); } } else { log.info("Default Context : " + defContextUrl); } } }
Source:
<code>public void generate(Model model, Resource report) { Resource entry = model.createResource(); entry.addProperty(RDF.type, SHACLM.ValidationResult); report.addProperty(SHACLM.result, entry); Function<Node, RDFNode> rdfNode = (gn)->ModelUtils.convertGraphNodeToRDFNode(gn, entry.getModel()); Function<String, RDFNode> str = (s)->entry.getModel().createLiteral(s); Objects.requireNonNull(focusNode,"focus node"); Objects.requireNonNull(severity,"severity"); Objects.requireNonNull(sourceConstraintComponent, "sourceConstraintComponent"); entry.addProperty(SHACLM.focusNode, rdfNode.apply(focusNode)); entry.addProperty(SHACLM.resultSeverity, rdfNode.apply(severity.level())); entry.addProperty(SHACLM.sourceConstraintComponent, rdfNode.apply(sourceConstraintComponent)); <START> if ( messages != null ) { <END> for ( Node msg : messages ) entry.addProperty(SHACLM.resultMessage, rdfNode.apply(msg)); } if ( sourceConstraint != null ) entry.addProperty(SHACLM.sourceConstraint, rdfNode.apply(sourceConstraint)); if ( source != null ) entry.addProperty(SHACLM.sourceShape, rdfNode.apply(source)); if ( resultPath != null ) { Node pn = ShaclPaths.pathToRDF(model.getGraph()::add, resultPath); entry.addProperty(SHACLM.resultPath, rdfNode.apply(pn)); } if ( value != null ) entry.addProperty(SHACLM.value, rdfNode.apply(value)); }</code><technical_language>null a private/final ArrayList initialized in this class (other methods messages defensive check)</technical_language>

Target:
public void generate(Model model, Resource report) { Resource entry = model.createResource(); entry.addProperty(RDF.type, SHACLM.ValidationResult); report.addProperty(SHACLM.result, entry); Function<Node, RDFNode> rdfNode = (gn)->ModelUtils.convertGraphNodeToRDFNode(gn, entry.getModel()); Function<String, RDFNode> str = (s)->entry.getModel().createLiteral(s); Objects.requireNonNull(focusNode,"focus node"); Objects.requireNonNull(severity,"severity"); Objects.requireNonNull(sourceConstraintComponent, "sourceConstraintComponent"); entry.addProperty(SHACLM.focusNode, rdfNode.apply(focusNode)); entry.addProperty(SHACLM.resultSeverity, rdfNode.apply(severity.level())); entry.addProperty(SHACLM.sourceConstraintComponent, rdfNode.apply(sourceConstraintComponent)); for ( Node msg : messages ) entry.addProperty(SHACLM.resultMessage, rdfNode.apply(msg)); if ( sourceConstraint != null ) entry.addProperty(SHACLM.sourceConstraint, rdfNode.apply(sourceConstraint)); if ( source != null ) entry.addProperty(SHACLM.sourceShape, rdfNode.apply(source)); if ( resultPath != null ) { Node pn = ShaclPaths.pathToRDF(model.getGraph()::add, resultPath); entry.addProperty(SHACLM.resultPath, rdfNode.apply(pn)); } if ( value != null ) entry.addProperty(SHACLM.value, rdfNode.apply(value)); }
Source:
<code>protected Function<String, Comparator<DigitalExchangeComponent>> getComparators() { return sort -> { switch (sort) { case LAST_UPDATE: return (a, b) -> ObjectUtils.compare(a.getLastUpdate(), b.getLastUpdate()); case VERSION: <START> return (a, b) -> StringUtils.compare(a.getVersion(), b.getVersion()); <END> case TYPE: return (a, b) -> StringUtils.compareIgnoreCase(a.getType(), b.getType()); case RATING: return (a, b) -> Double.compare(a.getRating(), b.getRating()); case INSTALLED: return (a, b) -> Boolean.compare(a.isInstalled(), b.isInstalled()); case NAME: default: return (a, b) -> StringUtils.compareIgnoreCase(a.getName(), b.getName()); } }; }</code><technical_language>version requires exact match ignore case</technical_language>

Target:
protected Function<String, Comparator<DigitalExchangeComponent>> getComparators() { return sort -> { switch (sort) { case LAST_UPDATE: return (a, b) -> ObjectUtils.compare(a.getLastUpdate(), b.getLastUpdate()); case VERSION: return (a, b) -> StringUtils.compareIgnoreCase(a.getVersion(), b.getVersion()); case TYPE: return (a, b) -> StringUtils.compareIgnoreCase(a.getType(), b.getType()); case RATING: return (a, b) -> Double.compare(a.getRating(), b.getRating()); case INSTALLED: return (a, b) -> Boolean.compare(a.isInstalled(), b.isInstalled()); case NAME: default: return (a, b) -> StringUtils.compareIgnoreCase(a.getName(), b.getName()); } }; }
Source:
<code>public void init(BeaconState state, byte[]... pubKeys) { assert pubKeys.length > 0; this.validatorIndices = new HashSet<>(); for (byte[] pubKey : pubKeys) { Validator validator = state.getValidatorSet().getByPubKey(pubKey); if (validator != null) { this.validatorIndices.add(validator.getIndex()); this.pubKeysMap.put(validator.getIndex(), validator.getPubKey()); } else { logger.error("Failed to start proposer for {}: validator does not exist", HashUtil.shortHash(pubKey)); <START> return; <END> } this.validatorIndices.add(validator.getIndex()); } this.proposerThread = Executors.newSingleThreadScheduledExecutor((r) -> { Thread t = Executors.defaultThreadFactory().newThread(r); t.setName("beacon-proposer-thread"); t.setDaemon(true); return t; }); this.lastStateRecalc = state.getCrystallizedState().getLastStateRecalc(); submitIfAssigned(state.getCommittees()); publisher.subscribe(BeaconBlockImported.class, (data) -> { if (data.isBest() && data.getState().getCrystallizedState().getLastStateRecalc() > lastStateRecalc) { this.lastStateRecalc = data.getState().getCrystallizedState().getLastStateRecalc(); this.submitIfAssigned(data.getState().getCommittees()); } }); }</code><technical_language>throw exception this continue parse rest. better, I guess</technical_language>

Target:
public void init(BeaconState state, byte[]... pubKeys) { assert pubKeys.length > 0; for (byte[] pubKey : pubKeys) { Validator validator = state.getValidatorSet().getByPubKey(pubKey); if (validator != null) { this.pubKeysMap.put(validator.getIndex(), validator.getPubKey()); } else { logger.error("Failed to start proposer for {}: validator does not exist", HashUtil.shortHash(pubKey)); throw new RuntimeException(HashUtil.shortHash(pubKey) + " validator does not exist"); } } this.proposerThread = Executors.newSingleThreadScheduledExecutor((r) -> { Thread t = Executors.defaultThreadFactory().newThread(r); t.setName("beacon-proposer-thread"); t.setDaemon(true); return t; }); this.lastStateRecalc = state.getCrystallizedState().getLastStateRecalc(); submitIfAssigned(state.getCommittees()); publisher.subscribe(BeaconBlockImported.class, (data) -> { if (data.isBest() && data.getState().getCrystallizedState().getLastStateRecalc() > lastStateRecalc) { this.lastStateRecalc = data.getState().getCrystallizedState().getLastStateRecalc(); this.submitIfAssigned(data.getState().getCommittees()); } }); }
Source:
<code>public void callRandomTickEvent(World world, BlockPos pos, IBlockState state, Random rand, CallbackInfo ci) { <START> BlockRandomTickEvent event = SpongeEventFactory.createBlockRandomTick(Sponge.getGame(), null, new Location((Extent)world, VecHelper.toVector(pos))); <END> Sponge.getGame().getEventManager().post(event); if(event.isCancelled()) { ci.cancel(); } }</code><technical_language>Mark this final add a TODO fix</technical_language>

Target:
public void callRandomTickEvent(World world, BlockPos pos, IBlockState state, Random rand, CallbackInfo ci) { final BlockRandomTickEvent event = SpongeEventFactory.createBlockRandomTick(Sponge.getGame(), null, new Location((Extent)world, VecHelper.toVector(pos))); Sponge.getGame().getEventManager().post(event); if(event.isCancelled()) { ci.cancel(); } }
Source:
<code><START> public Constraint vehicleCapacity(ConstraintFactory factory) { <END> return factory.from(Customer.class) .groupBy(Customer::getVehicle, sum(Customer::getDemand)) .filter((vehicle, demand) -> demand > vehicle.getCapacity()) .penalizeLong("vehicleCapacity", HardSoftLongScore.ONE_HARD, (vehicle, demand) -> demand - vehicle.getCapacity()); }</code><technical_language>reason this is public, others protected</technical_language>

Target:
protected Constraint vehicleCapacity(ConstraintFactory factory) { return factory.from(Customer.class) .groupBy(Customer::getVehicle, sum(Customer::getDemand)) .filter((vehicle, demand) -> demand > vehicle.getCapacity()) .penalizeLong("vehicleCapacity", HardSoftLongScore.ONE_HARD, (vehicle, demand) -> demand - vehicle.getCapacity()); }
Source:
<code>protected int calculateActualMaximumSize(LocalSearchSolverPhaseScope scope) { <START> return this.calculateFadingTabuSize(scope) + this.calculateRegularTabuSize(scope); <END> }</code><technical_language>Mind removing "this." matches rest of planner code style</technical_language>

Target:
protected int calculateActualMaximumSize(LocalSearchSolverPhaseScope scope) { return calculateFadingTabuSize(scope) + calculateRegularTabuSize(scope); }
Source:
<code>public void hasObjMapRefsNoIndexObjects() throws IOException { ArrayList<Ref> refs = new ArrayList<>(); refs.add(ref(MASTER, 1)); ReftableConfig cfg = new ReftableConfig(); cfg.setIndexObjects(false); byte[] table = write(refs, cfg); ReftableReader t = read(table); <START> assertFalse(t.hasObjectMap()); <END> }</code><technical_language>this method returns true, test fails</technical_language>

Target:
public void hasObjMapRefsNoIndexObjects() throws IOException { ArrayList<Ref> refs = new ArrayList<>(); ReftableConfig cfg = new ReftableConfig(); cfg.setIndexObjects(false); cfg.setRefBlockSize(256); cfg.setAlignBlocks(true); int N = 256 * 5 / 25; for (int i= 0; i < N; i++) { refs.add(ref(String.format("%02d/xxxxxxxxxx", i), i)); } byte[] table = write(refs, cfg); ReftableReader t = read(table); assertFalse(t.hasObjectMap()); }
Source:
<code>private Set<URI> fetchInstances(final URI type) throws QueryEvaluationException { final Set<URI> instances = new HashSet<>(); CloseableIteration<Statement, QueryEvaluationException> iter = RyaDAOHelper.query( ryaDAO, null, RDF.TYPE, type, conf); try { while (iter.hasNext()) { final Statement st = iter.next(); if (st.getSubject() instanceof URI) { instances.add((URI) st.getSubject()); } } } finally { if (iter != null) { iter.close(); } <START> } <END> return instances; }</code><technical_language>This reduced to: ryaDaoQueryWrapper.queryAll(null, RDF.TYPE, type, new RDFHandlerBase() { @Override public void handleStatement(final Statement st) throws RDFHandlerException { if (st.getSubject() instanceof URI) { instances.add((URI) st.getSubject()); } } });</technical_language>

Target:
private Set<URI> fetchInstances(final URI type) throws QueryEvaluationException { final Set<URI> instances = new HashSet<>(); ryaDaoQueryWrapper.queryAll(null, RDF.TYPE, type, new RDFHandlerBase() { @Override public void handleStatement(final Statement st) throws RDFHandlerException { if (st.getSubject() instanceof URI) { instances.add((URI) st.getSubject()); } } }); return instances; }
Source:
<code>public String getName() { <START> return "BOOTSTRAP_LOAD"; <END> }</code><technical_language>task name REPL_LOAD uniform REPL_DUMP</technical_language>

Target:
public String getName() { return "REPL_BOOTSTRAP_LOAD"; }
Source:
<code>public static Media from(MwQueryPage page) { ImageInfo imageInfo = page.imageInfo(); if(imageInfo == null) { return null; } ExtMetadata metadata = imageInfo.getMetadata(); if (metadata == null) { return new Media(null, imageInfo.getOriginalUrl(), page.title(), "", 0, null, null, null); } Media media = new Media(null, imageInfo.getOriginalUrl(), page.title(), "", 0, DateUtils.getDateFromString(metadata.dateTimeOriginal().value()), DateUtils.getDateFromString(metadata.dateTime().value()), StringUtils.getParsedStringFromHtml(metadata.artist().value()) ); media.setDescriptions(Collections.singletonMap("default", metadata.imageDescription().value())); media.setCategories(MediaDataExtractorUtil.extractCategoriesFromList(metadata.categories().value())); String latitude = metadata.gpsLatitude().value(); String longitude = metadata.gpsLongitude().value(); <START> <END> if(!StringUtils.isNullOrWhiteSpace(latitude) && !StringUtils.isNullOrWhiteSpace(longitude)) { LatLng latLng = new LatLng(Double.parseDouble(latitude), Double.parseDouble(longitude), 0); media.setCoordinates(latLng); } media.setLicense(metadata.licenseShortName().value()); return media; }</code><technical_language>@maskaravivek explain this lines unnecessary</technical_language>

Target:
public static Media from(MwQueryPage page) { ImageInfo imageInfo = page.imageInfo(); if(imageInfo == null) { return null; } ExtMetadata metadata = imageInfo.getMetadata(); if (metadata == null) { return new Media(null, imageInfo.getOriginalUrl(), page.title(), "", 0, null, null, null); } Media media = new Media(null, imageInfo.getOriginalUrl(), page.title(), "", 0, DateUtils.getDateFromString(metadata.dateTimeOriginal().value()), DateUtils.getDateFromString(metadata.dateTime().value()), StringUtils.getParsedStringFromHtml(metadata.artist().value()) ); String language = Locale.getDefault().getLanguage(); if (StringUtils.isNullOrWhiteSpace(language)) { language = "default"; } media.setDescriptions(Collections.singletonMap(language, metadata.imageDescription().value())); media.setCategories(MediaDataExtractorUtil.extractCategoriesFromList(metadata.categories().value())); String latitude = metadata.gpsLatitude().value(); String longitude = metadata.gpsLongitude().value(); if(!StringUtils.isNullOrWhiteSpace(latitude) && !StringUtils.isNullOrWhiteSpace(longitude)) { LatLng latLng = new LatLng(Double.parseDouble(latitude), Double.parseDouble(longitude), 0); media.setCoordinates(latLng); } media.setLicenseInformation(metadata.licenseShortName().value(), metadata.licenseUrl().value()); return media; }
Source:
<code>AuthFileCredential(String filepath, IdentityClientOptions identityClientOptions) { Objects.requireNonNull(filepath, "'filepath' cannot be null."); Objects.requireNonNull(identityClientOptions, "'identityClientOptions' cannot be null."); this.filepath = filepath; this.identityClientOptions = identityClientOptions; <START> ensureCredential(); <END> }</code><technical_language>code is in ensureCredential today pull constructor now? place call simplify things</technical_language>

Target:
AuthFileCredential(String filepath, IdentityClientOptions identityClientOptions) { Objects.requireNonNull(filepath, "'filepath' cannot be null."); Objects.requireNonNull(identityClientOptions, "'identityClientOptions' cannot be null."); this.filepath = filepath; this.identityClientOptions = identityClientOptions; }
Source:
<code>public void testList() throws IOException { if (skipTest()) return; final File a = new File(root, "a"); final File b = new File(root, "b"); final File d = new File(root, "d"); write(a, "a"); access.symlink(b, "a"); assertTrue("created " + d, d.mkdir()); DirEnt[] ent = access.list(root); assertEquals(4, ent.length); Arrays.sort(ent, new Comparator<DirEnt>() { public int compare(DirEnt a, DirEnt b) { return a.getName().compareTo(b.getName()); } }); DirEnt ent_git = ent[0]; DirEnt ent_a = ent[1]; DirEnt ent_b = ent[2]; DirEnt ent_d = ent[3]; assertEquals(".git", ent_git.getName()); assertEquals("a", ent_a.getName()); assertEquals("b", ent_b.getName()); <START> assertEquals("d", ent_d.getName()); <END> assertEquals(DirEnt.TYPE_DIRECTORY, ent_git.getType()); assertEquals(DirEnt.TYPE_FILE, ent_a.getType()); assertEquals(DirEnt.TYPE_SYMLINK, ent_b.getType()); assertEquals(DirEnt.TYPE_DIRECTORY, ent_d.getType()); }</code><technical_language>need test non-ascii names match java API's do</technical_language>

Target:
public void testList() throws IOException { if (skipTest()) return; final File a = new File(root, "a€"); final File b = new File(root, "b€"); final File d = new File(root, "d€"); write(a, "a€"); access.symlink(b, "a€"); assertTrue("created " + d, d.mkdir()); for (int i = 0; i < 116; i++) { final String name = fileName(i); final File f = new File(root, name); write(f, name); } DirEnt[] ent = access.list(root); assertEquals(120, ent.length); Arrays.sort(ent, new Comparator<DirEnt>() { public int compare(DirEnt d1, DirEnt d2) { return d1.getName().compareTo(d2.getName()); } }); DirEnt ent_git = ent[0]; DirEnt ent_a = ent[1]; DirEnt ent_b = ent[2]; DirEnt ent_d = ent[3]; assertEquals(".git", ent_git.getName()); assertEquals("a€", ent_a.getName()); assertEquals("b€", ent_b.getName()); assertEquals("d€", ent_d.getName()); assertEquals(DirEnt.TYPE_DIRECTORY, ent_git.getType()); assertEquals(DirEnt.TYPE_FILE, ent_a.getType()); assertEquals(DirEnt.TYPE_SYMLINK, ent_b.getType()); assertEquals(DirEnt.TYPE_DIRECTORY, ent_d.getType()); for (int i = 4; i < 120; i++) { DirEnt e = ent[i]; assertEquals(fileName(i - 4), e.getName()); assertEquals(DirEnt.TYPE_FILE, e.getType()); } }
Source:
<code><START> PRED_commit_delta_4(Term a1, Term a2, Term a3, Term a4, Operation n) { <END> arg1 = a1; arg2 = a2; arg3 = a3; arg4 = a4; cont = n; }</code><technical_language>public</technical_language>

Target:
public PRED_commit_delta_4(Term a1, Term a2, Term a3, Term a4, Operation n) { arg1 = a1; arg2 = a2; arg3 = a3; arg4 = a4; cont = n; }
Source:
<code>public void verifyPinDataWasChanged(String pinName, String pinDesc) { waitForElementVisibleByElement(mapFrame); driver.switchTo().frame(mapFrame); waitForElementVisibleByElement(popUpContent); scrollToElement(popUpContent); waitForElementVisibleByElement(pinTitle); waitForElementVisibleByElement(pinDescription); String actualTitle = pinTitle.getText(); String actualDesc = pinDescription.getText(); <START> Assertion.assertNotEquals(pinName, actualTitle); <END> Assertion.assertNotEquals(pinDesc, actualDesc); }</code><technical_language>pinTitle.getText(); remove variable is once</technical_language>

Target:
public void verifyPinDataWasChanged(String pinName, String pinDesc) { waitForElementVisibleByElement(mapFrame); driver.switchTo().frame(mapFrame); waitForElementVisibleByElement(popUpContent); scrollToElement(popUpContent); waitForElementVisibleByElement(pinTitle); waitForElementVisibleByElement(pinDescription); Assertion.assertNotEquals(pinName, pinTitle.getText()); Assertion.assertNotEquals(pinDesc, pinDescription.getText()); }
Source:
<code>public void testStr() throws Exception { checkStr("''", "", false, false, false, false); checkStr("'s'", "s", false, false, false, false); checkStr("b''", "", true, false, false, false); checkStr("b's'", "s", true, false, false, false); checkStr("f''", "", false, true, false, false); <START> checkStr("f's'", "s", false, true, false, false); <END> }</code><technical_language>checked is br rb. check too</technical_language>

Target:
public void testStr() throws Exception { checkStr("''", "", false, false, false, false); checkStr("'s'", "s", false, false, false, false); checkStr("r''", "", false, false, false, true); checkStr("r's'", "s", false, false, false, true); checkStr("b''", "", true, false, false, false); checkStr("b's'", "s", true, false, false, false); checkStr("br''", "", true, false, false, true); checkStr("br's'", "s", true, false, false, true); checkStr("rb''", "", true, false, false, true); checkStr("rb's'", "s", true, false, false, true); checkStr("f''", "", false, true, false, false); checkStr("f's'", "s", false, true, false, false); checkStr("fr''", "", false, true, false, true); checkStr("fr's'", "s", false, true, false, true); checkStr("rf''", "", false, true, false, true); checkStr("rf's'", "s", false, true, false, true); }
Source:
<code>private static IRemoteConnection getConnection(Map<?,?> parameters) { Object remoteServicesId = parameters.get(PARAMETER_REMOTE_SERVICES_ID); Object connectionName = parameters.get(PARAMETER_CONNECTION_NAME); if ((remoteServicesId != null) && (connectionName != null)) { return RemoteSystemProxy.getRemoteConnection( NonNullUtils.checkNotNull(remoteServicesId.toString()), <START> NonNullUtils.checkNotNull(connectionName.toString())); <END> } final INewConnectionDialog dialog = TraceControlDialogFactory.getInstance().getNewConnectionDialog(); if (dialog.open() == Window.OK) { return dialog.getConnection(); } return null; }</code><technical_language>statically import NonNullUtils.checkNotNull, especially if more in class</technical_language>

Target:
private static IRemoteConnection getConnection(Map<?,?> parameters) { Object remoteServicesId = parameters.get(PARAMETER_REMOTE_SERVICES_ID); Object connectionName = parameters.get(PARAMETER_CONNECTION_NAME); if ((remoteServicesId != null) && (connectionName != null)) { return RemoteSystemProxy.getRemoteConnection( checkNotNull(remoteServicesId.toString()), checkNotNull(connectionName.toString())); } final INewConnectionDialog dialog = TraceControlDialogFactory.getInstance().getNewConnectionDialog(); if (dialog.open() == Window.OK) { return dialog.getConnection(); } return null; }
Source:
<code>public String run(@Nonnull EnvVars launchEnv, @Nonnull String image, @CheckForNull String args, @CheckForNull String workdir, @Nonnull Map<String, String> volumes, @Nonnull EnvVars containerEnv, @Nonnull String user, @CheckForNull String... command) throws IOException, InterruptedException { ArgumentListBuilder argb = new ArgumentListBuilder(); argb.add("run", "-t", "-d", "-u", user); <START> argb.addTokenized(args); <END> if (workdir != null) { argb.add("-w", workdir); } for (Map.Entry<String, String> volume : volumes.entrySet()) { argb.add("-v", volume.getKey() + ":" + volume.getValue() + ":rw"); } for (Map.Entry<String, String> variable : containerEnv.entrySet()) { argb.add("-e"); argb.addMasked(variable.getKey()+"="+variable.getValue()); } if (command != null) { argb.add(image).add(command); } LaunchResult result = launch(launchEnv, false, null, argb); if (result.getStatus() == 0) { return result.getOut(); } else { throw new IOException(String.format("Failed to run image '%s'. Error: %s", image, result.getErr())); } }</code><technical_language>args, argb, supposed checked for null</technical_language>

Target:
public String run(@Nonnull EnvVars launchEnv, @Nonnull String image, @CheckForNull String args, @CheckForNull String workdir, @Nonnull Map<String, String> volumes, @Nonnull EnvVars containerEnv, @Nonnull String user, @CheckForNull String... command) throws IOException, InterruptedException { ArgumentListBuilder argb = new ArgumentListBuilder(); argb.add("run", "-t", "-d", "-u", user); if (args != null) { argb.addTokenized(args); } if (workdir != null) { argb.add("-w", workdir); } for (Map.Entry<String, String> volume : volumes.entrySet()) { argb.add("-v", volume.getKey() + ":" + volume.getValue() + ":rw"); } for (Map.Entry<String, String> variable : containerEnv.entrySet()) { argb.add("-e"); argb.addMasked(variable.getKey()+"="+variable.getValue()); } if (command != null) { argb.add(image).add(command); } LaunchResult result = launch(launchEnv, false, null, argb); if (result.getStatus() == 0) { return result.getOut(); } else { throw new IOException(String.format("Failed to run image '%s'. Error: %s", image, result.getErr())); } }
Source:
<code>public Collection<Metric> poll(int size, long maxWaitMillis) throws InterruptedException { Preconditions.checkArgument(size > 0); long timeout = System.currentTimeMillis() + maxWaitMillis; do { synchronized (this) { <START> final Metric first = queue.poll(); <END> if (first != null) { final Collection<Metric> metrics = new ArrayList<>(size); metrics.add(first); while (metrics.size() < size) { final Metric m = queue.poll(); if (m == null) { log.debug("No more metrics in queue, retrieved metrics", metrics.size()); break; } metrics.add(m); } for (final Map.Entry<String,Long> e : clientCounts(metrics).entrySet()) { incrementPerClientBacklog(e.getKey(), - e.getValue()); } return metrics; } } Thread.sleep(1); } while (System.currentTimeMillis() < timeout); log.debug("Unable to retrieve a single element after max wait"); return Collections.emptyList(); }</code><technical_language>change wait logic</technical_language>

Target:
public Collection<Metric> poll(int size, long maxWaitMillis) throws InterruptedException { Preconditions.checkArgument(size > 0); final Metric first = queue.poll(maxWaitMillis, TimeUnit.MILLISECONDS); if (first == null) { log.debug("Unable to retrieve a single element after max wait"); return Collections.emptyList(); } final Collection<Metric> metrics = new ArrayList<>(size); metrics.add(first); while (metrics.size() < size) { final Metric m = queue.poll(); if (m == null) { log.debug("No more metrics in queue, retrieved metrics", metrics.size()); break; } metrics.add(m); } for (final Multiset.Entry<String> e : clientCounts(metrics).entrySet()) { perClientBacklog.addAndGet(e.getElement(), - e.getCount()); } perClientBacklog.removeAllZeros(); return metrics; }
Source:
<code>public String[] getArray(String key) { <START> if(key.contains("ethiopian")){ <END> return context.getResources().getStringArray(R.array.ethiopian_months); } else if(key.contains("nepali")){ return context.getResources().getStringArray(R.array.nepali_months); } throw new Resources.NotFoundException("Couldn't find Android array for key " + key); }</code><technical_language>imprecision of this worries me. For instance, if 2 ethiopian related arrays: days months</technical_language>

Target:
public String[] getArray(String key) { int resourceId = context.getResources().getIdentifier(key, "array", context.getPackageName()); if (resourceId == 0) { throw new RuntimeException("Localized array data for '" + key + "' not found"); } return context.getResources().getStringArray(resourceId); }
Source:
<code>void testShouldRunRxTransactionFunctionExampleReactor() throws Exception { try ( RxTransactionFunctionExample example = new RxTransactionFunctionExample( uri, USER, PASSWORD ) ) { try ( Session session = neo4j.driver().session() ) { session.run( "UNWIND ['Infinity Gauntlet', 'Mjölnir'] AS item " + "CREATE (:Product {id: 0, title: item})" ); } StdIOCapture stdIOCapture = new StdIOCapture(); CountDownLatch latch = new CountDownLatch( 1 ); try ( AutoCloseable ignore = stdIOCapture.capture() ) { Mono.from( example.printAllProductsReactor() ) .doAfterTerminate( () -> latch.countDown() ) .subscribe( summary -> assertEquals( StatementType.READ_ONLY, summary.statementType() ) ); } <START> latch.await( 1, TimeUnit.MINUTES ); <END> Set<String> capturedOutput = new HashSet<>( stdIOCapture.stdout() ); assertEquals( new HashSet<>( asList( "Infinity Gauntlet", "Mjölnir" ) ), capturedOutput ); } }</code><technical_language>I this latch is needed? original await a timeout, ensures test blocking forever. If test is written in a proper reactive this test's focus is verify reactive result is correct. Another note: is a difference Mono.from(manyPublisher) Flux.from(manyPublisher).single(). If manyPublisher publishes more result, Mono code success, Flux code error</technical_language>

Target:
void testShouldRunRxTransactionFunctionExampleReactor() throws Exception { try ( RxTransactionFunctionExample example = new RxTransactionFunctionExample( uri, USER, PASSWORD ) ) { try ( Session session = neo4j.driver().session() ) { session.run( "UNWIND ['Infinity Gauntlet', 'Mjölnir'] AS item " + "CREATE (:Product {id: 0, title: item})" ); } StdIOCapture stdIOCapture = new StdIOCapture(); CountDownLatch latch = new CountDownLatch( 1 ); try ( AutoCloseable ignore = stdIOCapture.capture() ) { example.printAllProductsReactor() .single() .doAfterTerminate( () -> latch.countDown() ) .subscribe( summary -> assertEquals( StatementType.READ_ONLY, summary.statementType() ) ); } latch.await( 1, TimeUnit.MINUTES ); Set<String> capturedOutput = new HashSet<>( stdIOCapture.stdout() ); assertEquals( new HashSet<>( asList( "Infinity Gauntlet", "Mjölnir" ) ), capturedOutput ); } }
Source:
<code>public void test_service_registry(){ Cluster cluster = Cluster.joinAwait(); Transport transport = Transport.bindAwait(); ServicesConfig services = ServicesConfig.empty(); ServiceProcessor serviceProcessor = new AnnotationServiceProcessor(); ServiceRegistryImpl registry = new ServiceRegistryImpl(cluster, transport, services, serviceProcessor); try{ <START> new ServiceRegistryImpl(null, transport, services, serviceProcessor); <END> } catch (Exception ex){ assertEquals(ex.toString(), "java.lang.IllegalArgumentException: cluster can't be null"); } try{ new ServiceRegistryImpl(cluster, null, services, serviceProcessor); } catch (Exception ex){ assertEquals(ex.toString(), "java.lang.IllegalArgumentException: transport can't be null"); } try{ new ServiceRegistryImpl(cluster, transport, null, serviceProcessor); } catch (Exception ex){ assertEquals(ex.toString(), "java.lang.IllegalArgumentException: services can't be null"); } try{ new ServiceRegistryImpl(cluster, transport, services, null); } catch (Exception ex){ assertEquals(ex.toString(), "java.lang.IllegalArgumentException: serviceProcessor can't be null"); } }</code><technical_language>some formatting missalignment</technical_language>

Target:
public void test_service_registry() { Cluster cluster = Cluster.joinAwait(); ServicesConfig services = ServicesConfig.empty(); ServiceProcessor serviceProcessor = new AnnotationServiceProcessor(); ServiceCommunicator sender = new ClusterServiceCommunicator(cluster); ServiceRegistryImpl registry = new ServiceRegistryImpl(cluster, sender, services, serviceProcessor); assertTrue(registry.services().isEmpty()); cluster.shutdown(); }