auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void doRemoveRepository(final OrganizationalUnit orgUnit, final String alias, final Optional<org.guvnor.structure.organizationalunit.config.RepositoryInfo> thisRepositoryConfig, final Consumer<Repository> notification, final boolean lock) { SpaceConfigStorage configStorage = this.spaceConfigStorage.get(orgUnit.getName()); try { if (lock) { configStorage.startBatch(); } Optional<Repository> repo = Optional.ofNullable(this.configuredRepositories.getRepositoryByRepositoryAlias(orgUnit.getSpace(), alias)); repo.ifPresent(r -> this.close(r.getDefaultBranch())); for (Repository repository : orgUnit.getRepositories()) { if (repository.getAlias().equals(alias)) { <START> configStorage.deleteRepository(alias); <END> organizationalUnitService.removeRepository(orgUnit, repository); metadataStore.delete(alias); } } repo.ifPresent(r -> notification.accept(r)); } finally { if (lock) { configStorage.endBatch(); } } }</code><technical_language>This method called (and I needed else). Here, repository is marked for deletion organizationalUnitService (with lock acquired), FileSystemDeleteWorker#removeRepository(final Repository repo) remove repository directory once, remove change requests it</technical_language>

Target:
protected void doRemoveRepository(final OrganizationalUnit orgUnit, final String alias, final Optional<org.guvnor.structure.organizationalunit.config.RepositoryInfo> thisRepositoryConfig, final Consumer<Repository> notification, final boolean lock) { SpaceConfigStorage configStorage = this.spaceConfigStorage.get(orgUnit.getName()); try { if (lock) { configStorage.startBatch(); } Optional<Repository> repo = Optional.ofNullable(this.configuredRepositories.getRepositoryByRepositoryAlias(orgUnit.getSpace(), alias)); repo.ifPresent(r -> this.close(r.getDefaultBranch())); for (Repository repository : orgUnit.getRepositories()) { if (repository.getAlias().equals(alias)) { organizationalUnitService.removeRepository(orgUnit, repository); metadataStore.delete(alias); } } repo.ifPresent(r -> notification.accept(r)); } finally { if (lock) { configStorage.endBatch(); } } }
Source:
<code>public void deleteBy() throws JSONException, AlgoliaException { JSONObject task = index.addObjects(new JSONArray().put(new JSONObject() .put("name", "Washington")) .put(new JSONObject().put("name", "San Francisco")) .put(new JSONObject().put("name", "San Jose"))); index.waitTask(task.getString("taskID")); <START> index.deleteBy(new Query("San")); <END> JSONObject res = index.search(new Query("")); assertEquals(1, res.getInt("nbHits")); }</code><technical_language>wait task; delete query is asynchronous write operations</technical_language>

Target:
public void deleteBy() throws JSONException, AlgoliaException { JSONObject task = index.addObjects( new JSONArray() .put(new JSONObject().put("name", "Washington")) .put(new JSONObject().put("name", "San Francisco")) .put(new JSONObject().put("name", "San Jose")) ); index.waitTask(task.getString("taskID")); task = index.deleteBy(new Query().setTagFilters("a")); index.waitTask(task.getString("taskID")); JSONObject res = index.search(new Query("")); assertEquals(3, res.getInt("nbHits")); }
Source:
<code>public boolean checkAccount(HttpServletRequest request) { HttpSession session = request.getSession(); IProject project = (IProject) session.getAttribute("Project"); IUserSession userSession = (IUserSession) session.getAttribute("UserSession"); <START> AccountObject acc = userSession.getAccount(); <END> if (!acc.getEnable()) { return false; } ScrumRole sr = SessionManager.getScrumRole(request, project, acc); if (sr == null) { return false; } if (sr.isGuest()) { return false; } if (sr.isAdmin()) { return true; } return true; }</code><technical_language>acc......</technical_language>

