auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public RecordingRequester create(FormEntryPrompt prompt, boolean externalRecorderPreferred) { Optional<String> audioQuality = FormEntryPromptUtils.getAttributeValue(prompt, "quality"); <START> if (audioQuality.isPresent() && (audioQuality.get().equals("normal") || audioQuality.get().equals("voice-only"))) { <END> return new InternalRecordingRequester(activity, audioRecorderViewModel, permissionUtils, lifecycle, questionMediaManager); } else if (audioQuality.isPresent() && audioQuality.get().equals("external")) { return new ExternalAppRecordingRequester(activity, activityAvailability, waitingForDataRegistry, permissionUtils); } else if (externalRecorderPreferred) { return new ExternalAppRecordingRequester(activity, activityAvailability, waitingForDataRegistry, permissionUtils); } else { return new InternalRecordingRequester(activity, audioRecorderViewModel, permissionUtils, lifecycle, questionMediaManager); } }</code><technical_language>This feels a null structure if I mean. benefit Optional if chaining, for example</technical_language>

Target:
public RecordingRequester create(FormEntryPrompt prompt, boolean externalRecorderPreferred) { String audioQuality = FormEntryPromptUtils.getAttributeValue(prompt, "quality"); if (audioQuality != null && (audioQuality.equals("normal") || audioQuality.equals("voice-only"))) { return new InternalRecordingRequester(activity, audioRecorderViewModel, permissionUtils, lifecycle, questionMediaManager); } else if (audioQuality != null && audioQuality.equals("external")) { return new ExternalAppRecordingRequester(activity, activityAvailability, waitingForDataRegistry, permissionUtils); } else if (externalRecorderPreferred) { return new ExternalAppRecordingRequester(activity, activityAvailability, waitingForDataRegistry, permissionUtils); } else { return new InternalRecordingRequester(activity, audioRecorderViewModel, permissionUtils, lifecycle, questionMediaManager); } }
Source:
<code>public void testInsufficientData() throws IOException { InputStreamFactory in = new ResourceAsStreamFactory(getClass(), "/opennlp/tools/sentdetect/SentencesInsufficient.txt"); TrainingParameters mlParams = new TrainingParameters(); <START> mlParams.put(TrainingParameters.ITERATIONS_PARAM, Integer.toString(100)); <END> mlParams.put(TrainingParameters.CUTOFF_PARAM, Integer.toString(0)); SentenceDetectorFactory factory = new SentenceDetectorFactory("en", true, null, null); SentenceDetectorME.train("en", new SentenceSampleStream( new PlainTextByLineStream(in, StandardCharsets.UTF_8)), factory, mlParams); }</code><technical_language>replace Integer.toString() String.valueOf() ?</technical_language>

Target:
public void testInsufficientData() throws IOException { InputStreamFactory in = new ResourceAsStreamFactory(getClass(), "/opennlp/tools/sentdetect/SentencesInsufficient.txt"); TrainingParameters mlParams = new TrainingParameters(); mlParams.put(TrainingParameters.ITERATIONS_PARAM, "100"); mlParams.put(TrainingParameters.CUTOFF_PARAM, "0"); SentenceDetectorFactory factory = new SentenceDetectorFactory("en", true, null, null); SentenceDetectorME.train("en", new SentenceSampleStream( new PlainTextByLineStream(in, StandardCharsets.UTF_8)), factory, mlParams); }
Source:
<code>public @ResponseBody AffiliationGroupContainer getGroupedAffiliations(@PathVariable("orcid") String orcid) { AffiliationGroupContainer result = new AffiliationGroupContainer(); Map<AffiliationType, List<AffiliationGroup<AffiliationSummary>>> affiliationsMap = affiliationsManagerReadOnly.getGroupedAffiliations(orcid, true); for (AffiliationType type : AffiliationType.values()) { if (affiliationsMap.containsKey(type)) { List<AffiliationGroup<AffiliationSummary>> elementsList = affiliationsMap.get(type); List<AffiliationGroupForm> elementsFormList = new ArrayList<AffiliationGroupForm>(); IntStream.range(0, elementsList.size()).forEach(idx -> { AffiliationGroupForm groupForm = AffiliationGroupForm.valueOf(elementsList.get(idx), type.name() + '_' + idx, orcid); AffiliationForm defaultAffiliation = groupForm.getDefaultAffiliation(); if (defaultAffiliation != null) { <START> defaultAffiliation.setCountryForDisplay(groupForm.getDefaultAffiliation().getCountry().getValue()); <END> } for (AffiliationForm aff : groupForm.getAffiliations()) { aff.setCountryForDisplay(aff.getCountry().getValue()); } elementsFormList.add(groupForm); }); result.getAffiliationGroups().put(type, elementsFormList); } } return result; }</code><technical_language>Hey @lizkrznarich, check if groupForm.getDefaultAffiliation().getCountry() != null right</technical_language>

Target:
public @ResponseBody AffiliationGroupContainer getGroupedAffiliations(@PathVariable("orcid") String orcid) { AffiliationGroupContainer result = new AffiliationGroupContainer(); Map<AffiliationType, List<AffiliationGroup<AffiliationSummary>>> affiliationsMap = affiliationsManagerReadOnly.getGroupedAffiliations(orcid, true); for (AffiliationType type : AffiliationType.values()) { if (affiliationsMap.containsKey(type)) { List<AffiliationGroup<AffiliationSummary>> elementsList = affiliationsMap.get(type); List<AffiliationGroupForm> elementsFormList = new ArrayList<AffiliationGroupForm>(); IntStream.range(0, elementsList.size()).forEach(idx -> { AffiliationGroupForm groupForm = AffiliationGroupForm.valueOf(elementsList.get(idx), type.name() + '_' + idx, orcid); AffiliationForm defaultAffiliation = groupForm.getDefaultAffiliation(); if (defaultAffiliation != null) { if (!PojoUtil.isEmpty(groupForm.getDefaultAffiliation().getCountry())) { defaultAffiliation.setCountryForDisplay(groupForm.getDefaultAffiliation().getCountry().getValue()); } } for (AffiliationForm aff : groupForm.getAffiliations()) { if (!PojoUtil.isEmpty(aff.getCountry())) { aff.setCountryForDisplay(aff.getCountry().getValue()); } } elementsFormList.add(groupForm); }); result.getAffiliationGroups().put(type, elementsFormList); } } return result; }
Source:
<code>public void linkingObjects_IllegalStateException_ifNotYetLoaded() { final Realm realm = looperThread.realm; realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { <START> final BacklinksTarget target1 = realm.createObject(BacklinksTarget.class); <END> target1.setId(1); final BacklinksSource source = realm.createObject(BacklinksSource.class); source.setChild(target1); } }); final BacklinksTarget targetAsync = realm.where(BacklinksTarget.class) .equalTo(BacklinksTarget.FIELD_ID, 1L).findFirstAsync(); assertFalse(targetAsync.isLoaded()); thrown.expect(IllegalStateException.class); targetAsync.getParents(); fail(); }</code><technical_language>Is other target variable</technical_language>

