auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String addMetadaFromOpacPpn() { StringTokenizer tokenizer = new StringTokenizer(this.additionalOpacPpns, "\r\n"); while (tokenizer.hasMoreTokens()) { String tok = tokenizer.nextToken(); try { FileformatInterface addrdf = CataloguePlugin.getFirstHit(opacCatalog, QueryBuilder.restrictToField(opacSearchField, tok), myPrefs); if (addrdf != null) { List<MetadataTypeInterface> addableMetadataTypes = this.docStruct.getAddableMetadataTypes(); List<String> allowed = new ArrayList<>(); if (addableMetadataTypes != null && addableMetadataTypes.size() > 0) { <START> for (MetadataTypeInterface metadataTypeInterface : addableMetadataTypes) { <END> allowed.add(metadataTypeInterface.getName()); } } for (MetadataInterface metadataInterface : addrdf.getDigitalDocument().getLogicalDocStruct() .getAllMetadata()) { if (allowed.contains(metadataInterface.getMetadataType().getName())) { this.docStruct.addMetadata(metadataInterface); } } for (PersonInterface personInterface : addrdf.getDigitalDocument().getLogicalDocStruct() .getAllPersons()) { if (allowed.contains(personInterface.getMetadataType().getName())) { this.docStruct.addPerson(personInterface); } } readMetadataAsFirstTree(); } else { Helper.setMeldung(null, "Opac abgefragt: ", "kein Ergebnis"); } } catch (Exception e) { logger.error(e); } } saveMetadataAsBean(this.docStruct); this.modeView = "Metadaten"; return ""; }</code><technical_language>Interface appended variable name</technical_language>

Target:
public String addMetadaFromOpacPpn() { StringTokenizer tokenizer = new StringTokenizer(this.additionalOpacPpns, "\r\n"); while (tokenizer.hasMoreTokens()) { String tok = tokenizer.nextToken(); try { FileformatInterface addrdf = CataloguePlugin.getFirstHit(opacCatalog, QueryBuilder.restrictToField(opacSearchField, tok), myPrefs); if (addrdf != null) { List<MetadataTypeInterface> addableMetadataTypes = this.docStruct.getAddableMetadataTypes(); List<String> allowed = new ArrayList<>(); if (addableMetadataTypes != null && addableMetadataTypes.size() > 0) { for (MetadataTypeInterface metadataType : addableMetadataTypes) { allowed.add(metadataType.getName()); } } for (MetadataInterface metadata : addrdf.getDigitalDocument().getLogicalDocStruct() .getAllMetadata()) { if (allowed.contains(metadata.getMetadataType().getName())) { this.docStruct.addMetadata(metadata); } } for (PersonInterface person : addrdf.getDigitalDocument().getLogicalDocStruct().getAllPersons()) { if (allowed.contains(person.getMetadataType().getName())) { this.docStruct.addPerson(person); } } readMetadataAsFirstTree(); } else { Helper.setMeldung(null, "Opac abgefragt: ", "kein Ergebnis"); } } catch (Exception e) { logger.error(e); } } saveMetadataAsBean(this.docStruct); this.modeView = "Metadaten"; return ""; }
Source:
<code>public BlockBuilder closeEntry() { if (!currentEntryOpened) { throw new IllegalStateException("Expected entry to be opened but was closed"); } entryAdded(false); currentEntryOpened = false; ensureHashTableSize(); int previousAggregatedEntryCount = offsets[positionCount - 1]; int aggregatedEntryCount = offsets[positionCount]; int entryCount = aggregatedEntryCount - previousAggregatedEntryCount; int[] rawHashTables = hashTables.get(); <START> verify(rawHashTables != null, "rawHashTables is empty"); <END> buildHashTable( keyBlockBuilder, previousAggregatedEntryCount, entryCount, keyBlockHashCode, rawHashTables, previousAggregatedEntryCount * HASH_MULTIPLIER, entryCount * HASH_MULTIPLIER); return this; }</code><technical_language>nit: empty -> null in other places</technical_language>

Target:
public BlockBuilder closeEntry() { if (!currentEntryOpened) { throw new IllegalStateException("Expected entry to be opened but was closed"); } entryAdded(false); currentEntryOpened = false; ensureHashTableSize(); int previousAggregatedEntryCount = offsets[positionCount - 1]; int aggregatedEntryCount = offsets[positionCount]; int entryCount = aggregatedEntryCount - previousAggregatedEntryCount; int[] rawHashTables = hashTables.get(); verify(rawHashTables != null, "rawHashTables is null"); buildHashTable( keyBlockBuilder, previousAggregatedEntryCount, entryCount, keyBlockHashCode, rawHashTables, previousAggregatedEntryCount * HASH_MULTIPLIER, entryCount * HASH_MULTIPLIER); return this; }
Source:
<code>public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { this.cards.clear(); this.targets.clearChosen(); Player player = game.getPlayer(controllerId); if (player == null) { return false; } int amount = this.getTargets().get(0).getNumberOfTargets(); if (randomDiscard) { this.cards.addAll(player.discard(amount, true, ability, game).getCards(game)); } else if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) { Cards toDiscard = new CardsImpl(); toDiscard.addAll(targets.get(0).getTargets()); Cards discarded = player.discard(toDiscard, ability, game); <START> if (discarded != null) { <END> cards.addAll(discarded.getCards(game)); } } paid = cards.size() >= amount; return paid; }</code><technical_language>discarded null time. !isEmpty() ignore here</technical_language>

Target:
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { this.cards.clear(); this.targets.clearChosen(); Player player = game.getPlayer(controllerId); if (player == null) { return false; } int amount = this.getTargets().get(0).getNumberOfTargets(); if (randomDiscard) { this.cards.addAll(player.discard(amount, true, ability, game).getCards(game)); } else if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) { Cards toDiscard = new CardsImpl(); toDiscard.addAll(targets.get(0).getTargets()); Cards discarded = player.discard(toDiscard, ability, game); if (!discarded.isEmpty()) { cards.addAll(discarded.getCards(game)); } } paid = cards.size() >= amount; return paid; }
Source:
<code>private Mac getMacInstance() { int masterKeyLatestHashCode = this.credential.getKey().hashCode(); if (masterKeyLatestHashCode != this.masterKeyHashCode) { <START> synchronized (this.credential) { <END> if (masterKeyLatestHashCode != this.masterKeyHashCode) { byte[] masterKeyBytes = this.credential.getKey().getBytes(StandardCharsets.UTF_8); byte[] masterKeyDecodedBytes = Utils.Base64Decoder.decode(masterKeyBytes); SecretKey signingKey = new SecretKeySpec(masterKeyDecodedBytes, "HMACSHA256"); try { Mac macInstance = Mac.getInstance("HMACSHA256"); macInstance.init(signingKey); this.masterKeyHashCode = masterKeyLatestHashCode; this.macInstance = macInstance; } catch (NoSuchAlgorithmException | InvalidKeyException e) { throw new IllegalStateException(e); } } } } try { return (Mac)this.macInstance.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException(e); } }</code><technical_language>I concerned this synchronized code piece, this called request. concern is this slow things. Do need synchronized block credential is volatile</technical_language>

