auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onServerTickEnd(CallbackInfo ci) { TimingsManager.FULL_SERVER_TICK.stopTiming(); <START> } <END></code><technical_language>purpose of this injection is fire interact events while left-clicking AIR. If remove this, needs alternative handle events plugins break</technical_language>

Target:
public void onServerTickEnd(CallbackInfo ci) { int lastAnimTick = SpongeCommonEventFactory.lastAnimationPacketTick; int lastPrimaryTick = SpongeCommonEventFactory.lastPrimaryPacketTick; int lastSecondaryTick = SpongeCommonEventFactory.lastSecondaryPacketTick; if (SpongeCommonEventFactory.lastAnimationPlayer != null) { EntityPlayerMP player = SpongeCommonEventFactory.lastAnimationPlayer.get(); if (player != null && lastAnimTick != lastPrimaryTick && lastAnimTick != lastSecondaryTick && lastAnimTick != 0 && lastAnimTick - lastPrimaryTick > 3 && lastAnimTick - lastSecondaryTick > 3) { BlockSnapshot blockSnapshot = BlockSnapshot.NONE; final RayTraceResult result = SpongeImplHooks.rayTraceEyes(player, SpongeImplHooks.getBlockReachDistance(player) + 1); if (result != null && result.getBlockPos() != null) { return; } Sponge.getCauseStackManager().pushCause(player); if (!player.getHeldItemMainhand().isEmpty() && SpongeCommonEventFactory.callInteractItemEventPrimary(player, player.getHeldItemMainhand(), EnumHand.MAIN_HAND, null, blockSnapshot).isCancelled()) { SpongeCommonEventFactory.lastAnimationPacketTick = 0; Sponge.getCauseStackManager().popCause(); return; } SpongeCommonEventFactory.callInteractBlockEventPrimary(player, player.getHeldItemMainhand(), EnumHand.MAIN_HAND, null); Sponge.getCauseStackManager().popCause(); } } SpongeCommonEventFactory.lastAnimationPacketTick = 0; TimingsManager.FULL_SERVER_TICK.stopTiming(); }
Source:
<code>public void handleMessage(Message<?> message) { Assert.notNull(message, "Message must not be null"); Assert.notNull(message.getPayload(), "Message payload must not be null"); if (this.loggingEnabled && this.logger.isDebugEnabled()) { this.logger.debug(this + " received message: " + message); } MetricsContext start = null; boolean countsEnabled = this.countsEnabled; AbstractMessageHandlerMetrics handlerMetrics = this.handlerMetrics; try { if (this.shouldTrack) { message = MessageHistory.write(message, this, this.getMessageBuilderFactory()); } if (handlerMetrics.getTimer() != null && countsEnabled) { final Message<?> messageToSend = message; handlerMetrics.getTimer().record(() -> { try { handleMessageInternal(messageToSend); } <START> catch (Exception e) { <END> if (e instanceof MessagingException) { throw (MessagingException) e; } throw new MessageHandlingException(messageToSend, "error occurred in message handler [" + this + "]", e); } }); } else { if (countsEnabled) { start = handlerMetrics.beforeHandle(); } handleMessageInternal(message); if (countsEnabled) { handlerMetrics.afterHandle(start, true); } } } catch (Exception e) { if (countsEnabled) { if (handlerMetrics.getErrorCounter() != null) { handlerMetrics.getErrorCounter().increment(); } else { handlerMetrics.afterHandle(start, false); } } if (e instanceof MessagingException) { throw (MessagingException) e; } throw new MessageHandlingException(message, "error occurred in message handler [" + this + "]", e); } }</code><technical_language>recordCallable() return null; instead</technical_language>

Target:
public void handleMessage(Message<?> message) { Assert.notNull(message, "Message must not be null"); Assert.notNull(message.getPayload(), "Message payload must not be null"); if (this.loggingEnabled && this.logger.isDebugEnabled()) { this.logger.debug(this + " received message: " + message); } MetricsContext start = null; boolean countsEnabled = this.countsEnabled; AbstractMessageHandlerMetrics handlerMetrics = this.handlerMetrics; try { if (this.shouldTrack) { message = MessageHistory.write(message, this, this.getMessageBuilderFactory()); } if (countsEnabled) { if (handlerMetrics.getTimer() != null) { final Message<?> messageToSend = message; handlerMetrics.getTimer().recordCallable(() -> { handleMessageInternal(messageToSend); return null; }); } else { start = handlerMetrics.beforeHandle(); handleMessageInternal(message); handlerMetrics.afterHandle(start, true); } } else { handleMessageInternal(message); } } catch (Exception e) { if (countsEnabled) { if (handlerMetrics.getErrorCounter() != null) { handlerMetrics.getErrorCounter().increment(); } else { handlerMetrics.afterHandle(start, false); } } if (e instanceof MessagingException) { throw (MessagingException) e; } throw new MessageHandlingException(message, "error occurred in message handler [" + this + "]", e); } }
Source:
<code>private String getDisplayedRooms(Session session) { List<Room> rooms = session.rooms(); StringBuilder sb = new StringBuilder(); for (Room room : rooms) { sb.append(room.getName()).append(", "); } if (sb.length() > 2) { sb.delete(sb.length() - 2, sb.length() - 1); } <START> return rooms.get(0).getName(); <END> }</code><technical_language>StringBuilder output</technical_language>

Target:
private String getDisplayedRooms(Session session) { List<Room> rooms = session.rooms(); StringBuilder sb = new StringBuilder(); for (Room room : rooms) { sb.append(room.getName()).append(", "); } if (sb.length() > 2) { sb.delete(sb.length() - 2, sb.length() - 1); } return sb.toString(); }
Source:
<code>public MessageBuilder appendCustomMessage(Result buildResult) { String customMessage = notifier.getCustomMessage(); <START> if (buildResult != null) { <END> if (buildResult == Result.SUCCESS) { customMessage = notifier.getCustomMessageSuccess(); } else if (buildResult == Result.ABORTED) { customMessage = notifier.getCustomMessageAborted(); } else if (buildResult == Result.NOT_BUILT) { customMessage = notifier.getCustomMessageNotBuilt(); } else if (buildResult == Result.UNSTABLE) { customMessage = notifier.getCustomMessageUnstable(); } else if (buildResult == Result.FAILURE) { customMessage = notifier.getCustomMessageFailure(); } } try { String replaced = TokenMacro.expandAll(build, new LogTaskListener(logger, INFO), customMessage); message.append("\n"); message.append(replaced); } catch (MacroEvaluationException e) { logger.log(SEVERE, e.getMessage(), e); } catch (IOException e) { logger.log(SEVERE, e.getMessage(), e); } catch (InterruptedException e) { logger.log(SEVERE, e.getMessage(), e); } return this; }</code><technical_language>Thanks @KreAch3R This great problem imo is this is a breaking change. Currently custom message applies statuses this change applies Notify Build Start I suggest like: Custom Message - Statuses - Matches existing field Custom Message - Build Start - new field if wants override build start message</technical_language>