Target:
public boolean checkAccount(HttpServletRequest request) { HttpSession session = request.getSession(); IProject project = (IProject) session.getAttribute("Project"); IUserSession userSession = (IUserSession) session.getAttribute("UserSession"); AccountObject account = userSession.getAccount(); if (!account.getEnable()) { return false; } ScrumRole sr = SessionManager.getScrumRole(request, project, account); if (sr == null) { return false; } if (sr.isGuest()) { return false; } if (sr.isAdmin()) { return true; } return true; }
Source:
<code>public boolean refreshCommittedOffsetsIfNeeded(Timer timer) { final Set<TopicPartition> missingFetchPositions = subscriptions.missingFetchPositions(); final Map<TopicPartition, OffsetAndMetadata> offsets = fetchCommittedOffsets(missingFetchPositions, timer); if (offsets == null) return false; for (final Map.Entry<TopicPartition, OffsetAndMetadata> entry : offsets.entrySet()) { final TopicPartition tp = entry.getKey(); final OffsetAndMetadata offsetAndMetadata = entry.getValue(); if (offsetAndMetadata != null) { final ConsumerMetadata.LeaderAndEpoch leaderAndEpoch = metadata.leaderAndEpoch(tp); final SubscriptionState.FetchPosition position = new SubscriptionState.FetchPosition( offsetAndMetadata.offset(), offsetAndMetadata.leaderEpoch(), leaderAndEpoch); log.info("Setting offset for partition to the committed offset {}", tp, position); entry.getValue().leaderEpoch().ifPresent(epoch -> this.metadata.updateLastSeenEpochIfNewer(entry.getKey(), epoch)); <START> if (this.subscriptions.isAssigned(tp)) <END> this.subscriptions.seekUnvalidated(tp, position); } } return true; }</code><technical_language>sense move this check a bit? java if (offsetAndMetadata != null && subscriptions.isAssigned(tp)) { log message confusing</technical_language>

Target:
public boolean refreshCommittedOffsetsIfNeeded(Timer timer) { final Set<TopicPartition> missingFetchPositions = subscriptions.missingFetchPositions(); final Map<TopicPartition, OffsetAndMetadata> offsets = fetchCommittedOffsets(missingFetchPositions, timer); if (offsets == null) return false; for (final Map.Entry<TopicPartition, OffsetAndMetadata> entry : offsets.entrySet()) { final TopicPartition tp = entry.getKey(); final OffsetAndMetadata offsetAndMetadata = entry.getValue(); if (offsetAndMetadata != null) { entry.getValue().leaderEpoch().ifPresent(epoch -> this.metadata.updateLastSeenEpochIfNewer(entry.getKey(), epoch)); if (this.subscriptions.isAssigned(tp)) { final ConsumerMetadata.LeaderAndEpoch leaderAndEpoch = metadata.leaderAndEpoch(tp); final SubscriptionState.FetchPosition position = new SubscriptionState.FetchPosition( offsetAndMetadata.offset(), offsetAndMetadata.leaderEpoch(), leaderAndEpoch); this.subscriptions.seekUnvalidated(tp, position); log.info("Setting offset for partition to the committed offset {}", tp, position); } else { log.info("Ignoring the returned since its partition is no longer assigned", offsetAndMetadata, tp); } } } return true; }
Source:
<code>private int calculateStackTraceLevels(ITestResult testResult) { int stackTraceoutputMethod = config.getStackTraceOutputMethod(); if (testResult.isSuccess()) { stackTraceoutputMethod = config.getStackTraceOutputLevelForPassedTests(); } if ((stackTraceoutputMethod & XMLReporterConfig.STACKTRACE_SHORT) == XMLReporterConfig.STACKTRACE_SHORT) { return XMLReporterConfig.STACKTRACE_SHORT; } if ((stackTraceoutputMethod & XMLReporterConfig.STACKTRACE_FULL) == XMLReporterConfig.STACKTRACE_FULL) { return XMLReporterConfig.STACKTRACE_FULL; } <START> return XMLReporterConfig.STACKTRACE_BOTH; <END> }</code><technical_language>STACKTRACE_NONE instead if stackTraceoutputMethod = STACKTRACE_BOTH method return STACKTRACE_SHORT</technical_language>

Target:
private XMLReporterConfig.StackTraceLevels calculateStackTraceLevels(ITestResult testResult) { XMLReporterConfig.StackTraceLevels stackTraceoutputMethod = config.getStackTraceOutput(); if (testResult.isSuccess()) { stackTraceoutputMethod = config.getStackTraceOutputLevelForPassedTests(); } return stackTraceoutputMethod; }
Source:
<code><START> public Metadata getMetadata(String metadataName) { <END> for (Metadata meta: this.metadatas) { if (meta.getKey().equals(metadataName)) { return meta; } } return null; }</code><technical_language>need provide description for methods included</technical_language>

Target:
public Metadata getMetadata(String metadataName) throws EntityNotFoundException { Metadata aux = null; for (Metadata meta: this.metadatas) { if (meta.getKey().equals(metadataName)) { aux = meta; } } if (aux == null) { throw new EntityNotFoundException("Not metadata found: " + metadataName); } return aux; }
Source:
<code>public ResourceAssignment computeBestPossiblePartitionState( T cache, IdealState idealState, Resource resource, CurrentStateOutput currentStateOutput) { <START> System.out.println("Abstract computeBestPossiblePartitionState"); <END> if (LOG.isDebugEnabled()) { LOG.debug("Processing resource:" + resource.getResourceName()); } String stateModelDefName = idealState.getStateModelDefRef(); StateModelDefinition stateModelDef = cache.getStateModelDef(stateModelDefName); ResourceAssignment partitionMapping = new ResourceAssignment(resource.getResourceName()); for (Partition partition : resource.getPartitions()) { Set<String> disabledInstancesForPartition = cache.getDisabledInstancesForPartition(resource.getResourceName(), partition.toString()); List<String> preferenceList = getPreferenceList(partition, idealState, Collections.unmodifiableSet(cache.getLiveInstances().keySet())); Map<String, String> bestStateForPartition = computeBestPossibleStateForPartition(cache.getLiveInstances().keySet(), stateModelDef, preferenceList, currentStateOutput, disabledInstancesForPartition, idealState, cache.getClusterConfig(), partition); partitionMapping.addReplicaMap(partition, bestStateForPartition); } return partitionMapping; }</code><technical_language>Print statements reserved for local debugging - include this in core codebase</technical_language>

Target:
public ResourceAssignment computeBestPossiblePartitionState( T cache, IdealState idealState, Resource resource, CurrentStateOutput currentStateOutput) { if (LOG.isDebugEnabled()) { LOG.debug("Processing resource:" + resource.getResourceName()); } String stateModelDefName = idealState.getStateModelDefRef(); StateModelDefinition stateModelDef = cache.getStateModelDef(stateModelDefName); ResourceAssignment partitionMapping = new ResourceAssignment(resource.getResourceName()); for (Partition partition : resource.getPartitions()) { Set<String> disabledInstancesForPartition = cache.getDisabledInstancesForPartition(resource.getResourceName(), partition.toString()); List<String> preferenceList = getPreferenceList(partition, idealState, Collections.unmodifiableSet(cache.getLiveInstances().keySet())); Map<String, String> bestStateForPartition = computeBestPossibleStateForPartition(cache.getLiveInstances().keySet(), stateModelDef, preferenceList, currentStateOutput, disabledInstancesForPartition, idealState, cache.getClusterConfig(), partition); partitionMapping.addReplicaMap(partition, bestStateForPartition); } return partitionMapping; }
Source:
<code>Mono<Response<AnalyzeSentimentResult>> analyzeSentimentWithResponse(String text, String language, Context context) { Objects.requireNonNull(text, "'text' cannot be null."); return analyzeBatchSentimentWithResponse( Collections.singletonList(new TextDocumentInput("0", text, language)), null, context) <START> .map(response -> processSingleResponseErrorResult(response)); <END> }</code><technical_language>nit: method reference instead suggestion .map(Transforms::processSingleResponseErrorResult);</technical_language>

Target:
Mono<Response<AnalyzeSentimentResult>> analyzeSentimentWithResponse(String text, String language, Context context) { Objects.requireNonNull(text, "'text' cannot be null."); return analyzeBatchSentimentWithResponse( Collections.singletonList(new TextDocumentInput("0", text, language)), null, context) .map(Transforms::processSingleResponseErrorResult); }
Source:
<code>public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { if (!(node instanceof TopNNode)) { return Optional.empty(); } TopNNode parent = (TopNNode) node; if (!parent.getStep().equals(SINGLE)) { return Optional.empty(); } PlanNode source = lookup.resolve(parent.getSource()); <START> TopNNode result = new TopNNode( <END> idAllocator.getNextId(), source, parent.getCount(), parent.getOrderBy(), parent.getOrderings(), PARTIAL); return Optional.of(new TopNNode( idAllocator.getNextId(), result, parent.getCount(), parent.getOrderBy(), parent.getOrderings(), FINAL)); }</code><technical_language>result suggests this is returned rule, isn't. Call this partial, TopNNode call final return Optional.of(final)</technical_language>

Target:
public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { if (!(node instanceof TopNNode)) { return Optional.empty(); } TopNNode single = (TopNNode) node; if (!single.getStep().equals(SINGLE)) { return Optional.empty(); } PlanNode source = lookup.resolve(single.getSource()); TopNNode partial = new TopNNode( idAllocator.getNextId(), source, single.getCount(), single.getOrderBy(), single.getOrderings(), PARTIAL); return Optional.of(new TopNNode( idAllocator.getNextId(), partial, single.getCount(), single.getOrderBy(), single.getOrderings(), FINAL)); }
Source:
<code>protected void doExecute() { EObject applyStereotype = element.applyStereotype(stereotypeInTargetContext); EList<EStructuralFeature> eStructuralFeatures = applyStereotype.eClass().getEStructuralFeatures(); for(EStructuralFeature eStructuralFeature : eStructuralFeatures) { String name = eStructuralFeature.getName(); <START> if(!BASE_CLASS.equals(name) && eStructuralFeature.isChangeable()) { <END> applyStereotype.eSet(eStructuralFeature, stereotypeApplication.eGet(eStructuralFeature)); } } }</code><technical_language>base_Package, base_Property, base_Element, base_OpaqueExpression, ... ? This works for stereotypes extending Class metaclass. Other stereotype copies metaclass extensions corrupted. Also, stereotype associations copied incorrectly (I think), referencing wrong stereotype instance in case referenced stereotype is copied. This needs work more EcoreUtil::Copier's cross-reference handling. do support associations stereotypes classes defined in profile? UML2 API does. This code assume a metaclass extension is EAttribute is easily copied ..</technical_language>

Target:
protected void doExecute() { EObject applyStereotype = element.applyStereotype(stereotypeInTargetContext); EList<EStructuralFeature> eStructuralFeatures = applyStereotype.eClass().getEStructuralFeatures(); for(EStructuralFeature eStructuralFeature : eStructuralFeatures) { String name = eStructuralFeature.getName(); if(!name.startsWith(Extension.METACLASS_ROLE_PREFIX) && eStructuralFeature.isChangeable()) { applyStereotype.eSet(eStructuralFeature, stereotypeApplication.eGet(eStructuralFeature)); } } }
Source:
<code>public void setName(String name) { Matcher matcher = NPM_NAME_PATTERN.matcher(name); Assert.isTrue(matcher.matches(), <START> "NPM artifact name shoud fit specification (<LINK_0>"); <END> setCoordinate(NAME, name); }</code><technical_language>"The artifact's name follow NPM specification (<LINK_0>"</technical_language>

Target:
public void setName(String name) { Matcher matcher = NPM_NAME_PATTERN.matcher(name); Assert.isTrue(matcher.matches(), "The artifact's name should follow the NPM specification (<LINK_0>"); setCoordinate(NAME, name); }
Source:
<code>public void testAdd() throws Exception { BulkReadVeneerApi bulkReadWrapper = new BulkReadVeneerApi(BigtableDataClient.create(settingsBuilder.build()), TABLE_ID); ApiFuture<Result> resultFuture = bulkReadWrapper.add(ByteString.copyFromUtf8("one"), null); assertFalse(resultFuture.isDone()); resultFuture.get(); <START> Filters.Filter filter = Filters.FILTERS.key().regex("cf"); <END> ApiFuture<Result> secBatchResult = bulkReadWrapper.add(ByteString.copyFromUtf8("1"), filter); secBatchResult.get(); assertTrue(resultFuture.isDone()); assertTrue(secBatchResult.isDone()); assertEquals(2, fakeDataService.getReadRowsCount()); }</code><technical_language>removing batch</technical_language>

Target:
public void testAdd() throws Exception { dataClient = BigtableDataClient.create(settingsBuilder.build()); BulkReadWrapper bulkReadWrapper = new BulkReadVeneerApi(dataClient, TABLE_ID); ApiFuture<Result> resultFuture1_1 = bulkReadWrapper.add(ByteString.copyFromUtf8("one"), null); ApiFuture<Result> resultFuture1_2 = bulkReadWrapper.add(ByteString.copyFromUtf8("two"), null); assertFalse(resultFuture1_1.isDone()); Filters.Filter filter = Filters.FILTERS.key().regex("cf"); ApiFuture<Result> secBatchResult1 = bulkReadWrapper.add(ByteString.copyFromUtf8("1"), filter); ApiFuture<Result> secBatchResult2 = bulkReadWrapper.add(ByteString.copyFromUtf8("2"), filter); bulkReadWrapper.sendOutstanding(); resultFuture1_1.get(); resultFuture1_2.get(); secBatchResult1.get(); secBatchResult2.get(); assertTrue(resultFuture1_1.isDone()); assertTrue(resultFuture1_2.isDone()); assertTrue(secBatchResult1.isDone()); assertTrue(secBatchResult2.isDone()); assertEquals(2, fakeDataService.getReadRowsBatchCount()); }
Source:
<code>private Integer runTest(TestInformation testInfo, ITestInvocationListener listener) throws DeviceNotAvailableException { mTestDevice = testInfo.getDevice(); Assert.assertNotNull(mTestDevice); Integer batteryLevel = checkBatteryLevel(mTestDevice); if (batteryLevel == null) { CLog.w("Failed to determine battery level for device %s.", mTestDevice.getSerialNumber()); listener.testFailed( mTestDescription, FailureDescription.create("Failed to determine battery level")); return null; } else if (batteryLevel < mMaxBattery) { CLog.w("Battery level %d is below the min level %d; holding for device %s to charge " + "to level %d", batteryLevel, mMaxBattery, mTestDevice.getSerialNumber(), mResumeLevel); } else { CLog.d("Battery level %d is above the minimum of %d; %s is good to go.", batteryLevel, mMaxBattery, mTestDevice.getSerialNumber()); return <START> null; <END> } if (mRebootChargeDevices) { CLog.d("Rebooting device %s prior to holding", mTestDevice.getSerialNumber()); mTestDevice.reboot(); } turnScreenOff(mTestDevice); Integer finalBattery = null; try { if (mStopRuntime) { stopDeviceRuntime(); } if (mStopLogcat) { mTestDevice.stopLogcat(); } finalBattery = runBatteryCharging(listener, mTestDescription); } finally { if (mStopRuntime) { startDeviceRuntime(); } } CLog.i( "Device %s is now charged to battery level %d; releasing.", mTestDevice.getSerialNumber(), batteryLevel); if (finalBattery != null) { return finalBattery - batteryLevel; } return null; }</code><technical_language>this 0 -1 charge? charge rate check is fail this, skipped in this case</technical_language>

Target:
private Integer runTest(TestInformation testInfo, ITestInvocationListener listener) throws DeviceNotAvailableException { mTestDevice = testInfo.getDevice(); Assert.assertNotNull(mTestDevice); Integer batteryLevel = checkBatteryLevel(mTestDevice); if (batteryLevel == null) { CLog.w("Failed to determine battery level for device %s.", mTestDevice.getSerialNumber()); listener.testFailed( mTestDescription, FailureDescription.create("Failed to determine battery level")); return null; } else if (batteryLevel < mMaxBattery) { CLog.w("Battery level %d is below the min level %d; holding for device %s to charge " + "to level %d", batteryLevel, mMaxBattery, mTestDevice.getSerialNumber(), mResumeLevel); } else { CLog.d("Battery level %d is above the minimum of %d; %s is good to go.", batteryLevel, mMaxBattery, mTestDevice.getSerialNumber()); return IGNORE_CHARGE; } if (mRebootChargeDevices) { CLog.d("Rebooting device %s prior to holding", mTestDevice.getSerialNumber()); mTestDevice.reboot(); } turnScreenOff(mTestDevice); Integer finalBattery = null; try { if (mStopRuntime) { stopDeviceRuntime(); } if (mStopLogcat) { mTestDevice.stopLogcat(); } finalBattery = runBatteryCharging(listener, mTestDescription); } finally { if (mStopRuntime) { startDeviceRuntime(); } } CLog.i( "Device %s is now charged to battery level %d; releasing.", mTestDevice.getSerialNumber(), batteryLevel); if (finalBattery != null) { return finalBattery - batteryLevel; } return null; }
Source:
<code>public OpenShiftExplorerContentProvider() { listener = new IElementListener() { @Override <START> public void elementChanged(IOpenshiftUIElement<?, ?> element) { <END> if (element instanceof OpenshiftUIModel) { refreshViewer(ConnectionsRegistrySingleton.getInstance()); } else { refreshViewer(element); } if (element.getWrapped() instanceof IRoute) { viewer.update(element.getParent(), null); } } }; model.addListener(listener); }</code><technical_language>keeping constructor more testable inject a mock OpenshiftUIModel</technical_language>

Target:
public OpenShiftExplorerContentProvider() { this(OpenshiftUIModel.getInstance()); }
Source:
<code>public void testGenerateAndConsolidateTokens() { String tenantID = "111111"; String metricName = "a.b.c.d"; Locator locator = Locator.createLocatorFromPathComponents(tenantID, metricName); List<List<IMetric>> batch = new ArrayList<>(); batch.add(Arrays.asList(new Metric(locator, 1, 1L, new TimeValue(5, TimeUnit.SECONDS), ""))); Set<Token> tokens = TokenDiscoveryWriter.generateAndConsolidateTokens(TokenDiscoveryWriter.getLocators(batch)); <START> assertEquals("Invalid number of tokens", locator.getMetricName().split("\\.").length, tokens.size()); <END> }</code><technical_language>\\. a regex defined in Locator.java</technical_language>

Target:
public void testGenerateAndConsolidateTokens() { String tenantID = "111111"; String metricName = "a.b.c.d"; Locator locator = Locator.createLocatorFromPathComponents(tenantID, metricName); List<List<IMetric>> batch = new ArrayList<>(); batch.add(Arrays.asList(new Metric(locator, 1, 1L, new TimeValue(5, TimeUnit.SECONDS), ""))); Set<Token> tokens = TokenDiscoveryWriter.getUniqueTokens(TokenDiscoveryWriter.getLocators(batch)); assertEquals("Invalid number of tokens", locator.getMetricName().split(Locator.METRIC_TOKEN_SEPARATOR_REGEX).length, tokens.size()); }
Source:
<code>public List<PermissionSubject> getPermissionCheckSubjects() { Set<PermissionSubject> permissionSet = new HashSet<>(); for (Guid storageId : imageToDestinationDomainMap.values()) { permissionSet.add(new PermissionSubject(storageId, VdcObjectType.Storage, getActionType().getActionGroup())); } if <START> (getClusterId() != null) { <END> permissionSet.add(new PermissionSubject(getClusterId(), VdcObjectType.Cluster, ActionGroup.CREATE_VM)); } return new ArrayList<>(permissionSet); }</code><technical_language>note this check is redundant - getClusterId return null</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = new ArrayList<>(); permissionList.add(new PermissionSubject(getClusterId(), VdcObjectType.Cluster, ActionGroup.CREATE_VM)); return permissionList; }
Source:
<code>public boolean equals(Object o) { if (!(o instanceof OSCoreCtx)) { return false; } OSCoreCtx other = (OSCoreCtx) o; <START> return other.sender_id.equals(sender_id) && other.recipient_id.equals(recipient_id); <END> }</code><technical_language>I guess Arrays.equals is choice</technical_language>