Target:
private Mac getMacInstance() { reInitializeIfPossible(); try { return (Mac)this.macInstance.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException(e); } }
Source:
<code>protected void step(Document document) throws GenDocException { if (document == null) { this.worked(1); return; } do { if (document.getXMLParser() == null || document.getXMLParser().getKind() != CONFIGURATION.metadata) continue; IDocumentMetadataService propertyService = ((IDocumentMetadataService)GendocServices.getDefault().getService(IDocumentMetadataService.class)); if (propertyService != null) { boolean modify = false; List<String> propertyNames = propertyService.getMetadataProperties(document); for (String prop : propertyNames) { String value = propertyService.getMetadataValue(document, prop); String newValue = replaceValue(value); if (newValue != null && newValue.equals(value)) <START> continue; <END> propertyService.setMetadataValue(document, prop, newValue); modify = true; } if (modify) { propertyService.saveMetadata(document); } } } while (document.jumpToNextFile()); document.getXMLParser().setCurrentNode(null); this.worked(1); }</code><technical_language>"continue" keyword not. brackets, is 100% true prefer if</technical_language>

Target:
protected void step(Document document) throws GenDocException { if (document == null) { this.worked(1); return; } do { if (document.getXMLParser() == null || document.getXMLParser().getKind() != CONFIGURATION.metadata) continue; IDocumentMetadataService propertyService = ((IDocumentMetadataService)GendocServices.getDefault().getService(IDocumentMetadataService.class)); if (propertyService != null) { boolean modify = false; List<String> propertyNames = propertyService.getMetadataProperties(document); for (String prop : propertyNames) { String value = propertyService.getMetadataValue(document, prop); String newValue = replaceValue(value); if (newValue != null && newValue.equals(value)) { continue; } propertyService.setMetadataValue(document, prop, newValue); modify = true; } if (modify) { propertyService.saveMetadata(document); } } } while (document.jumpToNextFile()); document.getXMLParser().setCurrentNode(null); this.worked(1); }
Source:
<code>static boolean isBPMNFile(final String fileName) { <START> return fileName.endsWith("." + FormsMigrationConstants.BPMN_EXTENSION) <END> || fileName.endsWith("." + FormsMigrationConstants.BPMN2_EXTENSION) || fileName.endsWith("." + FormsMigrationConstants.BPMN_CM_EXTENSION); }</code><technical_language>minor Q - if remember, some task, updated [ResourceType](<LINK_0> add bpmn-cm extension bpmn/bpmn2 existing ones, remember? if dependency here, asking if dependency is present, extensions defined type instead of constants (FormsMigrationConstants.BPMN2_EXTENSION, etc)</technical_language>

Target:
static boolean isBPMNFile(final String fileName) { return ResourceType.getResourceType("BPMN2").matchesExtension(fileName); }
Source:
<code>public double getMajorCompactionThreshold() { <START> return getDouble(MAJOR_COMPACTION_THRESHOLD, 0.6f); <END> }</code><technical_language>default change</technical_language>

Target:
public double getMajorCompactionThreshold() { return getDouble(MAJOR_COMPACTION_THRESHOLD, 0.8f); }
Source:
<code>public Mono<Void> handleResult(ServerWebExchange exchange, HandlerResult result) { <START> Assert.notNull(result, "'result' must not be null"); <END> return (Mono<Void>) result.getReturnValue(); }</code><technical_language>I this is reported issue; problem is result.getReturnValue() return null, is allowed handleResult contract</technical_language>

Target:
public Mono<Void> handleResult(ServerWebExchange exchange, HandlerResult result) { Object returnValue = result.getReturnValue(); return returnValue == null ? Mono.empty() : (Mono<Void>) returnValue; }
Source:
<code>private void findInjectionTargetForSuperTypeWithInjectExtra(TypeElement typeElement, InjectionTarget injectionTarget, boolean shouldAddInjectionMaps, boolean shouldStopAtFirstParent) { while (true) { TypeMirror superType = typeElement.getSuperclass(); if (superType.getKind() == TypeKind.NONE) { return; } final TypeElement superTypeElement = (TypeElement) ((DeclaredType) superType).asElement(); final InjectionTarget superInjectionTarget = scanTypeForInjectExtras(superTypeElement); if (!superInjectionTarget.injectionMap.isEmpty()) { if (injectionTarget.parentTarget == null) { final String packageName = getPackageName(superTypeElement); final String parentFqcn = packageName + "." + getClassName(superTypeElement, packageName); injectionTarget.parentTarget = parentFqcn; <START> if (shouldAddInjectionMaps && !superInjectionTarget.injectionMap.isEmpty()) { <END> injectionTarget.injectionMap.putAll(superInjectionTarget.injectionMap); } } if (shouldStopAtFirstParent) { return; } } typeElement = superTypeElement; } }</code><technical_language>superInjectionTarget.injectionMap.isEmpty() false</technical_language>

Target:
private void findInjectionTargetForSuperTypeWithInjectExtra(TypeElement typeElement, InjectionTarget injectionTarget, boolean shouldAddInjectionMaps, boolean shouldStopAtFirstParent) { while (true) { TypeMirror superType = typeElement.getSuperclass(); if (superType.getKind() == TypeKind.NONE) { return; } final TypeElement superTypeElement = (TypeElement) ((DeclaredType) superType).asElement(); final InjectionTarget superInjectionTarget = scanTypeForInjectExtras(superTypeElement); if (!superInjectionTarget.injectionMap.isEmpty()) { if (injectionTarget.parentTarget == null) { final String packageName = getPackageName(superTypeElement); injectionTarget.parentTarget = packageName + "." + getClassName(superTypeElement, packageName); } if (shouldAddInjectionMaps) { injectionTarget.injectionMap.putAll(superInjectionTarget.injectionMap); } if (shouldStopAtFirstParent) { return; } } typeElement = superTypeElement; } }
Source:
<code><START> public Set<String> getFreeVariables() { <END> Set<String> freeVars = toReplace.getFreeVariables(); freeVars.addAll(inExpr.getFreeVariables()); freeVars.remove(varName); return freeVars; }</code><technical_language>Technically bind free variables in "toReplace" part. inExpr varName, else</technical_language>

Target:
public Set<String> getFreeVariables() { return toReplace.getFreeVariables(); }
Source:
<code>public synchronized void flush() throws IOException { if (closed) { throw new IllegalStateException("Cannot flush when the BufferedMutator is closed."); } if (!writeBuffer.isEmpty()) { List<Row> copy = Lists.<Row> newArrayList(writeBuffer); <START> for (List<Row> partition : Lists.partition(copy, 30)) { <END> writeBuffer.removeAll(partition); try { batchExecutor.batch(partition); } catch (RetriesExhaustedWithDetailsException e) { listener.onException(e, this); } catch (IOException e) { List<Throwable> problems = Lists.<Throwable> newArrayList(e); ArrayList<String> hostnames = new ArrayList<String>(1); listener.onException( new RetriesExhaustedWithDetailsException(problems, partition, hostnames), this); } } currentWriteBufferSize = 0; for (Mutation m : writeBuffer) { currentWriteBufferSize += m.heapSize(); } } }</code><technical_language>Is 30 correct here</technical_language>

Target:
public synchronized void flush() throws IOException { if (closed) { throw new IllegalStateException("Cannot flush when the BufferedMutator is closed."); } if (!writeBuffer.isEmpty()) { List<Row> copy = Lists.<Row> newArrayList(writeBuffer); for (List<Row> partition : Lists.partition(copy, this.maxInflightRpcCount)) { writeBuffer.removeAll(partition); try { batchExecutor.batch(partition); } catch (RetriesExhaustedWithDetailsException e) { listener.onException(e, this); } catch (IOException e) { List<Throwable> problems = Lists.<Throwable> newArrayList(e); ArrayList<String> hostnames = new ArrayList<String>(1); listener.onException( new RetriesExhaustedWithDetailsException(problems, partition, hostnames), this); } } currentWriteBufferSize = 0; for (Mutation m : writeBuffer) { currentWriteBufferSize += m.heapSize(); } } }
Source:
<code>public Properties getConsumerProperties(String inputChannelName) { Properties channelConsumerProperties = new Properties(); BindingProperties bindingProperties = this.bindings.get(inputChannelName); if (bindingProperties != null) { if (bindingProperties.getConcurrency() != null) { channelConsumerProperties.setProperty(BinderPropertyKeys.CONCURRENCY, Integer.toString(bindingProperties.getConcurrency())); } <START> if (Boolean.TRUE.equals(bindingProperties.isDurableSubscription())) { <END> channelConsumerProperties.setProperty(BinderPropertyKeys.DURABLE, Boolean.toString(bindingProperties.isDurableSubscription())); } updateConsumerPartitionProperties(inputChannelName, channelConsumerProperties); } return channelConsumerProperties; }</code><technical_language>this prevents passing durable=false binder, including Rabbit</technical_language>

Target:
public Properties getConsumerProperties(String inputChannelName) { Properties channelConsumerProperties = new Properties(); BindingProperties bindingProperties = this.bindings.get(inputChannelName); if (bindingProperties != null) { if (bindingProperties.getConcurrency() != null) { channelConsumerProperties.setProperty(BinderPropertyKeys.CONCURRENCY, Integer.toString(bindingProperties.getConcurrency())); } if (bindingProperties.isDurableSubscription() != null) { channelConsumerProperties.setProperty(BinderPropertyKeys.DURABLE, Boolean.toString(bindingProperties.isDurableSubscription())); } updateConsumerPartitionProperties(inputChannelName, channelConsumerProperties); } return channelConsumerProperties; }
Source:
<code><START> HtmlElementTransformation(String tagName, String attributeName) { <END> this.matchingTagName = tagName; this.matchingAttributeName = attributeName; }</code><technical_language>Similarly static enum thing, I subjectively enum constructors explicitly private practical difference. rationale for this change</technical_language>

Target:
private HtmlElementTransformation(String tagName, String attributeName) { this.matchingTagName = tagName; this.matchingAttributeName = attributeName; }
Source:
<code>public FileReplacer(final File file) throws IOException { this.file = checkNotNull(file); <START> this.filePrefix = file.getName() + "-" + UUID.randomUUID().toString() + "-" + counter.getAndIncrement(); <END> this.tempFile = new File(file.getParentFile(), filePrefix + ".tmp"); this.backupFile = new File(file.getParentFile(), filePrefix + ".bak"); file.getParentFile().mkdirs(); if (tempFile.exists()) { log.warn("Temporary file already exists; removing: {}", tempFile); delete(tempFile); } tempFile.createNewFile(); }</code><technical_language>need .toString() here..</technical_language>

Target:
public FileReplacer(final File file) throws IOException { this.file = checkNotNull(file); this.filePrefix = file.getName() + "-" + UUID.randomUUID() + "-" + counter.getAndIncrement(); this.tempFile = new File(file.getParentFile(), filePrefix + ".tmp"); this.backupFile = new File(file.getParentFile(), filePrefix + ".bak"); file.getParentFile().mkdirs(); if (tempFile.exists()) { log.warn("Temporary file already exists; removing: {}", tempFile); delete(tempFile); } tempFile.createNewFile(); }
Source:
<code>public HttpResponse doIndex( final HttpServletRequest request, @QueryParameter(required = true) @Nonnull final VstsHookEventName event, @StringBodyParameter @Nonnull final String body) { LOGGER.log(Level.FINER, "{}/?event={}\n{}", new String[]{URL_NAME, event.name(), body}); final Object parsedBody = event.parse(body); List<? extends GitStatus.ResponseContributor> contributors = null; switch (event) { case PING: <START> final String message = "Pong from the Jenkins TFS plugin! Here's your body:\n" + parsedBody; <END> final GitStatus.MessageResponseContributor contributor; contributor = new GitStatus.MessageResponseContributor(message); contributors = Collections.singletonList(contributor); case BUILD_COMPLETED: break; case GIT_CODE_PUSHED: break; case TFVC_CODE_CHECKED_IN: break; case PULL_REQUEST_MERGE_COMMIT_CREATED: break; case DEPLOYMENT_COMPLETED: break; case RELEASE_CREATED: break; } if (contributors == null) { return HttpResponses.error(SC_BAD_REQUEST, "Not implemented"); } else { final List<? extends GitStatus.ResponseContributor> finalContributors = contributors; return new HttpResponse() { public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { rsp.setStatus(SC_OK); rsp.setContentType("text/plain"); for (GitStatus.ResponseContributor c : finalContributors) { c.addHeaders(req, rsp); } PrintWriter w = rsp.getWriter(); for (GitStatus.ResponseContributor c : finalContributors) { c.writeBody(req, rsp, w); } } }; } }</code><technical_language>P3: "Jenkins TFS plugin" -> "TFS Plugin for Jenkins"</technical_language>

Target:
public HttpResponse doIndex( final HttpServletRequest request, @QueryParameter(required = true) @Nonnull final VstsHookEventName event, @StringBodyParameter @Nonnull final String body) { LOGGER.log(Level.FINER, "{}/?event={}\n{}", new String[]{URL_NAME, event.name(), body}); final Object parsedBody = event.parse(body); List<? extends GitStatus.ResponseContributor> contributors = null; switch (event) { case PING: final String message = "Pong from the Jenkins TFS plugin! Here's your body:\n" + parsedBody; final GitStatus.MessageResponseContributor contributor; contributor = new GitStatus.MessageResponseContributor(message); contributors = Collections.singletonList(contributor); case BUILD_COMPLETED: break; case GIT_CODE_PUSHED: break; case TFVC_CODE_CHECKED_IN: break; case PULL_REQUEST_MERGE_COMMIT_CREATED: break; case DEPLOYMENT_COMPLETED: break; } if (contributors == null) { return HttpResponses.error(SC_BAD_REQUEST, "Not implemented"); } else { final List<? extends GitStatus.ResponseContributor> finalContributors = contributors; return new HttpResponse() { public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { rsp.setStatus(SC_OK); rsp.setContentType(MediaType.TEXT_PLAIN); for (GitStatus.ResponseContributor c : finalContributors) { c.addHeaders(req, rsp); } rsp.setCharacterEncoding(MediaType.UTF_8.name()); PrintWriter w = rsp.getWriter(); for (GitStatus.ResponseContributor c : finalContributors) { c.writeBody(req, rsp, w); } } }; } }
Source:
<code><START> public static Boolean isString(Schema.Type type) { <END> return Schema.Type.STRING.equals(type); }</code><technical_language>Boolean, boolean</technical_language>

Target:
public static boolean isString(Schema.Type type) { return Schema.Type.STRING.equals(type); }
Source:
<code>private User makeTicketReceiver(){ User receiver = new User("receiver", new BCryptPasswordEncoder().encode("password"), "receiver@gmail.com"); receiver.getProfile() .setAllFields("receiver", " of tickets", "GotYaTicket", Gender.MALE, "Money Owner 4", "2826GJ", "Tomorrowland", "0906-1111", null); userRepository.saveAndFlush(receiver); <START> return receiver; <END> }</code><technical_language>return object returned saveAndFlush method here</technical_language>

Target:
private User makeTicketReceiver(){ User receiver = new User("receiver", new BCryptPasswordEncoder().encode("password"), "receiver@gmail.com"); receiver.getProfile() .setAllFields("receiver", " of tickets", "GotYaTicket", Gender.MALE, "Money Owner 4", "2826GJ", "Tomorrowland", "0906-1111", null); return userRepository.saveAndFlush(receiver); }
Source:
<code><START> public static boolean isRecoveryProblems() { <END> return recoveryProblems.get(); }</code><technical_language>if is reason public private (or package-private in case)</technical_language>

Target:
boolean isRecoveryProblems() { return this.recoveryProblems.get(); }
Source:
<code>private File[] getPathsToScan() { String lastKnownCczLocation = HiddenPreferences.getLastKnownCczLocation(); ArrayList<File> filePathsToScan = new ArrayList<>(3); if (!StringUtils.isEmpty(lastKnownCczLocation)) { filePathsToScan.add(new File(lastKnownCczLocation)); } <START> Logger.log(LogTypes.SOFT_ASSERT, "Access outside scoped storage in scanning cczs."); <END> filePathsToScan.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)); filePathsToScan.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)); return filePathsToScan.toArray(new File[filePathsToScan.size()]); }</code><technical_language>remove this soft assert this path get hit for this functionality,</technical_language>