Target:
public MessageBuilder appendCustomMessage(Result buildResult) { String customMessage = ""; if (buildResult != null) { if (buildResult == Result.SUCCESS) { customMessage = notifier.getCustomMessageSuccess(); } else if (buildResult == Result.ABORTED) { customMessage = notifier.getCustomMessageAborted(); } else if (buildResult == Result.NOT_BUILT) { customMessage = notifier.getCustomMessageNotBuilt(); } else if (buildResult == Result.UNSTABLE) { customMessage = notifier.getCustomMessageUnstable(); } else if (buildResult == Result.FAILURE) { customMessage = notifier.getCustomMessageFailure(); } } if (customMessage.isEmpty()) { customMessage = notifier.getCustomMessage(); } try { String replaced = TokenMacro.expandAll(build, new LogTaskListener(logger, INFO), customMessage, false, null); message.append("\n"); message.append(replaced); } catch (MacroEvaluationException | IOException | InterruptedException e) { logger.log(SEVERE, e.getMessage(), e); } return this; }
Source:
<code>public FeedbackResponseCommentRow(FeedbackResponseCommentAttributes frc, String giverDisplay, String giverName, String recipientName, String showCommentToString, String showGiverNameToString, Map<FeedbackParticipantType, Boolean> responseVisibilities, Map<String, String> instructorEmailNameTable) { this(frc, giverDisplay, instructorEmailNameTable); setDataForAddEditDelete(frc, giverName, recipientName, showCommentToString, showGiverNameToString, responseVisibilities); setCommentGiverName(giverDisplay); setCommentLastEditorName(frc.lastEditorEmail); this.questionId = frc.feedbackQuestionId; <START> this.editedAt = setEditedAtText(frc.createdAt, frc.lastEditedAt); <END> }</code><technical_language>a need for 4 lines, considering set this(frc, giverDisplay, instructorEmailNameTable);</technical_language>

Target:
public FeedbackResponseCommentRow(FeedbackResponseCommentAttributes frc, String giverDisplay, String giverName, String recipientName, String showCommentToString, String showGiverNameToString, Map<FeedbackParticipantType, Boolean> responseVisibilities, Map<String, String> instructorEmailNameTable) { this(frc, giverDisplay, instructorEmailNameTable); setDataForAddEditDelete(frc, giverName, recipientName, showCommentToString, showGiverNameToString, responseVisibilities); }
Source:
<code>default PlanNode resolve(PlanNode node) { <START> return getOnlyElement(resolveGroup(node).iterator()); <END> }</code><technical_language>resolveGroup(node) .collect(toOptional()) .get() more javaeightish</technical_language>

Target:
default PlanNode resolve(PlanNode node) { return resolveGroup(node).collect(toOptional()).get(); }
Source:
<code>private void processingMovements() { distributionOrders.entrySet().stream().filter(entry -> entry != null).forEach(entry -> { I_DD_Order distributionOrder = entry.getValue(); List<Integer> orderIds = new ArrayList<Integer>(); orderIds.add(distributionOrder.getDD_Order_ID()); ProcessInfo processInfo = ProcessBuilder.create(getCtx()) .process(MovementGenerate.getProcessId()) .withSelectedRecordsIds(MDDOrder.Table_ID, orderIds) .withParameter(MWMInOutBound.COLUMNNAME_M_Warehouse_ID, distributionOrder.getM_Warehouse_ID()) .withParameter(MMovement.COLUMNNAME_MovementDate, getMovementDate()) .withoutTransactionClose() .execute(get_TrxName()); if (processInfo.isError()) throw new AdempiereException(processInfo.getSummary()); addLog(processInfo.getSummary()); <START> Arrays.stream(processInfo.getIDs()).forEach(recordId -> { <END> Optional<MMovement> maybeMovement = Optional.ofNullable(new MMovement(getCtx(), recordId, get_TrxName())); maybeMovement.ifPresent(movement -> { documentCreated++; printDocument(movement, "Inventory Move Hdr (Example)"); }); }); }); }</code><technical_language>**Inventory Move Hdr (Example)** is hardcoded work for shipments</technical_language>

