auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public synchronized void stop() throws IOException { this.started = false; notifyAll(); boolean interrupted = false; long WAIT_TIMEOUT = 100; boolean waited = false; while (thread != null) { if (waited) { this.thread.interrupt(); break; } try { long started = System.currentTimeMillis(); wait(WAIT_TIMEOUT); waited <START> = System.currentTimeMillis() - started >= WAIT_TIMEOUT; <END> } catch (InterruptedException ie) { interrupted = true; } } if (interrupted) Thread.currentThread().interrupt(); }</code><technical_language>This requires a single wait 100ms. I move started initialization loop</technical_language>

Target:
public synchronized void stop() throws IOException { this.started = false; notifyAll(); boolean interrupted = false; long WAIT_TIMEOUT = 100; boolean waited = false; long started = System.currentTimeMillis(); while (thread != null) { if (waited) { this.thread.interrupt(); break; } try { wait(WAIT_TIMEOUT); waited = System.currentTimeMillis() - started >= WAIT_TIMEOUT; } catch (InterruptedException ie) { interrupted = true; } } if (interrupted) Thread.currentThread().interrupt(); }
Source:
<code>private void fillValues() { if (jvms.isEmpty()) { String message; if (Platform.OS_WIN32.equals(Platform.getOS())) { message = "BrowserSim/CordovaSim require a 32-bit JRE/JDK 6 or JDK 7 to be installed."; } else if (PlatformUtil.OS_MACOSX.equals(PlatformUtil.getOs()) && PlatformUtil.ARCH_X86.equals(PlatformUtil.getArch())) { <START> message = "BrowserSim/CordovaSim require Java 6 to be installed."; <END> } else { message = "BrowserSim/CordovaSim require Java 6 and above to be installed."; } setMessage(message, IMessageProvider.ERROR); automatically.setSelection(true); select.setEnabled(false); combo.setEnabled(false); } else { int selectionIndex = -1; if (IPreferenceStore.FALSE.equals(getPreferenceStore().getString(BROWSERSIM_JVM_AUTOMATICALLY))) { String selectedID = getPreferenceStore().getString(BROWSERSIM_JVM_ID); for(int i = 0; i < jvms.size(); i++) { if (selectedID.equals(jvms.get(i).getId())) { selectionIndex = i; break; } } select.setSelection(true); controlChanged(select); } else { automatically.setSelection(true); controlChanged(automatically); } automatically.setText(automatically.getText() + " (" + jvms.get(0).getName() + ")"); combo.select(selectionIndex); } }</code><technical_language>this is misleading. Java 6 is needed OSX running Eclipse 32-bit ? work Java 7 _if_ user runing 64-bit eclipse right ? message like: "To run BrowserSim Java 7 run 64-bit Eclipse Java 6 supports 32-bit"</technical_language>

Target:
private void fillValues() { if (jvms.isEmpty()) { String message; if (Platform.OS_WIN32.equals(Platform.getOS())) { message = "BrowserSim/CordovaSim require a 32-bit JRE/JDK 6 or JDK 7 to be installed."; } else if (PlatformUtil.OS_MACOSX.equals(PlatformUtil.getOs()) && PlatformUtil.ARCH_X86.equals(PlatformUtil.getArch())) { message = "To run BrowserSim/CordovaSim with Java 7 you must run 64-bit Eclipse or use Java 6."; } else { message = "BrowserSim/CordovaSim require Java 6 and above to be installed."; } setMessage(message, IMessageProvider.ERROR); automatically.setSelection(true); select.setEnabled(false); combo.setEnabled(false); } else { int selectionIndex = -1; if (IPreferenceStore.FALSE.equals(getPreferenceStore().getString(BROWSERSIM_JVM_AUTOMATICALLY))) { String selectedID = getPreferenceStore().getString(BROWSERSIM_JVM_ID); for(int i = 0; i < jvms.size(); i++) { if (selectedID.equals(jvms.get(i).getId())) { selectionIndex = i; break; } } select.setSelection(true); controlChanged(select); } else { automatically.setSelection(true); controlChanged(automatically); } automatically.setText(automatically.getText() + " (" + jvms.get(0).getName() + ")"); combo.select(selectionIndex); } }
Source:
<code>public OrderPositionEto saveOrderPosition(OrderPositionEto orderPosition) { Objects.requireNonNull(orderPosition, "orderPosition"); Long orderPositionId = orderPosition.getId(); String action; if (orderPositionId == null) { action = "saved"; Long offerId = orderPosition.getOfferId(); <START> Objects.requireNonNull(offerId, "offerId cannot be null"); <END> OfferEto offer = this.offerManagement.findOffer(offerId); Objects.requireNonNull(offer, "Offer@" + offerId); orderPosition.setPrice(offer.getPrice()); orderPosition.setOfferName(offer.getName()); } else { OrderPositionEntity currentOrderPosition = getOrderPositionDao().find(orderPositionId); verifyUpdate(currentOrderPosition, orderPosition); action = "updated"; } OrderPositionEntity orderPositionEntity = getBeanMapper().map(orderPosition, OrderPositionEntity.class); orderPositionEntity = getOrderPositionDao().save(orderPositionEntity); LOG.debug("The order position with id has been {}.", orderPositionEntity.getId(), action); return getBeanMapper().map(orderPositionEntity, OrderPositionEto.class); }</code><technical_language>please remove " connot null" here</technical_language>