Target:
public boolean equals(Object o) { if (!(o instanceof OSCoreCtx)) { return false; } OSCoreCtx other = (OSCoreCtx) o; return Arrays.equals(other.sender_id, sender_id) && Arrays.equals(other.recipient_id, recipient_id); }
Source:
<code>public void prepareRun(StageSubmitterContext context) throws Exception { <START> config.validate(context.getInputSchema(), context.getFailureCollector()); <END> }</code><technical_language>throw validation exception collector.getOrThrowException() in prepareRun</technical_language>

Target:
public void prepareRun(StageSubmitterContext context) throws Exception { FailureCollector failureCollector = context.getFailureCollector(); config.validate(context.getInputSchema(), failureCollector); failureCollector.getOrThrowException(); }
Source:
<code>protected void addToOutgoingQueue(StreamsDatum datum) throws InterruptedException{ if(this.outQueues.size() == 1) { outQueues.get(0).put(datum); } else { StreamsDatum newDatum = null; List<BlockingQueue<StreamsDatum>> failedQueues = Lists.newLinkedList(); <START> for(BlockingQueue<StreamsDatum> queue : this.outQueues) { <END> try { newDatum = cloneStreamsDatum(datum); if(newDatum != null) { if(!queue.offer(newDatum, 500, TimeUnit.MILLISECONDS)) { failedQueues.add(queue); } } } catch (RuntimeException e) { LOGGER.debug("Failed to add StreamsDatum to outgoing queue : {}", datum); LOGGER.error("Exception while offering StreamsDatum to outgoing queue: {}", e); } } for(BlockingQueue<StreamsDatum> queue : failedQueues) { try { newDatum = cloneStreamsDatum(datum); if(newDatum != null) { queue.put(newDatum); } } catch (RuntimeException e) { LOGGER.debug("Failed to add StreamsDatum to outgoing queue : {}", datum); LOGGER.error("Exception while offering StreamsDatum to outgoing queue: {}", e); } } } }</code><technical_language>this logic retries time. this organized for readability reduced code</technical_language>