Target:
private void processingMovements() { distributionOrders.entrySet().stream().filter(entry -> entry != null).forEach(entry -> { I_DD_Order distributionOrder = entry.getValue(); List<Integer> orderIds = new ArrayList<Integer>(); orderIds.add(distributionOrder.getDD_Order_ID()); ProcessInfo processInfo = ProcessBuilder.create(getCtx()) .process(MovementGenerate.getProcessId()) .withSelectedRecordsIds(MDDOrder.Table_ID, orderIds) .withParameter(MWMInOutBound.COLUMNNAME_M_Warehouse_ID, distributionOrder.getM_Warehouse_ID()) .withParameter(MMovement.COLUMNNAME_MovementDate, getMovementDate()) .withoutTransactionClose() .execute(get_TrxName()); if (processInfo.isError()) throw new AdempiereException(processInfo.getSummary()); addLog(processInfo.getSummary()); Arrays.stream(processInfo.getIDs()).forEach(recordId -> { Optional<MMovement> maybeMovement = Optional.ofNullable(new MMovement(getCtx(), recordId, get_TrxName())); maybeMovement.ifPresent(movement -> { documentCreated++; printDocument(movement, true); }); }); }); }
Source:
<code>public void checkCodeValidationFeature() { editor.selectTabByName(GO_FILE_NAME); editor.waitAllMarkersInvisibility(ERROR); editor.goToCursorPositionVisible(13, 1); editor.typeTextIntoEditor("p"); editor.waitMarkerInPosition(ERROR, 13); editor.moveToMarkerAndWaitAssistContent(ERROR); editor.waitTextIntoAnnotationAssist("expected 'package', found 'IDENT' ppackage"); editor.goToCursorPositionVisible(13, 1); editor.typeTextIntoEditor(Keys.DELETE.toString()); editor.waitAllMarkersInvisibility(ERROR); editor.goToCursorPositionVisible(13, 1); editor.launchCommentCodeFeature(); editor.waitTextIntoEditor(" editor.launchCommentCodeFeature(); <START> editor.waitTextIntoEditor("package main"); <END> }</code><technical_language>check "//" disappear, do it</technical_language>

Target:
public void checkCodeValidationFeature() { editor.selectTabByName(GO_FILE_NAME); editor.waitAllMarkersInvisibility(ERROR); editor.goToCursorPositionVisible(13, 1); editor.typeTextIntoEditor("p"); editor.waitMarkerInPosition(ERROR, 13); editor.moveToMarkerAndWaitAssistContent(ERROR); editor.waitTextIntoAnnotationAssist("expected 'package', found 'IDENT' ppackage"); editor.goToCursorPositionVisible(13, 1); editor.typeTextIntoEditor(Keys.DELETE.toString()); editor.waitAllMarkersInvisibility(ERROR); editor.goToCursorPositionVisible(13, 1); editor.launchCommentCodeFeature(); editor.waitTextIntoEditor(" editor.launchCommentCodeFeature(); editor.waitTextNotPresentIntoEditor(" }
Source:
<code>public Boolean execute(ServiceProvider context) { final RemoteJob job = context.service(RemoteJob.class); final String user = job.getUser(); final Map<String, CodeSystemEntry> codeSystemsByShortName = fetchAllCodeSystems(context); final CodeSystemEntry codeSystem = codeSystemsByShortName.get(codeSystemShortName); if (codeSystem == null) { throw new CodeSystemNotFoundException(codeSystemShortName); } final String newVersionPath = String.format("%s%s%s", codeSystem.getBranchPath(), Branch.SEPARATOR, versionId); Branch.BranchNameValidator.DEFAULT.checkName(versionId); try { RepositoryRequests.branching() .prepareGet(newVersionPath) .build(codeSystem.getRepositoryUuid()) .execute(context.service(IEventBus.class)) .getSync(); throw new ConflictException("An existing branch with path '%s' conflicts with the specified version identifier.", newVersionPath); } catch (NotFoundException e) { } final Map<CodeSystemEntry, IVersioningManager> versioningManagersByCodeSystem = createVersioningManagers(context, codeSystemsByShortName, codeSystem); <START> acquireLocks(context, user, versioningManagersByCodeSystem.keySet()); <END> for (Entry<CodeSystemEntry, IVersioningManager> entry : versioningManagersByCodeSystem.entrySet()) { createVersion(context, entry.getValue(), entry.getKey(), user); } releaseLocks(context); return Boolean.TRUE; }</code><technical_language>release locks in a try...finally block</technical_language>

Target:
public Boolean execute(ServiceProvider context) { final RemoteJob job = context.service(RemoteJob.class); final String user = job.getUser(); final Map<String, CodeSystemEntry> codeSystemsByShortName = fetchAllCodeSystems(context); final CodeSystemEntry codeSystem = codeSystemsByShortName.get(codeSystemShortName); if (codeSystem == null) { throw new CodeSystemNotFoundException(codeSystemShortName); } final String newVersionPath = String.format("%s%s%s", codeSystem.getBranchPath(), Branch.SEPARATOR, versionId); Branch.BranchNameValidator.DEFAULT.checkName(versionId); try { RepositoryRequests.branching() .prepareGet(newVersionPath) .build(codeSystem.getRepositoryUuid()) .execute(context.service(IEventBus.class)) .getSync(); throw new ConflictException("An existing branch with path '%s' conflicts with the specified version identifier.", newVersionPath); } catch (NotFoundException e) { } final Map<CodeSystemEntry, IVersioningManager> versioningManagersByCodeSystem = createVersioningManagers(context, codeSystemsByShortName, codeSystem); try { acquireLocks(context, user, versioningManagersByCodeSystem.keySet()); for (Entry<CodeSystemEntry, IVersioningManager> entry : versioningManagersByCodeSystem.entrySet()) { createVersion(context, entry.getValue(), entry.getKey(), user); } return Boolean.TRUE; } finally { releaseLocks(context); } }
Source:
<code>public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); List<String> processes = new ArrayList<String>(); processes.add("repo/processes/general/customtask.bpmn"); processes.add("repo/processes/general/humanTask.bpmn"); processes.add("repo/processes/general/import.bpmn"); processes.add("repo/processes/general/signal.bpmn"); processes.add("repo/processes/general/signalWithExpression.bpmn2"); processes.add("repo/processes/general/callactivity.bpmn"); DeploymentDescriptor customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain"); DeploymentDescriptorBuilder ddBuilder = customDescriptor.getBuilder(); ddBuilder.auditMode(AuditMode.NONE); Map<String, String> extraResources = new HashMap<String, String>(); extraResources.put("src/main/resources/" + DeploymentDescriptor.META_INF_LOCATION, customDescriptor.toXml()); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes, extraResources); File pom = new File("target/kmodule", "pom.xml"); pom.getParentFile().mkdir(); try { FileOutputStream fs = new FileOutputStream(pom); fs.write(getPom(releaseId).getBytes()); fs.close(); } catch (Exception e) { <START> <END> } KieMavenRepository repository = getKieMavenRepository(); repository.deployArtifact(releaseId, kJar1, pom); }</code><technical_language>exception is thrown this point, test setup compromised. Please throw unchecked exception clear root case is</technical_language>

Target:
public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); List<String> processes = new ArrayList<String>(); processes.add("repo/processes/general/customtask.bpmn"); processes.add("repo/processes/general/humanTask.bpmn"); processes.add("repo/processes/general/import.bpmn"); processes.add("repo/processes/general/signal.bpmn"); processes.add("repo/processes/general/signalWithExpression.bpmn2"); processes.add("repo/processes/general/callactivity.bpmn"); DeploymentDescriptor customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain"); DeploymentDescriptorBuilder ddBuilder = customDescriptor.getBuilder(); ddBuilder.auditMode(AuditMode.NONE); Map<String, String> extraResources = new HashMap<String, String>(); extraResources.put("src/main/resources/" + DeploymentDescriptor.META_INF_LOCATION, customDescriptor.toXml()); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes, extraResources); File pom = new File("target/kmodule", "pom.xml"); pom.getParentFile().mkdir(); try { FileOutputStream fs = new FileOutputStream(pom); fs.write(getPom(releaseId).getBytes()); fs.close(); } catch (Exception e) { throw new RuntimeException("Unable to save pom content", e); } KieMavenRepository repository = getKieMavenRepository(); repository.deployArtifact(releaseId, kJar1, pom); }
Source:
<code>public void changeListener_syncIfNeeded_updatedFromOtherThread() { final Realm realm = Realm.getInstance(looperThread.createConfiguration("Foo")); populateTestRealm(realm, 10); final RealmResults<AllTypes> results = realm.where(AllTypes.class).lessThan(AllTypes.FIELD_LONG, 10).findAll(); assertEquals(10, results.size()); realm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { <START> realm.where(AllTypes.class).equalTo(AllTypes.FIELD_LONG, 0).findFirst().removeFromRealm(); <END> } }, new Realm.Transaction.OnSuccess() { @Override public void onSuccess() { assertEquals(9, results.size()); realm.close(); looperThread.testComplete(); } }); }</code><technical_language>revert this</technical_language>