Target:
public OrderPositionEto saveOrderPosition(OrderPositionEto orderPosition) { Objects.requireNonNull(orderPosition, "orderPosition"); Long orderPositionId = orderPosition.getId(); String action; if (orderPositionId == null) { action = "saved"; Long offerId = orderPosition.getOfferId(); Objects.requireNonNull(offerId, "offerId"); OfferEto offer = this.offerManagement.findOffer(offerId); Objects.requireNonNull(offer, "Offer@" + offerId); orderPosition.setPrice(offer.getPrice()); orderPosition.setOfferName(offer.getName()); } else { OrderPositionEntity currentOrderPosition = getOrderPositionDao().find(orderPositionId); verifyUpdate(currentOrderPosition, orderPosition); action = "updated"; } OrderPositionEntity orderPositionEntity = getBeanMapper().map(orderPosition, OrderPositionEntity.class); orderPositionEntity = getOrderPositionDao().save(orderPositionEntity); LOG.debug("The order position with id has been {}.", orderPositionEntity.getId(), action); return getBeanMapper().map(orderPositionEntity, OrderPositionEto.class); }
Source:
<code>public boolean isQueryCacheable(Query query) { <START> return !Sets.newHashSet(unCacheable).contains(query.getType()); <END> }</code><technical_language>need create a set here.</technical_language>

Target:
public boolean isQueryCacheable(Query query) { return !unCacheable.contains(query.getType()); }
Source:
<code>public ActionButton addMenuListItem(final ActionButtonDefinition<T> menuItemDef) { ActionAnchorListItem result = new ActionAnchorListItem(menuItemDef.getText()); String <START> menuId = <END> menuItemDef.getUniqueId(); if (menuId != null) { result.asWidget().getElement().setId( ElementIdUtils.createElementId(elementId, menuId)); } if (menuItemDef.getCommandLocation().equals(CommandLocation.ContextAndToolBar) || menuItemDef.getCommandLocation().equals(CommandLocation.OnlyFromContext)) { actionButtonList.add(menuItemDef); } result.addClickHandler(e -> { menuItemDef.onClick(getSelectedItems()); }); registerSelectionChangeHandler(menuItemDef); menuItemDef.addInitializeHandler(e -> { updateActionButton(result, menuItemDef); }); updateActionButton(result, menuItemDef); return result; }</code><technical_language>menuItemId</technical_language>

Target:
public ActionButton addMenuListItem(final ActionButtonDefinition<T> menuItemDef) { ActionAnchorListItem result = new ActionAnchorListItem(menuItemDef.getText()); String menuItemId = menuItemDef.getUniqueId(); if (menuItemId != null) { result.asWidget().getElement().setId( ElementIdUtils.createElementId(elementId, menuItemId)); } if (menuItemDef.getCommandLocation().equals(CommandLocation.ContextAndToolBar) || menuItemDef.getCommandLocation().equals(CommandLocation.OnlyFromContext)) { actionButtonList.add(menuItemDef); } result.addClickHandler(e -> { menuItemDef.onClick(getSelectedItems()); }); registerSelectionChangeHandler(menuItemDef); menuItemDef.addInitializeHandler(e -> { updateActionButton(result, menuItemDef); }); updateActionButton(result, menuItemDef); return result; }
Source:
<code>public void deleteMilestone() throws Exception { final Milestones milestones = milestones(); final int number = milestones.create("first milestones").number(); milestones.remove(number); MatcherAssert.assertThat( milestones.iterate(new ArrayMap<String, String>()), <START> Matchers.notNullValue() <END> ); }</code><technical_language>I correct. asserting milestone removed. If remove() do nothing, test pass</technical_language>

Target:
public void deleteMilestone() throws Exception { final Milestones milestones = milestones(); final Milestone milestone = milestones.create("a milestones"); MatcherAssert.assertThat( milestones.iterate(new ArrayMap<String, String>()), Matchers.hasItem(milestone) ); milestones.remove(milestone.number()); MatcherAssert.assertThat( milestones.iterate(new ArrayMap<String, String>()), Matchers.not(Matchers.hasItem(milestone)) ); }
Source:
<code>protected List<Measurement> doInBackground(Object... params) { Context context = (Context) params[0]; String ministryId = (String) params[1]; String mcc = (String) params[2]; String period = (String) params[3]; try { <START> GmaApiClient apiClient = GmaApiClient.getInstance(context); <END> JSONArray results = apiClient.searchMeasurements(ministryId, mcc, period); if(results == null) { Log.w(TAG, "No measurements found!"); return null; } return MeasurementsJsonParser.parseMeasurements(results, ministryId, mcc, period); } catch(ApiException e) { Log.e(TAG, "Failed to retrieve measurements from API", e); return null; } }</code><technical_language>GmaApiClient apiClient = GmaApiClient.getInstance(MeasurementsActivity.this);</technical_language>

Target:
protected List<Measurement> doInBackground(Object... params) { String ministryId = (String) params[0]; String mcc = (String) params[1]; String period = (String) params[2]; try { GmaApiClient apiClient = GmaApiClient.getInstance(MeasurementsActivity.this); JSONArray results = apiClient.searchMeasurements(ministryId, mcc, period); if(results == null) { Log.w(TAG, "No measurements found!"); return null; } return MeasurementsJsonParser.parseMeasurements(results, ministryId, mcc, period); } catch(ApiException e) { Log.e(TAG, "Failed to retrieve measurements from API", e); return null; } }
Source:
<code>private LeaderPingResult actuallyPingLeaderWithUuid( MultiplexingCompletionService<LeaderPingerContext<PingableLeader>, PingResult> multiplexingCompletionService, UUID uuid, LeaderPingerContext<PingableLeader> leader, Callable<PingResult> pingEndpoint) { try { multiplexingCompletionService.submit(leader, pingEndpoint); Future<Map.Entry<LeaderPingerContext<PingableLeader>, PingResult>> pingFuture = multiplexingCompletionService.poll(leaderPingResponseWait.toMillis(), TimeUnit.MILLISECONDS); return getLeaderPingResult(uuid, pingFuture, timeLockVersion, <START> () -> greeningNodeShouldBecomeLeaderRateLimiter.tryAcquire()); <END> } catch (InterruptedException e) { Thread.currentThread().interrupt(); return LeaderPingResults.pingCallFailure(e); } catch (CheckedRejectedExecutionException e) { log.warn("Could not ping the leader, because the executor used to talk to that node is overloaded", e); return LeaderPingResults.pingCallFailure(e); } }</code><technical_language>suggestion greeningNodeShouldBecomeLeaderRateLimiter::tryAcquire);</technical_language>