Target:
public void linkingObjects_IllegalStateException_ifNotYetLoaded() { final Realm realm = looperThread.realm; realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { final BacklinksTarget target = realm.createObject(BacklinksTarget.class); target.setId(1); final BacklinksSource source = realm.createObject(BacklinksSource.class); source.setChild(target); } }); final BacklinksTarget targetAsync = realm.where(BacklinksTarget.class) .equalTo(BacklinksTarget.FIELD_ID, 1L).findFirstAsync(); assertFalse(targetAsync.isLoaded()); thrown.expect(IllegalStateException.class); targetAsync.getParents(); fail(); }
Source:
<code>private void handleStreamZero(FrameType type, ByteBuf frame) { switch (type) { case ERROR: tryTerminateOnZeroError(frame); break; case LEASE: leaseHandler.receive(frame); break; case KEEPALIVE: if (keepAliveFramesAcceptor != null) { keepAliveFramesAcceptor.receive(frame); } break; default: if (LOGGER.isDebugEnabled()) { <START> LOGGER.debug("Requester received unsupported frame on stream 0: " + frame.toString()); <END> } } }</code><technical_language>I if this visible in production logs, INFO level</technical_language>

Target:
private void handleStreamZero(FrameType type, ByteBuf frame) { switch (type) { case ERROR: tryTerminateOnZeroError(frame); break; case LEASE: leaseHandler.receive(frame); break; case KEEPALIVE: if (keepAliveFramesAcceptor != null) { keepAliveFramesAcceptor.receive(frame); } break; default: if (LOGGER.isInfoEnabled()) { LOGGER.info("Requester received unsupported frame on stream 0: " + frame.toString()); } } }
Source:
<code><START> public ResponseEntity<String> resetPassword(@PathVariable("activationkey") String activationkey, <END> @RequestBody Map<String, String> body) { String newPassword = body.get("newPassword"); if (userService.getUserByActivationKey(activationkey) == null) { return new ResponseEntity<String>("Invalid Activation Key", HttpStatus.BAD_REQUEST); } else { userService.changePasswordUsingActivationKey(activationkey, newPassword); return new ResponseEntity<String>(HttpStatus.OK); } }</code><technical_language>return ResponseEntity, return SimpleObject</technical_language>

Target:
public void resetPassword(@PathVariable("activationkey") String activationkey, @RequestBody Map<String, String> body) { String newPassword = body.get("newPassword"); try { userService.changePasswordUsingActivationKey(activationkey, newPassword); } catch (InvalidActivationKeyException ex) { throw new ValidationException(ex.getMessage()); } }
Source:
<code>public boolean traceExists(List<EObject> selection, EClass traceType, EObject traceModel) { TraceMetaModelAdapter traceAdapter = ExtensionPointHelper.getTraceMetamodelAdapter().get(); <START> List<EObject> allElements = new ArrayList<>(); <END> allElements.addAll(selection); EObject source = allElements.get(0); allElements.remove(0); List<EObject> targets = allElements; EObject tempTraceModel = ExtensionPointHelper.getTracePersistenceAdapter().get() .getTraceModel(new ResourceSetImpl()); EObject tempTlink = traceAdapter.createTrace(traceType, tempTraceModel, selection); Connection connection = new Connection(source, targets, tempTlink); List<Connection> relevantConnections = new ArrayList<>(); for (Connection c : traceAdapter.getAllTraceLinks(traceModel)) { if (connection.equals(c)) { relevantConnections.add(c); } } if (relevantConnections.size() > 0) { return true; } else return false; }</code><technical_language>ArrayList constructor accepts a list instead of adding separately</technical_language>

Target:
public boolean traceExists(List<EObject> selection, EClass traceType, EObject traceModel) { TraceMetaModelAdapter traceAdapter = ExtensionPointHelper.getTraceMetamodelAdapter().get(); List<EObject> allElements = new ArrayList<>(selection); EObject source = allElements.get(0); allElements.remove(0); List<EObject> targets = allElements; EObject tempTraceModel = ExtensionPointHelper.getTracePersistenceAdapter().get() .getTraceModel(new ResourceSetImpl()); EObject tempTlink = traceAdapter.createTrace(traceType, tempTraceModel, selection); Connection connection = new Connection(source, targets, tempTlink); return traceAdapter.getAllTraceLinks(traceModel).stream().anyMatch(c -> c.equals(connection)); }
Source:
<code>public void run() { try (AutoCloseable ctx = requestContext.open()) { HashSet<Branch.NameKey> pending = new HashSet<>(); <START> List<ChangeData> changes = <END> queryProvider.get().allSubmitted(); for (ChangeData cd : changes) { try { pending.add(cd.change().getDest()); } catch (OrmException e) { log.error("Error reading submitted change", e); } } for (Branch.NameKey branch : pending) { mergeQueue.schedule(branch); } } catch (Exception e) { log.error("Cannot reload MergeQueue", e); } }</code><technical_language>inlined in loop below</technical_language>