Target:
public void changeListener_syncIfNeeded_updatedFromOtherThread() { final Realm realm = Realm.getInstance(looperThread.createConfiguration("Foo")); populateTestRealm(realm, 10); final RealmResults<AllTypes> results = realm.where(AllTypes.class).lessThan(AllTypes.FIELD_LONG, 10).findAll(); assertEquals(10, results.size()); realm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { realm.where(AllTypes.class).equalTo(AllTypes.FIELD_LONG, 0).findFirst().deleteFromRealm(); } }, new Realm.Transaction.OnSuccess() { @Override public void onSuccess() { assertEquals(9, results.size()); realm.close(); looperThread.testComplete(); } }); }
Source:
<code>public void testDeleteFromListColumnIndexTable_NullColumn() { <START> ColumnModel multiValue = null; <END> Set<Long> rowIdFilter = null; assertThrows(IllegalArgumentException.class, ()->{ tableIndexDAO.populateListColumnIndexTable(tableId, multiValue, rowIdFilter); }); }</code><technical_language>nan</technical_language>

Target:
public void testDeleteFromListColumnIndexTable_NullColumn() { ColumnModel multiValue = null; Set<Long> rowIdFilter = Sets.newHashSet(1L); String message = assertThrows(IllegalArgumentException.class, ()->{ tableIndexDAO.populateListColumnIndexTable(tableId, multiValue, rowIdFilter); }).getMessage(); assertEquals("listColumn is required.", message); }
Source:
<code>private List<Flux<CoreEvent>> collectPublishers() { List<Flux<CoreEvent>> routes = this.routes.stream() .map(ExecutableRoute::getPublisher) <START> .collect(toCollection(ArrayList::new)); <END> Integer lastRouteIndex = routes.size() - 1; routes.set(lastRouteIndex, subscribeFluxOnPublisherSubscription(routes.get(lastRouteIndex), router)); return routes; }</code><technical_language>Collectors.toList()</technical_language>

Target:
private List<Flux<CoreEvent>> collectPublishers() { List<Flux<CoreEvent>> routes = new ArrayList<>(); for (Iterator routesIterator = this.routes.iterator(); routesIterator.hasNext();) { ExecutableRoute nextRoute = (ExecutableRoute) routesIterator.next(); if (routesIterator.hasNext()) { routes.add(nextRoute.getPublisher()); } else { routes.add(subscribeFluxOnPublisherSubscription(nextRoute.getPublisher(), router)); } } return routes; }
Source:
<code>public void testExplicitWaffleString() throws Exception { stmt.setString(3, I_AM_A_STRING); replay(stmt); <START> foreman.waffle(String.class, I_AM_A_STRING, null).apply(3, stmt, null); <END> }</code><technical_language>+1: This is a big improvement tests</technical_language>

Target:
public void testExplicitWaffleString() throws Exception { foreman.waffle(String.class, I_AM_A_STRING, null).apply(3, stmt, null); verify(stmt).setString(3, I_AM_A_STRING); }
Source:
<code>public InstructorFeedbackEditCopyData(AccountAttributes account, String errorMessage) { <START> this(account, "", errorMessage); <END> }</code><technical_language>other constructor calling this instead? for redirectUrl, simply null leave handling for calls instead</technical_language>

Target:
public InstructorFeedbackEditCopyData(AccountAttributes account, String errorMessage) { this(account, null, errorMessage); }
Source:
<code>public DurableScheduledService(@NotNull final String serviceName, @NotNull final Duration runInterval, @NotNull final Duration timeout, @NotNull final Duration watcherInterval, <START> @NotNull final Duration shutdownTimeout) { <END> _serviceName = serviceName; _runInterval = runInterval; _timeout = timeout; _watcherInterval = watcherInterval; _shutdownTimeout = shutdownTimeout; _watcherService = createWatcherService(); }</code><technical_language>please, add null/empty checks</technical_language>

Target:
public DurableScheduledService(@NotNull final String serviceName, @NotNull final Duration runInterval, @NotNull final Duration timeout, @NotNull final Duration watcherInterval, @NotNull final Duration shutdownTimeout) { Validate.notEmpty(serviceName); _serviceName = serviceName; _runInterval = runInterval; _timeout = timeout; _watcherInterval = watcherInterval; _shutdownTimeout = shutdownTimeout; _watcherService = createWatcherService(); }
Source:
<code>public ByteBufferPool(int bufferSize, int maxPoolSize, boolean directByteBuffer) { this.bufferSize = bufferSize; this.maxPoolSize = maxPoolSize; this.directByteBuffer = directByteBuffer; LOG.info("Created with bufferSize={} and maxPoolSize={}", org.apache.hadoop.util.StringUtils.byteDesc(bufferSize), maxPoolSize); this.count = new AtomicInteger(0); <START> } <END></code><technical_language>add (maxPoolSize* bufferSize) log also? actual maxPoolSize in byteDesc</technical_language>