Target:
private LeaderPingResult actuallyPingLeaderWithUuid( MultiplexingCompletionService<LeaderPingerContext<PingableLeader>, PingResult> multiplexingCompletionService, UUID uuid, LeaderPingerContext<PingableLeader> leader, Callable<PingResult> pingEndpoint) { try { multiplexingCompletionService.submit(leader, pingEndpoint); Future<Map.Entry<LeaderPingerContext<PingableLeader>, PingResult>> pingFuture = multiplexingCompletionService.poll(leaderPingResponseWait.toMillis(), TimeUnit.MILLISECONDS); return getLeaderPingResult(uuid, pingFuture, timeLockVersion, greeningNodeShouldBecomeLeaderRateLimiter::tryAcquire); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return LeaderPingResults.pingCallFailure(e); } catch (CheckedRejectedExecutionException e) { log.warn("Could not ping the leader, because the executor used to talk to that node is overloaded", e); return LeaderPingResults.pingCallFailure(e); } }
Source:
<code>private void sendBypassEmail(final ReceiveCommand cmd) throws EmailException { final Account.Id me = currentUser.getAccountId(); final String destBranchName = cmd.getRefName().substring(Constants.R_HEADS.length()); BranchEmail bm = branchEmailFactory.create(project, destBranchName, cmd.getType()); <START> bm.setFrom(me); <END> bm.send(); }</code><technical_language>Nit: combine this line 628 simple</technical_language>

Target:
private void sendBypassEmail(final ReceiveCommand cmd) { final String destBranchName = cmd.getRefName().substring(Constants.R_HEADS.length()); BranchEmail bm = branchEmailFactory.create(project, destBranchName, cmd.getType()); bm.setFrom(currentUser.getAccountId()); try { bm.send(); } catch (EmailException e) { String error_head = ""; error_head = error_head + bm.getMessageClass() + " : "; log.error(error_head, e); } }
Source:
<code>private void showSignOutBar() { findViewById(R.id.sign_in_bar).setVisibility(View.GONE); findViewById(R.id.sign_out_bar).setVisibility(View.VISIBLE); Player player = Games.Players.getCurrentPlayer(mGoogleApiClient); String url = player.getIconImageUrl(); TextView name = (TextView)findViewById(R.id.playerName); name.setText(player.getDisplayName()); if (url != null) { ImageView vw = (ImageView) findViewById(R.id.avatar); new DownloadImageTask(vw).execute(url); <START> vw.setVisibility(View.VISIBLE); <END> } String email = Plus.AccountApi.getAccountName(mGoogleApiClient); TextView emailView = (TextView)findViewById((R.id.playerEmail)); emailView.setText(email); }</code><technical_language>put this in onPostExecute of AsyncTask</technical_language>

Target:
private void showSignOutBar() { findViewById(R.id.sign_in_bar).setVisibility(View.GONE); findViewById(R.id.sign_out_bar).setVisibility(View.VISIBLE); Player player = Games.Players.getCurrentPlayer(mGoogleApiClient); String url = player.getIconImageUrl(); TextView name = (TextView)findViewById(R.id.playerName); name.setText(player.getDisplayName()); if (url != null) { ImageView vw = (ImageView) findViewById(R.id.avatar); new DownloadImageTask(vw).execute(url); } String email = Plus.AccountApi.getAccountName(mGoogleApiClient); TextView emailView = (TextView)findViewById((R.id.playerEmail)); emailView.setText(email); }
Source:
<code><START> public Optional<String> getReturnUrl() { <END> return Optional.ofNullable(returnUrl); }</code><technical_language>A create card payment request a return URL, I this return optional</technical_language>

Target:
public String getReturnUrl() { return returnUrl; }
Source:
<code>public void testEmptySessionKeyEmptyInput() throws Exception { exception.expect(NullPointerException.class); <START> pipe.setSessionKey(null); <END> session.put("a", "123"); PipeRunResult res = doPipe(pipe, null, session); assertEquals(res.getResult().toString(), "[null]"); }</code><technical_language>Setters null (they set). empty ""</technical_language>

