auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void reportUpgradeError(CentralRepoException ex) { try { SwingUtilities.invokeAndWait(() -> { JOptionPane.showMessageDialog(null, ex.getUserMessage(), NbBundle.getMessage(this.getClass(), "Installer.centralRepoUpgradeFailed.title"), JOptionPane.ERROR_MESSAGE); }); } catch (InterruptedException | InvocationTargetException e) { LOGGER.warning("There was an error while running the swing utility invoke later while displaying an error " + "for creating the central repository database: " <START> + e.getMessage() + System.lineSeparator() + e.getStackTrace()); <END> } }</code><technical_language>this LOGGER.warning("msg...", e) ? I "ex" a bit for consistency</technical_language>

Target:
private void reportUpgradeError(CentralRepoException ex) { try { SwingUtilities.invokeAndWait(() -> { JOptionPane.showMessageDialog(null, ex.getUserMessage(), NbBundle.getMessage(this.getClass(), "Installer.centralRepoUpgradeFailed.title"), JOptionPane.ERROR_MESSAGE); }); } catch (InterruptedException | InvocationTargetException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } }
Source:
<code>protected List<MethodMatcher> getMethodInvocationMatchers() { <START> return ImmutableList.of(MethodMatcher.create().typeDefinition("javax.servlet.http.HttpSession").name("setAttribute").withNoParameterConstraint()); <END> }</code><technical_language>@m-g-sonar add parameters constraint require parameters in line 66</technical_language>

Target:
protected List<MethodMatcher> getMethodInvocationMatchers() { return ImmutableList.of( MethodMatcher.create().typeDefinition("javax.servlet.http.HttpSession").name("setAttribute").addParameter(TypeCriteria.anyType()).addParameter(TypeCriteria.anyType()), MethodMatcher.create().typeDefinition("javax.servlet.http.HttpSession").name("putValue").addParameter(TypeCriteria.anyType()).addParameter(TypeCriteria.anyType())); }
Source:
<code>public static int getPortOffset() { ServerConfiguration carbonConfig = ServerConfiguration.getInstance(); String portOffset = System .getProperty(PORT_OFFSET_SYSTEM_VAR, carbonConfig.getFirstProperty(PORT_OFFSET_CONFIG)); try { if (portOffset != null) { return Integer.parseInt(portOffset.trim()); } else { return 0; } } catch (NumberFormatException e) { <START> log.error("Invalid Port Offset: " + portOffset + ". Default value 0 will be used.", e); <END> return 0; } }</code><technical_language>throw this error interrupt server startup</technical_language>

Target:
public static int getPortOffset() { ServerConfiguration carbonConfig = ServerConfiguration.getInstance(); String portOffsetInCarbonXML = carbonConfig.getFirstProperty(PORT_OFFSET_CONFIG); String portOffset = System.getProperty(PORT_OFFSET_SYSTEM_VAR, portOffsetInCarbonXML); if (portOffset != null) { return Integer.parseInt(portOffset.trim()); } else { return 0; } }
Source:
<code>protected File discoverGitPrefix() { String path = SystemReader.getInstance().getenv("PATH"); File gitExe = searchPath(path, "git.exe", "git.cmd"); if (gitExe != null) return gitExe.getParentFile().getParentFile(); String w = readPipe(userHome(), new String[] { "bash", "--login", "-c", "which git" }, Charset.defaultCharset().name()); if (w != null) { gitExe = resolve(null, w); if (gitExe != null) { File parentFile = gitExe.getParentFile(); <START> if(parentFile != null) <END> return parentFile.getParentFile(); } } return null; }</code><technical_language>style nit: s/if(/if (/</technical_language>

Target:
protected File discoverGitPrefix() { String path = SystemReader.getInstance().getenv("PATH"); File gitExe = searchPath(path, "git.exe", "git.cmd"); if (gitExe != null) return resolveGrandparentFile(gitExe); String w = readPipe(userHome(), new String[] { "bash", "--login", "-c", "which git" }, Charset.defaultCharset().name()); if (w != null) { gitExe = resolve(null, w); if (gitExe != null) return resolveGrandparentFile(gitExe); } return null; }
Source:
<code>public Dialog onCreateDialog(Bundle savedInstanceState) { String title = getArguments().getString(ARG_TITLE); String message = getArguments().getString(ARG_MESSAGE); <START> AlertDialog ret = new AlertDialog.Builder(getContext()) <END> .setMessage(message) .setPositiveButton(R.string.label_ok, null) .create(); if (title != null) { ret.setTitle(title); } ret.setCanceledOnTouchOutside(false); return ret; }</code><technical_language>Shorthand for replace ret alertDialog</technical_language>

Target:
public Dialog onCreateDialog(Bundle savedInstanceState) { String title = getArguments().getString(ARG_TITLE); String message = getArguments().getString(ARG_MESSAGE); AlertDialog alertDialog = new AlertDialog.Builder(getContext()) .setMessage(message) .setPositiveButton(R.string.label_ok, null) .create(); if (title != null) { alertDialog.setTitle(title); } alertDialog.setCanceledOnTouchOutside(false); return alertDialog; }
Source:
<code>private Optional<Account> updateEmail(final Account account, final Long lastModified) { try { int rows = updateEmail(account.email, account.id.get(), account.lastModified, lastModified); if (rows == 0) { return Optional.absent(); } return getById(account.id.get()); } catch (UnableToExecuteStatementException exception) { final Matcher matcher = MatcherPatternsDB.PG_UNIQ_PATTERN.matcher(exception.getMessage()); if (matcher.find()) { LOGGER.error("Account with email = already exists", account.email); <START> } <END> } return Optional.absent(); }</code><technical_language>log if is other error</technical_language>

Target:
private Optional<Account> updateEmail(final Account account, final Long lastModified) { try { int rows = updateEmail(account.email, account.id.get(), account.lastModified, lastModified); if (rows == 0) { return Optional.absent(); } return getById(account.id.get()); } catch (UnableToExecuteStatementException exception) { final Matcher matcher = MatcherPatternsDB.PG_UNIQ_PATTERN.matcher(exception.getMessage()); if (matcher.find()) { LOGGER.error("Account with email = already exists", account.email); } LOGGER.error("Unknown error: {}", exception.getMessage()); } return Optional.absent(); }
Source:
<code>public Pair<Boolean, String> validate(DispoAnnotationData annotation) { String pcr = annotation.getResolution().toUpperCase().trim(); boolean isValid = false; String type = "NONE"; if (pcr.matches("^\\s*[CTR]\\d{4,5}\\s*$")) { isValid = true; if (pcr.startsWith("C")) { type = "CODE"; } else if (pcr.startsWith("T")) { type = "TEST"; } else if (pcr.startsWith("R")) { type = "REQ"; <START> } else if (pcr.startsWith("TRAX") || pcr.startsWith("CTE")) { <END> type = "OTHER"; } } boolean isOpen = checkStatus(pcr); Pair<Boolean, String> toReturn = new Pair<Boolean, String>(isOpen && isValid, type); return toReturn; }</code><technical_language>eclipse.org code TRAX CTE in</technical_language>

Target:
public Pair<Boolean, String> validate(DispoAnnotationData annotation) { String pcr = annotation.getResolution().toUpperCase().trim(); boolean isValid = false; String type = "NONE"; if (pcr.matches("^\\s*[CTR]\\d{4,5}\\s*$")) { isValid = true; if (pcr.startsWith("C")) { type = "CODE"; } else if (pcr.startsWith("T")) { type = "TEST"; } else if (pcr.startsWith("R")) { type = "REQ"; } else { type = "OTHER"; } } boolean isOpen = checkStatus(pcr); Pair<Boolean, String> toReturn = new Pair<Boolean, String>(isOpen && isValid, type); return toReturn; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { if (DEBUG) Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]"); <START> ServiceHelper.initServices(this); <END> ThemeHelper.setTheme(this, ServiceHelper.getSelectedServiceId(this)); super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window w = getWindow(); w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); } if (getSupportFragmentManager() != null && getSupportFragmentManager().getBackStackEntryCount() == 0) { initFragments(); } setSupportActionBar(findViewById(R.id.toolbar)); try { setupDrawer(); } catch (Exception e) { ErrorActivity.reportUiError(this, e); } }</code><technical_language>this happen App.onCreate() function</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { if (DEBUG) Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]"); ThemeHelper.setTheme(this, ServiceHelper.getSelectedServiceId(this)); super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window w = getWindow(); w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); } if (getSupportFragmentManager() != null && getSupportFragmentManager().getBackStackEntryCount() == 0) { initFragments(); } setSupportActionBar(findViewById(R.id.toolbar)); try { setupDrawer(); } catch (Exception e) { ErrorActivity.reportUiError(this, e); } }
Source:
<code>List<Object> projectRow(Group row) { <START> ArrayList<Object> output = new ArrayList<Object>(this.visitor.getProjectedColumns().size()); <END> int fieldCount = row.getType().getFieldCount(); for (int field = 0; field < fieldCount; field++) { int valueCount = row.getFieldRepetitionCount(field); Type fieldType = row.getType().getType(field); String fieldName = fieldType.getName(); for (int index = 0; index < valueCount; index++) { switch (fieldName) { case "INT96": output.add(row.getInt96(field, index)); break; case "INT": output.add(row.getInteger(field, index)); break; case "BOOLEAN": output.add(row.getBoolean(field, index)); break; case "FLOAT": output.add(row.getFloat(field, index)); break; case "DOUBLE": output.add(row.getDouble(field, index)); break; case "BYTE_ARRAY": output.add(row.getBinary(field,index)); } } } return output; }</code><technical_language>I logic needs match is asked of projected columns, select *, i.e. projected columns a single column all, output match in parquet record</technical_language>