Target:
private File[] getPathsToScan() { String lastKnownCczLocation = HiddenPreferences.getLastKnownCczLocation(); ArrayList<File> filePathsToScan = new ArrayList<>(3); if (!StringUtils.isEmpty(lastKnownCczLocation)) { filePathsToScan.add(new File(lastKnownCczLocation)); } filePathsToScan.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)); filePathsToScan.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)); return filePathsToScan.toArray(new File[filePathsToScan.size()]); }
Source:
<code>public String render(final PutBulkResult result) throws JsonProcessingException { final CommonJsonView view = CommonJsonView.newView(CommonJsonView.Status.OK); <START> if (result.getIgnoredFiles() == null || result.getIgnoredFiles().isEmpty()) { <END> view.message(result.getResult()); } else { view.data(result); } return JsonMapper.toJson(view); }</code><technical_language>this of Guard methods</technical_language>

Target:
public String render(final PutBulkResult result) throws JsonProcessingException { final CommonJsonView view = CommonJsonView.newView(CommonJsonView.Status.OK); if (Guard.isNullOrEmpty(result.getIgnoredFiles())) { view.message(result.getResult()); } else { view.data(result); } return JsonMapper.toJson(view); }
Source:
<code>public void tearDown() throws Exception { <START> this.mTranslateSpecialChar = null; <END> this.mTestStr.clear(); this.mVerifyStr.clear(); }</code><technical_language>remove "this."</technical_language>