Target:
public void testEmptySessionKeyEmptyInput() throws Exception { exception.expect(NullPointerException.class); pipe.setSessionKey(""); session.put("a", "123"); PipeRunResult res = doPipe(pipe, null, session); assertEquals(res.getResult().toString(), "[null]"); }
Source:
<code>public void onAvailabilityChecked(OnAvailabilityChecked event) { if (mRequestedEmail == null || !mRequestedEmail.equalsIgnoreCase(event.value)) { return; } if (isInProgress()) { endProgress(); } if (event.isError()) { AppLog.e(T.API, "OnAvailabilityChecked has error: " + event.error.type + " - " + event.error.message); <START> ActivityUtils.hideKeyboardForced(mEmailInput); <END> showEmailError(R.string.email_not_registered_wpcom); return; } switch (event.type) { case EMAIL: if (event.isAvailable) { showEmailError(R.string.email_not_registered_wpcom); } else if (mLoginListener != null) { EditTextUtils.hideSoftInput(mEmailInput.getEditText()); mLoginListener.gotWpcomEmail(event.value); } break; default: AppLog.e(T.API, "OnAvailabilityChecked unhandled event type: " + event.error.type); break; } }</code><technical_language>If event is isError() event.type == EMAIL event.isAvailable, enter [this case here](<LINK_0> , insert 2 lines well. // hide keyboard ensure link login site address is visible ActivityUtils.hideKeyboardForced(mEmailInput); Also, do replacing [this line ](<LINK_1> EditTextUtils.hideSoftInput(mEmailInput.getEditText()); (marked deprecated) ActivityUtils.hideKeyboardForced(mEmailInput); consistent</technical_language>

Target:
public void onAvailabilityChecked(OnAvailabilityChecked event) { if (mRequestedEmail == null || !mRequestedEmail.equalsIgnoreCase(event.value)) { return; } if (isInProgress()) { endProgress(); } if (event.isError()) { AppLog.e(T.API, "OnAvailabilityChecked has error: " + event.error.type + " - " + event.error.message); ActivityUtils.hideKeyboardForced(mEmailInput); showEmailError(R.string.email_not_registered_wpcom); return; } switch (event.type) { case EMAIL: if (event.isAvailable) { ActivityUtils.hideKeyboardForced(mEmailInput); showEmailError(R.string.email_not_registered_wpcom); } else if (mLoginListener != null) { ActivityUtils.hideKeyboardForced(mEmailInput); mLoginListener.gotWpcomEmail(event.value); } break; default: AppLog.e(T.API, "OnAvailabilityChecked unhandled event type: " + event.error.type); break; } }
Source:
<code>public IfLogicEndBrick(IfLogicBeginBrick ifLogicBeginBrick, IfLogicElseBrick ifElseBrick) { <START> this.ifElseBrick = ifElseBrick; <END> this.ifBeginBrick = ifLogicBeginBrick; }</code><technical_language>Please swap lines :laughing:</technical_language>

Target:
public IfLogicEndBrick(IfLogicBeginBrick ifLogicBeginBrick, IfLogicElseBrick ifElseBrick) { this.ifBeginBrick = ifLogicBeginBrick; this.ifElseBrick = ifElseBrick; }
Source:
<code>public static <M, K> Window<M, K, Collection<M>> keyedSessionWindow(Function<M, K> keyFn, Duration sessionGap) { BiFunction<M, Collection<M>, Collection<M>> aggregator = (m, c) -> { c.add(m); return c; }; <START> Supplier<Collection<M>> initialValue = () -> { <END> return new ArrayList<>(); }; return keyedSessionWindow(keyFn, sessionGap, initialValue, aggregator); }</code><technical_language>nit: I this lambda duplicated multiple times. useful define a function class refer lambda</technical_language>

Target:
public static <M, K> Window<M, K, Collection<M>> keyedSessionWindow(Function<M, K> keyFn, Duration sessionGap) { FoldLeftFunction<M, Collection<M>> aggregator = createAggregator(); Supplier<Collection<M>> initialValue = () -> new ArrayList<>(); return keyedSessionWindow(keyFn, sessionGap, initialValue, aggregator); }
Source:
<code>protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); String user = getRequestParamValue(Const.ParamsNames.USER_ID); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, courseId); Assumption.assertPostParamNotNull(Const.ParamsNames.USER_ID, user); <START> <END> InstructorCourseEnrollAjaxPageData data = new InstructorCourseEnrollAjaxPageData( logic.getAccount(user), sessionToken, logic.getStudentsForCourse(courseId)); return createAjaxResult(data); }</code><technical_language>need verify logged in user sufficient privilege access this data first</technical_language>

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, courseId); gateKeeper.verifyInstructorPrivileges(account); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); CourseAttributes course = logic.getCourse(courseId); gateKeeper.verifyAccessible(instructor, course); InstructorCourseEnrollAjaxPageData data = new InstructorCourseEnrollAjaxPageData( account, sessionToken, logic.getStudentsForCourse(courseId)); return createAjaxResult(data); }
Source:
<code>public void channelRead0(ChannelHandlerContext ctx, DiscoveryEvent event) throws Exception { try { nodeManager.handleInbound(event); } catch (Throwable t) { <START> logger.error("Failed to process incoming message: {}", event.getMessage(), t); <END> } }</code><technical_language>I change log level WARN INFO, receive garbage this is error. output t.toString() instead of t flood logs traces in case of invalid messages Ideally try differentiate message handle problems MalformedMessageException others. is error, assumed error</technical_language>

Target:
public void channelRead0(ChannelHandlerContext ctx, DiscoveryEvent event) throws Exception { try { nodeManager.handleInbound(event); } catch (Throwable t) { logger.info("Failed to process incoming message: {}, caused by: {}", event.getMessage(), t.toString()); } }
Source:
<code>public int hashCode() { int result = 17; <START> result = 31 * result + Objects.hashCode(command); <END> result = 31 * result + Objects.hashCode(notification); return result; }</code><technical_language>objects.hash</technical_language>

Target:
public int hashCode() { return Objects.hashCode(command, notification); }
Source:
<code>public void validate(IValidatable<String> iv) { String value = iv.getValue(); if (GeoServerApplication.get().getCatalog().getWorkspaceByName(value) != null) { <START> iv.error(new ValidationError("NewWorkspacePanel.duplicateWorkspace")); <END> } }</code><technical_language>Error message "workspace" parameter lost in translation</technical_language>

Target:
public void validate(IValidatable<String> iv) { String value = iv.getValue(); if (GeoServerApplication.get().getCatalog().getWorkspaceByName(value) != null) { iv.error(new ValidationError("NewWorkspacePanel.duplicateWorkspace") .setVariable("workspace", value)); } }
Source:
<code>public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { if (maxConnections > 0) { <START> numConnections.decrementAndGet(); <END> } super.channelClosed(ctx, e); }</code><technical_language>log error message if numConnections zero</technical_language>

Target:
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { if (maxConnections > 0) { if (numConnections.decrementAndGet() < 0) { log.error("BUG in ConnectionLimiter"); } } super.channelClosed(ctx, e); }
Source:
<code>public void onFailure(Exception e) { Timber.d(e, "Alerts fetching failed."); <START> if (getAlertsFragment()!=null){ <END> getAlertsFragment().showError(); } }</code><technical_language>This check needed</technical_language>

Target:
public void onFailure(Exception e) { Timber.d(e, "Alerts fetching failed."); getAlertsFragment().showError(); }
Source:
<code>public void destroy() { keytab = null; serverSubject = null; for (LoginContext loginContext : loginContexts) { try { loginContext.logout(); } catch (LoginException ex) { <START> log.warn(ex.getMessage(), ex); <END> } } loginContexts.clear(); }</code><technical_language>This is backwards. log.warn(ex, ex.getMessage())</technical_language>