Target:
List<Object> projectRow(Group row) throws TranslatorException { final List<Object> output = new ArrayList<Object>(); int field = 0; List<String> expectedColumnNames = this.visitor.getProjectedColumnNames(); for (int i = 0; i < expectedColumnNames.size(); i++) { if(this.partitionedColumnsHm.contains(expectedColumnNames.get(i))){ output.add(partitionedColumnsValue.get(expectedColumnNames.get(i))); }else { Type fieldType = row.getType().getType(field); int valueCount = row.getFieldRepetitionCount(field); if ("REPEATED".equals(fieldType.getRepetition().toString())) { output.add(getRepeatedList(row, field)); } if (fieldType.getLogicalTypeAnnotation() != null && "LIST".equals(fieldType.getLogicalTypeAnnotation().toString())) { output.add(getList(row.getGroup(field, 0))); field++; continue; } if (!fieldType.isPrimitive()) { throw new TranslatorException("We don't support any logical type other than LIST as of now."); } if (valueCount == 0) { output.add(null); } else { PrimitiveType.PrimitiveTypeName type = fieldType.asPrimitiveType().getPrimitiveTypeName(); output.add(getPrimitiveTypeObject(type, field, 0, row, fieldType)); } field++; } } return output; }
Source:
<code>public <T> T getBitmapResult(BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory) { <START> return null; <END> }</code><technical_language>Hm, this return bitmapResultFactory.wrapAllTrue(Filters.allTrue(selector)); return true for supportsBitmapIndex. As-is, TrueFilter returning true for supportsSelectivityEstimation support bitmap indexes, supporting bitmap indexes potentially interfere of bitmap indexes for other subfilters And/Or filter contains a TrueFilter (See makeCursors() in QueryableIndexStorageAdapter getExecutionPlan() in AutoStrategy)</technical_language>

Target:
public <T> T getBitmapResult(BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory) { return bitmapResultFactory.wrapAllTrue(Filters.allTrue(selector)); }
Source:
<code>protected ValidationResult validate(Artifact artToValidate, IProgressMonitor monitor) throws OseeCoreException { Collection<String> errorMessages = new ArrayList<>(); boolean validationPassed = true; String wtc = artToValidate.getSoleAttributeValue(CoreAttributeTypes.WordTemplateContent, ""); Matcher match = NORMAL_LIST_BULLET_STYLE.matcher(wtc); if (match.find()) { <START> errorMessages.add(ValidationReportOperation.getRequirementHyperlink( <END> artToValidate) + " (" + artToValidate.getGammaId() + ")" + " is not using lists or bullets associated with an expected style."); validationPassed = false; } return new ValidationResult(errorMessages, validationPassed); }</code><technical_language>Recommend adding a link in report LBA Wiki explains this error is fix it. a link general information Validate Requirement Changes add other needed. this of them</technical_language>