Target:
protected void addToOutgoingQueue(StreamsDatum datum) throws InterruptedException{ if(this.outQueues.size() == 1) { outQueues.get(0).put(datum); } else { List<BlockingQueue<StreamsDatum>> toOutput = Lists.newLinkedList(this.outQueues); while(!toOutput.isEmpty()) { for (BlockingQueue<StreamsDatum> queue : toOutput) { StreamsDatum newDatum = cloneStreamsDatum(datum); if (newDatum != null) { if (queue.offer(newDatum, 500, TimeUnit.MILLISECONDS)) { toOutput.remove(queue); } } } } } }
Source:
<code>private static int computeBufferCount(PartitioningHandle partitioning, int defaultConcurrency, List<Integer> partitionChannels) { int bufferCount; if (partitioning.equals(SINGLE_DISTRIBUTION)) { bufferCount = 1; checkArgument(partitionChannels.isEmpty(), "Gather exchange must not have partition channels"); } else if (partitioning.equals(FIXED_BROADCAST_DISTRIBUTION)) { bufferCount = defaultConcurrency; checkArgument(partitionChannels.isEmpty(), "Broadcast exchange must not have partition channels"); } else if (partitioning.equals(FIXED_ARBITRARY_DISTRIBUTION)) { bufferCount = defaultConcurrency; checkArgument(partitionChannels.isEmpty(), "Arbitrary exchange must not have partition channels"); } else if (partitioning.equals(FIXED_PASSTHROUGH_DISTRIBUTION)) { bufferCount = defaultConcurrency; checkArgument(partitionChannels.isEmpty(), "Passthrough exchange must not have partition channels"); } else { bufferCount = defaultConcurrency; } return bufferCount; <START> } <END></code><technical_language>ditto: add a check connector partitioning, FIXED_HASH_DISTRIBUTION</technical_language>