Target:
public void destroy() { keytab = null; serverSubject = null; for (LoginContext loginContext : loginContexts) { try { loginContext.logout(); } catch (LoginException ex) { log.warn(ex, ex.getMessage()); } } loginContexts.clear(); }
Source:
<code>public DeveloperProducts(String expectedSku, Map<String, Product> products) { this.sku = products.remove(expectedSku); this.provided = products; <START> log.debug("Test?? {}", this.sku); <END> }</code><technical_language>If this left in accident, change message a more informative</technical_language>

Target:
public DeveloperProducts(String expectedSku, Map<String, Product> products) { this.sku = products.remove(expectedSku); this.provided = products; }
Source:
<code>public void setAbsoluteBounds(Node<? extends View, ?> node) { Object definition = node.getContent().getDefinition(); setBounds(absoluteBounds(node)); <START> if (definition instanceof BaseAdHocSubprocess || <END> definition instanceof EventSubprocess || definition instanceof EmbeddedSubprocess) { shape.setIsExpanded(true); } }</code><technical_language>This if condition SubProcessPropertyWriter overriding this method. this is specific subprocesses. sense</technical_language>

Target:
public void setAbsoluteBounds(Node<? extends View, ?> node) { setBounds(absoluteBounds(node)); }
Source:
<code>public ITestContainer addTestClass(String className) { if (fCurrentTestClass != null) { fCurrentTestClass.setEntityStatus(TestStatus.FINISHED); fCurrentTestClass = null; } if (className != null) { final ITestFile testFile = getTestFile(); final List<ITestEntity> duplicateClasses = <START> testFile.getChildren().stream().filter(p <END> -> p.getName().equals(className)).collect(Collectors.toList()); if (duplicateClasses.isEmpty()) { fCurrentTestClass = IRuntimeFactory.eINSTANCE.createTestClass(); fCurrentTestClass.setName(className); } else { fCurrentTestClass = (ITestClass) duplicateClasses.get(0); } fCurrentTestClass.setEntityStatus(TestStatus.RUNNING); if (getScriptEngine() instanceof IDebugEngine) fCurrentTestClass.setStackTrace(((IDebugEngine) getScriptEngine()).getStackTrace()); testFile.getChildren().add(fCurrentTestClass); } return fCurrentTestClass; }</code><technical_language>filter ITestClass type,</technical_language>