Target:
protected ValidationResult validate(Artifact artToValidate, IProgressMonitor monitor) throws OseeCoreException { Collection<String> errorMessages = new ArrayList<>(); boolean validationPassed = true; String wtc = artToValidate.getSoleAttributeValue(CoreAttributeTypes.WordTemplateContent, ""); Matcher match = NORMAL_LIST_BULLET_STYLE.matcher(wtc); if (match.find()) { errorMessages.add(ValidationReportOperation.getRequirementHyperlink( artToValidate) + " (" + artToValidate.getGammaId() + ")" + " is not using lists or bullets associated with an expected style." + " See " + getHyperLink()); validationPassed = false; } return new ValidationResult(errorMessages, validationPassed); }
Source:
<code>public void append(final LogEvent event) { <START> if (event.getLoggerName() != null && event.getLoggerName().startsWith("org.apache.redis")) { <END> LOGGER.warn("Recursive logging from for appender [{}].", event.getLoggerName(), getName()); } else { try { tryAppend(event); } catch (final Exception e) { error("Unable to write to Redis in appender [" + getName() + "]", event, e); } } }</code><technical_language>check AbstractLogger.getRecursionDepth() > 1? class name check is fragile</technical_language>

Target:
public void append(final LogEvent event) { final Layout<? extends Serializable> layout = getLayout(); if (event.getLoggerName() != null && AbstractLogger.getRecursionDepth() > 1) { LOGGER.warn("Recursive logging from for appender [{}].", event.getLoggerName(), getName()); } else if (layout instanceof StringLayout) { String serializedEvent = ((StringLayout)layout).toSerializable(event); while (!logQueue.offer(serializedEvent)) { tryFlushQueue(); } if (shouldFlushLogQueue(event.isEndOfBatch())) { tryFlushQueue(); } } else { throw new AppenderLoggingException("The Redis appender only supports StringLayouts."); } }
Source:
<code>public Construct exec(Target t, Environment environment, Construct... args) throws CancelCommandException, ConfigRuntimeException { if(!(args[0].nval() instanceof String)) { throw new CRECastException(this.getName() + " expects a string as first argument, but type " + args[0].typeof() + " was found.", t); } String text = args[0].nval(); if(text.length() != 1) { throw new CREFormatException("Got \"" + text + "\" instead of expected character.", t); } char check = text.charAt(0); if(!Character.isLetter(check)) { <START> throw new CRECastException("Got \"" + text + "\" instead of alphabetical character.", t); <END> } return CBoolean.get(Character.isUpperCase(check)); }</code><technical_language>CREFormatException, CRECastException</technical_language>

Target:
public Construct exec(Target t, Environment environment, Construct... args) throws CancelCommandException, ConfigRuntimeException { if(!(args[0].nval() instanceof String)) { throw new CRECastException(this.getName() + " expects a string as first argument, but type " + args[0].typeof() + " was found.", t); } String text = args[0].nval(); if(text.length() != 1) { throw new CREFormatException("Got \"" + text + "\" instead of expected character.", t); } char check = text.charAt(0); if(!Character.isLetter(check)) { throw new CREFormatException("Got \"" + text + "\" instead of alphabetical character.", t); } return CBoolean.get(Character.isUpperCase(check)); }
Source:
<code>@Test public void startActivityInNewAppTestCaseWithoutClosingApp() { driver.startActivity("io.appium.android.apis", ".accessibility.AccessibilityNodeProviderActivity"); Assert.assertEquals(driver.currentActivity(), ".accessibility.AccessibilityNodeProviderActivity"); driver.startActivity("com.android.contacts", ".ContactsListActivity", "com.android.contacts", ".ContactsListActivity", false); <START> Assert.assertEquals(driver.currentActivity(), ".ContactsListActivity"); <END> driver.pressKeyCode(AndroidKeyCode.BACK); Assert.assertEquals(driver.currentActivity(), ".accessibility.AccessibilityNodeProviderActivity"); }</code><technical_language>assertEquals statically imported Assert. omitted</technical_language>

Target:
@Test public void startActivityInNewAppTestCaseWithoutClosingApp() { driver.startActivity("io.appium.android.apis", ".accessibility.AccessibilityNodeProviderActivity"); assertEquals(driver.currentActivity(), ".accessibility.AccessibilityNodeProviderActivity"); driver.startActivity("com.android.contacts", ".ContactsListActivity", "com.android.contacts", ".ContactsListActivity", false); assertEquals(driver.currentActivity(), ".ContactsListActivity"); driver.pressKeyCode(AndroidKeyCode.BACK); assertEquals(driver.currentActivity(), ".accessibility.AccessibilityNodeProviderActivity"); }
Source:
<code>void should_fail_if_period_is_zero() { <START> Period period = Period.ofMonths(0); <END> ThrowableAssert.ThrowingCallable code = () -> assertThat(period).isPositive(); assertThatAssertionErrorIsThrownBy(code).withMessage(shouldBePositive(period).create()); }</code><technical_language>Period.ZERO</technical_language>

Target:
void should_fail_if_period_is_zero() { Period period = Period.ZERO; final AssertionError code = expectAssertionError(() -> assertThat(period).isPositive()); then(code).hasMessage(shouldBePositive(period).create()); }
Source:
<code>public int read(byte[] buffer, int offset, int readLength) throws AssetDataSourceException { if (bytesRemaining == 0) { return -1; } else { int bytesRead = 0; try { bytesRead = assetInputStream.read(buffer, offset, (int) Math.min(bytesRemaining, readLength)); } catch (IOException e) { throw new AssetDataSourceException(e); } if (bytesRead > 0) { bytesRemaining -= bytesRead; if (listener != null) { listener.onBytesTransferred(bytesRead); } } <START> Log.i("AssetDataSource", "read(). bytesRead = " + bytesRead); <END> return bytesRead; } }</code><technical_language>get rid of this. pretty spammy (guessing for debugging)</technical_language>