Target:
public void run() { try (AutoCloseable ctx = requestContext.open()) { HashSet<Branch.NameKey> pending = new HashSet<>(); for (ChangeData cd : queryProvider.get().allSubmitted()) { try { pending.add(cd.change().getDest()); } catch (OrmException e) { log.error("Error reading submitted change", e); } } for (Branch.NameKey branch : pending) { mergeQueue.schedule(branch); } } catch (Exception e) { log.error("Cannot reload MergeQueue", e); } }
Source:
<code>public static boolean kafkaDetected() { <START> AdminClient client = null; <END> try { client = AdminClient.create(getDefaultAdminProperties()); client.findAllBrokers(); return true; } catch (RuntimeException e) { return false; } finally { if (client != null) { client.close(); } } }</code><technical_language>pattern is init try: AdminClient client = AdminClient.create(getDefaultAdminProperties()); try { ... } finally { client.close(); // need check for null if factory returns null } if AdminClient is AutoCloseable try-with-resources</technical_language>

Target:
public static boolean kafkaDetected() { AdminClient client = AdminClient.create(getDefaultAdminProperties()); try { client.findAllBrokers(); return true; } catch (RuntimeException e) { return false; } finally { if (client != null) { client.close(); } } }
Source:
<code>protected Iterable<? extends RunningInstance> pollRunningInstancesByRegionsAndIds(final Multimap<String,String> idsByRegions) { Iterable<? extends Set<? extends Reservation<? extends RunningInstance>>> reservations <START> = transform(idsByRegions.keySet(), instancesByIdInRegionFunction(idsByRegions)); <END> return concat(concat(reservations)); }</code><technical_language>Do need ...Function suffix in method name</technical_language>

Target:
protected Iterable<? extends RunningInstance> pollRunningInstancesByRegionsAndIds(final Multimap<String,String> idsByRegions) { Iterable<? extends Set<? extends Reservation<? extends RunningInstance>>> reservations = transform(idsByRegions.keySet(), instancesByIdInRegion(idsByRegions)); return concat(concat(reservations)); }
Source:
<code>public void testIsLiquidTumor() throws Exception { TumorType tumorType = new TumorType(); MainType mainType = new MainType(); tumorType.setMainType(mainType); assertFalse("Empty tumor type is not liquid tumor", TumorTypeUtils.isLiquidTumor(tumorType)); mainType.setName("Leukemia"); assertTrue("Leukemia is liquid tumor", TumorTypeUtils.isLiquidTumor(tumorType)); mainType.setName("Melanoma"); assertFalse("Melanoma is not liquid tumor", TumorTypeUtils.isLiquidTumor(tumorType)); mainType.setName("Melanoma"); tumorType.setTissue("BLOOD"); <START> assertTrue("Tissue has higher priority than main type", TumorTypeUtils.isLiquidTumor(tumorType)); <END> }</code><technical_language>printed out message match statement</technical_language>

Target:
public void testIsLiquidTumor() throws Exception { TumorType tumorType = new TumorType(); MainType mainType = new MainType(); tumorType.setMainType(mainType); assertFalse("Empty tumor type is liquid tumor, but it should not be.", TumorTypeUtils.isLiquidTumor(tumorType)); mainType.setName("Leukemia"); assertTrue("Leukemia is not liquid tumor, but it should be.", TumorTypeUtils.isLiquidTumor(tumorType)); mainType.setName("Melanoma"); assertFalse("Melanoma is liquid tumor, but it should not be.", TumorTypeUtils.isLiquidTumor(tumorType)); mainType.setName("Melanoma"); tumorType.setTissue("BLOOD"); assertTrue("Tissue does not have higher priority than main type, but it should have.", TumorTypeUtils.isLiquidTumor(tumorType)); }
Source:
<code>void shouldWriteOnePointPerName() throws Exception { final Map<String, Point> pointsByName = ImmutableMap.of( "United Kingdom", new Point(1011, 1021), "Germany", new Point(2011, 2021), "Eastern United States", new Point(3011, 3021)); final String content = writeToString(os -> PointFileReaderWriter.writeOneToOne(os, pointsByName)); assertThat(content, containsString("United Kingdom (1011,1021)")); assertThat(content, containsString("Germany (2011,2021)")); <START> assertThat(content, containsString("Eastern United States (3011,3021)")); <END> }</code><technical_language>Line endings important check. If is in line a syntax error</technical_language>

Target:
void shouldWriteOnePointPerName() throws Exception { final Map<String, Point> pointsByName = ImmutableMap.of( "United Kingdom", new Point(1011, 1021), "Germany", new Point(2011, 2021), "Eastern United States", new Point(3011, 3021)); final String content = writeToString(os -> PointFileReaderWriter.writeOneToOne(os, pointsByName)); assertThat( content, is( "" + "United Kingdom (1011,1021) \r\n" + "Germany (2011,2021) \r\n" + "Eastern United States (3011,3021) ")); }
Source:
<code>public Callable<Exercise> getAdaptiveExercise() throws OAuthSystemException, OAuthProblemException, NotLoggedInException { return wrapWithNotLoggedInException(new Callable<Exercise>() { @Override public Exercise call() throws Exception { try { Callable<String> download = new HttpTasks(). getForText(URI.create("<LINK_0>")); String json = download.call(); return adaptiveExerciseParser.parseFromJson(json); } catch (Exception ex) { <START> return null; <END> } } }); }</code><technical_language>log exception</technical_language>

Target:
public Callable<Exercise> getAdaptiveExercise() throws OAuthSystemException, OAuthProblemException, NotLoggedInException { return wrapWithNotLoggedInException(new Callable<Exercise>() { @Override public Exercise call() throws Exception { try { Callable<String> download = new HttpTasks() .getForText(URI.create(SKILLIFIER_URL)); String json = download.call(); return adaptiveExerciseParser.parseFromJson(json); } catch (Exception ex) { LOG.log(Level.WARNING, "Downloading and parsing adaptive exercise URL failed."); return null; } } }); }
Source:
<code>public void process(KeyFilter<? super K> filter, final CacheLoaderTask<K, V> task, Executor executor, final boolean fetchValue, final boolean fetchMetadata) { filter = PersistenceUtil.notNull(filter); ArrayList<KeyValuePair<K, FileEntry>> keysToLoad = new ArrayList<>(entries.size()); synchronized (entries) { for (Map.Entry<K, FileEntry> e : entries.entrySet()) { if (filter.accept(e.getKey())) keysToLoad.add(new KeyValuePair<>(e.getKey(), e.getValue())); } <START> keysToLoad.sort((o1, o2) -> { <END> long offset1 = o1.getValue().offset; long offset2 = o2.getValue().offset; return offset1 < offset2 ? -1 : offset1 == offset2 ? 0 : 1; }); } ExecutorAllCompletionService eacs = new ExecutorAllCompletionService(executor); final TaskContextImpl taskContext = new TaskContextImpl(); for (KeyValuePair<K, FileEntry> entry : keysToLoad) { if (taskContext.isStopped()) break; final K key = entry.getKey(); eacs.submit(() -> { try { final MarshalledEntry marshalledEntry = _load(key, fetchValue, fetchMetadata); if (marshalledEntry != null) { task.processEntry(marshalledEntry, taskContext); } return null; } catch (Exception e) { log.errorExecutingParallelStoreTask(e); throw e; } }); } eacs.waitUntilAllCompleted(); if (eacs.isExceptionThrown()) { throw new PersistenceException("Execution exception!", eacs.getFirstException()); } }</code><technical_language>move this of synchronized block</technical_language>

Target:
public void process(KeyFilter<? super K> filter, final CacheLoaderTask<K, V> task, Executor executor, final boolean fetchValue, final boolean fetchMetadata) { filter = PersistenceUtil.notNull(filter); ArrayList<KeyValuePair<K, FileEntry>> keysToLoad = new ArrayList<>(entries.size()); synchronized (entries) { for (Map.Entry<K, FileEntry> e : entries.entrySet()) { if (filter.accept(e.getKey())) keysToLoad.add(new KeyValuePair<>(e.getKey(), e.getValue())); } } keysToLoad.sort((o1, o2) -> { long offset1 = o1.getValue().offset; long offset2 = o2.getValue().offset; return offset1 < offset2 ? -1 : offset1 == offset2 ? 0 : 1; }); ExecutorAllCompletionService eacs = new ExecutorAllCompletionService(executor); final TaskContextImpl taskContext = new TaskContextImpl(); for (KeyValuePair<K, FileEntry> entry : keysToLoad) { if (taskContext.isStopped()) break; final K key = entry.getKey(); eacs.submit(() -> { try { final MarshalledEntry marshalledEntry = _load(key, fetchValue, fetchMetadata); if (marshalledEntry != null) { task.processEntry(marshalledEntry, taskContext); } return null; } catch (Exception e) { log.errorExecutingParallelStoreTask(e); throw e; } }); } eacs.waitUntilAllCompleted(); if (eacs.isExceptionThrown()) { throw new PersistenceException("Execution exception!", eacs.getFirstException()); } }
Source:
<code><START> private List<DiseaseOccurrence> refineSubsetForOtherDiseaseGroup(List<DiseaseOccurrence> occurrences) { <END> if (minDistinctCountries != null) { extractDistinctGaulCodes(occurrences); while (!minDataSpreadCheckForOtherDiseaseGroup()) { if (occurrences.equals(allOccurrences)) { return null; } int n = occurrences.size(); occurrences = allOccurrences.subList(0, n + 1); countriesWithAtLeastOneOccurrence.add(occurrences.get(n).getLocation().getCountryGaulCode()); } } return occurrences; }</code><technical_language>Minor point I expect this method refineSubsetForAfricanDiseaseGroup. Helps comparing methods well</technical_language>

Target:
private List<DiseaseOccurrence> refineSubsetForOtherDiseaseGroup(List<DiseaseOccurrence> occurrences) { if (minDistinctCountries != null) { extractDistinctGaulCodes(occurrences); while (!minDataSpreadCheckForOtherDiseaseGroup()) { int n = occurrences.size(); if (n == allOccurrences.size()) { return null; } DiseaseOccurrence nextOccurrence = allOccurrences.get(n); occurrences.add(nextOccurrence); countriesWithAtLeastOneOccurrence.add(nextOccurrence.getLocation().getCountryGaulCode()); } } return occurrences; }
Source:
<code>public boolean starred() throws IOException { <START> final Request request = this.entry.uri().path(RtGist.PATH_ELEMENT_STAR) <END> .back().method("GET"); final Response response = request.fetch(); if (response.status() == HttpURLConnection.HTTP_NO_CONTENT || response.status() == HttpURLConnection.HTTP_NOT_FOUND) { return response.status() == HttpURLConnection.HTTP_NO_CONTENT; } throw new AssertionError( String.format( "HTTP status %s", response.status() ) ); }</code><technical_language>here, do need this time variable request</technical_language>

Target:
public boolean starred() throws IOException { final RestResponse response = this.request.method("GET").fetch() .as(RestResponse.class).assertStatus( Matchers.isOneOf( HttpURLConnection.HTTP_NO_CONTENT, HttpURLConnection.HTTP_NOT_FOUND ) ); return response.status() == HttpURLConnection.HTTP_NO_CONTENT; }
Source:
<code>public void test03_New_Line() throws IOException { driver.findElement(By.id("03")).click(); inputFieldAccessor.overrideValue(By.id("text-output"), "Spring\nmvc\nspring mvc", driver); driver.findElement(By.id("btn-output")).click(); WebElement newLineOutput = driver.findElement(By.id("newLineOutput")); <START> BufferedReader newLineOutputTextReader = new BufferedReader(new StringReader( <END> newLineOutput.getText())); assertThat(newLineOutputTextReader.readLine(), is("Spring")); assertThat(newLineOutputTextReader.readLine(), is("mvc")); assertThat(newLineOutputTextReader.readLine(), is("spring mvc")); assertThat(newLineOutputTextReader.readLine(), nullValue()); assertThat(newLineOutput.findElements(By.tagName("br")).size(), is(2)); screenCapture.save(driver); driver.get(applicationContextUrl); driver.findElement(By.id("EL")).click(); driver.findElement(By.id("03")).click(); inputFieldAccessor.overrideValue(By.id("text-output"), "Spring_Mvc", driver); driver.findElement(By.id("btn-output")).click(); assertThat(driver.getPageSource().contains("Spring_Mvc"), is(true)); }</code><technical_language>This BufferedReader closed</technical_language>

Target:
public void test03_New_Line() throws IOException { driver.findElement(By.id("03")).click(); inputFieldAccessor.overrideValue(By.id("text-output"), "Spring\nmvc\nspring mvc", driver); driver.findElement(By.id("btn-output")).click(); WebElement newLineOutput = driver.findElement(By.id("newLineOutput")); BufferedReader newLineOutputTextReader = new BufferedReader(new StringReader( newLineOutput.getText())); try { assertThat(newLineOutputTextReader.readLine(), is("Spring")); assertThat(newLineOutputTextReader.readLine(), is("mvc")); assertThat(newLineOutputTextReader.readLine(), is("spring mvc")); assertThat(newLineOutputTextReader.readLine(), nullValue()); } finally { newLineOutputTextReader.close(); } assertThat(newLineOutput.findElements(By.tagName("br")).size(), is(2)); screenCapture.save(driver); driver.get(applicationContextUrl); driver.findElement(By.id("EL")).click(); driver.findElement(By.id("03")).click(); inputFieldAccessor.overrideValue(By.id("text-output"), "Spring_Mvc", driver); driver.findElement(By.id("btn-output")).click(); assertThat(driver.getPageSource().contains("Spring_Mvc"), is(true)); }
Source:
<code>public MeasureDefinition withObjUriQualifiers(final ObjQualifierConverter objQualifierConverter) { if (popAttribute instanceof IdentifierObjQualifier) { final IdentifierObjQualifier identifierPopAttribute = (IdentifierObjQualifier) popAttribute; Validate.notNull(objQualifierConverter, "'objQualifierConverter' must not be null!"); return objQualifierConverter.convertToUriQualifier(identifierPopAttribute) .map(uriObjQualifier -> new PopMeasureDefinition(measureIdentifier, uriObjQualifier)) .orElseThrow(() -> new IllegalArgumentException(format("The converter does not know how to convert identifier '%s'!", popAttribute))); } <START> return this; <END> }</code><technical_language>method contract is stated return a copy, honest I why, contract changed if case require copy always</technical_language>

Target:
public MeasureDefinition withObjUriQualifiers(final ObjQualifierConverter objQualifierConverter) { return ObjIdentifierUtilities.copyIfNecessary( this, popAttribute, uriObjQualifier -> new PopMeasureDefinition(measureIdentifier, uriObjQualifier), objQualifierConverter ); }
Source:
<code>public int read() throws IOException { <START> ByteBuffer buffer = singleByteBufferChannel.getBuffer(); <END> buffer.clear(); int data = -1; if (read(singleByteBufferChannel) != -1) { buffer.flip(); data = buffer.get() & 0xFF; } return data; }</code><technical_language>simply create a byte array of element call byte based read() method instead of creating a channel</technical_language>

Target:
public int read() throws IOException { ByteBuffer buffer = singleByteBufferChannel.getBuffer(); buffer.clear(); int data = -1; if (read(singleByteBufferChannel) != -1) { buffer.flip(); data = buffer.get() & 0xFF; totalBytesRead++; } return data; }
Source:
<code>private List<DiskImage> getDisksBasedOnImage() { if (disksImages == null) { disksImages = DisksFilter.filterImageDisks(getVm().getDiskMap().values(), <START> ONLY_SNAPABLE, ONLY_ACTIVE); <END> } return disksImages; }</code><technical_language>ONLY_NOT_SHAREABLE</technical_language>

Target:
private List<DiskImage> getDisksBasedOnImage() { if (disksImages == null) { disksImages = DisksFilter.filterImageDisks(getVm().getDiskMap().values(), ONLY_NOT_SHAREABLE, ONLY_ACTIVE); } return disksImages; }
Source:
<code>private void flushAppender(AsyncAppender appender) throws InterruptedException { int timeWaiting = 0; while (timeWaiting < appender.getMaxFlushTime() && appender.getNumberOfElementsInQueue() > 0) { Thread.sleep(100); timeWaiting += 100; } if (appender.getNumberOfElementsInQueue() > 0) { <START> appender.addWarn("Possibly " + <END> appender.getNumberOfElementsInQueue() + " will be discarded"); } }</code><technical_language>Mild preference word this "n records possibly discarded"</technical_language>

Target:
private void flushAppender(AsyncAppender appender) throws InterruptedException { int timeWaiting = 0; while (timeWaiting < appender.getMaxFlushTime() && appender.getNumberOfElementsInQueue() > 0) { Thread.sleep(100); timeWaiting += 100; } if (appender.getNumberOfElementsInQueue() > 0) { appender.addWarn(appender.getNumberOfElementsInQueue() + " events may be discarded"); } }
Source:
<code>public void activateAggregation(AggregationPropertyPath.Type aggregationType) { super.activateAggregation( aggregationType ); if ( aggregationType == AggregationPropertyPath.Type.COUNT ) { <START> count = true; <END> } }</code><technical_language>I this work for operations requiring aggregation. Right now, work COUNT more pro-active it. more general solution track of AggregationPropertyPath variable in a field (instead of boolean count) getOperation() method is called check if aggregationPathOperation is null. need a funciton converts a AggregationPropertyPath a MongoDBQueryDescriptor.Operation</technical_language>

Target:
public void activateAggregation(AggregationPropertyPath.Type aggregationType) { super.activateAggregation( aggregationType ); this.aggregationPropertyPathType = aggregationType; }
Source:
<code>private Response addDomain(VdcActionType action, StorageDomain model, StorageDomainStatic entity, Guid hostId, StorageServerConnections connection) { Response response = null; boolean isConnNew = false; if (connection.getstorage_type().isFileDomain() && StringUtils.isEmpty(connection.getid())) { isConnNew = true; connection.setid(addStorageServerConnection(connection, hostId)); } entity.setStorage(connection.getid()); if (action == VdcActionType.AddNFSStorageDomain || action == VdcActionType.AddPosixFsStorageDomain || action == VdcActionType.AddGlusterFsStorageDomain) { org.ovirt.engine.core.common.businessentities.StorageDomain existing = getExistingStorageDomain(hostId, entity.getStorageType(), entity.getStorageDomainType(), connection); if (existing != null) { <START> setStorageDomainProperties(entity, <END> existing.getStorageStaticData()); entity = existing.getStorageStaticData(); action = VdcActionType.AddExistingFileStorageDomain; } } if (action != VdcActionType.AddExistingFileStorageDomain) { validateParameters(model, 2, "name"); } try { response = performCreate(action, getAddParams(entity, hostId), ID_RESOLVER); } catch (WebFaultException e) { if (isConnNew) { removeStorageServerConnection(connection, hostId); } throw e; } return response; }</code><technical_language>A bit more elegant re-use mapper map 'model' top of 'entity'. fields changed users overridden, is behaviour want</technical_language>

Target:
private Response addDomain(VdcActionType action, StorageDomain model, StorageDomainStatic entity, Guid hostId, StorageServerConnections connection) { Response response = null; boolean isConnNew = false; if (connection.getstorage_type().isFileDomain() && StringUtils.isEmpty(connection.getid())) { isConnNew = true; connection.setid(addStorageServerConnection(connection, hostId)); } entity.setStorage(connection.getid()); if (action == VdcActionType.AddNFSStorageDomain || action == VdcActionType.AddPosixFsStorageDomain || action == VdcActionType.AddGlusterFsStorageDomain) { org.ovirt.engine.core.common.businessentities.StorageDomain existing = getExistingStorageDomain(hostId, entity.getStorageType(), entity.getStorageDomainType(), connection); if (existing != null) { StorageDomainMapper.map(model, existing.getStorageStaticData()); entity = existing.getStorageStaticData(); action = VdcActionType.AddExistingFileStorageDomain; } } if (action != VdcActionType.AddExistingFileStorageDomain) { validateParameters(model, 2, "name"); } try { response = performCreate(action, getAddParams(entity, hostId), ID_RESOLVER); } catch (WebFaultException e) { if (isConnNew) { removeStorageServerConnection(connection, hostId); } throw e; } return response; }
Source:
<code>public void testCheckAndUpdateConfigMapConcurrently() throws Exception { final List<CompletableFuture<Void>> futures = new ArrayList<>(); final int target = 10; final int updateIntervalMs = 100; for (String key : data.keySet()) { futures.add(FutureUtils.runAfterwardsAsync(FutureUtils.completedVoidFuture(), () -> { for (int index = 0; index < target; index++) { final boolean updated = flinkKubeClient.checkAndUpdateConfigMap( TEST_CONFIG_MAP_NAME, configMap -> { final int newValue = Integer.valueOf(configMap.getData().get(key)) + 1; configMap.getData().put(key, String.valueOf(newValue)); return Optional.of(configMap); <START> }).get(); <END> assertThat(updated, is(true)); try { Thread.sleep((long) (updateIntervalMs * Math.random())); } catch (InterruptedException e) { } } }, kubernetesResource.getExecutorService())); } FutureUtils.waitForAll(futures).get(TIMEOUT, TimeUnit.MILLISECONDS); final Optional<KubernetesConfigMap> configMapOpt = flinkKubeClient.getConfigMap(TEST_CONFIG_MAP_NAME); assertThat(configMapOpt.isPresent(), is(true)); assertThat(configMapOpt.get().getData().values(), everyItem(is(String.valueOf(target)))); }</code><technical_language>FutureUtils.runAfterwardsAsync(FutureUtils.completedVoidFuture(), () -> {}, exec) CompletableFuture.runAsync(() -> {}, exec)</technical_language>

Target:
public void testCheckAndUpdateConfigMapConcurrently() throws Exception { final List<CompletableFuture<Void>> futures = new ArrayList<>(); final int target = 10; final int updateIntervalMs = 100; for (String key : data.keySet()) { futures.add(CompletableFuture.runAsync(() -> { for (int index = 0; index < target; index++) { final boolean updated = flinkKubeClient.checkAndUpdateConfigMap( TEST_CONFIG_MAP_NAME, configMap -> { final int newValue = Integer.valueOf(configMap.getData().get(key)) + 1; configMap.getData().put(key, String.valueOf(newValue)); return Optional.of(configMap); }).join(); assertThat(updated, is(true)); try { Thread.sleep((long) (updateIntervalMs * Math.random())); } catch (InterruptedException e) { } } }, executorService)); } FutureUtils.waitForAll(futures).get(TIMEOUT, TimeUnit.MILLISECONDS); final Optional<KubernetesConfigMap> configMapOpt = flinkKubeClient.getConfigMap(TEST_CONFIG_MAP_NAME); assertThat(configMapOpt.isPresent(), is(true)); assertThat(configMapOpt.get().getData().values(), everyItem(is(String.valueOf(target)))); }
Source:
<code>public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { FlingRegister.flingDetected(); String navigation = (String) GeneralSharedPreferences.getInstance() .get(GeneralKeys.KEY_NAVIGATION); if (e1 != null && e2 != null && navigation.contains(GeneralKeys.NAVIGATION_SWIPE) && allowSwiping) { <START> int xpixellimit = (int) (ScreenUtils.getXPixelsNumberPerInch() * .25); <END> int ypixellimit = (int) (ScreenUtils.getYPixelsNumberPerInch() * .25); if (odkView != null && odkView.suppressFlingGesture(e1, e2, velocityX, velocityY)) { return false; } if (beenSwiped) { return false; } float diffX = Math.abs(e1.getX() - e2.getX()); float diffY = Math.abs(e1.getY() - e2.getY()); if (odkView != null && canScrollVertically() && getGestureAngle(diffX, diffY) > 30) { return false; } if ((diffX > xpixellimit && diffY < ypixellimit) || diffX > xpixellimit * 2) { beenSwiped = true; if (velocityX > 0) { if (e1.getX() > e2.getX()) { Timber.e("showNextView VelocityX is bogus! %f > %f", e1.getX(), e2.getX()); onSwipe.showNextView(); } else { onSwipe.showPreviousView(); } } else { if (e1.getX() < e2.getX()) { Timber.e("showPreviousView VelocityX is bogus! %f < %f", e1.getX(), e2.getX()); onSwipe.showPreviousView(); } else { onSwipe.showNextView(); } } return true; } } return false; }</code><technical_language>I guess avoiding direct dependency Collect instance a closer testable. Fine me</technical_language>

Target:
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { FlingRegister.flingDetected(); String navigation = (String) GeneralSharedPreferences.getInstance() .get(GeneralKeys.KEY_NAVIGATION); if (e1 != null && e2 != null && navigation.contains(GeneralKeys.NAVIGATION_SWIPE) && allowSwiping) { int xpixellimit = (int) (ScreenUtils.xdpi() * .25); int ypixellimit = (int) (ScreenUtils.ydpi() * .25); if (odkView != null && odkView.suppressFlingGesture(e1, e2, velocityX, velocityY)) { return false; } if (beenSwiped) { return false; } float diffX = Math.abs(e1.getX() - e2.getX()); float diffY = Math.abs(e1.getY() - e2.getY()); if (odkView != null && canScrollVertically() && getGestureAngle(diffX, diffY) > 30) { return false; } if ((diffX > xpixellimit && diffY < ypixellimit) || diffX > xpixellimit * 2) { beenSwiped = true; if (velocityX > 0) { if (e1.getX() > e2.getX()) { Timber.e("showNextView VelocityX is bogus! %f > %f", e1.getX(), e2.getX()); onSwipe.showNextView(); } else { onSwipe.showPreviousView(); } } else { if (e1.getX() < e2.getX()) { Timber.e("showPreviousView VelocityX is bogus! %f < %f", e1.getX(), e2.getX()); onSwipe.showPreviousView(); } else { onSwipe.showNextView(); } } return true; } } return false; }
Source:
<code>private <T> Set<T> toSet(T ele, T... eles) { <START> return Stream.concat(Stream.of(ele), Stream.of(eles)).collect(Collectors.toSet()); <END> }</code><technical_language>return toStream(ele, eles).collect(Collector.toSet());</technical_language>

Target:
private <T> Set<T> toSet(T ele, T... eles) { return toStream(ele, eles).collect(Collectors.toSet()); }
Source:
<code>public static Optional<VoltPhysicalLimit> buildFragmentLimit(VoltPhysicalLimit coordinatorLimit, RelDistribution fragmentDist, RelNode fragmentNode) { RexNode limit = coordinatorLimit.getLimit(); RexNode offset = coordinatorLimit.getOffset(); if (limit == null) { return Optional.empty(); } VoltPhysicalLimit fragmentLimit = null; if (offset == null) { fragmentLimit = new VoltPhysicalLimit( coordinatorLimit.getCluster(), coordinatorLimit.getTraitSet().replace(fragmentDist), fragmentNode, null, limit, false); } else { <START> RexNode combinedLimit = null; <END> RexBuilder builder = coordinatorLimit.getCluster().getRexBuilder(); if (RexUtil.isLiteral(limit, true) && RexUtil.isLiteral(offset, true)) { int intLimit = RexLiteral.intValue(limit); int intOffset = RexLiteral.intValue(offset); combinedLimit = builder.makeLiteral(intLimit + intOffset, limit.getType(), true); } else { combinedLimit = builder.makeCall( SqlStdOperatorTable.PLUS, offset, limit); } fragmentLimit = new VoltPhysicalLimit( coordinatorLimit.getCluster(), coordinatorLimit.getTraitSet().replace(fragmentDist), fragmentNode, null, combinedLimit, false); } return Optional.of(fragmentLimit); }</code><technical_language>Minor: a final, uninitialized value. way, Java compiler if forgot assign it</technical_language>

Target:
public static Optional<VoltPhysicalLimit> buildFragmentLimit(VoltPhysicalLimit coordinatorLimit, RelDistribution fragmentDist, RelNode fragmentNode) { RexNode limit = coordinatorLimit.getLimit(); RexNode offset = coordinatorLimit.getOffset(); if (limit == null) { return Optional.empty(); } VoltPhysicalLimit fragmentLimit = null; if (offset == null) { fragmentLimit = new VoltPhysicalLimit( coordinatorLimit.getCluster(), coordinatorLimit.getTraitSet().replace(fragmentDist), fragmentNode, null, limit, false); } else { final RexNode combinedLimit; RexBuilder builder = coordinatorLimit.getCluster().getRexBuilder(); if (RexUtil.isLiteral(limit, true) && RexUtil.isLiteral(offset, true)) { int intLimit = RexLiteral.intValue(limit); int intOffset = RexLiteral.intValue(offset); combinedLimit = builder.makeLiteral(intLimit + intOffset, limit.getType(), true); } else { combinedLimit = builder.makeCall( SqlStdOperatorTable.PLUS, offset, limit); } fragmentLimit = new VoltPhysicalLimit( coordinatorLimit.getCluster(), coordinatorLimit.getTraitSet().replace(fragmentDist), fragmentNode, null, combinedLimit, false); } return Optional.of(fragmentLimit); }
Source:
<code>public static HadoopDruidIndexerConfig fromMap(Map<String, Object> argSpec) { if (argSpec.containsKey("registererers")) { List<Registererer> registererers = Lists.transform( MapUtils.getList(argSpec, "registererers"), new Function<Object, Registererer>() { @Override public Registererer apply(@Nullable Object input) { try { return (Registererer) Class.forName((String) input).newInstance(); } catch (Exception e) { throw Throwables.propagate(e); } } } ); for (Registererer registererer : registererers) { registererer.register(); <START> registererer.registerSubType(jsonMapper); <END> } } final HadoopDruidIndexerConfig retVal = jsonMapper.convertValue(argSpec, HadoopDruidIndexerConfig.class); retVal.verify(); return retVal; }</code><technical_language>is important "register" called process, registerSubType() called jsonMapper. need change semantics of register() method expect multiple calls do once</technical_language>

Target:
public static HadoopDruidIndexerConfig fromMap(Map<String, Object> argSpec) { if (argSpec.containsKey("registererers")) { List<Registererer> registererers = Lists.transform( MapUtils.getList(argSpec, "registererers"), new Function<Object, Registererer>() { @Override public Registererer apply(@Nullable Object input) { try { return (Registererer) Class.forName((String) input).newInstance(); } catch (Exception e) { throw Throwables.propagate(e); } } } ); RegisteringNode.registerHandlers(registererers, Arrays.asList(jsonMapper)); } final HadoopDruidIndexerConfig retVal = jsonMapper.convertValue(argSpec, HadoopDruidIndexerConfig.class); retVal.verify(); return retVal; }
Source:
<code>static PendingAddOp create(LedgerHandle lh, ByteBuf payload, AddCallback cb, Object ctx) { PendingAddOp op = RECYCLER.get(); op.lh = lh; op.isRecoveryAdd = false; op.cb = cb; op.ctx = ctx; op.entryId = LedgerHandle.INVALID_ENTRY_ID; op.currentLedgerLength = -1; op.payload = payload; op.entryLength = payload.readableBytes(); op.completed = false; op.ackSet = lh.distributionSchedule.getAckSet(); op.addOpLogger = lh.bk.getAddOpLogger(); op.timeoutNanos = TimeUnit.SECONDS.toNanos(lh.bk.getConf().getAddEntryQuorumTimeout()); op.pendingWriteRequests = 0; op.callbackTriggered = false; op.hasRun = false; <START> op.requestTimeNanos = Long.MAX_VALUE; <END> return op; }</code><technical_language>I miss there? requestTimeNanos is Long.MAX_VALUE</technical_language>

Target:
static PendingAddOp create(LedgerHandle lh, ByteBuf payload, AddCallback cb, Object ctx) { PendingAddOp op = RECYCLER.get(); op.lh = lh; op.isRecoveryAdd = false; op.cb = cb; op.ctx = ctx; op.entryId = LedgerHandle.INVALID_ENTRY_ID; op.currentLedgerLength = -1; op.payload = payload; op.entryLength = payload.readableBytes(); op.completed = false; op.ackSet = lh.distributionSchedule.getAckSet(); op.addOpLogger = lh.bk.getAddOpLogger(); op.timeoutNanos = lh.bk.addEntryQuorumTimeoutNanos; op.pendingWriteRequests = 0; op.callbackTriggered = false; op.hasRun = false; op.requestTimeNanos = Long.MAX_VALUE; return op; }
Source:
<code>public void initialize(RealtimeContext context) throws Exception { super.initialize(context); BasicAWSCredentials awsCred = new BasicAWSCredentials(config.awsAccessKey, config.awsAccessSecret); kinesisClient = new AmazonKinesisClient(awsCred); createAndWaitForStreamToBecomeAvailable(kinesisClient, <START> config.name, <END> config.shardCount); }</code><technical_language>nit: need for newlines here, merge this 1 line</technical_language>

Target:
public void initialize(RealtimeContext context) throws Exception { super.initialize(context); BasicAWSCredentials awsCred = new BasicAWSCredentials(config.awsAccessKey, config.awsAccessSecret); kinesisClient = new AmazonKinesisClient(awsCred); KinesisUtil.createAndWaitForStream(kinesisClient, config.name, config.shardCount); }
Source:
<code><START> public Collection<CauseOfInterruption> getCausesOfInterruption(){ <END> return Collections.unmodifiableCollection(causes); }</code><technical_language>@olivergondza space () ;) new line return line</technical_language>