Target:
public ITestContainer addTestClass(String className) { if (fCurrentTestClass != null) { fCurrentTestClass.setEntityStatus(TestStatus.FINISHED); fCurrentTestClass = null; } if (className != null) { final ITestFile testFile = getTestFile(); final List<ITestEntity> duplicateClasses = testFile.getChildren().stream() .filter(p -> ITestClass.class.isAssignableFrom(p.getClass()) && p.getName().equals(className)).collect(Collectors.toList()); if (duplicateClasses.isEmpty()) { fCurrentTestClass = IRuntimeFactory.eINSTANCE.createTestClass(); fCurrentTestClass.setName(className); } else { fCurrentTestClass = (ITestClass) duplicateClasses.get(0); } fCurrentTestClass.setEntityStatus(TestStatus.RUNNING); if (getScriptEngine() instanceof IDebugEngine) fCurrentTestClass.setStackTrace(((IDebugEngine) getScriptEngine()).getStackTrace()); testFile.getChildren().add(fCurrentTestClass); } return fCurrentTestClass; }
Source:
<code>public String toCodeStringPreStatement() { StringBuilder b = new StringBuilder(); b.append(" <START> b.append(" END> b.append("try {" + Globals.lineSep + " "); return b.toString(); }</code><technical_language>Missing word "be". do "will be" "was"</technical_language>

Target:
public final String toCodeStringPreStatement() { StringBuilder b = new StringBuilder(); b.append(" b.append("try {" + Globals.lineSep + " "); return b.toString(); }
Source:
<code>public SCOPE getScope(){ if (isInReplicationScope()){ <START> if (isMetadataOnly() || isMetadataOnlyForExternalTables()){ <END> return SCOPE.MD_ONLY; } else { return SCOPE.REPL; } } else { return SCOPE.NO_REPL; } }</code><technical_language>need change this</technical_language>

Target:
public SCOPE getScope(){ if (isInReplicationScope()){ if (isMetadataOnly()){ return SCOPE.MD_ONLY; } else { return SCOPE.REPL; } } else { return SCOPE.NO_REPL; } }
Source:
<code><START> public LabelPickerState setupState(String userInput, String... labelNames) { <END> return new LabelPickerState(getHashSet(labelNames), getTestRepoLabels(), userInput); }</code><technical_language>helper methods need public</technical_language>

Target:
private LabelPickerState setupState(String userInput, String... labelNames) { return new LabelPickerState(getHashSet(labelNames), getTestRepoLabels(), userInput); }
Source:
<code>public void testBuildName() throws Exception { final String imageName = "test-build-name"; final String dockerDirectory = Resources.getResource("dockerDirectory").getPath(); final String imageId = sut.build(Paths.get(dockerDirectory), imageName); final ImageInfo info = sut.inspectImage(imageName); <START> final String expextedId = dockerApiVersionLessThan("1.22") ? imageId : "sha256:" + imageId; <END> assertThat(info.id(), startsWith(expextedId)); }</code><technical_language>nit: typo in expexted</technical_language>

Target:
public void testBuildName() throws Exception { final String imageName = "test-build-name"; final String dockerDirectory = Resources.getResource("dockerDirectory").getPath(); final String imageId = sut.build(Paths.get(dockerDirectory), imageName); final ImageInfo info = sut.inspectImage(imageName); final String expectedId = dockerApiVersionLessThan("1.22") ? imageId : "sha256:" + imageId; assertThat(info.id(), startsWith(expectedId)); }
Source:
<code>Engine(final Executor taskExecutor, final DelayedExecutor timerExecutor, final ILoggerFactory loggerFactory, final Map<String, Object> properties, final PlanDeactivationListener planActivityListener, final PlanCompletionListener planCompletionListener) { _taskExecutor = taskExecutor; _timerExecutor = timerExecutor; _loggerFactory = loggerFactory; _properties = properties; _planDeactivationListener = planActivityListener; _planCompletionListener = planContext -> { <START> planCompletionListener.onPlanCompleted(planContext); <END> _taskDoneListener.onPlanCompleted(planContext); }; _allLogger = loggerFactory.getLogger(LOGGER_BASE + ":all"); _rootLogger = loggerFactory.getLogger(LOGGER_BASE + ":root"); if (_properties.containsKey(MAX_RELATIONSHIPS_PER_TRACE)) { _maxRelationshipsPerTrace = (Integer) getProperty(MAX_RELATIONSHIPS_PER_TRACE); } else { _maxRelationshipsPerTrace = DEFUALT_MAX_RELATIONSHIPS_PER_TRACE; } }</code><technical_language>Wrap customer's code in try-catch call _taskDoneListener</technical_language>

Target:
Engine(final Executor taskExecutor, final DelayedExecutor timerExecutor, final ILoggerFactory loggerFactory, final Map<String, Object> properties, final PlanDeactivationListener planActivityListener, final PlanCompletionListener planCompletionListener) { _taskExecutor = taskExecutor; _timerExecutor = timerExecutor; _loggerFactory = loggerFactory; _properties = properties; _planDeactivationListener = planActivityListener; _allLogger = loggerFactory.getLogger(LOGGER_BASE + ":all"); _rootLogger = loggerFactory.getLogger(LOGGER_BASE + ":root"); _planCompletionListener = planContext -> { try { planCompletionListener.onPlanCompleted(planContext); } catch (Throwable t) { LOG.error("Uncaught throwable from custom PlanCompletionListener.", t); } finally { _taskDoneListener.onPlanCompleted(planContext); } }; if (_properties.containsKey(MAX_RELATIONSHIPS_PER_TRACE)) { _maxRelationshipsPerTrace = (Integer) getProperty(MAX_RELATIONSHIPS_PER_TRACE); } else { _maxRelationshipsPerTrace = DEFUALT_MAX_RELATIONSHIPS_PER_TRACE; } }
Source:
<code><START> public boolean waitUntilReadyToProcess(Properties jobProps) { <END> return true; }</code><technical_language>Is this method overridden in a subclass provide a behavior? This method protected if is supposed overridden package</technical_language>

Target:
protected boolean waitUntilReadyToProcess(Properties jobProps) { return true; }
Source:
<code>private boolean validRegex() { try { Pattern.compile(searchField.getText()); } catch (PatternSyntaxException e) { <START> LOGGER.error(e.getMessage()); <END> return false; } return true; }</code><technical_language>Please LOGGER.debug this error is kind of expected</technical_language>

Target:
private boolean validRegex() { try { Pattern.compile(searchField.getText()); } catch (PatternSyntaxException e) { LOGGER.debug(e.getMessage()); return false; } return true; }
Source:
<code>public void testLinkInternalPageAnchorReference2() { <START> String html = parser.parseToHtml("a [[#Some link?|alt text]] reference to an internal anchor"); <END> TestUtil.println("HTML: \n" + html); assertTrue(html.contains("<body><p>a <a href=\"#Some_link.3F\">alt text</a> reference to an internal anchor</p></body>")); }</code><technical_language>consider changing "alt text" "link text" in markup, "alt text" easily confused HTML "alt" attribute</technical_language>

Target:
public void testLinkInternalPageAnchorReference2() { String html = parser.parseToHtml("a [[#Some link?|link text]] reference to an internal anchor"); TestUtil.println("HTML: \n" + html); assertTrue(html.contains("<body><p>a <a href=\"#Some_link.3F\">link text</a> reference to an internal anchor</p></body>")); }
Source:
<code>public Dispatcher unsubscribe(Subscription subscription, int after) { if (subscription.getDispatcher() != this) { throw new IllegalStateException("Subscription is not managed by this Dispatcher"); } <START> if (this.subscriptionsUsingDefaultHandler.get(subscription.getSubject()) != null) { <END> throw new IllegalStateException("Subscription uses default handler and cannot call unsubscribe"); } if (!(subscription instanceof NatsSubscription)) { throw new IllegalArgumentException("This Subscription implementation is not known by Dispatcher"); } NatsSubscription ns = ((NatsSubscription) subscription); NatsSubscription sub = this.subscriptionsWithHandlers.get(ns.getSID()); if (sub != null) { this.connection.unsubscribe(sub, after); } return this; }</code><technical_language>I don' this is right. "foo" default handler "foo" a custom handler. Instead check if sid is in handler map if is false, do this check</technical_language>

Target:
public Dispatcher unsubscribe(Subscription subscription, int after) { if (!this.running.get()) { throw new IllegalStateException("Dispatcher is closed"); } if (isDraining()) { return this; } if (subscription.getDispatcher() != this) { throw new IllegalStateException("Subscription is not managed by this Dispatcher"); } if (!(subscription instanceof NatsSubscription)) { throw new IllegalArgumentException("This Subscription implementation is not known by Dispatcher"); } NatsSubscription ns = ((NatsSubscription) subscription); NatsSubscription sub = this.subscriptionsWithHandlers.get(ns.getSID()); if (sub != null) { this.connection.unsubscribe(sub, after); } return this; }
Source:
<code>public SafeHtml getValue() { <START> if (showUnderline) { <END> return templates.underlinedHeader(headerText); } return headerText; }</code><technical_language>I showUnderline in setter instead of getter. time getValue is called, evaluate template. If do in setter, is underlined version evaluation once</technical_language>

Target:
public SafeHtml getValue() { return headerText; }
Source:
<code>public LightblueResponse data(LightblueRequest lightblueRequest) { LOGGER.debug("Calling data service with lightblueRequest: " + lightblueRequest.toString()); return callService(new LightblueHttpDataRequest(lightblueRequest) <START> .getRestRequest(configuration.getDataServiceURI())); <END> }</code><technical_language>Method data(LightblueRequest) longer wraps runtime exception. I that, a glance, bad. want this change unexpected side effects. difference is request JSON part of stacktrace anymore. I mixed feelings this. 1) easier debug 2) means sensitive data is logged client</technical_language>

Target:
public LightblueResponse data(LightblueRequest lightblueRequest) { LOGGER.debug("Calling data service with lightblueRequest: " + lightblueRequest.toString()); try { return callService(new LightblueHttpDataRequest(lightblueRequest) .getRestRequest(configuration.getDataServiceURI())); } catch (RuntimeException e) { throw new LightblueHttpClientException("Error sending lightblue request: " + lightblueRequest.getBody(), e); } }
Source:
<code>public AuthUser authenticate(final AuthRequest request) throws AuthException { List<AuthUser> authUsers = Lists.newArrayList(); List<AuthException> authExs = Lists.newArrayList(); for (AuthBackend backend : authBackends) { try { <START> authUsers.add(backend.authenticate(request)); <END> } catch (MissingCredentialsException ex) { } catch (AuthException ex) { authExs.add(ex); } } if (authExs.isEmpty() && authUsers.isEmpty()) { throw new MissingCredentialsException(); } else if (authExs.isEmpty() && authUsers.size() == 1) { return authUsers.get(0); } else if (authExs.size() == 1 && authUsers.isEmpty()) { throw authExs.get(0); } String msg = String.format("Multiple AuthBackends attempted to handle request:" + " authUsers=%s authExs=%s", authUsers, authExs); throw new AuthException(msg); }</code><technical_language>perhaps, wrap returned authUser in a checkNotNull</technical_language>

Target:
public AuthUser authenticate(final AuthRequest request) throws AuthException { List<AuthUser> authUsers = Lists.newArrayList(); List<AuthException> authExs = Lists.newArrayList(); for (AuthBackend backend : authBackends) { try { authUsers.add(checkNotNull(backend.authenticate(request))); } catch (MissingCredentialsException ex) { } catch (AuthException ex) { authExs.add(ex); } } if (authExs.isEmpty() && authUsers.isEmpty()) { throw new MissingCredentialsException(); } else if (authExs.isEmpty() && authUsers.size() == 1) { return authUsers.get(0); } else if (authExs.size() == 1 && authUsers.isEmpty()) { throw authExs.get(0); } String msg = String.format("Multiple AuthBackends attempted to handle request:" + " authUsers=%s authExs=%s", authUsers, authExs); throw new AuthException(msg); }
Source:
<code><START> public void close() throws Exception { <END> shutdown(); }</code><technical_language>need throw Exception shutdown() declare a checked exception</technical_language>

Target:
public void close() { shutdown(); }
Source:
<code>protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { CallGraphAnalysis fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysis.ID); if (fModule == null) { return null; } fModule.schedule(); <START> Job job = new Job(Messages.CallStackTableViewer_name) { <END> @Override protected IStatus run(IProgressMonitor monitor) { fModule.waitForCompletion(NonNullUtils.checkNotNull(monitor)); if(monitor.isCanceled()) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; } }; job.schedule(); return fModule; }</code><technical_language>rename callgraph..</technical_language>

Target:
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { CallGraphAnalysis fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysis.ID); if (fModule == null) { return null; } fModule.schedule(); Job job = new Job(Messages.CallGraphAnalysis) { @Override protected IStatus run(IProgressMonitor monitor) { fModule.waitForCompletion(NonNullUtils.checkNotNull(monitor)); if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; } }; job.schedule(); return fModule; }
Source:
<code>public AndroidBluetoothPlatform(Context ctx) { context = ctx; permissionChecker = new PermissionChecker(ctx); <START> if (BluetoothAdapter.getDefaultAdapter() != null) { <END> bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); } if (Build.VERSION.SDK_INT >= 18) { crashCallBackWrapper = new CrashCallBackWrapper(ctx); } else { crashCallBackWrapper = null; } }</code><technical_language>remove check, is null before, null set system. isBluetoothLowEnergySupported covers rest</technical_language>