Target:
public ByteBufferPool(int bufferSize, int maxPoolSize, boolean directByteBuffer) { this.bufferSize = bufferSize; this.maxPoolSize = maxPoolSize; this.directByteBuffer = directByteBuffer; LOG.info("Created with bufferSize={}, maxPoolSize={} and totalBufferSize={}", org.apache.hadoop.util.StringUtils.byteDesc(bufferSize), maxPoolSize, org.apache.hadoop.util.StringUtils.byteDesc((long) (bufferSize * maxPoolSize))); this.count = new AtomicInteger(0); }
Source:
<code>protected void applySorting(List<ProcessDefinition> input, final QueryContext queryContext) { if (queryContext != null && queryContext.getOrderBy() != null && !queryContext.getOrderBy().isEmpty()) { Collections.sort(input, new Comparator<ProcessDefinition>() { @Override public int compare(ProcessDefinition o1, ProcessDefinition o2) { if ("ProcessName".equals(queryContext.getOrderBy())) { return o1.getName().compareToIgnoreCase(o2.getName()); } else if ("ProcessVersion".equals(queryContext.getOrderBy())) { return o1.getVersion().compareTo(o2.getVersion()); <START> } else if ("Project".equals(queryContext.getOrderBy())) { <END> return o1.getDeploymentId().compareTo(o2.getDeploymentId()); } return 0; } }); if (!queryContext.isAscending()) { Collections.reverse(input); } } }</code><technical_language>_Project_ needs fix</technical_language>

Target:
protected void applySorting(List<ProcessDefinition> input, final QueryContext queryContext) { if (queryContext != null && queryContext.getOrderBy() != null && !queryContext.getOrderBy().isEmpty()) { Collections.sort(input, new Comparator<ProcessDefinition>() { @Override public int compare(ProcessDefinition o1, ProcessDefinition o2) { if ("ProcessName".equals(queryContext.getOrderBy())) { return o1.getName().compareToIgnoreCase(o2.getName()); } else if ("ProcessVersion".equals(queryContext.getOrderBy())) { return o1.getVersion().compareTo(o2.getVersion()); } else if ("Project".equals(queryContext.getOrderBy())) { return o1.getDeploymentId().compareToIgnoreCase(o2.getDeploymentId()); } return 0; } }); if (!queryContext.isAscending()) { Collections.reverse(input); } } }
Source:
<code>public void disconnect() { <START> context.unbindService(serviceConnection); <END> }</code><technical_language>call context.stopService() client is longer bound continue consume resources clients connected</technical_language>

Target:
public void disconnect() { context.unbindService(serviceConnection); Intent intent = new Intent(context, FusedLocationProviderService.class); context.stopService(intent); }
Source:
<code>public DatasetVersion getDatasetVersion(String datasetID, String edition, String version) throws IOException, DatasetAPIException { if (StringUtils.isEmpty(datasetID) || StringUtils.isEmpty(edition)) { throw new BadRequestException("A dataset ID, edition, and version must be provided."); } <START> String path = "/datasets/" + datasetID + "/editions/" + edition + "/versions/" + version ; <END> logInfo("Calling dataset API") .addParameter("path", path) .addParameter("method", "GET") .log(); HttpGet httpget = new HttpGet(datasetAPIURL + path); httpget.addHeader(authTokenHeaderName, datasetAPIAuthToken); try (CloseableHttpResponse response = client.execute(httpget)) { switch (response.getStatusLine().getStatusCode()) { case HttpStatus.SC_OK: String responseString = EntityUtils.toString(response.getEntity()); return ContentUtil.deserialise(responseString, DatasetVersion.class); case HttpStatus.SC_NOT_FOUND: throw new DatasetNotFoundException("The dataset API returned 404 for " + path); default: throw new UnexpectedResponseException( String.format("The dataset API returned a %s response for %s", response.getStatusLine().getStatusCode(), path)); } } }</code><technical_language>Is worth a URL builder</technical_language>

Target:
public DatasetVersion getDatasetVersion(String datasetID, String edition, String version) throws IOException, DatasetAPIException { if (StringUtils.isEmpty(datasetID) || StringUtils.isEmpty(edition)) { throw new BadRequestException("A dataset ID, edition, and version must be provided."); } String path = String.format("/datasets/%s/editions/%s/versions/%s", datasetID, edition, version); URI uri; try { uri = new URIBuilder(datasetAPIURL) .setPath(path) .build(); } catch (URISyntaxException e) { throw new BadRequestException(e.getMessage()); } logInfo("Calling dataset API") .addParameter("uri", uri) .addParameter("method", "GET") .log(); HttpGet httpget = new HttpGet(uri); httpget.addHeader(authTokenHeaderName, datasetAPIAuthToken); try (CloseableHttpResponse response = client.execute(httpget)) { switch (response.getStatusLine().getStatusCode()) { case HttpStatus.SC_OK: String responseString = EntityUtils.toString(response.getEntity()); return ContentUtil.deserialise(responseString, DatasetVersion.class); case HttpStatus.SC_NOT_FOUND: throw new DatasetNotFoundException("The dataset API returned 404 for " + path); default: throw new UnexpectedResponseException( String.format("The dataset API returned a %s response for %s", response.getStatusLine().getStatusCode(), path)); } } }
Source:
<code>private PutChunk getChunkToFill() { if (chunkToFill != null && chunkToFill.isBuilding()) { return chunkToFill; } chunkToFill = null; for (PutChunk chunk : putChunks) { if (chunk.isFree()) { chunkCounter++; chunk.prepareForBuilding(chunkCounter, getSizeOfChunkAt(chunkCounter)); chunkToFill = chunk; <START> routerMetrics.chunkFillerWaitingTrunkTimeMs.update(time.milliseconds() - timeFilledPreviousChunkMs); <END> timeStartFillingCurrentChunkMs = time.milliseconds(); break; } } return chunkToFill; }</code><technical_language>I this is correct. updating timeFilledPreviousChunkMs fill is complete threshold for wait. fill is complete, reuse PutChunk chunk holds is out, end calculating in "wait time"</technical_language>