Target:
public void tearDown() throws Exception { mTranslateSpecialChar = null; mTestStr.clear(); mVerifyStr.clear(); }
Source:
<code><START> protected static List<PermissionSet> buildListOfSelectableRoles(WebappDaoFactory wadf) { <END> List<PermissionSet> list = new ArrayList<PermissionSet>(); for (PermissionSet ps: wadf.getUserAccountsDao().getAllPermissionSets()) { if (!ps.isForPublic()) { list.add(ps); } } list.sort(new Comparator<PermissionSet>() { @Override public int compare(PermissionSet ps1, PermissionSet ps2) { return ps1.getUri().compareTo(ps2.getUri()); } }); for (PermissionSet ps: wadf.getUserAccountsDao().getAllPermissionSets()) { if (ps.isForPublic()) { list.add(ps); } } return list; }</code><technical_language>this method private</technical_language>

Target:
private static List<PermissionSet> buildListOfSelectableRoles(WebappDaoFactory wadf) { List<PermissionSet> list = new ArrayList<>(); for (PermissionSet ps: wadf.getUserAccountsDao().getAllPermissionSets()) { if (!ps.isForPublic()) { list.add(ps); } } list.sort(new Comparator<PermissionSet>() { @Override public int compare(PermissionSet ps1, PermissionSet ps2) { return ps1.getUri().compareTo(ps2.getUri()); } }); for (PermissionSet ps: wadf.getUserAccountsDao().getAllPermissionSets()) { if (ps.isForPublic()) { list.add(ps); } } return list; }
Source:
<code>public static void setUpJenkins() throws Exception { store = CredentialsProvider.lookupStores(r.jenkins).iterator().next(); appCredentials = new GitHubAppCredentials( CredentialsScope.GLOBAL, myAppCredentialsId, "sample", "54321", Secret.fromString(JwtHelperTest.PKCS8_PRIVATE_KEY)); appCredentials.setOwner("cloudbeers"); store.addCredentials(Domain.global(), appCredentials); <START> LogRecorderManager mgr = r.jenkins.getLog(); logRecorder = new LogRecorder(GitHubAppCredentials.class.getName()); mgr.logRecorders.put(GitHubAppCredentials.class.getName(), logRecorder); LogRecorder.Target t = new LogRecorder.Target(GitHubAppCredentials.class.getName(), Level.FINER); logRecorder.targets.add(t); logRecorder.save(); t.enable(); <END> agent = r.createOnlineSlave(); agent.setLabelString("my-agent"); }</code><technical_language>LoggerRule? hard specifically capture agent logs</technical_language>