Target:
public AndroidBluetoothPlatform(Context ctx) { context = ctx; permissionChecker = new PermissionChecker(ctx); bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (Build.VERSION.SDK_INT >= 18) { crashCallBackWrapper = new CrashCallBackWrapper(ctx); } else { crashCallBackWrapper = null; } }
Source:
<code>private void logIngestException(IngestException exception, File inputFile) { LOGGER.debug("Failed to ingest file [{}].", inputFile.getAbsolutePath(), exception); if (INGEST_LOGGER.isWarnEnabled()) { <START> INGEST_LOGGER.warn("\nFailed to ingest file [{}]: \n" + Exceptions.getFullMessage(exception), inputFile.getAbsolutePath()); <END> } }</code><technical_language>parameterized logging for here</technical_language>

Target:
private void logIngestException(IngestException exception, File inputFile) { LOGGER.debug("Failed to ingest file [{}].", inputFile.getAbsolutePath(), exception); INGEST_LOGGER.warn("Failed to ingest file [{}]: \n{}", inputFile.getAbsolutePath(), Exceptions.getFullMessage(exception)); }
Source:
<code>private void updateData(@NonNull TimeQueryFilter filters, IProgressMonitor monitor) { if (fXYDataProvider == null) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, "Data provider for this viewer is not available"); return; } boolean isComplete = false; do { TmfModelResponse<ITmfCommonXAxisModel> response = fXYDataProvider.fetchXY(filters, monitor); ITmfCommonXAxisModel model = response.getModel(); if (model != null) { updateDisplay(model); } ITmfResponse.Status status = response.getStatus(); if (status == ITmfResponse.Status.COMPLETED) { isComplete = true; } else if (status == ITmfResponse.Status.FAILED || status == ITmfResponse.Status.CANCELLED) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, <START> String.valueOf(response.getStatusMessage())); <END> isComplete = true; } else { try { Thread.sleep(BUILD_UPDATE_TIMEOUT); } catch (InterruptedException e) { TraceCompassLogUtils.traceInstant(LOGGER, Level.INFO, e.getMessage()); isComplete = true; } } } while (!isComplete); }</code><technical_language>unnecessary</technical_language>