Target:
public @Nonnull Collection<CauseOfInterruption> getCausesOfInterruption() { return Collections.unmodifiableCollection(causes); }
Source:
<code><START> public void whenKafkaPublishTimeoutThenCircuitIsOpened() throws Exception { <END> when(nakadiSettings.getKafkaSendTimeoutMs()).thenReturn(1000L); when(kafkaProducer.partitionsFor(EXPECTED_PRODUCER_RECORD.topic())).thenReturn(ImmutableList.of( new PartitionInfo(EXPECTED_PRODUCER_RECORD.topic(), 1, new Node(1, "host", 9091), null, null))); when(kafkaProducer.send(any(), any())).thenAnswer(invocation -> { final Callback callback = (Callback) invocation.getArguments()[1]; callback.onCompletion(null, new TimeoutException()); return null; }); final List<BatchItem> batches = new LinkedList<>(); for (int i = 0; i < 1000; i++) { try { final BatchItem batchItem = new BatchItem(new JSONObject()); batchItem.setPartition("1"); batches.add(batchItem); kafkaTopicRepository.syncPostBatch(EXPECTED_PRODUCER_RECORD.topic(), ImmutableList.of(batchItem)); fail(); } catch (final EventPublishingException e) { } } Assert.assertTrue(batches.stream() .filter(item -> item.getResponse().getPublishingStatus() == EventPublishingStatus.FAILED && item.getResponse().getDetail().equals("timed out")) .count() >= 1); }</code><technical_language>checking if circuit opened in this test? I expected assertion 20 failures due timeout 1000 - 20 failures due open circuit</technical_language>