Target:
public static void setUpJenkins() throws Exception { store = CredentialsProvider.lookupStores(r.jenkins).iterator().next(); appCredentials = new GitHubAppCredentials( CredentialsScope.GLOBAL, myAppCredentialsId, "sample", "54321", Secret.fromString(JwtHelperTest.PKCS8_PRIVATE_KEY)); appCredentials.setOwner("cloudbeers"); store.addCredentials(Domain.global(), appCredentials); agent = r.createOnlineSlave(); agent.setLabelString("my-agent"); LogRecorderManager mgr = r.jenkins.getLog(); logRecorder = new LogRecorder(GitHubAppCredentials.class.getName()); mgr.logRecorders.put(GitHubAppCredentials.class.getName(), logRecorder); LogRecorder.Target t = new LogRecorder.Target(GitHubAppCredentials.class.getName(), Level.FINE); logRecorder.targets.add(t); logRecorder.save(); t.enable(); }
Source:
<code>public void testEmptyParameter() { PhoneHomeParameterCreator phoneHomeParameterCreator = new PhoneHomeParameterCreator(); Map<String, String> map = phoneHomeParameterCreator.getParameters(); assertNotNull(map); <START> assertEquals(map, new HashMap<>()); <END> assertEquals(phoneHomeParameterCreator.build(), "?"); }</code><technical_language>nit: Collections.emptyMap() here</technical_language>

Target:
public void testEmptyParameter() { PhoneHomeParameterCreator phoneHomeParameterCreator = new PhoneHomeParameterCreator(); Map<String, String> map = phoneHomeParameterCreator.getParameters(); assertEquals(Collections.emptyMap(), map); assertEquals(phoneHomeParameterCreator.build(), "?"); }
Source:
<code>public void testGenerate() throws IOException{ final LabelsGeneratorInput input = new LabelsGeneratorInput(); input.setAllAvailablefields(this.mockAvailableFields()); input.setFileName("filename"); input.setBarcodeRequired(false); input.setNumberOfRowsPerPageOfLabel("7"); input.setSizeOfLabelSheet("1"); final LabelsData data = new LabelsData(TermId.OBS_UNIT_ID.getId(), Arrays.asList(this.mockLabels())); final File file = this.pdfLabelsFileGenerator.generate(input, data); Assert.assertNotNull(file); <START> Assert.assertEquals("filename.pdf", file.getName()); <END> }</code><technical_language>Delete file</technical_language>