Target:
public int read(byte[] buffer, int offset, int readLength) throws AssetDataSourceException { if (bytesRemaining == 0) { return -1; } else { int bytesRead = 0; try { bytesRead = assetInputStream.read(buffer, offset, (int) Math.min(bytesRemaining, readLength)); } catch (IOException e) { throw new AssetDataSourceException(e); } if (bytesRead > 0) { bytesRemaining -= bytesRead; if (listener != null) { listener.onBytesTransferred(bytesRead); } } return bytesRead; } }
Source:
<code>public void instantiate(@Observes StackStarting event) { ControllerMethod controllerMethod = event.getControllerMethod(); if (containsParameters(controllerMethod)) { fixIndexedParameters(request); addHeaderParametersToAttribute(controllerMethod); Object[] values = getParametersFor(controllerMethod); validator.addAll(errors); logger.debug("Conversion errors: {}", errors); logger.debug("Parameter values for are {}", controllerMethod, values); Parameter[] parameters = parameterNameProvider.parametersFor(controllerMethod.getMethod()); ValuedParameter[] valuedParameters = new ValuedParameter[values.length]; for (int i = 0; i < valuedParameters.length; i++) { <START> valuedParameters[i] = new ValuedParameter(parameters[i], values[i]); <END> } methodInfo.setValuedParameters(valuedParameters); } }</code><technical_language>put this code in method info, call: methodInfo.setParameter(i, values[i]);</technical_language>

Target:
public void instantiate(@Observes StackStarting event) { ControllerMethod controllerMethod = event.getControllerMethod(); if (containsParameters(controllerMethod)) { fixIndexedParameters(request); addHeaderParametersToAttribute(controllerMethod); Object[] values = getParametersFor(controllerMethod); validator.addAll(errors); logger.debug("Conversion errors: {}", errors); logger.debug("Parameter values for are {}", controllerMethod, values); ValuedParameter[] valuedParameters = methodInfo.getValuedParameters(); for (int i = 0; i < valuedParameters.length; i++) { valuedParameters[i].setValue(values[i]); } } }
Source:
<code><START> public void onPostsSearched(OnPostsSearched event) { <END> hideLoadMoreProgress(); if (event.isError()) { ToastUtils.showToast(getActivity(), "Error searching posts: " + event.error.type); return; } List<PostModel> results = event.searchResults == null ? null : event.searchResults.getPosts(); updateAdapter(results); }</code><technical_language>handling pagination for search here</technical_language>

Target:
public void onPostsSearched(OnPostsSearched event) { mIsSearching = false; hideLoadMoreProgress(); if (event.isError()) { AppLog.w(AppLog.T.POSTS, "Error searching posts: " + event.error.message); ToastUtils.showToast(getActivity(), "Error searching posts: " + event.error.type); return; } if (event.searchResults != null && !ListUtils.isEmpty(event.searchResults.getPosts())) { mSearchResults.addAll(event.searchResults.getPosts()); } mCanSearchMore = event.canLoadMore; showSearchResults(); }
Source:
<code>private AuthenticationResult acquireTokenWithCachedItem(final TokenCacheItem cachedItem) throws AuthenticationException { final AuthenticationResult result = acquireTokenWithRefreshToken(cachedItem.getRefreshToken()); <START> mTokenCacheAccessor.updateCachedItemToResult(mAuthRequest.getResource(), mAuthRequest.getClientId(), <END> result, cachedItem); return result; }</code><technical_language>move check for if is expired here</technical_language>

Target:
private AuthenticationResult acquireTokenWithCachedItem(final TokenCacheItem cachedItem) throws AuthenticationException { final AuthenticationResult result = acquireTokenWithRefreshToken(cachedItem.getRefreshToken()); if (result != null) { mTokenCacheAccessor.updateCachedItemWithResult(mAuthRequest.getResource(), mAuthRequest.getClientId(), result, cachedItem); } return result; }
Source:
<code>private JSONObject makeRequest(DOI doi) throws ShortDOIServiceException { URIBuilder uriBuilder = null; URL url = null; try { uriBuilder = new URIBuilder(BASIC_URL); uriBuilder.setPath(uriBuilder.getPath() + doi.getDOI()); uriBuilder.addParameter("format", "json"); URI uri = uriBuilder.build(); url = uri.toURL(); } catch (URISyntaxException | MalformedURLException e) { throw new ShortDOIServiceException("Cannot get short DOI", e); } URLDownload urlDownload = new URLDownload(url); JSONObject jsonObject = null; try { <START> jsonObject = JsonReader.toJsonObject(urlDownload.asInputStream()); <END> } catch (ParseException | IOException | JSONException e) { throw new ShortDOIServiceException("Cannot get short DOI", e); } return jsonObject; }</code><technical_language>here: early return is</technical_language>

Target:
private JSONObject makeRequest(DOI doi) throws ShortDOIServiceException { URIBuilder uriBuilder = null; URL url = null; try { uriBuilder = new URIBuilder(BASIC_URL); uriBuilder.setPath(uriBuilder.getPath() + doi.getDOI()); uriBuilder.addParameter("format", "json"); URI uri = uriBuilder.build(); url = uri.toURL(); } catch (URISyntaxException | MalformedURLException e) { throw new ShortDOIServiceException("Cannot get short DOI", e); } URLDownload urlDownload = new URLDownload(url); try { return JsonReader.toJsonObject(urlDownload.asInputStream()); } catch (ParseException | IOException | JSONException e) { throw new ShortDOIServiceException("Cannot get short DOI", e); } }
Source:
<code>public Map<String, Collection<Message>> getGrouped() { if (grouped == null) { <START> grouped = Multimaps.index(delegate, new GroupByCategory()).asMap(); <END> } return grouped; }</code><technical_language>'frecura', static import Multimaps create a static atribute named byCategory, this line becomes:</technical_language>

Target:
public Map<String, Collection<Message>> getGrouped() { if (grouped == null) { grouped = index(delegate, byCategory).asMap(); } return grouped; }
Source:
<code>public void testAddTransfer_Receiver(){ addTicketTransfer(ticketReciever.getUsername(), "password").then().statusCode(HttpStatus.SC_FORBIDDEN); ticket = ticketRepository.findByKey(ticket.getKey()).orElse(null); if(ticket == null) Assert.fail("Could not refresh ticket"); <START> Assert.assertTrue(ticket.isLockedForTransfer()); <END> }</code><technical_language>here. ticket prepared for transfer, locked</technical_language>