Target:
private PutChunk getChunkToFill() { if (chunkToFill != null && chunkToFill.isBuilding()) { return chunkToFill; } chunkToFill = null; for (PutChunk chunk : putChunks) { if (chunk.isFree()) { chunkCounter++; chunk.prepareForBuilding(chunkCounter, getSizeOfChunkAt(chunkCounter)); chunkToFill = chunk; break; } } return chunkToFill; }
Source:
<code>public MoshiConverterFactory asLenient() { <START> if (lenient) { <END> return this; } return create(moshi, true); }</code><technical_language>I delete this if. happen if big of a deal create a new instance</technical_language>

Target:
public MoshiConverterFactory asLenient() { return new MoshiConverterFactory(moshi, true); }
Source:
<code>protected void executeVmCommand() { addCustomValue("InterfaceType", VmInterfaceType.forValue(getInterface().getType()).getDescription().toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (isVnicProfileChanged(oldIface, getInterface())) { Network newNetwork = networkHelper.getNetworkByVnicProfileId(getInterface().getVnicProfileId()); Network oldNetwork = networkHelper.getNetworkByVnicProfileId(oldIface.getVnicProfileId()); if (!Objects.equals(oldNetwork, newNetwork)) { externalNetworkManagerFactory.create(oldIface).deallocateIfExternal(); } } macAddedToPool = allocateMacFromRequest(); if (mustChangeAddress(oldIface.getType(), getInterface().getType())) { vmDeviceDao.clearDeviceAddress(getInterface().getId()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); succeeded = Boolean.TRUE.equals(TransactionSupport.executeInNewTransaction(() -> { bumpVmVersion(); updatePassthoughDeviceIfNeeded(); getCompensationContext().snapshotEntity(oldIface); vmNicDao.update(getInterface()); saveNetworkFilterParameters(); getCompensationContext().stateChanged(); return true; })); <START> succeeded &= updateHost(); <END> } finally { setSucceeded(succeeded); macPoolCleanupAfterExecution(macAddedToPool); } }</code><technical_language>is related patch. a change in patch increases risk of db fail? If db fails, exception thrown get 'updateHost' code</technical_language>

Target:
protected void executeVmCommand() { addCustomValue("InterfaceType", VmInterfaceType.forValue(getInterface().getType()).getDescription().toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (isVnicProfileChanged(oldIface, getInterface())) { Network newNetwork = networkHelper.getNetworkByVnicProfileId(getInterface().getVnicProfileId()); Network oldNetwork = networkHelper.getNetworkByVnicProfileId(oldIface.getVnicProfileId()); if (!Objects.equals(oldNetwork, newNetwork)) { externalNetworkManagerFactory.create(oldIface).deallocateIfExternal(); } } macAddedToPool = allocateMacFromRequest(); if (mustChangeAddress(oldIface.getType(), getInterface().getType())) { vmDeviceDao.clearDeviceAddress(getInterface().getId()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(() -> { bumpVmVersion(); updatePassthoughDeviceIfNeeded(); getCompensationContext().snapshotEntity(oldIface); vmNicDao.update(getInterface()); saveNetworkFilterParameters(); getCompensationContext().stateChanged(); return null; }); succeeded = updateHost(); } finally { setSucceeded(succeeded); macPoolCleanupAfterExecution(macAddedToPool); } }
Source:
<code>private int getMapMode () { String map_mode = PreferenceUtils.getValue(context, PreferenceUtils.KEY_SETTING_MAP_MODE); <START> return (map_mode.equals("0") || map_mode.equals("1") || map_mode.equals("2")) ? Integer.valueOf(map_mode) : 0; <END> }</code><technical_language>This perfect I a idiom here: Arrays.asList("0", "1", "2").contains(map_mode); map_mode needs camelCase, btw. this method is kinda in a wrong place - I this method in PreferenceUtils some other class deals saving loading preferences care about</technical_language>

Target:
private int getMapMode () { String mapMode = PreferenceUtils.getValue(context, PreferenceUtils.KEY_SETTING_MAP_MODE); return Arrays.asList("0", "1", "2").contains(mapMode) ? Integer.valueOf(mapMode) : 0; }
Source:
<code><START> final void setNewGeneration(final Generation generation) { <END> this.generation = generation; }</code><technical_language>methods synchronized</technical_language>

Target:
final synchronized void setNewGeneration(final Generation generation) { this.generation = generation; }
Source:
<code>protected boolean InitializeVds() { boolean returnValue = true; if (getVds() == null) { List<VDS> runningVdss = getAllRunningVdssInPool(); setVds(runningVdss.isEmpty() ? null : runningVdss.get(0)); <START> if (getVds() == null) { <END> returnValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL); } } return returnValue; }</code><technical_language>this block, unreadable. try follwoing: if (runningVDSs.isEmpty) { returnValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL); } else { setVds(runningVdss); }</technical_language>

Target:
protected boolean InitializeVds() { boolean returnValue = true; if (getVds() == null) { List<VDS> runningVdss = getAllRunningVdssInPool(); if (runningVdss.isEmpty()) { returnValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL); } else { setVds(runningVdss.get(0)); } } return returnValue; }
Source:
<code>private GQuery updateHeight() { <START> return $(error).height(Window.getClientHeight() - 113); <END> }</code><technical_language>113</technical_language>

Target:
private GQuery updateHeight() { return $(error).height(Window.getClientHeight() - $("footer").height()); }
Source:
<code><START> public void addsFriend() throws Exception { <END> final Docs docs = new MkBase().user("urn:test:1").docs(); final Doc doc = docs.doc("hey"); final String friend = "urn:test:2"; MatcherAssert.assertThat( Lists.newArrayList(doc.friends().names()), Matchers.not(Matchers.hasItem(friend)) ); MatcherAssert.assertThat( new RsPrint(new TkAddFriend(doc, friend).act()).print(), Matchers.containsString("document+shared") ); MatcherAssert.assertThat( Lists.newArrayList(doc.friends().names()), Matchers.hasItem(friend) ); }</code><technical_language>@pinaf totally right, I wrong</technical_language>