Target:
private static int computeBufferCount(PartitioningHandle partitioning, int defaultConcurrency, List<Integer> partitionChannels) { int bufferCount; if (partitioning.equals(SINGLE_DISTRIBUTION)) { bufferCount = 1; checkArgument(partitionChannels.isEmpty(), "Gather exchange must not have partition channels"); } else if (partitioning.equals(FIXED_BROADCAST_DISTRIBUTION)) { bufferCount = defaultConcurrency; checkArgument(partitionChannels.isEmpty(), "Broadcast exchange must not have partition channels"); } else if (partitioning.equals(FIXED_ARBITRARY_DISTRIBUTION)) { bufferCount = defaultConcurrency; checkArgument(partitionChannels.isEmpty(), "Arbitrary exchange must not have partition channels"); } else if (partitioning.equals(FIXED_PASSTHROUGH_DISTRIBUTION)) { bufferCount = defaultConcurrency; checkArgument(partitionChannels.isEmpty(), "Passthrough exchange must not have partition channels"); } else if (partitioning.equals(FIXED_HASH_DISTRIBUTION) || partitioning.getConnectorId().isPresent()) { bufferCount = defaultConcurrency; } else { throw new IllegalArgumentException("Unsupported local exchange partitioning " + partitioning); } return bufferCount; }
Source:
<code>private static void handleLaunchArguments(String[] args) { Path homePath = null; for (String arg : args) { boolean recognized = true; if (arg.startsWith(USE_SPECIFIED_DIR_AS_HOME)) { homePath = Paths.get(arg.substring(USE_SPECIFIED_DIR_AS_HOME.length())); } else if (arg.equals(USE_CURRENT_DIR_AS_HOME)) { homePath = Paths.get(""); } else if (arg.equals(START_HEADLESS)) { isHeadless = true; crashReportEnabled = false; splashEnabled = false; soundEnabled = false; } else if (arg.equals(NO_SAVE_GAMES)) { System.setProperty(SystemConfig.SAVED_GAMES_ENABLED_PROPERTY, "false"); } else if (arg.equals(NO_CRASH_REPORT)) { crashReportEnabled = false; } else if (arg.equals(NO_SOUND)) { soundEnabled = false; } else if (arg.equals(NO_SPLASH)) { splashEnabled = false; } else if (arg.equals(LOAD_LAST_GAME)) { loadLastGame = true; } else if (arg.startsWith(SERVER_PORT)) { System.setProperty(ConfigurationSubsystem.SERVER_PORT_PROPERTY, arg.substring(SERVER_PORT.length())); } else if (arg.startsWith(OVERRIDE_DEFAULT_CONFIG)) { System.setProperty(Config.PROPERTY_OVERRIDE_DEFAULT_CONFIG, arg.substring(OVERRIDE_DEFAULT_CONFIG.length())); } else { recognized = false; } System.out.println((recognized ? "Recognized" : "Invalid") + " argument: " + arg); } try <START> { <END> if (homePath != null) { PathManager.getInstance().useOverrideHomePath(homePath); } else { PathManager.getInstance().useDefaultHomePath(); } } catch (IOException e) { reportException(e); System.exit(0); } }</code><technical_language>Dangling bracket sticking out :-)</technical_language>

Target:
private static void handleLaunchArguments(String[] args) { Path homePath = null; for (String arg : args) { boolean recognized = true; if (arg.startsWith(USE_SPECIFIED_DIR_AS_HOME)) { homePath = Paths.get(arg.substring(USE_SPECIFIED_DIR_AS_HOME.length())); } else if (arg.equals(USE_CURRENT_DIR_AS_HOME)) { homePath = Paths.get(""); } else if (arg.equals(START_HEADLESS)) { isHeadless = true; crashReportEnabled = false; splashEnabled = false; } else if (arg.equals(NO_SAVE_GAMES)) { System.setProperty(SystemConfig.SAVED_GAMES_ENABLED_PROPERTY, "false"); } else if (arg.equals(NO_CRASH_REPORT)) { crashReportEnabled = false; } else if (arg.equals(NO_SOUND)) { soundEnabled = false; } else if (arg.equals(NO_SPLASH)) { splashEnabled = false; } else if (arg.equals(LOAD_LAST_GAME)) { loadLastGame = true; } else if (arg.startsWith(SERVER_PORT)) { System.setProperty(ConfigurationSubsystem.SERVER_PORT_PROPERTY, arg.substring(SERVER_PORT.length())); } else if (arg.startsWith(OVERRIDE_DEFAULT_CONFIG)) { System.setProperty(Config.PROPERTY_OVERRIDE_DEFAULT_CONFIG, arg.substring(OVERRIDE_DEFAULT_CONFIG.length())); } else { recognized = false; } System.out.println((recognized ? "Recognized" : "Invalid") + " argument: " + arg); } try { if (homePath != null) { PathManager.getInstance().useOverrideHomePath(homePath); } else { PathManager.getInstance().useDefaultHomePath(); } } catch (IOException e) { reportException(e); System.exit(0); } }
Source:
<code>void localize() { applicationTitle.setText(dynamicMessages.applicationTitle()); copyrightNotice.setText(dynamicMessages.copyRightNotice()); versionLabel.setText(dynamicMessages.ovirtVersionAbout()); <START> userNameLabel.setText(constants.userNameAboutLabel()); <END> }</code><technical_language>this set in ui binder file need do in localize (we do this due DynamicMessages)</technical_language>