Target:
public void testAddTransfer_Receiver(){ addTicketTransfer(ticketReceiver.getUsername(), "password") .then() .statusCode(HttpStatus.SC_FORBIDDEN); Assert.assertTrue(tttRepository.count() == 0); }
Source:
<code>public void onViewCreated(final View view, final Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); final Bundle arguments = getArgumentsBundle(); Query.one( AssignmentsDAO.class, "SELECT * " + "FROM " + AssignmentsDAO.TABLE_NAME + " " + "WHERE soldierId = ? AND platformId = ? AND version = ?", arguments.getString(Keys.Soldier.ID, ""), arguments.getInt(Keys.Soldier.PLATFORM, 0), Assignments.VERSION ).getAsync( getLoaderManager(), new OneQuery.ResultHandler<AssignmentsDAO>() { @Override public boolean handleResult(AssignmentsDAO assignmentsDAO) { final View view = getView(); if (view == null || assignmentsDAO == null) { return true; } final SortedAssignmentContainer container = assignmentsDAO.getSortedAssignmentContainer(); <START> Log.d("YOLO", "number of items: " + container); <END> sendDataToGridView(view, container.getItems()); showLoadingState(false); return true; } } ); }</code><technical_language>YOLO log strikes :zap:</technical_language>

Target:
public void onViewCreated(final View view, final Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); final Bundle arguments = getArgumentsBundle(); Query.one( AssignmentsDAO.class, "SELECT * " + "FROM " + AssignmentsDAO.TABLE_NAME + " " + "WHERE soldierId = ? AND platformId = ? AND version = ?", arguments.getString(Keys.Soldier.ID, ""), arguments.getInt(Keys.Soldier.PLATFORM, 0), BuildConfig.VERSION_CODE ).getAsync( getLoaderManager(), new OneQuery.ResultHandler<AssignmentsDAO>() { @Override public boolean handleResult(AssignmentsDAO assignmentsDAO) { final View view = getView(); if (view == null || assignmentsDAO == null) { return true; } final SortedAssignmentContainer container = assignmentsDAO.getSortedAssignmentContainer(); sendDataToGridView(view, container.getItems()); showLoadingState(false); return true; } } ); }
Source:
<code>protected void onSaveInstanceState(Bundle outState) { <START> if(mNoteEditorFragmentPagerAdapter.getItem(0).isAdded()) { <END> getSupportFragmentManager() .putFragment(outState, getString(R.string.tab_edit), mNoteEditorFragmentPagerAdapter.getItem(0)); } if(mNoteEditorFragmentPagerAdapter.getItem(1).isAdded()) { getSupportFragmentManager() .putFragment(outState, getString(R.string.tab_preview), mNoteEditorFragmentPagerAdapter.getItem(1)); } outState.putBoolean(NoteEditorFragment.ARG_MARKDOWN_ENABLED, isMarkdownEnabled); super.onSaveInstanceState(outState); }</code><technical_language>check for IndexOutOfBoundsException here? happen in case..</technical_language>

Target:
protected void onSaveInstanceState(Bundle outState) { if (mNoteEditorFragmentPagerAdapter.getCount() > 0 && mNoteEditorFragmentPagerAdapter.getItem(0).isAdded()) { getSupportFragmentManager() .putFragment(outState, getString(R.string.tab_edit), mNoteEditorFragmentPagerAdapter.getItem(0)); } if (mNoteEditorFragmentPagerAdapter.getCount() > 1 && mNoteEditorFragmentPagerAdapter.getItem(1).isAdded()) { getSupportFragmentManager() .putFragment(outState, getString(R.string.tab_preview), mNoteEditorFragmentPagerAdapter.getItem(1)); } outState.putBoolean(NoteEditorFragment.ARG_MARKDOWN_ENABLED, isMarkdownEnabled); super.onSaveInstanceState(outState); }
Source:
<code>protected void clickXY(int x, int y) { log.debug(MessageFormat.format("Clicking on {0}", this)); notifyTree(SWT.MouseEnter); notifyTree(SWT.MouseMove); notifyTree(SWT.Activate); notifyTree(SWT.FocusIn); notifyTree(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.NONE, 1)); notifyTree(SWT.MouseUp, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); syncExec(new VoidResult() { public void run() { if (tree.getSelectionCount() != 1 || <START> tree.getSelection()[0].equals(widget)) <END> { tree.setSelection(widget); } } }); notifyTree(SWT.Selection, createSelectionEvent(SWT.BUTTON1)); notifyTree(SWT.MouseHover); notifyTree(SWT.MouseMove); notifyTree(SWT.MouseExit); notifyTree(SWT.Deactivate); notifyTree(SWT.FocusOut); log.debug(MessageFormat.format("Clicked on {0}", this)); }</code><technical_language>!(equals)</technical_language>

Target:
protected void clickXY(int x, int y) { log.debug(MessageFormat.format("Clicking on {0}", this)); notifyTree(SWT.MouseEnter); notifyTree(SWT.MouseMove); notifyTree(SWT.Activate); notifyTree(SWT.FocusIn); notifyTree(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.NONE, 1)); notifyTree(SWT.MouseUp, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); syncExec(new VoidResult() { public void run() { if (tree.getSelectionCount() != 1 || !tree.getSelection()[0].equals(widget)) { tree.setSelection(widget); } } }); notifyTree(SWT.Selection, createSelectionEvent(SWT.BUTTON1)); notifyTree(SWT.MouseHover); notifyTree(SWT.MouseMove); notifyTree(SWT.MouseExit); notifyTree(SWT.Deactivate); notifyTree(SWT.FocusOut); log.debug(MessageFormat.format("Clicked on {0}", this)); }
Source:
<code>private final Xid createXid (boolean branch, XAModifier theModifier) { Xid jtaXid = baseXid(); if (jtaXid != null && jtaXid.getFormatId() != com.arjuna.ats.jts.extensions.Arjuna.XID()) return jtaXid; try { if (jtaXid != null) { Integer eisName = null; if(jtaXid instanceof XidImple) eisName = XATxConverter.getEISName(((XidImple) jtaXid).getXID()); <START> jtaXid = new XidImple(jtaXid, branch, eisName); <END> } else { jtaXid = _theTransaction.get_xid(branch); } if (theModifier != null) { try { jtaXid = theModifier.createXid(jtaXid); } catch (Exception e) { e.printStackTrace(); } } return jtaXid; } catch (Exception e) { e.printStackTrace(); } return null; }</code><technical_language>need a new line condition</technical_language>