Target:
public void addsFriend() throws Exception { final Docs docs = new MkBase().user("urn:test:1").docs(); final Doc doc = docs.doc("hey"); final String friend = "The Dude"; MatcherAssert.assertThat( Lists.newArrayList(doc.friends().names()), Matchers.not(Matchers.hasItem(friend)) ); MatcherAssert.assertThat( new RsPrint( new TkAddFriend(doc).act( new RqFake( "POST", "/", String.format("friend=%s", friend) ) ) ).print(), Matchers.containsString("document+shared") ); MatcherAssert.assertThat( Lists.newArrayList(doc.friends().names()), Matchers.hasItem(friend) ); }
Source:
<code>@Test public void nullUrlThrows() { try { <START> Endpoint.createFixed(" "); <END> } catch (IllegalArgumentException expected) { assertThat(expected).hasMessage("url is empty"); } }</code><technical_language>Missing fail()</technical_language>

Target:
@Test public void nullUrlThrows() { try { Endpoint.createFixed(null); fail(); } catch (NullPointerException e) { assertThat(e).hasMessage("url == null"); } }
Source:
<code>private void setupSuggestionServiceAndAdapter() { if (!isAdded() || mSiteStore.hasWPComOrJetpackSiteWithSiteId(mSite.getSiteId())) { return; } <START> mSuggestionServiceConnectionManager = new SuggestionServiceConnectionManager(getActivity(), mSite.getSiteId()); <END> mSuggestionAdapter = SuggestionUtils.setupSuggestions(mSiteStore.getSiteBySiteId(mSite.getSiteId()), getActivity(), mSuggestionServiceConnectionManager); if (mSuggestionAdapter != null) { mEditReply.setAdapter(mSuggestionAdapter); } }</code><technical_language>This a good time update SuggestionServiceConnectionManager rely mSite remoteBlogId. for SuggestionUtils.setupSuggestions(), this line</technical_language>

Target:
private void setupSuggestionServiceAndAdapter() { if (!isAdded() || !mSite.isWPCom()) { return; } mSuggestionServiceConnectionManager = new SuggestionServiceConnectionManager(getActivity(), mSite.getSiteId()); mSuggestionAdapter = SuggestionUtils.setupSuggestions(mSiteStore.getSiteBySiteId(mSite.getSiteId()), getActivity(), mSuggestionServiceConnectionManager); if (mSuggestionAdapter != null) { mEditReply.setAdapter(mSuggestionAdapter); } }
Source:
<code>private static double weightedAverageSorted(double x1, double w1, double x2, double w2) { <START> checkArgument(x1 <= x2, "error"); <END> final double x = (x1 * w1 + x2 * w2) / (w1 + w2); return Math.max(x1, Math.min(x, x2)); }</code><technical_language>a more meaningful error message here? "Expect x1 <= x2 get..."</technical_language>

Target:
private static double weightedAverageSorted(double x1, double w1, double x2, double w2) { final double x = (x1 * w1 + x2 * w2) / (w1 + w2); return Math.max(x1, Math.min(x, x2)); }
Source:
<code>private Element handle() { <START> return textElement(BlogConstants.BLOG_HANDLE, entity.getHandle()); <END> }</code><technical_language>import static</technical_language>

Target:
private Element handle() { return textElement(BLOG_HANDLE, entity.getHandle()); }
Source:
<code><START> public int size() { <END> return authValue.length(); }</code><technical_language>Required a new method in interface? add @Override</technical_language>

Target:
public int size() { if (authValue == null) { getAuthValue(); } return authValue == null ? 0 : authValue.length(); }
Source:
<code>public static final void translate(Group group, Vector3d v) { for (Atom atom : group.getAtoms()) { translate(atom, v); } for (Group altG : group.getAltLocs()) { <START> for (Atom atom : altG.getAtoms()) { <END> translate(atom, v); } } }</code><technical_language>translate(g, v)? a recursive call this function, nicer solution</technical_language>

Target:
public static final void translate(Group group, Vector3d v) { for (Atom atom : group.getAtoms()) { translate(atom, v); } for (Group altG : group.getAltLocs()) { translate(altG, v); } }
Source:
<code>public Statement apply(final Statement base, final Description description) { return new Statement() { @Override public void evaluate() throws Throwable { State.runnerStarted(); if (!State.hasTestAdaptor()) { if (State.hasInitializationException()) { throw new RuntimeException( "Arquillian has previously been attempted initialized, but failed. " <START> + "See cause for previous exception", <END> State.getInitializationException()); } else { try { TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder .build(); adaptor.beforeSuite(); State.testAdaptor(adaptor); } catch (Exception e) { State.caughtInitializationException(e); State.runnerFinished(); if (State.isLastRunner()) { State.clean(); } throw e; } } } if (State.hasTestAdaptor()) { adaptor = State.getTestAdaptor(); } adaptor.beforeClass(description.getTestClass(), LifecycleMethodExecutor.NO_OP); try { base.evaluate(); } finally { adaptor.afterClass(description.getTestClass(), LifecycleMethodExecutor.NO_OP); State.runnerFinished(); if (State.isLastRunner()) { try { adaptor.afterSuite(); adaptor.shutdown(); } finally { State.clean(); } } adaptor = null; } } }; }</code><technical_language>if is proper English, in other places > Arquillian previously attempted initialized, failed. previous exceptions for cause</technical_language>

Target:
public Statement apply(final Statement base, final Description description) { return new Statement() { @Override public void evaluate() throws Throwable { State.runnerStarted(); if (!State.hasTestAdaptor()) { if (State.hasInitializationException()) { throw new RuntimeException( "Arquillian initialization has already been attempted, but failed. See previous exceptions for cause", State.getInitializationException()); } else { try { TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder .build(); adaptor.beforeSuite(); State.testAdaptor(adaptor); } catch (Exception e) { State.caughtInitializationException(e); State.runnerFinished(); if (State.isLastRunner()) { State.clean(); } throw e; } } } if (State.hasTestAdaptor()) { adaptor = State.getTestAdaptor(); } adaptor.beforeClass(description.getTestClass(), LifecycleMethodExecutor.NO_OP); try { base.evaluate(); } finally { adaptor.afterClass(description.getTestClass(), LifecycleMethodExecutor.NO_OP); State.runnerFinished(); if (State.isLastRunner()) { try { adaptor.afterSuite(); adaptor.shutdown(); } finally { State.clean(); } } adaptor = null; } } }; }
Source:
<code>public void uploadPicture() { uploadPictureSubmit.click(); browser.selenium.waitForPageToLoad("10000"); <START> ThreadHelper.waitFor(1000); <END> }</code><technical_language>Do need this? I thought if retry status check, need wait here</technical_language>