Target:
void localize() { applicationTitle.setText(dynamicMessages.applicationTitle()); copyrightNotice.setText(dynamicMessages.copyRightNotice()); versionLabel.setText(dynamicMessages.ovirtVersionAbout()); }
Source:
<code>protected void refreshASTSettingsActions() { boolean enabled; switch (getCurrentInputKind()) { case ASTInputKindAction.USE_CACHE: enabled= false; break; default: enabled= true; break; } fCreateBindingsAction.setEnabled(enabled && getCurrentInputKind() != ASTInputKindAction.USE_RECONCILE); fStatementsRecoveryAction.setEnabled(enabled); fBindingsRecoveryAction.setEnabled(enabled); fIgnoreMethodBodiesAction.setEnabled(enabled); for (ASTView.ASTLevelToggle <START> astVersionToggleAction : <END> fASTVersionToggleActions) { astVersionToggleAction.setEnabled(enabled); } }</code><technical_language>rename action</technical_language>

Target:
protected void refreshASTSettingsActions() { boolean enabled; switch (getCurrentInputKind()) { case ASTInputKindAction.USE_CACHE: enabled= false; break; default: enabled= true; break; } fCreateBindingsAction.setEnabled(enabled && getCurrentInputKind() != ASTInputKindAction.USE_RECONCILE); fStatementsRecoveryAction.setEnabled(enabled); fBindingsRecoveryAction.setEnabled(enabled); fIgnoreMethodBodiesAction.setEnabled(enabled); for (ASTView.ASTLevelToggle action : fASTVersionToggleActions) { action.setEnabled(enabled); } }
Source:
<code>protected void updateAlarmTimeOnBind() { long dueTime = getNextAlarmDueElapsedTime(); <START> long newDueTime = dueTime - (getUnboundIntervalInSeconds() * MILLISECONDS_IN_SECOND) + (getBoundIntervalInSeconds() * MILLISECONDS_IN_SECOND) - SystemClock.elapsedRealtime(); <END> setNextAlarmDue(newDueTime); }</code><technical_language>Line length formatting</technical_language>

Target:
private void updateAlarmTimeOnBind() { long dueTime = getNextAlarmDueElapsedTime(); long newDueTime = dueTime - (getUnboundIntervalInSeconds() * MILLISECONDS_IN_SECOND) + (getBoundIntervalInSeconds() * MILLISECONDS_IN_SECOND) - SystemClock.elapsedRealtime(); setNextAlarmDue(newDueTime); }
Source:
<code>public static AuthenticationToken getTokenFromFile(Configuration conf, String principal, String tokenFile) { FSDataInputStream in = null; try { <START> URI[] uris = DistributedCacheHelper.getCacheFiles(conf); <END> Path path = null; File tempFile = new File(ConfiguratorBase.tokenFileName); if (tempFile.exists()) { path = new Path(ConfiguratorBase.tokenFileName); } if (path == null && uris != null) for (URI u : uris) { if (u.toString().equals(tokenFile)) { path = new Path(u); break; } else if (u.toString().replace("#" + ConfiguratorBase.tokenFileName, "") .equals(tokenFile)) { path = new Path(u.toString().replace("#" + ConfiguratorBase.tokenFileName, "")); break; } } if (path == null) { throw new IllegalArgumentException( "Couldn't find password file called \"" + tokenFile + "\"or default in cache."); } FileSystem fs = FileSystem.get(conf); in = fs.open(path); } catch (IOException e) { throw new IllegalArgumentException( "Couldn't open password file called \"" + tokenFile + "\"."); } try (java.util.Scanner fileScanner = new java.util.Scanner(in)) { while (fileScanner.hasNextLine()) { Credentials creds = Credentials.deserialize(fileScanner.nextLine()); if (principal.equals(creds.getPrincipal())) { return creds.getToken(); } } throw new IllegalArgumentException( "Couldn't find token for user \"" + principal + "\" in file \"" + tokenFile + "\""); } }</code><technical_language>I need call this anymore</technical_language>

Target:
public static AuthenticationToken getTokenFromFile(Configuration conf, String principal, String tokenFile) { FSDataInputStream in = null; try { Path path; File tempFile = new File(ConfiguratorBase.cachedFileName); if (tempFile.exists()) { path = new Path(ConfiguratorBase.cachedFileName); } else { path = new Path(tokenFile); } if (path == null) { throw new IllegalArgumentException("Couldn't find password file called \"" + tokenFile + "\" in the distributed cache or the specified path in the distributed filesystem."); } FileSystem fs = FileSystem.get(conf); in = fs.open(path); } catch (IOException e) { throw new IllegalArgumentException( "Couldn't open password file called \"" + tokenFile + "\"."); } try (java.util.Scanner fileScanner = new java.util.Scanner(in)) { while (fileScanner.hasNextLine()) { Credentials creds = Credentials.deserialize(fileScanner.nextLine()); if (principal.equals(creds.getPrincipal())) { return creds.getToken(); } } throw new IllegalArgumentException( "Couldn't find token for user \"" + principal + "\" in file \"" + tokenFile + "\""); } }
Source:
<code>Map getNumaNodeMemFreeMap(int memFree, String memUsed) { <START> int memFreePerNode = memFree / NUMBER_OF_NUMA_NODES; <END> Map numaFreeMemMap = map(); numaFreeMemMap.put("memFree", Integer.valueOf(memFreePerNode)); numaFreeMemMap.put("memPercent", memUsed); Map numaNodeMemFreeMap = map(); numaNodeMemFreeMap.put("0", numaFreeMemMap); numaNodeMemFreeMap.put("1", numaFreeMemMap); return numaNodeMemFreeMap; }</code><technical_language>improve this line. give correct results of integer divison: 5/2 = 2 2*2 = 4 In a case produce 2 for node 3 for node</technical_language>