Target:
private final Xid createXid (boolean branch, XAModifier theModifier) { Xid jtaXid = baseXid(); if (jtaXid != null && jtaXid.getFormatId() != com.arjuna.ats.jts.extensions.Arjuna.XID()) return jtaXid; try { if (jtaXid != null) { jtaXid = new XidImple(jtaXid, branch, XAUtils.getEisName(jtaXid)); } else { jtaXid = _theTransaction.get_xid(branch); } if (theModifier != null) { try { jtaXid = theModifier.createXid(jtaXid); } catch (Exception e) { e.printStackTrace(); } } return jtaXid; } catch (Exception e) { e.printStackTrace(); } return null; }
Source:
<code>public void testBuilderWithPositionalParameters() { final ParsedSql parsedSql = ParsedSql.builder() .append("insert into test (a, b, c) values (") .appendPositionalParameter() .append(", ") .appendPositionalParameter() .append(", ") .appendPositionalParameter() .append(")") .build(); assertThat(parsedSql).isNotNull(); assertThat(parsedSql.getSql()).isEqualTo("insert into test (a, b, c) values (?, ?, ?)"); assertThat(parsedSql.getParameters().isPositional()).isTrue(); <START> assertThat(parsedSql.getParameters().getParameterNames()).contains("?", "?", "?"); <END> }</code><technical_language>containsOnly("?")</technical_language>

Target:
public void testBuilderWithPositionalParameters() { final ParsedSql parsedSql = ParsedSql.builder() .append("insert into test (a, b, c) values (") .appendPositionalParameter() .append(", ") .appendPositionalParameter() .append(", ") .appendPositionalParameter() .append(")") .build(); assertThat(parsedSql).isNotNull(); assertThat(parsedSql.getSql()).isEqualTo("insert into test (a, b, c) values (?, ?, ?)"); assertThat(parsedSql.getParameters().isPositional()).isTrue(); assertThat(parsedSql.getParameters().getParameterNames()).containsOnly("?"); }
Source:
<code>public SpliceCatalogUpgradeScripts(SpliceDataDictionary sdd,Splice_DD_Version catalogVersion,TransactionController tc){ this.sdd=sdd; this.catalogVersion=catalogVersion; this.tc=tc; ddComparator=new Comparator<Splice_DD_Version>(){ @Override public int compare(Splice_DD_Version version1,Splice_DD_Version version2){ long v1=version1.toLong(); long v2=version2.toLong(); if(v1<v2) return -1; else if(v1==v2) return 0; else return 1; } }; scripts=new TreeMap<>(ddComparator); scripts.put(new Splice_DD_Version(sdd,1,0,0),new UpgradeScriptForFuji(sdd,tc)); scripts.put(new Splice_DD_Version(sdd,1,1,1),new LassenUpgradeScript(sdd,tc)); <START> scripts.put(new Splice_DD_Version(sdd,2,6,0, 9999),new UpgradeScriptFor260(sdd,tc)); <END> }</code><technical_language>version threshold 2.5.0.9999 instead of 2.6.0.9999</technical_language>

Target:
public SpliceCatalogUpgradeScripts(SpliceDataDictionary sdd,Splice_DD_Version catalogVersion,TransactionController tc){ this.sdd=sdd; this.catalogVersion=catalogVersion; this.tc=tc; ddComparator=new Comparator<Splice_DD_Version>(){ @Override public int compare(Splice_DD_Version version1,Splice_DD_Version version2){ long v1=version1.toLong(); long v2=version2.toLong(); if(v1<v2) return -1; else if(v1==v2) return 0; else return 1; } }; scripts=new TreeMap<>(ddComparator); scripts.put(new Splice_DD_Version(sdd,1,0,0),new UpgradeScriptForFuji(sdd,tc)); scripts.put(new Splice_DD_Version(sdd,1,1,1),new LassenUpgradeScript(sdd,tc)); scripts.put(new Splice_DD_Version(sdd,2,6,0),new UpgradeScriptFor260(sdd,tc)); }
Source:
<code>public static Boolean updateHistoryForProcess(Process inProc) { Boolean updated; try { updated = updateHistory(inProc); updated = updateHistoryForSteps(inProc); } catch (Exception ex) { logger.warn("Updating history failed.", ex); <START> logger.error(ex.getStackTrace()); <END> updated = false; } return updated; }</code><technical_language>Is this error log call necessary in warning call is stack trace included</technical_language>

Target:
public static Boolean updateHistoryForProcess(Process inProc) { Boolean updated; try { updated = updateHistory(inProc); updated = updateHistoryForSteps(inProc); } catch (Exception ex) { logger.warn("Updating history failed.", ex); updated = false; } return updated; }
Source:
<code>protected void onFinishInflate() { mLockPatternUtils = new LockPatternUtils(mContext); mSecurityMessageDisplay = <START> (KeyguardMessageArea) KeyguardMessageArea.findSecurityMessageDisplay(this); <END> mEcaView = findViewById(R.id.keyguard_selector_fade_container); EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button); if (button != null) { button.setCallback(this); } }</code><technical_language>Instead of breaking abstraction here, introduce isEmpty SecurityMessageDisplay</technical_language>