Target:
private void updateData(@NonNull TimeQueryFilter filters, IProgressMonitor monitor) { if (fXYDataProvider == null) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, "Data provider for this viewer is not available"); return; } boolean isComplete = false; do { TmfModelResponse<ITmfCommonXAxisModel> response = fXYDataProvider.fetchXY(filters, monitor); ITmfCommonXAxisModel model = response.getModel(); if (model != null) { updateDisplay(model); } ITmfResponse.Status status = response.getStatus(); if (status == ITmfResponse.Status.COMPLETED) { isComplete = true; } else if (status == ITmfResponse.Status.FAILED || status == ITmfResponse.Status.CANCELLED) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, response.getStatusMessage()); isComplete = true; } else { try { Thread.sleep(BUILD_UPDATE_TIMEOUT); } catch (InterruptedException e) { TraceCompassLogUtils.traceInstant(LOGGER, Level.INFO, e.getMessage()); } } } while (!isComplete); }
Source:
<code>public void test01_02_ByteMin_invalid() { click(By.linkText("@ByteMin Test")); setText(By.id("userName"), "あいu"); click(By.id("btn_validate")); assertThat(getText(By.id("userName.errors")), <START> is("must be grater than or equal 6 Bytes")); <END> }</code><technical_language>Tiny grammar mistakes in test messages. - [ ] greater - [ ] equal I created issue "grater" typo. <LINK_0></technical_language>

Target:
public void test01_02_ByteMin_invalid() { driver.findElement(By.linkText("@ByteMin Test")).click(); inputFieldAccessor.overrideValue(By.id("userName"), "あいu", driver); driver.findElement(By.id("btn_validate")).click(); assertThat(driver.findElement(By.id("userName.errors")).getText(), is("must be greater than or equal to 6 Bytes")); }
Source:
<code>public void testRemoveRange() { <START> List<Integer> list = new ArrayList<Integer>(); <END> list.add(1); Collection<Integer> result = CollectionUtils.removeRange(list, 0, 0); assertEquals(1, list.size()); assertEquals(0, result.size()); list.add(2); list.add(3); result = CollectionUtils.removeRange(list, 1, 3); assertEquals(1, list.size()); assertEquals(1, (int) list.get(0)); assertEquals(2, result.size()); assertTrue(result.contains(2)); assertTrue(result.contains(3)); }</code><technical_language>FYI: need generics in Java 8 anymore, so: List<Integer> list = new ArrayList<Integer>(); simply be: List<Integer> list = new ArrayList<>();</technical_language>

Target:
public void testRemoveRange() { List<Integer> list = new ArrayList<>(); list.add(1); Collection<Integer> result = CollectionUtils.removeRange(list, 0, 0); assertEquals(1, list.size()); assertEquals(0, result.size()); list.add(2); list.add(3); result = CollectionUtils.removeRange(list, 1, 3); assertEquals(1, list.size()); assertEquals(1, (int) list.get(0)); assertEquals(2, result.size()); assertTrue(result.contains(2)); assertTrue(result.contains(3)); }
Source:
<code>protected UnimprovedTimeMillisSpentScoreDifferenceThresholdTermination(long unimprovedTimeMillisSpentLimit, Score unimprovedScoreDifferenceThreshold, <START> Clock clock) { <END> this.unimprovedTimeMillisSpentLimit = unimprovedTimeMillisSpentLimit; this.unimprovedScoreDifferenceThreshold = unimprovedScoreDifferenceThreshold; if (unimprovedTimeMillisSpentLimit <= 0L) { throw new IllegalArgumentException("The unimprovedTimeMillisSpentLimit (" + unimprovedTimeMillisSpentLimit + ") cannot be negative."); } this.clock = clock; }</code><technical_language>Suggestion: if want avoid "align method parameters/call arguments multiline not" dilemma, format this: java protected UnimprovedTimeMillisSpentScoreDifferenceThresholdTermination( long unimprovedTimeMillisSpentLimit, Score unimprovedScoreDifferenceThreshold, Clock clock ) { // body } This is compatible "align ... multiline" part of KIE Java Conventions Geoffrey's IDE settings ignoring KIE Java Conventions in this regard :wink:. I aligning either. I chose follow KIE conventions I rule checked I format this rule applying</technical_language>

Target:
protected UnimprovedTimeMillisSpentScoreDifferenceThresholdTermination( long unimprovedTimeMillisSpentLimit, Score unimprovedScoreDifferenceThreshold, Clock clock) { this.unimprovedTimeMillisSpentLimit = unimprovedTimeMillisSpentLimit; this.unimprovedScoreDifferenceThreshold = unimprovedScoreDifferenceThreshold; if (unimprovedTimeMillisSpentLimit < 0L) { throw new IllegalArgumentException("The unimprovedTimeMillisSpentLimit (" + unimprovedTimeMillisSpentLimit + ") cannot be negative."); } this.clock = clock; }
Source:
<code>public @Nonnull ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { if (!Prep.isInvalid(stack)) { IoMode mode = getIoMode(side); <START> if (mode != IoMode.PUSH && mode != IoMode.DISABLED) { <END> return getInventory().getView(EnderInventory.Type.INPUT).insertItem(slot, stack, simulate); } } return ItemStack.EMPTY; }</code><technical_language>please IoMode.canRecieveInput()/canOutput(), e.g. crazypants.enderio.base.capability.LegacyMachineWrapper.insertItem(int, ItemStack, boolean) (PS: And: I miss this???)</technical_language>

Target:
public @Nonnull ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { if (!Prep.isInvalid(stack)) { IoMode mode = getIoMode(side); if (mode.canRecieveInput()) { return getInventory().getView(EnderInventory.Type.INPUT).insertItem(slot, stack, simulate); } } return ItemStack.EMPTY; }