Target:
Map getNumaNodeMemFreeMap(int memFree, String memUsed) { double memFreePerNode = ((double) memFree) / NUMBER_OF_NUMA_NODES; int nodeZeroMemFree = (int) Math.floor(memFreePerNode); int nodeOneMemFree = (int) Math.ceil(memFreePerNode); Map nodeZeroNumaFreeMemMap = map(); nodeZeroNumaFreeMemMap.put("memFree", Integer.valueOf(nodeZeroMemFree)); nodeZeroNumaFreeMemMap.put("memPercent", memUsed); Map nodeOneNumaFreeMemMap = map(); nodeOneNumaFreeMemMap.put("memFree", Integer.valueOf(nodeOneMemFree)); nodeOneNumaFreeMemMap.put("memPercent", memUsed); Map numaNodeMemFreeMap = map(); numaNodeMemFreeMap.put("0", nodeZeroNumaFreeMemMap); numaNodeMemFreeMap.put("1", nodeOneNumaFreeMemMap); return numaNodeMemFreeMap; }
Source:
<code>private void addCostFunction(CostFunction costFunction) { if (costFunction.getMultiplier() <= 0) { <START> LOG.info("exclude cost function {}", costFunction.getClass().getSimpleName()); <END> } else { costFunctions.add(costFunction); } }</code><technical_language>inverting logic, log functions loaded, skipped, please a DEBUG level</technical_language>

Target:
private void addCostFunction(CostFunction costFunction) { if (costFunction.getMultiplier() > 0) { costFunctions.add(costFunction); } }
Source:
<code>private String readFailure( File failureFile ) throws IOException { try ( StoreChannel channel = fs.open( failureFile, OpenMode.READ ) ) { byte[] data = new byte[(int) channel.size()]; <START> channel.read( ByteBuffer.wrap( data ) ); <END> return UTF8.decode( withoutZeros( data ) ); } }</code><technical_language>readAll well</technical_language>

Target:
private String readFailure( File failureFile ) throws IOException { try ( StoreChannel channel = fs.open( failureFile, OpenMode.READ ) ) { byte[] data = new byte[(int) channel.size()]; channel.readAll( ByteBuffer.wrap( data ) ); return UTF8.decode( withoutZeros( data ) ); } }
Source:
<code>public void removeHeaderFooterComponentWhenColumnIsRemoved() { HeaderRow h1 = grid.prependHeaderRow(); FooterRow f1 = grid.addFooterRowAt(0); <START> Button headerButton = new Button("This one will be an orthan"); <END> Button footerButton = new Button("This one will be an orthan"); h1.getCell("foo").setComponent(headerButton); f1.getCell("foo").setComponent(footerButton); Assert.assertEquals(grid, headerButton.getParent()); Assert.assertEquals(grid, footerButton.getParent()); grid.removeColumn("foo"); Assert.assertNull(headerButton.getParent()); Assert.assertNull(footerButton.getParent()); }</code><technical_language>Typo in button</technical_language>

Target:
public void removeHeaderFooterComponentWhenColumnIsRemoved() { HeaderRow h1 = grid.prependHeaderRow(); FooterRow f1 = grid.addFooterRowAt(0); Button headerButton = new Button("This is a button, mkay?"); Button footerButton = new Button("This is a button, mkay?"); h1.getCell("foo").setComponent(headerButton); f1.getCell("foo").setComponent(footerButton); Assert.assertEquals(grid, headerButton.getParent()); Assert.assertEquals(grid, footerButton.getParent()); grid.removeColumn("foo"); Assert.assertNull(headerButton.getParent()); Assert.assertNull(footerButton.getParent()); }
Source:
<code>public void loadEnvironmentConfig() { ConfigurationStrategy strategy = new ConfigurationEnvironmentStrategy(); Map<ConfigurationKey, String> conf = strategy.loadConfiguration(); assertThat(conf).isEmpty(); strategy = new ConfigurationEnvironmentStrategy(getMapForEnv()); conf = strategy.loadConfiguration(); <START> assertThat(conf.isEmpty()).isFalse(); <END> assertThat(strategy.isValid()).isTrue(); assertThat(conf.keySet()).hasSize(14); }</code><technical_language>assertThat(conf).isNotEmpty(); is shorter error messages. 7x in this PR: CTRL + f "isEmpty()).isFalse()"</technical_language>

Target:
public void loadEnvironmentConfig() { ConfigurationStrategy strategy = new ConfigurationEnvironmentStrategy(); Map<ConfigurationKey, String> conf = strategy.loadConfiguration(); assertThat(conf).isEmpty(); strategy = new ConfigurationEnvironmentStrategy(getMapForEnv()); conf = strategy.loadConfiguration(); assertThat(conf).isNotEmpty(); assertThat(strategy.isValid()).isTrue(); assertThat(conf.keySet()).hasSize(14); }
Source:
<code><START> AmqpMessageBody() { <END> }</code><technical_language>This private required other class package</technical_language>

Target:
private AmqpMessageBody() { }
Source:
<code>protected List<SPMAsyncTaskHandler> initTaskHandlers() { List<SPMAsyncTaskHandler> taskHandlers = new ArrayList<>(); <START> if (getParameters().getImageIds() == null) { <END> List<DiskImage> images = getAllImagesForDisk(); ImagesHandler.sortImageList(images); List<DiskImage> sortedImages = LinqUtils.filter(images, new Predicate<DiskImage>() { @Override public boolean eval(DiskImage image) { return getImages().contains(image); } }); getParameters().setImageIds(new ArrayList<>(ImagesHandler.getDiskImageIds(sortedImages))); } for (Guid imageId : getParameters().getImageIds()) { taskHandlers.add(new RemoveDiskSnapshotTaskHandler(this, imageId, getImageGroupId(), getVmId())); } return taskHandlers; }</code><technical_language>verified UI? send 'imageIds' array in RemoveDiskSnapshotsParameters's ctr. this block executed.</technical_language>