Target:
protected void onFinishInflate() { mLockPatternUtils = new LockPatternUtils(mContext); mSecurityMessageDisplay = KeyguardMessageArea.findSecurityMessageDisplay(this); mEcaView = findViewById(R.id.keyguard_selector_fade_container); EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button); if (button != null) { button.setCallback(this); } }
Source:
<code><START> public final void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) <END> throws IOException, ServletException { if (!(request instanceof HttpServletRequest) || !(response instanceof HttpServletResponse)) { throw new ServletException("Only HTTP requests are supported"); } HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; String userIdParam = httpRequest.getParameter(AuthorizationConstants.USER_ID_PARAM); if (userIdParam==null) { HttpAuthUtil.reject(httpResponse, "Missing user id.", HttpStatus.INTERNAL_SERVER_ERROR); return; } Long userId = Long.parseLong(userIdParam); if (!BOOTSTRAP_PRINCIPAL.ANONYMOUS_USER.getPrincipalId().equals(userId)) { if (!authenticationService.hasUserAcceptedTermsOfUse(userId)) { HttpAuthUtil.reject(httpResponse, TOU_UNSIGNED_REASON, HttpStatus.FORBIDDEN); return; } } filterChain.doFilter(httpRequest, httpResponse); }</code><technical_language>A trickery in (CGLIB) proxies for spring beans, afraid method final</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest) || !(response instanceof HttpServletResponse)) { throw new ServletException("Only HTTP requests are supported"); } HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; String userIdParam = httpRequest.getParameter(AuthorizationConstants.USER_ID_PARAM); if (userIdParam==null) { HttpAuthUtil.reject(httpResponse, "Missing user id.", HttpStatus.INTERNAL_SERVER_ERROR); return; } Long userId = Long.parseLong(userIdParam); if (!BOOTSTRAP_PRINCIPAL.ANONYMOUS_USER.getPrincipalId().equals(userId)) { if (!authenticationService.hasUserAcceptedTermsOfUse(userId)) { HttpAuthUtil.reject(httpResponse, TOU_UNSIGNED_REASON, HttpStatus.FORBIDDEN); return; } } filterChain.doFilter(httpRequest, httpResponse); }
Source:
<code>public Attribute getAttributeValue(PerunSessionImpl perunSession, User user, AttributeDefinition attributeDefinition) throws InternalErrorException { Map<String, String> userOrganizations = new LinkedHashMap<>(); List<Vo> vos = perunSession.getPerunBl().getUsersManagerBl().getVosWhereUserIsMember(perunSession, user); for (Vo vo : vos) { try { Member member = perunSession.getPerunBl().getMembersManagerBl().getMemberByUser(perunSession, vo, user); String value = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, member, A_M_organization).valueAsString(); <START> userOrganizations.put(vo.getShortName(), value); <END> } catch (MemberNotExistsException e) { throw new ConsistencyErrorException(e); } catch (WrongAttributeAssignmentException | AttributeNotExistsException e) { throw new InternalErrorException(e); } } Attribute attribute = new Attribute(attributeDefinition); attribute.setValue(userOrganizations); return attribute; }</code><technical_language>Please do add key-value pair result if is null -> user organization set for VO</technical_language>

Target:
public Attribute getAttributeValue(PerunSessionImpl perunSession, User user, AttributeDefinition attributeDefinition) throws InternalErrorException { Map<String, String> userOrganizations = new LinkedHashMap<>(); List<Vo> vos = perunSession.getPerunBl().getUsersManagerBl().getVosWhereUserIsMember(perunSession, user); for (Vo vo : vos) { try { Member member = perunSession.getPerunBl().getMembersManagerBl().getMemberByUser(perunSession, vo, user); String value = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, member, A_M_organization).valueAsString(); if (value != null) userOrganizations.put(vo.getShortName(), value); } catch (MemberNotExistsException e) { throw new ConsistencyErrorException(e); } catch (WrongAttributeAssignmentException | AttributeNotExistsException e) { throw new InternalErrorException(e); } } Attribute attribute = new Attribute(attributeDefinition); attribute.setValue(userOrganizations); return attribute; }
Source:
<code>public void startCommandByDoubleClick(String commandName) { <START> String locatorToCurrentCommand = String.format(Locators.COMMANDS, commandName); <END> WebElement currentCommand = redrawUiElementTimeout.until( ExpectedConditions.visibilityOfElementLocated(By.xpath(locatorToCurrentCommand))); actions.doubleClick(currentCommand).perform(); redrawUiElementTimeout.until( ExpectedConditions.invisibilityOfElementLocated(By.xpath(locatorToCurrentCommand))); }</code><technical_language>static import of **String.format()** method code a bit clear</technical_language>

Target:
public void startCommandByDoubleClick(String commandName) { String locatorToCurrentCommand = format(Locators.COMMANDS, commandName); WebElement currentCommand = redrawUiElementTimeout.until( ExpectedConditions.visibilityOfElementLocated(By.xpath(locatorToCurrentCommand))); actions.doubleClick(currentCommand).perform(); redrawUiElementTimeout.until( ExpectedConditions.invisibilityOfElementLocated(By.xpath(locatorToCurrentCommand))); }
Source:
<code>public void should_return_endpoints_without_context_path() { contextRunner.withConfiguration(UserConfigurations.of(EndpointConfig.class)) .withPropertyValues("management.endpoint.health.enabled=true", <START> "management.endpoint.info.enabled=true", <END> "management.endpoints.web.exposure.include=info,health") .run(context -> { SkipPatternProvider skipPatternProvider = context .getBean(SkipPatternProvider.class); Pattern pattern = skipPatternProvider.skipPattern(); then(pattern.pattern()) .contains("/actuator/(health|health/.*|info|info/.*)"); }); }</code><technical_language>endpoints enabled default? Meaning result is properties</technical_language>

Target:
public void should_return_endpoints_without_context_path() { contextRunner.withConfiguration(UserConfigurations.of(ServerPropertiesConfig.class)) .run(context -> { then(extractAllPatterns(context)).containsExactlyInAnyOrder( "/actuator/(health|health/.*|info|info/.*)", SleuthWebProperties.DEFAULT_SKIP_PATTERN); }); }
Source:
<code>public static StreamStoreCleanupMetadata hydrateFromProto( SchemaMetadataPersistence.StreamStoreCleanupMetadata streamStoreCleanupMetadata) { ImmutableStreamStoreCleanupMetadata.Builder builder = ImmutableStreamStoreCleanupMetadata.builder(); if (streamStoreCleanupMetadata.hasV1Metadata()) { StreamStoreCleanupV1Metadata v1Metadata = streamStoreCleanupMetadata.getV1Metadata(); if (v1Metadata.hasNumHashedRowComponents()) { builder.numHashedRowComponents(v1Metadata.getNumHashedRowComponents()); } if (v1Metadata.hasStreamIdType()) { builder.streamIdType(ValueType.hydrateFromProto(v1Metadata.getStreamIdType())); } } else { <START> log.warn("Encountered stream store cleanup metadata without v1 metadata, which is unexpected."); <END> } return builder.build(); }</code><technical_language>exposing badness throwing exception here? happen if Nimbus sweep this table</technical_language>