Target:
public void uploadPicture() { uploadPictureSubmit.click(); browser.selenium.waitForPageToLoad("10000"); }
Source:
<code>public static JcloudsSpecParser parse(String spec, boolean dryrun) { JcloudsSpecParser result = new JcloudsSpecParser(); int split = spec.indexOf(':'); if (split<0) { if (spec.equalsIgnoreCase(JCLOUDS)) { if (dryrun) return null; throw new IllegalArgumentException("Cannot use '"+spec+"' as a location ID; it is insufficient. "+ "Try jclouds:aws-ec2 (for example)."); } result.providerOrApi = spec; result.parameter = null; } else { result.providerOrApi = spec.substring(0, split); result.parameter = spec.substring(split+1); while (result.providerOrApi.equalsIgnoreCase(JCLOUDS)) { result.providerOrApi = result.parameter; result.parameter = null; split = result.providerOrApi.indexOf(':'); if (split>=0) { result.parameter = result.providerOrApi.substring(split+1); result.providerOrApi = result.providerOrApi.substring(0, split); } } } if (result.parameter==null && AWS_REGIONS.contains(result.providerOrApi)) { result.parameter = result.providerOrApi; result.providerOrApi = "aws-ec2"; if (!dryrun) <START> log.warn("Use of deprecated location '"+result.parameter+"'; in future refer to with explicit provider '"+result.providerOrApi+":"+result.parameter+"'"); <END> } return result; }</code><technical_language>excellent, great deprecate special cases stuff allows fuzzy spec definitions</technical_language>

Target:
public static JcloudsSpecParser parse(String spec, boolean dryrun) { JcloudsSpecParser result = new JcloudsSpecParser(); int split = spec.indexOf(':'); if (split<0) { if (spec.equalsIgnoreCase(JCLOUDS)) { if (dryrun) return null; throw new IllegalArgumentException("Cannot use '"+spec+"' as a location ID; it is insufficient. "+ "Try jclouds:aws-ec2 (for example)."); } result.providerOrApi = spec; result.parameter = null; } else { result.providerOrApi = spec.substring(0, split); result.parameter = spec.substring(split+1); int numJcloudsPrefixes = 0; while (result.providerOrApi.equalsIgnoreCase(JCLOUDS)) { numJcloudsPrefixes++; result.providerOrApi = result.parameter; result.parameter = null; split = result.providerOrApi.indexOf(':'); if (split>=0) { result.parameter = result.providerOrApi.substring(split+1); result.providerOrApi = result.providerOrApi.substring(0, split); } } if (!dryrun && numJcloudsPrefixes > 1) { log.warn("Use of deprecated location spec '"+spec+"'; in future use a single \"jclouds\" prefix"); } } if (result.parameter==null && AWS_REGIONS.contains(result.providerOrApi)) { result.parameter = result.providerOrApi; result.providerOrApi = "aws-ec2"; if (!dryrun) log.warn("Use of deprecated location '"+result.parameter+"'; in future refer to with explicit provider '"+result.providerOrApi+":"+result.parameter+"'"); } return result; }
Source:
<code>public void close() { isOpened = false; try { <START> executor.shutdown(); <END> executor.awaitTermination(10, TimeUnit.SECONDS); } catch (InterruptedException e) { } try { producer.close(); } catch(Exception e) { log.error("failed to close kafka producer", e); } }</code><technical_language>metadataWaitingQueue.take() blocked executor.awaitTermination(10, TimeUnit.SECONDS) 10 seconds. So, need set a timeout poll(). example QueuedSink.java in suro-core. If want simpler, calling shutdown(), push 'command' message metadataWaitingQueue. In thread loop, if message is 'command' message, skip message break loop</technical_language>

Target:
public void close() { isOpened = false; try { metadataWaitingQueue.offer(SHUTDOWN_POISON_MSG); executor.shutdown(); executor.awaitTermination(10, TimeUnit.SECONDS); } catch (InterruptedException e) { } try { producer.close(); } catch(Exception e) { log.error("failed to close kafka producer", e); } }
Source:
<code>private PolicyInstance initPolicyInstance() throws InitialisationException { if (policyContext == null) { <START> initPolicyContext(); <END> } return policyContext.getRegistry().lookupByType(PolicyInstance.class).get(); }</code><technical_language>this set already, do need add this</technical_language>

Target:
private PolicyInstance initPolicyInstance() { return policyContext.getRegistry().lookupByType(PolicyInstance.class).get(); }
Source:
<code>private static List<String> extractInfo(String str) { StringBuilder idEdited = new StringBuilder(); StringBuilder valEdited = new StringBuilder(); int strlen = str.length(); boolean foundSpace = false; boolean foundDigit = false; for (int i = 0; i < strlen; i++) { if (!foundDigit) <START> if (Character.isLetter(str.charAt(i))) foundDigit = true; <END> if (foundDigit) { if (Character.isWhitespace(str.charAt(i))) { if (!foundSpace) { foundSpace = true; } else break; } else { if (foundSpace) { valEdited.append(str.charAt(i)); } else { idEdited.append(str.charAt(i)); } } } } List<String> objec = new ArrayList<>(); objec.add(idEdited.toString()); objec.add(valEdited.toString()); return objec; }</code><technical_language>changed in patch, worries, I understand this code is supposed do... useful variable naming :(</technical_language>

Target:
private static List<String> extractInfo(String str) { int beg = 0; int end = 0; int len = str.length(); List<String> parts = new ArrayList<>(); while (end < len && !Character.isSpaceChar(str.charAt(end))) end++; parts.add(str.substring(beg,end)); while (end < len && Character.isSpaceChar(str.charAt(end))) end++; beg = end; while (end < len && !Character.isSpaceChar(str.charAt(end))) end++; parts.add(str.substring(beg,end)); return parts; }