Target:
public void testGenerate() throws IOException{ final LabelsGeneratorInput input = new LabelsGeneratorInput(); input.setAllAvailablefields(this.mockAvailableFields()); input.setFileName("filename"); input.setBarcodeRequired(false); input.setNumberOfRowsPerPageOfLabel("7"); input.setSizeOfLabelSheet("1"); final LabelsData data = new LabelsData(TermId.OBS_UNIT_ID.getId(), Arrays.asList(this.mockLabels())); final File file = this.pdfLabelsFileGenerator.generate(input, data); Assert.assertNotNull(file); Assert.assertEquals("filename.pdf", file.getName()); file.delete(); }
Source:
<code>public void start(final Stage primaryStage) throws IOException { Runtime.getRuntime().addShutdownHook(MainApplication.CLEAN_SHUTDOWN_PERFORMER); executorService = Executors.newCachedThreadPool(); addShutdownTask(() -> { executorService.shutdown(); }); WebDavServer.getInstance().start(); chooseNativeStylesheet(); final ResourceBundle rb = ResourceBundle.getBundle("localization"); final FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/main.fxml"), rb); final Parent root = loader.load(); final MainController ctrl = loader.getController(); ctrl.setStage(primaryStage); final Scene scene = new Scene(root); primaryStage.setTitle(rb.getString("app.name")); primaryStage.setScene(scene); primaryStage.sizeToScene(); primaryStage.setResizable(false); primaryStage.show(); ActiveWindowStyleSupport.startObservingFocus(primaryStage); TrayIconUtil.init(primaryStage, rb, () -> { quit(); }); for (String arg : getParameters().getUnnamed()) { handleCommandLineArg(ctrl, arg); } <START> if (org.controlsfx.tools.Platform.getCurrent().equals(org.controlsfx.tools.Platform.OSX)) { <END> Main.openFileHandler.complete(file -> handleCommandLineArg(ctrl, file.getAbsolutePath())); } LocalInstance cryptomatorGuiInstance = SingleInstanceManager.startLocalInstance(APPLICATION_KEY, executorService); addShutdownTask(() -> { cryptomatorGuiInstance.close(); }); cryptomatorGuiInstance.registerListener(arg -> handleCommandLineArg(ctrl, arg)); }</code><technical_language>I prefer SystemUtils.IS_OS_MAC_OSX</technical_language>

Target:
public void start(final Stage primaryStage) throws IOException { Runtime.getRuntime().addShutdownHook(MainApplication.CLEAN_SHUTDOWN_PERFORMER); executorService = Executors.newCachedThreadPool(); addShutdownTask(() -> { executorService.shutdown(); }); WebDavServer.getInstance().start(); chooseNativeStylesheet(); final ResourceBundle rb = ResourceBundle.getBundle("localization"); final FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/main.fxml"), rb); final Parent root = loader.load(); final MainController ctrl = loader.getController(); ctrl.setStage(primaryStage); final Scene scene = new Scene(root); primaryStage.setTitle(rb.getString("app.name")); primaryStage.setScene(scene); primaryStage.sizeToScene(); primaryStage.setResizable(false); primaryStage.show(); ActiveWindowStyleSupport.startObservingFocus(primaryStage); TrayIconUtil.init(primaryStage, rb, () -> { quit(); }); for (String arg : getParameters().getUnnamed()) { handleCommandLineArg(ctrl, arg); } if (org.controlsfx.tools.Platform.getCurrent().equals(org.controlsfx.tools.Platform.OSX)) { Main.OPEN_FILE_HANDLER.complete(file -> handleCommandLineArg(ctrl, file.getAbsolutePath())); } LocalInstance cryptomatorGuiInstance = SingleInstanceManager.startLocalInstance(APPLICATION_KEY, executorService); addShutdownTask(() -> { cryptomatorGuiInstance.close(); }); cryptomatorGuiInstance.registerListener(arg -> handleCommandLineArg(ctrl, arg)); }
Source:
<code>private CircuitBreaker getCircuitBreaker(String circuitBreakerName) { CircuitBreaker circuitBreaker = circuitBreakerRegistry.circuitBreaker(circuitBreakerName); <START> if (circuitBreaker == null && !circuitBreaker.getName().equalsIgnoreCase(circuitBreakerName)) { <END> new IllegalArgumentException(String .format("circuit breaker with name %s not found", circuitBreakerName)); } return circuitBreaker; }</code><technical_language>I this need checked. CircuitBreakerRegistry create get request a circuitbreaker. Therefore, null, requested name</technical_language>

Target:
private CircuitBreaker getCircuitBreaker(String circuitBreakerName) { return circuitBreakerRegistry.circuitBreaker(circuitBreakerName); }
Source:
<code>private void mockViolations(List<DomainViolation> violations) { violations.stream().forEach(v -> { when(v.getViolationType()).thenReturn(Violation.Type.ERROR); when(v.getUUID()).thenReturn(UUID_1); }); DomainViolation first = violations.get(0); when(first.getUUID()).thenReturn(UUID_0); DomainViolation last1 = violations.get(violations.size() - 2); <START> when(last1.getUUID()).thenReturn("null"); <END> DomainViolation last = violations.get(violations.size() - 1); when(last.getUUID()).thenReturn(null); }</code><technical_language>null instead of String relating name of violation</technical_language>

Target:
private void mockViolations(List<DomainViolation> violations) { violations.stream().forEach(v -> { when(v.getViolationType()).thenReturn(Violation.Type.ERROR); when(v.getUUID()).thenReturn(UUID_1); }); DomainViolation first = violations.get(0); when(first.getUUID()).thenReturn(UUID_0); DomainViolation last1 = violations.get(violations.size() - 2); when(last1.getUUID()).thenReturn(null); DomainViolation last = violations.get(violations.size() - 1); when(last.getUUID()).thenReturn("null"); }
Source:
<code>void offer(final UUID client) { if (uniqueClients.contains(client)) { clientsByTaskLoad.remove(client); } clientsByTaskLoad.offer(client); <START> uniqueClients.add(client); <END> }</code><technical_language>prop: I add client if is contained in set</technical_language>

Target:
void offer(final UUID client) { if (uniqueClients.contains(client)) { clientsByTaskLoad.remove(client); } else { uniqueClients.add(client); } clientsByTaskLoad.offer(client); }
Source:
<code>protected CompletionStage<Collection<Void>> handleMessageAsync(KV<K, V> message, MessageCollector collector, TaskCoordinator coordinator) { <START> return table.putAsync(message.getKey(), message.getValue()) <END> .thenApply(ignored -> Collections.emptyList()); }</code><technical_language>this change, put order is guaranteed more. a sequence of put event: 1. put(1, 10) 2. put (2, 20) 3. put(1, 5) 1st put fails 1st attempt retry triggered. 2nd put succeed 3rd put succeed retry for 1st put succeeds. for key 1 in store is 10, while 5 is expected</technical_language>

Target:
protected CompletionStage<Collection<KV<K, V>>> handleMessageAsync(KV<K, V> message, MessageCollector collector, TaskCoordinator coordinator) { return table.putAsync(message.getKey(), message.getValue(), sendToTableOpSpec.getArgs()) .thenApply(result -> Collections.singleton(message)); }
Source:
<code>private void merge(YamlNode source, YamlNode target) { if (source == null) { return; } YamlMapping sourceAsMapping = asMapping(source); YamlMapping targetAsMapping = asMapping(target); for (YamlNode sourceChild : sourceAsMapping.children()) { YamlNode targetChild = targetAsMapping.child(sourceChild.nodeName()); if (targetChild != null) { merge(sourceChild, targetChild); } else { if (targetAsMapping instanceof MutableYamlMapping) { <START> ((YamlMappingImpl) targetAsMapping).addChild(sourceChild.nodeName(), sourceChild); <END> } } } }</code><technical_language>cast MutableYamlMapping instanceof</technical_language>

Target:
private void merge(YamlNode source, YamlNode target) { YamlMapping sourceAsMapping = asMapping(source); YamlMapping targetAsMapping = asMapping(target); for (YamlNode sourceChild : sourceAsMapping.children()) { YamlNode targetChild = targetAsMapping.child(sourceChild.nodeName()); if (targetChild != null) { merge(sourceChild, targetChild); } else { ((MutableYamlMapping) targetAsMapping).addChild(sourceChild.nodeName(), sourceChild); } } }
Source:
<code>public static List<String> getTags(JSONObject jo) throws JSONException { if (jo.has(FIELD_TAGS)) { return getStringsFromJSONArray(jo.getJSONArray(FIELD_TAGS)); } else { <START> return Lists.newArrayList(); <END> } }</code><technical_language>Collections.emptyList(); need create new instance</technical_language>

Target:
public static List<String> getTags(JSONObject jo) throws JSONException { if (jo.has(FIELD_TAGS)) { return getStringsFromJSONArray(jo.getJSONArray(FIELD_TAGS)); } else { return Collections.emptyList(); } }
Source:
<code>public void onFailure(Call<T> call, Throwable t) { <START> Log.e("DefaultCallback", "Nework failure", t); <END> }</code><technical_language>Zlog receive error in Crashlytics? This noisy tho :)</technical_language>

Target:
public void onFailure(Call<T> call, Throwable t) { ZLog.logException(t); }
Source:
<code>public void validate() { if (enabled()) { if (clustering().cacheMode().isInvalidation()) { throw CONFIG.invalidConfigurationIndexingWithInvalidation(); } if (indexedEntities().isEmpty() && !getBuilder().template()) { CONFIG.noIndexableClassesDefined(); } } else { if (!indexedEntities().isEmpty()) { } } if (attributes.attribute(PROPERTIES).get() .entrySet().stream() .filter(e -> ((String) e.getKey()).endsWith(DIRECTORY_PROVIDER_SUFFIX)) .map(Map.Entry::getValue) .collect(Collectors.toSet()).size() > 1) { <START> throw CONFIG.foundMultipleDirectoryProviders(); <END> } if (attributes.attribute(INDEX).get() == Index.PRIMARY_OWNER) { throw CONFIG.indexModeNotSupported(Index.PRIMARY_OWNER.name()); } }</code><technical_language>need account default is fs, omitted. 2 entities of pointing local-heap, 1 property DIRECTORY_PROVIDER_SUFFIX backends</technical_language>

Target:
public void validate() { if (enabled()) { if (clustering().cacheMode().isInvalidation()) { throw CONFIG.invalidConfigurationIndexingWithInvalidation(); } if (indexedEntities().isEmpty() && !getBuilder().template()) { CONFIG.noIndexableClassesDefined(); } } else { if (!indexedEntities().isEmpty()) { } } ensureSingleIndexingProvider(); if (attributes.attribute(INDEX).get() == Index.PRIMARY_OWNER) { throw CONFIG.indexModeNotSupported(Index.PRIMARY_OWNER.name()); } }
Source:
<code>static <T, R> WorkProcessor<R> flatTransform(WorkProcessor<T> processor, Transformation<T, WorkProcessor<R>> transformation) { return processor.transform(new Transformation<T, R>() { WorkProcessor<R> processor; boolean needsMoreData; @Override public ProcessorState<R> process(Optional<T> elementOptional) { while (true) { if (processor == null) { ProcessorState<WorkProcessor<R>> state = transformation.process(elementOptional); if (state.type != ProcessorState.Type.RESULT) { return new ProcessorState<>(state.type, state.needsMoreData, Optional.empty(), state.blocked); } processor = state.result.get(); needsMoreData = state.needsMoreData; } if (processor.process()) { if (!processor.isFinished()) { return ProcessorState.ofResult(processor.getResult(), false); } processor = null; if (needsMoreData) { return ProcessorState.needsMoreData(); } } else if (processor.isBlocked()) { return ProcessorState.blocked(processor.getBlockedFuture()); } else { return ProcessorState.yield(); } <START> } <END> } }); }</code><technical_language>redundant else</technical_language>

Target:
static <T, R> WorkProcessor<R> flatTransform(WorkProcessor<T> processor, Transformation<T, WorkProcessor<R>> transformation) { return processor.transform(new Transformation<T, R>() { WorkProcessor<R> processor; boolean needsMoreData; @Override public ProcessorState<R> process(Optional<T> elementOptional) { while (true) { if (processor == null) { ProcessorState<WorkProcessor<R>> state = transformation.process(elementOptional); if (state.getType() != ProcessorState.Type.RESULT) { return new ProcessorState<>(state.getType(), state.isNeedsMoreData(), Optional.empty(), state.getBlocked()); } processor = state.getResult().get(); needsMoreData = state.isNeedsMoreData(); } if (processor.process()) { if (!processor.isFinished()) { return ProcessorState.ofResult(processor.getResult(), false); } processor = null; if (needsMoreData) { return ProcessorState.needsMoreData(); } } else if (processor.isBlocked()) { return ProcessorState.blocked(processor.getBlockedFuture()); } else { return ProcessorState.yield(); } } } }); }
Source:
<code>public void testProcessSpecialSoftwareCapabilities() { VDS vds = new VDS(); vds.setSupportedEmulatedMachines("pc-1.0"); vds.setStatus(VDSStatus.Up); virtStrategy.processSoftwareCapabilities(vds); <START> Assert.assertEquals(VDSStatus.Up, vds.getStatus()); <END> vds.setKvmEnabled(Boolean.TRUE); virtStrategy.processSoftwareCapabilities(vds); Assert.assertEquals(VDSStatus.Up, vds.getStatus()); vds.setKvmEnabled(Boolean.FALSE); virtStrategy.processSoftwareCapabilities(vds); assertEquals(VDSStatus.NonOperational, vds.getStatus()); }</code><technical_language>omit Assert.</technical_language>

Target:
public void testProcessSpecialSoftwareCapabilities() { VDS vds = new VDS(); vds.setSupportedEmulatedMachines("pc-1.0"); vds.setStatus(VDSStatus.Up); virtStrategy.processSoftwareCapabilities(vds); assertEquals(VDSStatus.Up, vds.getStatus()); vds.setKvmEnabled(Boolean.TRUE); virtStrategy.processSoftwareCapabilities(vds); assertEquals(VDSStatus.Up, vds.getStatus()); vds.setKvmEnabled(Boolean.FALSE); virtStrategy.processSoftwareCapabilities(vds); assertEquals(VDSStatus.NonOperational, vds.getStatus()); }
Source:
<code>public Optional<?> getProperty(T pojo, String propertyName) { return ReflectionAdapterUtils.getFields(pojo.getClass()).stream() <START> .filter(f -> Objects.equals(propertyName, f.getName())) <END> .map(field -> Exceptions.swallow(() -> field.get(pojo), null)) .findFirst(); }</code><technical_language>please field instead of f consistent line below</technical_language>

Target:
public Optional<?> getProperty(T pojo, String propertyName) { return ReflectionAdapterUtils.getFields(pojo.getClass()).stream() .filter(field -> Objects.equals(propertyName, field.getName())) .map(field -> Exceptions.swallow(() -> field.get(pojo), null)) .findFirst(); }
Source:
<code>private CompletableFuture<Location> calculateRandomLocation(Location center, double minRange, double maxRange) { CompletableFuture<Location> future = new CompletableFuture<>(); <START> double[] offset = getRandXySquare(minRange, maxRange); <END> Location location = new Location( center.getWorld(), center.getX() + offset[0], center.getWorld().getMaxHeight(), center.getZ() + offset[1], 360 * RANDOM.nextFloat() - 180, 0 ); PaperLib.getChunkAtAsync(location).thenAccept(chunk -> { if (World.Environment.NETHER.equals(center.getWorld().getEnvironment())) { location.setY(getNetherYAt(location)); } else { location.setY(center.getWorld().getHighestBlockYAt(location) + HIGHEST_BLOCK_Y_OFFSET); } future.complete(location); }); return future; }</code><technical_language>suggestion double[] offsets = getOffsets(minRange, maxRange); a name</technical_language>

Target:
private CompletableFuture<Location> calculateRandomLocation(Location center, double minRange, double maxRange) { CompletableFuture<Location> future = new CompletableFuture<>(); double rectX = RANDOM.nextDouble() * (maxRange - minRange) + minRange; double rectZ = RANDOM.nextDouble() * (maxRange + minRange) - minRange; double offsetX, offsetZ; int transform = RANDOM.nextInt(4); if (transform == 0) { offsetX = rectX; offsetZ = rectZ; } else if (transform == 1) { offsetX = -rectZ; offsetZ = rectX; } else if (transform == 2) { offsetX = -rectX; offsetZ = -rectZ; } else { offsetX = rectZ; offsetZ = -rectX; } Location location = new Location( center.getWorld(), center.getX() + offsetX, center.getWorld().getMaxHeight(), center.getZ() + offsetZ, 360 * RANDOM.nextFloat() - 180, 0 ); PaperLib.getChunkAtAsync(location).thenAccept(chunk -> { if (World.Environment.NETHER.equals(center.getWorld().getEnvironment())) { location.setY(getNetherYAt(location)); } else { location.setY(center.getWorld().getHighestBlockYAt(location) + HIGHEST_BLOCK_Y_OFFSET); } future.complete(location); }); return future; }
Source:
<code>public void makeHeaderVisible() { waitForElementByElement(titleLink); <START> executeScript("$('.LightboxHeader').css('opacity', 'initial')"); <END> }</code><technical_language>initial? 1 work? 1 default (i.e. opaque) of opacity</technical_language>

Target:
public void makeHeaderVisible() { waitForElementByElement(titleLink); executeScript("$('.LightboxHeader').css('opacity', '1')"); }
Source:
<code>private String getIdForEvent(MuleEvent event) throws Exception { if (useSecureHash) { MuleMessage message = event.getMessage(); Object payload = message.getPayload(); byte[] payloadBytes = (byte[]) objectToByteArray.transform(payload); <START> byte[] bytes = Bytes.concat(payloadBytes, message.getUniqueId().getBytes()); <END> if (payload instanceof InputStream) { event.getMessage().setPayload(bytes); } MessageDigest md = MessageDigest.getInstance(messageDigestAlgorithm); byte[] digestedBytes = md.digest(bytes); return (String)byteArrayToHexString.transform(digestedBytes); } else { return event.getMuleContext().getExpressionManager().parse(idExpression, event, true); } }</code><technical_language>static import</technical_language>

Target:
private String getIdForEvent(MuleEvent event) throws Exception { if (useSecureHash) { MuleMessage message = event.getMessage(); Object payload = message.getPayload(); byte[] payloadBytes = (byte[]) objectToByteArray.transform(payload); byte[] bytes = concat(payloadBytes, message.getUniqueId().getBytes()); if (payload instanceof InputStream) { event.getMessage().setPayload(bytes); } MessageDigest md = MessageDigest.getInstance(messageDigestAlgorithm); byte[] digestedBytes = md.digest(bytes); return (String)byteArrayToHexString.transform(digestedBytes); } else { return event.getMuleContext().getExpressionManager().parse(idExpression, event, true); } }
Source:
<code>static String checkNotEmpty(String value, String name) <START> { <END> if (value == null) { throw new NullPointerException(name + " is null"); } if (value.isEmpty()) { throw new PrestoException(GENERIC_USER_ERROR, name + " is empty"); } return value; }</code><technical_language>Is a reason fix this also? is possible</technical_language>

Target:
static String checkNotEmpty(String value, String name) { if (value == null) { throw new NullPointerException(name + " is null"); } if (value.isEmpty()) { throw new IllegalArgumentException(name + " is empty"); } return value; }
Source:
<code>default Tuple2<Iterator<T>, Iterator<T>> partition(Predicate<? super T> predicate) { Objects.requireNonNull(predicate, "predicate is null"); if (!hasNext()) { return Tuple.of(empty(), empty()); } else { Stream<T> first = Stream.empty(); Stream<T> second = Stream.empty(); for (T t : this) { if (predicate.test(t)) { <START> first = first.append(t); <END> } else { second = second.append(t); } } return Tuple.of(first.iterator(), second.iterator()); } }</code><technical_language>I remember, Stream.append is O(n) operation, op O(n^2). I java's ArrayList objects partition</technical_language>

Target:
default Tuple2<Iterator<T>, Iterator<T>> partition(Predicate<? super T> predicate) { Objects.requireNonNull(predicate, "predicate is null"); if (!hasNext()) { return Tuple.of(empty(), empty()); } else { final Tuple2<Iterator<T>, Iterator<T>> dup = IteratorModule.duplicate(this); return Tuple.of(dup._1.filter(predicate), dup._2.filterNot(predicate)); } }