Target:
public static StreamStoreCleanupMetadata hydrateFromProto( SchemaMetadataPersistence.StreamStoreCleanupMetadata streamStoreCleanupMetadata) { ImmutableStreamStoreCleanupMetadata.Builder builder = ImmutableStreamStoreCleanupMetadata.builder(); if (streamStoreCleanupMetadata.hasV1Metadata()) { StreamStoreCleanupV1Metadata v1Metadata = streamStoreCleanupMetadata.getV1Metadata(); if (v1Metadata.hasNumHashedRowComponents()) { builder.numHashedRowComponents(v1Metadata.getNumHashedRowComponents()); } if (v1Metadata.hasStreamIdType()) { builder.streamIdType(ValueType.hydrateFromProto(v1Metadata.getStreamIdType())); } } else { final String v1MetadataNotFound = "Encountered stream store cleanup metadata without v1 metadata," + " which is unexpected."; log.warn(v1MetadataNotFound); throw new IllegalStateException(v1MetadataNotFound); } return builder.build(); }
Source:
<code>public <T, E extends Exception> T transaction(TransactionActionWithException<T, D, E> action, Class<E> exClass) throws E { try { return transactionRetryExecutor.runInterruptible(() -> { try (Handle handle = dbi.open()) { handle.begin(); T retval; try { retval = action.call(handle, handle.attach(daoIface)); } catch (Exception ex) { try { handle.rollback(); } catch (Exception rollback) { ex.addSuppressed(rollback); } Throwables.propagateIfInstanceOf(ex, exClass); Throwables.propagateIfPossible(ex); throw new TransactionFailedException( <START> "Transaction failed do to exception being thrown " + <END> "from within the callback. See cause " + "for the original exception.", ex); } validateTransactionAndCommit(handle); return retval; } }); } catch (RetryGiveupException ex) { Throwable innerException = ex.getCause(); Throwables.propagateIfInstanceOf(innerException, exClass); throw Throwables.propagate(innerException); } catch (InterruptedException ex) { throw Throwables.propagate(ex); } }</code><technical_language>s/do/due</technical_language>

Target:
public <T, E extends Exception> T transaction(TransactionActionWithException<T, D, E> action, Class<E> exClass) throws E { try { return transactionRetryExecutor.runInterruptible(() -> { try (Handle handle = dbi.open()) { handle.begin(); T retval; try { retval = action.call(handle, handle.attach(daoIface)); } catch (Exception ex) { try { handle.rollback(); } catch (Exception rollback) { ex.addSuppressed(rollback); } Throwables.propagateIfInstanceOf(ex, exClass); Throwables.propagateIfPossible(ex); throw new TransactionFailedException( "Transaction failed due to exception being thrown " + "from within the callback. See cause " + "for the original exception.", ex); } validateTransactionAndCommit(handle); return retval; } }); } catch (RetryGiveupException ex) { Throwable innerException = ex.getCause(); Throwables.propagateIfInstanceOf(innerException, exClass); throw Throwables.propagate(innerException); } catch (InterruptedException ex) { throw Throwables.propagate(ex); } }
Source:
<code><START> private void _put(String tableName, String rowKeyStr) { <END> _logger.trace(MessageFormat.format("Inserting rowkey {0} into table {1}", rowKeyStr, tableName)); final PutRequest put = new PutRequest(Bytes.toBytes(tableName), Bytes.toBytes(rowKeyStr), COLUMN_FAMILY, COLUMN_QUALIFIER, CELL_VALUE); Deferred<Object> deferred = _client.put(put); if(syncPut) { deferred.addCallback(new Callback<Object, Object>() { @Override public Object call(Object arg) throws Exception { _logger.trace(MessageFormat.format("Put to {0} successfully.", tableName)); return null; } }); } deferred.addErrback(new Callback<Object, Exception>() { @Override public Object call(Exception e) throws Exception { throw new SystemException("Error occured while trying to execute put().", e); } }); }</code><technical_language>Correct indent Ctrl+I in eclipse</technical_language>

Target:
private void _put(String tableName, String rowKeyStr) { _logger.trace(MessageFormat.format("Inserting rowkey {0} into table {1}", rowKeyStr, tableName)); final PutRequest put = new PutRequest(Bytes.toBytes(tableName), Bytes.toBytes(rowKeyStr), COLUMN_FAMILY, COLUMN_QUALIFIER, CELL_VALUE); Deferred<Object> deferred = _client.put(put); if(_syncPut) { deferred.addCallback(new Callback<Object, Object>() { @Override public Object call(Object arg) throws Exception { _logger.trace(MessageFormat.format("Put to {0} successfully.", tableName)); return null; } }); } deferred.addErrback(new Callback<Object, Exception>() { @Override public Object call(Exception e) throws Exception { throw new SystemException("Error occured while trying to execute put().", e); } }); }
Source:
<code>int commitAll() { <START> if (rebalanceInProgress) { <END> return -1; } final int committed = active.commit(); return committed + standby.commit(); }</code><technical_language>long separate tags for standby primary tasks commit, I metrics messed up</technical_language>

Target:
int commitAll() { return rebalanceInProgress ? -1 : active.commit() + standby.commit(); }
Source:
<code>private static boolean uniqueSchemaOnAllNodesAllowingForOneUnreachable( Map<String, List<String>> versions) { <START> return getDistinctReachableSchemas(versions).size() <= 1 <END> && (!versions.keySet().contains(VERSION_UNREACHABLE) || versions.get(VERSION_UNREACHABLE).size() == 1); }</code><technical_language>Is <= intentional? I if case getDistinctReachableSchemas(versions) size 0 (i.e. is unreachable) - in case I if safe proceed</technical_language>

Target:
private static boolean uniqueSchemaOnAllNodesAllowingForOneUnreachable( Map<String, List<String>> versions) { return getDistinctReachableSchemas(versions).size() == 1 && (versions.getOrDefault(VERSION_UNREACHABLE, ImmutableList.of()).size() <= 1); }