Target:
public void whenKafkaPublishTimeoutThenCircuitIsOpened() throws Exception { when(nakadiSettings.getKafkaSendTimeoutMs()).thenReturn(1000L); when(kafkaProducer.partitionsFor(EXPECTED_PRODUCER_RECORD.topic())).thenReturn(ImmutableList.of( new PartitionInfo(EXPECTED_PRODUCER_RECORD.topic(), 1, new Node(1, "host", 9091), null, null))); when(kafkaProducer.send(any(), any())).thenAnswer(invocation -> { final Callback callback = (Callback) invocation.getArguments()[1]; callback.onCompletion(null, new TimeoutException()); return null; }); final List<BatchItem> batches = new LinkedList<>(); for (int i = 0; i < 1000; i++) { try { final BatchItem batchItem = new BatchItem(new JSONObject()); batchItem.setPartition("1"); batches.add(batchItem); kafkaTopicRepository.syncPostBatch(EXPECTED_PRODUCER_RECORD.topic(), ImmutableList.of(batchItem)); fail(); } catch (final EventPublishingException e) { } } Assert.assertTrue(batches.stream() .filter(item -> item.getResponse().getPublishingStatus() == EventPublishingStatus.FAILED && item.getResponse().getDetail().equals("short circuited")) .count() >= 1); }
Source:
<code>protected void checkValidAndUniqueInstanceHeaderTitle(String instanceHeaderCellValue, int columnIndex) { <START> if (instanceHeaderCellValue.isEmpty()) { <END> throw new IllegalArgumentException(ScenarioSimulationEditorConstants.INSTANCE.instanceTitleEmptyError()); } if (instanceHeaderCellValue.contains(".")) { throw new IllegalArgumentException(ScenarioSimulationEditorConstants.INSTANCE.instanceTitleWithPeriodsError()); } Range instanceLimits = getInstanceLimits(columnIndex); SimulationDescriptor simulationDescriptor = simulation.getSimulationDescriptor(); FactIdentifier factIdentifier = simulationDescriptor.getFactMappingByIndex(columnIndex).getFactIdentifier(); if (IntStream.range(0, getColumnCount()) .filter(index -> index < instanceLimits.getMinRowIndex() || index > instanceLimits.getMaxRowIndex()) .filter(index -> !Objects.equals(factIdentifier, simulationDescriptor.getFactMappingByIndex(index).getFactIdentifier())) .mapToObj(index -> (ScenarioGridColumn) getColumns().get(index)) .filter(elem -> elem.getInformationHeaderMetaData() != null) .map(ScenarioGridColumn::getInformationHeaderMetaData) .anyMatch(elem -> Objects.equals(elem.getTitle(), instanceHeaderCellValue))) { throw new IllegalArgumentException(ScenarioSimulationEditorConstants.INSTANCE. instanceTitleAssignedError(instanceHeaderCellValue)); } }</code><technical_language>@yesamer Is check for null instanceHeaderCellValue somewhere? add - if **currently** unneeded</technical_language>