Target:
protected List<SPMAsyncTaskHandler> initTaskHandlers() { List<SPMAsyncTaskHandler> taskHandlers = new ArrayList<>(); if (!getParameters().isImageIdsSorted()) { List<DiskImage> images = getAllImagesForDisk(); ImagesHandler.sortImageList(images); List<DiskImage> sortedImages = LinqUtils.filter(images, new Predicate<DiskImage>() { @Override public boolean eval(DiskImage image) { return getImages().contains(image); } }); getParameters().setImageIds(new ArrayList<>(ImagesHandler.getDiskImageIds(sortedImages))); getParameters().setImageIdsSorted(true); } for (Guid imageId : getParameters().getImageIds()) { taskHandlers.add(new RemoveDiskSnapshotTaskHandler(this, imageId, getImageGroupId(), getVmId())); } return taskHandlers; }
Source:
<code>public void stop(JobInstance jobInstance) throws Exception { JobStatus currentStatus = getJobSamzaStatus(jobInstance); if (!currentStatus.hasBeenStarted()) { log.info("Job will not be stopped because it is currently {}.", jobInstance, currentStatus.toString()); return; } String scriptPath = getScriptPath(jobInstance, STOP_SCRIPT_NAME); <START> int resultCode = scriptRunner.runScript(scriptPath, YarnRestJobStatusProvider.getQualifiedJobName(jobInstance)); <END> if (resultCode != 0) { throw new SamzaException("Failed to stop job. Result code: " + resultCode); } }</code><technical_language>a minor suggestion. odd house getQualifiedName method in YarnRestJobStatusProvider class invoke scriptRunner.runScript a param. move string generation util method move jobInstance.toString(there removing getQualifiedName method)</technical_language>

Target:
public void stop(JobInstance jobInstance) throws Exception { JobStatus currentStatus = getJobSamzaStatus(jobInstance); if (!currentStatus.hasBeenStarted()) { log.info("Job will not be stopped because it is currently {}.", jobInstance, currentStatus.toString()); return; } String scriptPath = getScriptPath(jobInstance, STOP_SCRIPT_NAME); int resultCode = scriptRunner.runScript(scriptPath, YarnApplicationInfo.getQualifiedJobName(jobInstance)); if (resultCode != 0) { throw new SamzaException("Failed to stop job. Result code: " + resultCode); } }
Source:
<code>private static InsnNode simplifyOneArgConsecutive(InsnNode insn1, InsnNode insn2, ArithNode modInsn) { if (insn1.getType() == InsnType.IGET && insn2.getArg(1).equals(insn1.getResult())) { <START> FieldInfo field = (FieldInfo) ((IndexInsnNode) insn2).getIndex(); <END> FieldArg fArg = new FieldArg(field, new InsnWrapArg(insn1)); return new ArithNode(modInsn.getOp(), fArg, modInsn.getArg(1)); } return null; }</code><technical_language>Check type of insn2 cast</technical_language>

Target:
private static InsnNode simplifyOneArgConsecutive(InsnNode insn1, InsnNode insn2, ArithNode modInsn) { if (insn1.getType() == InsnType.IGET && insn2.getType() == InsnType.IPUT && insn1.getResult().getSVar().getUseCount() == 2 && insn2.getArg(1).equals(insn1.getResult())) { FieldInfo field = (FieldInfo) ((IndexInsnNode) insn2).getIndex(); FieldArg fArg = new FieldArg(field, new InsnWrapArg(insn1)); return new ArithNode(modInsn.getOp(), fArg, modInsn.getArg(1)); } return null; }
Source:
<code>public static void runFinalization() { boolean shouldRunGC; synchronized(lock) { shouldRunGC = runGC; runGC = false; } if (shouldRunGC) { Runtime.getRuntime().gc(); } Runtime.getRuntime().runFinalization(); <START> justRanFinalization = <END> true; }</code><technical_language>this assignment guarded lock well</technical_language>

Target:
public static void runFinalization() { boolean shouldRunGC; synchronized(lock) { shouldRunGC = runGC; runGC = false; } if (shouldRunGC) { Runtime.getRuntime().gc(); } Runtime.getRuntime().runFinalization(); synchronized(lock) { justRanFinalization = true; } }
Source:
<code>public int hashCode() { <START> return inputOffsets != null ? inputOffsets.hashCode() : 0; <END> }</code><technical_language>hashCode based checkpointId stateCheckpoints match equals implementation</technical_language>

Target:
public int hashCode() { return Objects.hash(checkpointId, inputOffsets, stateCheckpoints); }
Source:
<code>public void delete(OmCalendar c) { c.setDeleted(true); List<Appointment> appointments = appointmentDao.getAppointmentsinCalendar(c.getId()); <START> for (Appointment appointment : appointments) <END> appointmentDao.delete(appointment, appointment.getOwner().getId()); update(c); }</code><technical_language>here, be: for () { }</technical_language>

Target:
public void delete(OmCalendar c) { c.setDeleted(true); appointmentDao.deletebyCalendar(c.getId()); update(c); }
Source:
<code>private boolean isAboutToExpire(Date expires) { Date validity = getTokenValidityTime().getTime(); <START> return (expires != null && expires.before(validity)); <END> }</code><technical_language>do need bracket</technical_language>

Target:
private boolean isAboutToExpire(Date expires) { Date validity = getTokenValidityTime().getTime(); return expires != null && expires.before(validity); }
Source:
<code><START> public Flux<Message> getDeliveredMessages() { <END> return messages; }</code><technical_language>I curious do decoding here? this break service bus? iirc, SB track of deliveries in receive delete mode understand hold a user performs a settlement method it, settle delivery</technical_language>

Target:
public Flux<Delivery> getDeliveredMessages() { return deliveries .doOnNext(this::removeQueuedDelivery); }
Source:
<code>public void testIllegalState() { final DetailAST init = new DetailAST(); init.setType(TokenTypes.STATIC_INIT); final DetailAST objBlock = new DetailAST(); objBlock.setType(TokenTypes.OBJBLOCK); objBlock.addChild(init); final DetailAST iface = new DetailAST(); iface.setType(TokenTypes.INTERFACE_DEF); <START> iface.addChild(objBlock); <END> final InterfaceMemberImpliedModifierCheck check = new InterfaceMemberImpliedModifierCheck(); try { check.visitToken(init); Assert.fail("IllegalStateException is expected"); } catch (IllegalStateException ex) { assertEquals("Error message is unexpected", init.toString(), ex.getMessage()); } }</code><technical_language><LINK_0> please name in "iface" ==> "interfaceAst" CIs pass</technical_language>

Target:
public void testIllegalState() { final DetailAST init = new DetailAST(); init.setType(TokenTypes.STATIC_INIT); final DetailAST objBlock = new DetailAST(); objBlock.setType(TokenTypes.OBJBLOCK); objBlock.addChild(init); final DetailAST interfaceAst = new DetailAST(); interfaceAst.setType(TokenTypes.INTERFACE_DEF); interfaceAst.addChild(objBlock); final InterfaceMemberImpliedModifierCheck check = new InterfaceMemberImpliedModifierCheck(); try { check.visitToken(init); Assert.fail("IllegalStateException is expected"); } catch (IllegalStateException ex) { assertEquals("Error message is unexpected", init.toString(), ex.getMessage()); } }