Target:
protected void checkValidAndUniqueInstanceHeaderTitle(String instanceHeaderCellValue, int columnIndex) { if (instanceHeaderCellValue.contains(".")) { throw new IllegalArgumentException(ScenarioSimulationEditorConstants.INSTANCE.instanceTitleWithPeriodsError()); } Range instanceLimits = getInstanceLimits(columnIndex); SimulationDescriptor simulationDescriptor = simulation.getSimulationDescriptor(); FactIdentifier factIdentifier = simulationDescriptor.getFactMappingByIndex(columnIndex).getFactIdentifier(); if (IntStream.range(0, getColumnCount()) .filter(index -> index < instanceLimits.getMinRowIndex() || index > instanceLimits.getMaxRowIndex()) .filter(index -> !Objects.equals(factIdentifier, simulationDescriptor.getFactMappingByIndex(index).getFactIdentifier())) .mapToObj(index -> (ScenarioGridColumn) getColumns().get(index)) .filter(elem -> elem.getInformationHeaderMetaData() != null) .map(ScenarioGridColumn::getInformationHeaderMetaData) .anyMatch(elem -> Objects.equals(elem.getTitle(), instanceHeaderCellValue))) { throw new IllegalArgumentException(ScenarioSimulationEditorConstants.INSTANCE. instanceTitleAssignedError(instanceHeaderCellValue)); } }