auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>static <T> T tryFor(long timeout, TimeUnit timeoutUnit, long interval, TimeUnit intervalUnit, Supplier<T> supplier, Predicate<T> predicate, Timer timer) throws TimeoutException, InterruptedException { long until = timer.nanoTime() + NANOSECONDS.convert(timeout, timeoutUnit); T value; do { value = supplier.get(); if (predicate.test(value)) { return value; } else { <START> timer.sleep(interval, intervalUnit); <END> } } while (timer.nanoTime() < until); throw new TimeoutException(); }</code><technical_language>sleep happen for min(interval, - now) sleep timeout</technical_language>

Target:
static <T> T tryFor(long timeout, TimeUnit timeoutUnit, long interval, TimeUnit intervalUnit, Supplier<T> supplier, Predicate<T> predicate, Timer timer) throws TimeoutException, InterruptedException { long until = timer.nanoTime() + NANOSECONDS.convert(timeout, timeoutUnit); long intervalNano = NANOSECONDS.convert(interval, intervalUnit); T value; for (;;) { value = supplier.get(); if (predicate.test(value)) { return value; } else { if ((timer.nanoTime() + intervalNano) < until) { timer.sleep(intervalNano); } else { break; } } } throw new TimeoutException(); }
Source:
<code>public void parseXML(List<Workspace> workspaces,XMLStreamReader parser) throws XMLStreamException { List<String> hierarchy = new ArrayList<String>(); for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; <START> event = parser.next()) { <END> switch(event) { case XMLStreamConstants.START_ELEMENT: hierarchy.add(parser.getLocalName()); break; case XMLStreamConstants.END_ELEMENT: hierarchy.remove(hierarchy.size()-1); break; case XMLStreamConstants.CHARACTERS: if(RemoteCommons.endsWith(hierarchy,"workspaces","workspace")) { workspaces.add(new Workspace(cParams, parser.getText().trim())); } break; } } }</code><technical_language>calls parser.next() strange... explain a bit</technical_language>

Target:
public void parseXML(List<Workspace> workspaces,XMLStreamReader parser) throws XMLStreamException { List<String> hierarchy = new ArrayList<String>(); StringBuilder characters = new StringBuilder(); for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) { switch(event) { case XMLStreamConstants.START_ELEMENT: hierarchy.add(parser.getLocalName()); break; case XMLStreamConstants.END_ELEMENT: if(RemoteCommons.endsWith(hierarchy,"workspaces","workspace")) { workspaces.add(new Workspace(cParams,characters.toString().trim())); } hierarchy.remove(hierarchy.size()-1); characters = new StringBuilder(); break; case XMLStreamConstants.CHARACTERS: characters.append(StringEscapeUtils.unescapeHtml(parser.getText())); break; } } }
Source:
<code><START> private LocationAvailability createLocationAvailability() { <END> LocationManager locationManager = (LocationManager) context.getSystemService( Context.LOCATION_SERVICE); boolean gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); boolean networkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); return new LocationAvailability(gpsEnabled || networkEnabled); }</code><technical_language>I if this method check step verify location provider is enabled LocationManager#getLastKnownLocation(provider) returns a non-null for provider</technical_language>

Target:
private LocationAvailability createLocationAvailability() { LocationManager locationManager = (LocationManager) context.getSystemService( Context.LOCATION_SERVICE); boolean gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); boolean networkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); boolean gpsLocationExists = locationManager.getLastKnownLocation( LocationManager.GPS_PROVIDER) != null; boolean networkLocationExists = locationManager.getLastKnownLocation( LocationManager.NETWORK_PROVIDER) != null; return new LocationAvailability((gpsEnabled && gpsLocationExists) || (networkEnabled && networkLocationExists)); }
Source:
<code>public PremisEventBuilder(String eventId, Resource eventType, Date date, PremisLogger premisLogger) { this.eventId = eventId; this.eventType = eventType; <START> this.date = date; <END> this.premisLogger = premisLogger; addEvent(); }</code><technical_language>is a reason hold date eventType instance variables PremisEventBuilder class, need live long enough for call addEvent, pass in parameters</technical_language>

Target:
public PremisEventBuilder(String eventId, Resource eventType, Date date, PremisLogger premisLogger) { this.eventId = eventId; this.premisLogger = premisLogger; addEvent(eventType, date); }
Source:
<code>protected @NonNull List<@NonNull TmfTreeDataModel> getTree(@NonNull ITmfStateSystem ss, @NonNull TimeQueryFilter filter, @Nullable IProgressMonitor monitor) throws StateSystemDisposedException { List<@NonNull Integer> attribs = ss.getSubAttributes(ITmfStateSystem.ROOT_ATTRIBUTE, false); List<@NonNull TmfTreeDataModel> retVal = new ArrayList<>(); for (Integer attrib : attribs) { String[] strings = <START> fCache.get(attrib); if (strings == null) { strings = ss.getFullAttributePathArray(attrib); fCache.put(attrib, strings); } <END> retVal.add(new TmfTreeDataModel(getId(attrib), getId(ITmfStateSystem.ROOT_ATTRIBUTE), strings[0])); } return retVal; }</code><technical_language>computeIfAbsent</technical_language>

Target:
protected @NonNull List<@NonNull TmfTreeDataModel> getTree(@NonNull ITmfStateSystem ss, @NonNull TimeQueryFilter filter, @Nullable IProgressMonitor monitor) throws StateSystemDisposedException { List<@NonNull Integer> attribs = ss.getSubAttributes(ITmfStateSystem.ROOT_ATTRIBUTE, false); List<@NonNull TmfTreeDataModel> retVal = new ArrayList<>(); for (Integer attrib : attribs) { String[] strings = fCache.computeIfAbsent(attrib, t -> ss.getFullAttributePathArray(t)); retVal.add(new TmfTreeDataModel(getId(attrib), getId(ITmfStateSystem.ROOT_ATTRIBUTE), strings[0])); } return retVal; }
Source:
<code>public List<Map<String, Object>> getActionLinks(BusinessObjectBase businessObject, Person user) { BatchFile batchFile = (BatchFile) businessObject; List<Map<String, Object>> actionLinks = new LinkedList<>(); if (canCreateDoneFile(batchFile, user)) { Map<String, Object> createDoneLink = new LinkedHashMap<>(); createDoneLink.put("label", "Create Done"); createDoneLink.put("url", KRAD_URL_PREFIX + getCreateDoneUrl(batchFile)); <START> createDoneLink.put("method", "GET"); <END> actionLinks.add(createDoneLink); } return actionLinks; }</code><technical_language>This class a lot of string literals for property names standard property values. some of replaced constants instead? (If needed, leaving as-is if intend perform cleanup this file in a future sprint.)</technical_language>

Target:
public List<Map<String, Object>> getActionLinks(BusinessObjectBase businessObject, Person user) { BatchFile batchFile = (BatchFile) businessObject; List<Map<String, Object>> actionLinks = new LinkedList<>(); if (canCreateDoneFile(batchFile, user)) { Map<String, Object> createDoneLink = new LinkedHashMap<>(); createDoneLink.put(CUKFSPropertyConstants.LOOKUP_RESULT_ACTION_LABEL, "Create Done"); createDoneLink.put(CUKFSPropertyConstants.LOOKUP_RESULT_ACTION_URL, KRAD_URL_PREFIX + getCreateDoneUrl(batchFile)); createDoneLink.put(CUKFSPropertyConstants.LOOKUP_RESULT_ACTION_METHOD, "GET"); actionLinks.add(createDoneLink); } return actionLinks; }
Source:
<code>public boolean matches(MethodParams params) { return params.are(EventMessage.class, EventContext.class) <START> && params.declaredAsClasses(); <END> }</code><technical_language>check params declared classes in a single place? Now, copy this check for signature</technical_language>

Target:
public boolean matches(MethodParams params) { return params.match(criteria); }
Source:
<code>public void displayNewPage(final PageTitle title, final HistoryEntry entry, boolean allowStateLoss) { ACRA.getErrorReporter().putCustomData("api", title.getSite().getApiDomain()); ACRA.getErrorReporter().putCustomData("title", title.toString()); if (drawerLayout.isDrawerOpen(Gravity.START)) { drawerLayout.closeDrawer(Gravity.START); } if (title.isSpecial()) { Utils.visitInExternalBrowser(this, Uri.parse(title.getMobileUri())); return; } resetFragments(allowStateLoss); fragmentContainerView.post(new Runnable() { @Override public void run() { PageViewFragmentInternal frag = getCurPageFragment(); if (frag == null) { return; } <START> if (frag.getCurrentTab().getBackStack().size() > 0 <END> && frag.getCurrentTab().getBackStack().get(frag.getCurrentTab().getBackStack().size() - 1).getTitle().equals(title)) { if (!TextUtils.isEmpty(title.getFragment())) { frag.scrollToSection(title.getFragment()); } return; } frag.closeFindInPage(); frag.displayNewPage(title, entry, false, true); app.getSessionFunnel().pageViewed(entry); } }); }</code><technical_language>instead of size() > 0 I prefer !isEmpty()</technical_language>

Target:
public void displayNewPage(final PageTitle title, final HistoryEntry entry, boolean allowStateLoss) { ACRA.getErrorReporter().putCustomData("api", title.getSite().getApiDomain()); ACRA.getErrorReporter().putCustomData("title", title.toString()); if (drawerLayout.isDrawerOpen(Gravity.START)) { drawerLayout.closeDrawer(Gravity.START); } if (title.isSpecial()) { Utils.visitInExternalBrowser(this, Uri.parse(title.getMobileUri())); return; } resetFragments(allowStateLoss); fragmentContainerView.post(new Runnable() { @Override public void run() { PageViewFragmentInternal frag = getCurPageFragment(); if (frag == null) { return; } if (!frag.getCurrentTab().getBackStack().isEmpty() && frag.getCurrentTab().getBackStack().get(frag.getCurrentTab().getBackStack().size() - 1).getTitle().equals(title)) { if (!TextUtils.isEmpty(title.getFragment())) { frag.scrollToSection(title.getFragment()); } return; } frag.closeFindInPage(); frag.displayNewPage(title, entry, false, true); app.getSessionFunnel().pageViewed(entry); } }); }
Source:
<code><START> public void dumpTrailer(PrintStream p, String indent, boolean noArmor) { <END> if (!noArmor) { p.print ("\n}\n"); } }</code><technical_language>'indent' is in this method</technical_language>

Target:
public void dumpTrailer(PrintStream p, String indent, boolean noArmor) { if (!noArmor) { p.print (indent+"\n}\n"); } }
Source:
<code>private void doResetStatistics() { progressBar.setVisibility(View.VISIBLE); feedStatisticsList.setVisibility(View.GONE); if (disposable != null) { disposable.dispose(); } <START> UserPreferences.resetUsageCounting(); <END> disposable = Completable.fromFuture(DBWriter.resetStatistics()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(this::refreshStatistics, error -> Log.e(TAG, Log.getStackTraceString(error))); }</code><technical_language>a safeguard, please move this .subscribe lambda? If for reason database call fails, date reset. I do this happen (or if happens, users care) feels more clean update is reset</technical_language>

Target:
private void doResetStatistics() { progressBar.setVisibility(View.VISIBLE); feedStatisticsList.setVisibility(View.GONE); if (disposable != null) { disposable.dispose(); } disposable = Completable.fromFuture(DBWriter.resetStatistics()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(() -> { refreshStatistics(); UserPreferences.resetUsageCountingDate(); }, error -> Log.e(TAG, Log.getStackTraceString(error))); }
Source:
<code>public void run() { long iteration = 0; Metronome metronome = SimpleMetronome.withFixedIntervalMs(intervalMs); SqlPredicate sqlPredicate = new SqlPredicate(sqlQuery); <START> Predicate predicate = new AgePredicate(56); <END> while (!testContext.isStopped()) { metronome.waitForNext(); if (customPredicate == true) { search.started(); map.values(predicate); search.done(); } else { search.started(); map.values(sqlPredicate); search.done(); } if (iteration % logFrequency == 0) { log.info(Thread.currentThread().getName() + " At iteration: " + iteration); } if (iteration % performanceUpdateFrequency == 0) { operations.addAndGet(performanceUpdateFrequency); } iteration++; } }</code><technical_language>OperationSelector configure Predicate completely runtime configuration. Instead of PUT, PUT_ASYNC, GET, GET_ASYNC etc. in other tests enum Predicates (NAME, AGE, SALARY, ACTIVE). In code prepare of depending operationSelector.select()</technical_language>

Target:
public void run() { long iteration = 0; Metronome metronome = SimpleMetronome.withFixedIntervalMs(intervalMs); SqlPredicate sqlPredicate = new SqlPredicate(sqlQuery); PredicateType type = selector.select(); AgePredicate agePredicate = new AgePredicate(30); NamePredicate namePredicate = new NamePredicate("aaa"); ActivePredicate activePredicate = new ActivePredicate(true); SalaryPredicate salaryPredicate = new SalaryPredicate(700.0); while (!testContext.isStopped()) { metronome.waitForNext(); search.started(); if (customPredicate) { switch (type){ case AGE: map.values(agePredicate); break; case NAME: map.values(namePredicate); break; case ACTIVE: map.values(activePredicate); break; case SALARY: map.values(salaryPredicate); break; default: log.severe("There is no predicate type like this"); } } else { map.values(sqlPredicate); } search.done(); iteration++; if (iteration % logFrequency == 0) { log.info(Thread.currentThread().getName() + " At iteration: " + iteration); } if (iteration % performanceUpdateFrequency == 0) { operations.addAndGet(performanceUpdateFrequency); } } operations.addAndGet(iteration % performanceUpdateFrequency); }
Source:
<code>public long objectSize() throws InternalException { if (this.objectSize == null) { throw new InternalException( <START> "buildHeaders(long objectSize, String etag) must be called prior this method invocation"); <END> } return this.objectSize; }</code><technical_language>suggestion "buildHeaders(long objectSize, String etag) called prior invocation of this method");</technical_language>

Target:
public long objectSize() throws InternalException { if (this.objectSize == null) { throw new InternalException( "buildHeaders(long objectSize, String etag) must be called prior to this method invocation"); } return this.objectSize; }
Source:
<code>private Response convertToResponse(Object retVal, Throwable throwable) { if (throwable != null) { throwable = CompletableFutures.extractException(throwable); if (throwable instanceof InterruptedException || throwable instanceof IllegalLifecycleStateException) { <START> log.debugf("Shutdown while handling command %s", command); <END> return shuttingDownResponse(); } else { CLUSTER.exceptionHandlingCommand(command, throwable); return exceptionHandlingCommand(throwable); } } else { if (retVal == null || retVal instanceof Response) { return (Response) retVal; } else { return SuccessfulResponse.create(retVal); } } }</code><technical_language>CLUSTER log CLUSTER.debugf("Shutdown while handling command %s", command);</technical_language>

Target:
private Response convertToResponse(Object retVal, Throwable throwable) { if (throwable != null) { throwable = CompletableFutures.extractException(throwable); if (throwable instanceof InterruptedException || throwable instanceof IllegalLifecycleStateException) { CLUSTER.debugf("Shutdown while handling command %s", command); return shuttingDownResponse(); } else { CLUSTER.exceptionHandlingCommand(command, throwable); return exceptionHandlingCommand(throwable); } } else { if (retVal == null || retVal instanceof Response) { return (Response) retVal; } else { return SuccessfulResponse.create(retVal); } } }
Source:
<code>public void isExecutable_HeaderCellSelected() { when(scenarioGridModelMock.getSelectedCells()).thenReturn(Collections.emptyList()); <START> when(scenarioGridModelMock.getSelectedHeaderCells()).thenReturn(Lists.create(selectedCell, selectedCell2)); <END> assertTrue(handler.isExecutable(scenarioGridMock)); }</code><technical_language>cell please</technical_language>

Target:
public void isExecutable_HeaderCellSelected() { when(scenarioGridModelMock.getSelectedCells()).thenReturn(Collections.emptyList()); when(scenarioGridModelMock.getSelectedHeaderCells()).thenReturn(Arrays.asList(selectedCell, selectedCell2)); assertTrue(handler.isExecutable(scenarioGridMock)); }
Source:
<code>public void show(List<NavItem> itemList) { this.navItemList = itemList; this.navSubgroupList.clear(); if (secure) { navItemList = new ArrayList<>(itemList); navigationManager.secure(navItemList, hideEmptyGroups); } view.clearItems(); if (navItemList.isEmpty()) { view.errorNavItemsEmpty(); } for (NavItem navChild : navItemList) { if (navChild instanceof NavGroup) { if (areSubGroupsSupported()) { showGroup((NavGroup) navChild); } else { <START> showItem(navChild); <END> } } else if (navChild instanceof NavDivider) { view.addDivider(); } else { showItem(navChild); } } }</code><technical_language>related this change: configure Menu Bar this: 1) set fixed number of levels (so some groups submenus displayed) 2) set target div -> menu items groups, clicking nothing. sense show Groups in menu bar, is "nowhere go" group</technical_language>

Target:
public void show(List<NavItem> itemList) { this.hide(); this.navItemList = itemList; this.navSubgroupList.clear(); if (secure) { navItemList = new ArrayList<>(itemList); navigationManager.secure(navItemList, hideEmptyGroups); } if (navItemList.isEmpty()) { view.errorNavItemsEmpty(); } for (NavItem navChild : navItemList) { if (navChild instanceof NavGroup) { if (areSubGroupsSupported()) { showGroup((NavGroup) navChild); } else { showItem(navChild); } } else if (navChild instanceof NavDivider) { view.addDivider(); } else { showItem(navChild); } } }
Source:
<code>private IdToken(String idtoken) throws UnsupportedEncodingException, JSONException{ int firstDot = idtoken.indexOf("."); int secondDot = idtoken.indexOf(".", firstDot + 1); int invalidDot = idtoken.indexOf(".", secondDot + 1); if (invalidDot == -1 && firstDot > 0 && secondDot > 0) { String idbody = idtoken.substring(firstDot + 1, secondDot); byte[] data = Base64.decode(idbody, Base64.URL_SAFE); String decodedBody = new String(data, "UTF-8"); HashMap<String, String> responseItems = new HashMap<String, String>(); extractJsonObjects(responseItems, decodedBody); if (responseItems != null && !responseItems.isEmpty()) { this.mSubject = responseItems .get(AuthenticationConstants.OAuth2.ID_TOKEN_SUBJECT); this.mTenantId = responseItems .get(AuthenticationConstants.OAuth2.ID_TOKEN_TENANTID); this.mUpn = responseItems .get(AuthenticationConstants.OAuth2.ID_TOKEN_UPN); this.mEmail = responseItems .get(AuthenticationConstants.OAuth2.ID_TOKEN_EMAIL); this.mGivenName = responseItems .get(AuthenticationConstants.OAuth2.ID_TOKEN_GIVEN_NAME); this.mFamilyName = responseItems .get(AuthenticationConstants.OAuth2.ID_TOKEN_FAMILY_NAME); this.mIdentityProvider = responseItems .get(AuthenticationConstants.OAuth2.ID_TOKEN_IDENTITY_PROVIDER); this.mObjectId = responseItems .get(AuthenticationConstants.OAuth2.ID_TOKEN_OBJECT_ID); String expiration = responseItems .get(AuthenticationConstants.OAuth2.ID_TOKEN_PASSWORD_EXPIRATION); if (!StringExtensions.IsNullOrBlank(expiration)) { <START> this.mPasswordExpiration = Long.parseLong(expiration); <END> } this.mPasswordChangeUrl = responseItems .get(AuthenticationConstants.OAuth2.ID_TOKEN_PASSWORD_CHANGE_URL); } } }</code><technical_language>tab</technical_language>

Target:
public IdToken(String idtoken) throws AuthenticationException { final HashMap<String, String> responseItems = this.parseJWT(idtoken); if (responseItems != null && !responseItems.isEmpty()) { this.mSubject = responseItems.get(AuthenticationConstants.OAuth2.ID_TOKEN_SUBJECT); this.mTenantId = responseItems.get(AuthenticationConstants.OAuth2.ID_TOKEN_TENANTID); this.mUpn = responseItems.get(AuthenticationConstants.OAuth2.ID_TOKEN_UPN); this.mEmail = responseItems.get(AuthenticationConstants.OAuth2.ID_TOKEN_EMAIL); this.mGivenName = responseItems.get(AuthenticationConstants.OAuth2.ID_TOKEN_GIVEN_NAME); this.mFamilyName = responseItems.get(AuthenticationConstants.OAuth2.ID_TOKEN_FAMILY_NAME); this.mIdentityProvider = responseItems.get(AuthenticationConstants.OAuth2.ID_TOKEN_IDENTITY_PROVIDER); this.mObjectId = responseItems.get(AuthenticationConstants.OAuth2.ID_TOKEN_OBJECT_ID); final String expiration = responseItems.get(AuthenticationConstants.OAuth2.ID_TOKEN_PASSWORD_EXPIRATION); if (!StringExtensions.IsNullOrBlank(expiration)) { this.mPasswordExpiration = Long.parseLong(expiration); } this.mPasswordChangeUrl = responseItems.get(AuthenticationConstants.OAuth2.ID_TOKEN_PASSWORD_CHANGE_URL); } }
Source:
<code>private void fillParentJobIdIfExistsInGenInfo(Job userJob, InternalJob job) { <START> if (userJob.getGenericInformation().containsKey(PARENT_JOB_ID)) { <END> String parentJobIdString = userJob.getGenericInformation().get(PARENT_JOB_ID); try { long parentJobId = Long.parseLong(parentJobIdString); job.setParentId(parentJobId); } catch (NumberFormatException e) { logger.error("Cannot parse '" + PARENT_JOB_ID + "' in the generic info: " + parentJobIdString); } } }</code><technical_language>I generic information map null</technical_language>

Target:
private void fillParentJobIdIfExistsInGenInfo(Job userJob, InternalJob job) { if (userJob.getGenericInformation() != null && userJob.getGenericInformation().containsKey(PARENT_JOB_ID)) { String parentJobIdString = userJob.getGenericInformation().get(PARENT_JOB_ID); try { long parentJobId = Long.parseLong(parentJobIdString); job.setParentId(parentJobId); } catch (NumberFormatException e) { logger.error("Cannot parse '" + PARENT_JOB_ID + "' in the generic info: " + parentJobIdString); } } }
Source:
<code>public static JsonSchemaNode createSchema(JsonParser parser) throws IOException { JsonSchemaNode dummy = new JsonSchemaStructNode(null); JsonSchemaStructNode parent = (JsonSchemaStructNode) dummy; JsonToken currentToken = parser.nextToken(); int nameLocation = -1; while (currentToken != null) { if (currentToken.isStructStart()) { JsonSchemaStructNode structNode = new JsonSchemaStructNode(parent); JsonSchemaNameValue nameValue = new JsonSchemaNameValue(nameLocation, structNode); parent.addChild(nameValue); parent = structNode; nameLocation = -1; } else if (currentToken == JsonToken.FIELD_NAME) { nameLocation = (int) getLocation(parser.getTokenLocation()); } else if (currentToken.isStructEnd()) { parent = parent.getParent(); nameLocation = -1; } else { JsonSchemaTerminalNode terminalNode = new JsonSchemaTerminalNode(parent); terminalNode.setValueStartLocation((int) getLocation(parser.getTokenLocation())); JsonSchemaNameValue nameValue = new JsonSchemaNameValue(nameLocation, terminalNode); parent.addChild(nameValue); nameLocation = -1; } currentToken = parser.nextToken(); } JsonSchemaNameValue nameValue = ((JsonSchemaStructNode) dummy).getChild(0); if (nameValue == null) { return null; } <START> dummy = nameValue.getValue(); <END> dummy.setParent(null); return dummy; }</code><technical_language>Minor: in extreme case provided JSON is empty string, this fail IndexOutOfBoundsException</technical_language>

Target:
public static JsonSchemaNode createSchema(JsonParser parser) throws IOException { JsonSchemaNode dummy = new JsonSchemaStructNode(null); JsonSchemaStructNode parent = (JsonSchemaStructNode) dummy; JsonToken currentToken = parser.nextToken(); int nameLocation = -1; if (currentToken == null) { return null; } while (currentToken != null) { if (currentToken.isStructStart()) { JsonSchemaStructNode structNode = new JsonSchemaStructNode(parent); JsonSchemaNameValue nameValue = new JsonSchemaNameValue(nameLocation, structNode); parent.addChild(nameValue); parent = structNode; nameLocation = -1; } else if (currentToken == JsonToken.FIELD_NAME) { nameLocation = (int) getTokenLocation(parser); } else if (currentToken.isStructEnd()) { parent = parent.getParent(); nameLocation = -1; } else { JsonSchemaTerminalNode terminalNode = new JsonSchemaTerminalNode(parent); terminalNode.setValueStartLocation((int) getTokenLocation(parser)); JsonSchemaNameValue nameValue = new JsonSchemaNameValue(nameLocation, terminalNode); parent.addChild(nameValue); nameLocation = -1; } currentToken = parser.nextToken(); } JsonSchemaNameValue nameValue = ((JsonSchemaStructNode) dummy).getChild(0); if (nameValue == null) { return null; } dummy = nameValue.getValue(); dummy.setParent(null); return dummy; }
Source:
<code>public void onUnPublish() { logger.info("Stop recording: entry Id [" + liveEntry.id + "], asset Id [" + liveAsset.id + "], current media server index: " + index); if (liveAsset.tags.contains(Constants.RECORDING_ANCHOR_TAG_VALUE) && KalturaEntryServerNodeType.LIVE_PRIMARY.equals(index)) { logger.info("Cancel replacement is required"); if (liveEntry.recordedEntryId != null && liveEntry.recordedEntryId.length() > 0) { <START> if (!isNewLiveRecordingEnabled) { <END> KalturaAPI.getKalturaAPI().cancelReplace(liveEntry); } } } this.isLastChunk = true; super.onUnPublish(); this.stopRecording(); entryRecorders.remove(liveEntry.id); this.removeListener(this); }</code><technical_language>please fix if in if in if</technical_language>

Target:
public void onUnPublish() { logger.info("Stop recording: entry Id [" + liveEntry.id + "], asset Id [" + liveAsset.id + "], current media server index: " + index); if (liveAsset.tags.contains(Constants.RECORDING_ANCHOR_TAG_VALUE) && KalturaEntryServerNodeType.LIVE_PRIMARY.equals(index)) { logger.info("Cancel replacement is required"); if (liveEntry.recordedEntryId != null && liveEntry.recordedEntryId.length() > 0 && !isNewLiveRecordingEnabled) { KalturaAPI.getKalturaAPI().cancelReplace(liveEntry); } } this.isLastChunk = true; super.onUnPublish(); this.stopRecording(); entryRecorders.remove(liveEntry.id); this.removeListener(this); }
Source:
<code>private void makeInsert(final ActionInsertFactCol52 column) { if (!addedInserts.contains(column.getBoundName())) { makeHeaderAndTitle(ACTION, ""); <START> fieldRow.createCell(columnIndex).setCellValue(String.format("%s %s = new %s(); insert( %s );", <END> column.getFactType(), column.getBoundName(), column.getFactType(), column.getBoundName())); addedInserts.add(column.getBoundName()); columnIndex++; } makeHeaderAndTitle(ACTION, column.getHeader()); fieldRow.createCell(columnIndex).setCellValue(makeSetMethod(column.getBoundName(), column.getFactField(), "$param")); }</code><technical_language>MessageFormat pass column.getBoundName()</technical_language>

Target:
private void makeInsert(final ActionInsertFactCol52 column) { if (!addedInserts.contains(column.getBoundName())) { makeHeaderAndTitle(ACTION, ""); fieldRow.createCell(targetColumnIndex).setCellValue(MessageFormat.format("{0} {1} = new {2}(); insert( {1} );", column.getFactType(), column.getBoundName(), column.getFactType())); addedInserts.add(column.getBoundName()); targetColumnIndex++; } makeHeaderAndTitle(ACTION, column.getHeader()); fieldRow.createCell(targetColumnIndex).setCellValue(makeSetMethod(column.getBoundName(), column.getFactField(), "$param")); }
Source:
<code>protected Map<Locator, MetricData> resultSetsToMetricData(Map<Locator, List<ResultSetFuture>> resultSets, Map<Locator, RollupType> locatorRollupType, Granularity granularity) { Map<Locator, MetricData> locatorMetricDataMap = new HashMap<Locator, MetricData>(); for (Map.Entry<Locator, List<ResultSetFuture>> entry : resultSets.entrySet() ) { Locator locator = entry.getKey(); List<ResultSetFuture> futures = entry.getValue(); try { RollupType rollupType = locatorRollupType.get(locator); DAbstractPreaggregatedIO io = rollupTypeToIO.get(rollupType); Table<Locator, Long, Rollup> locatorTimestampRollup = io.toLocatorTimestampRollup(futures, locator, granularity); Points<Rollup> points = convertToPoints(locatorTimestampRollup.row(locator)); DataType dataType = getDataType(locator, MetricMetadata.TYPE.name().toLowerCase()); MetricData.Type outputType = MetricData.Type.from(rollupType, dataType); MetricData metricData = new MetricData(points, getUnitString(locator), outputType); locatorMetricDataMap.put(locator, metricData); <START> } catch (Exception ex) { <END> Instrumentation.markReadError(); LOG.error(String.format("error reading preaggregated metric for locator %s, granularity %s", locator, granularity), ex); } } return locatorMetricDataMap; }</code><technical_language>throws exception here</technical_language>

Target:
protected Map<Locator, MetricData> resultSetsToMetricData(Map<Locator, List<ResultSetFuture>> resultSets, Map<Locator, RollupType> locatorRollupType, Granularity granularity) { Map<Locator, MetricData> locatorMetricDataMap = new HashMap<Locator, MetricData>(); for (Map.Entry<Locator, List<ResultSetFuture>> entry : resultSets.entrySet() ) { Locator locator = entry.getKey(); List<ResultSetFuture> futures = entry.getValue(); try { RollupType rollupType = locatorRollupType.get(locator); DAbstractPreaggregatedIO io = rollupTypeToIO.get(rollupType); Table<Locator, Long, Rollup> locatorTimestampRollup = io.toLocatorTimestampRollup(futures, locator, granularity); Points<Rollup> points = convertToPoints(locatorTimestampRollup.row(locator)); DataType dataType = getDataType(locator, MetricMetadata.TYPE.name().toLowerCase()); MetricData.Type outputType = MetricData.Type.from(rollupType, dataType); MetricData metricData = new MetricData(points, getUnitString(locator), outputType); locatorMetricDataMap.put(locator, metricData); } catch (CacheException ex) { Instrumentation.markReadError(); LOG.error(String.format("error getting dataType for locator %s, granularity %s", locator, granularity), ex); } } return locatorMetricDataMap; }
Source:
<code>public void getSettingsShouldReturnSettings() { <START> HashMap<String, String> customStatus = new HashMap<String, String>(){ { <END> put("currency", "USD"); put("hasNewsSubscription", "true"); put("hasOtpEnabled", "false"); put("theme", "minimalistic"); put("internationalizationUserSettingLanguage", "en-US"); put("internationalizationUserSettingDateTimeFormat", "en-GB"); put("internationalizationUserSettingNumberFormat", "en-AU"); } }; User user = Fixtures.loadUser(customStatus); Assert.assertEquals(user.getSettings().getCurrency(), "USD"); Assert.assertTrue(user.getSettings().getHasNewsSubscription()); Assert.assertFalse(user.getSettings().getHasOtpEnabled()); Assert.assertEquals(user.getSettings().getTheme(), "minimalistic"); Assert.assertEquals(user.getSettings().getIntl().getLanguage().getLocale(), "en-US"); Assert.assertEquals(user.getSettings().getIntl().getDateTimeFormat().getLocale(), "en-GB"); Assert.assertEquals(user.getSettings().getIntl().getNumberFormat().getLocale(), "en-AU"); }</code><technical_language>Add whitespace { {. - Remove whitespace { {</technical_language>

Target:
public void getSettingsShouldReturnSettings() { HashMap<String, String> data = new HashMap<String, String>() {{ put("currency", "USD"); put("hasNewsSubscription", "true"); put("hasOtpEnabled", "false"); put("theme", "minimalistic"); put("internationalizationUserSettingLanguage", "en-US"); put("internationalizationUserSettingDateTimeFormat", "en-GB"); put("internationalizationUserSettingNumberFormat", "en-AU"); }}; User user = Fixtures.loadUser(data); Assert.assertEquals(user.getSettings().getCurrency(), "USD"); Assert.assertTrue(user.getSettings().getHasNewsSubscription()); Assert.assertFalse(user.getSettings().getHasOtpEnabled()); Assert.assertEquals(user.getSettings().getTheme(), "minimalistic"); Assert.assertEquals(user.getSettings().getIntl().getLanguage().getLocale(), "en-US"); Assert.assertEquals(user.getSettings().getIntl().getDateTimeFormat().getLocale(), "en-GB"); Assert.assertEquals(user.getSettings().getIntl().getNumberFormat().getLocale(), "en-AU"); }
Source:
<code>public void testGetObjectOnDateReturnsSqlDate() throws Exception { Date date = new Date( 123456789 ); setNextRow( new Object[] { date } ); rowMeta.addValueMeta( new ValueMetaDate( "theDate" ) ); getTestObject().next(); Object value = getTestObject().getObject( 1 ); assertEquals( "java.sql.Timestamp", value.getClass().getName() ); <START> assertTrue( value.toString().startsWith( "1970-01-02 " ) ); <END> }</code><technical_language>startsWith instead of asserting full string</technical_language>

Target:
public void testGetObjectOnDateReturnsSqlDate() throws Exception { Date date = new Date( 123456789 ); setNextRow( new Object[] { date } ); rowMeta.addValueMeta( new ValueMetaDate( "theDate" ) ); getTestObject().next(); Object value = getTestObject().getObject( 1 ); assertEquals( "java.sql.Timestamp", value.getClass().getName() ); Timestamp timestampValue = (Timestamp) value; assertEquals( "2 Jan 1970 10:17:36 GMT", timestampValue.toGMTString() ); }
Source:
<code>public static PaxosResources create( TimelockPaxosInstallationContext install, MetricsManager metrics, Supplier<PaxosRuntimeConfiguration> paxosRuntime, ExecutorService sharedExecutor) { PaxosRemoteClients remoteClients = ImmutablePaxosRemoteClients.of(install, metrics); <START> HikariDataSource sqliteDataSource = SqliteConnections.getPooledDataSource(install.sqliteDataDirectory()); <END> ImmutablePaxosResources.Builder resourcesBuilder = setupTimestampResources( install, sqliteDataSource, metrics, paxosRuntime, sharedExecutor, remoteClients); if (install.useLeaderForEachClient()) { return configureLeaderForEachClient( resourcesBuilder, install, sqliteDataSource, metrics, paxosRuntime, sharedExecutor, remoteClients); } else { return configureLeaderForAllClients( resourcesBuilder, install, sqliteDataSource, metrics, paxosRuntime, sharedExecutor, remoteClients); } }</code><technical_language>create this TimeLockAgent inject</technical_language>

Target:
public static PaxosResources create( TimelockPaxosInstallationContext install, MetricsManager metrics, Supplier<PaxosRuntimeConfiguration> paxosRuntime, ExecutorService sharedExecutor) { PaxosRemoteClients remoteClients = ImmutablePaxosRemoteClients.of(install, metrics); ImmutablePaxosResources.Builder resourcesBuilder = setupTimestampResources( install, metrics, paxosRuntime, sharedExecutor, remoteClients); if (install.useLeaderForEachClient()) { return configureLeaderForEachClient( resourcesBuilder, install, metrics, paxosRuntime, sharedExecutor, remoteClients); } else { return configureLeaderForAllClients( resourcesBuilder, install, metrics, paxosRuntime, sharedExecutor, remoteClients); } }
Source:
<code>public void addDescription(ConceptDescription description) { if (description != null && StringUtils.isNotBlank(description.getDescription()) && (!descriptions.contains(description))) { <START> description.setConcept(this); <END> descriptions.add(description); } }</code><technical_language>@mavrk I mixed tabs whitespaces in description.setConcept(this) line. in OpenMRS tabs. Please remove whitespaces</technical_language>

Target:
public void addDescription(ConceptDescription description) { if (description != null && StringUtils.isNotBlank(description.getDescription()) && !descriptions.contains(description)) { description.setConcept(this); descriptions.add(description); } }
Source:
<code><START> public static String makeRandomId(int l) { <END> if (l<=0) return ""; char[] id = new char[l]; int d = random.nextInt( (26+26) * (26+26+10) * (26+26+10) * (26+26+10) * (26+26+10)); int i = 0; id[i] = idCharsStart.charAt(d % (26+26)); d /= (26+26); if (++i<l) do { id[i] = idCharsSubseq.charAt(d%(26+26+10)); if (++i>=l) break; if (i%5==0) { d = random.nextInt( (26+26+10) * (26+26+10) * (26+26+10) * (26+26+10) * (26+26+10)); } else { d /= (26+26+10); } } while (true); return new String(id); }</code><technical_language>This is in IdGenerator, deleted here</technical_language>

Target:
public static String makeRandomId(int l) { return Identifiers.makeRandomId(l); }
Source:
<code>public byte[] getData() { <START> Object base = slice.getBase(); <END> checkState(base instanceof byte[], "unexpected serialization type %s", base.getClass()); byte[] bytes = (byte[]) base; if (slice.isCompact()) { return bytes; } return slice.getBytes(); }</code><technical_language>this lines happen in this if branch? I need get base if slice is compact</technical_language>

Target:
public byte[] getData() { if (slice.isCompact()) { Object base = slice.getBase(); checkState(base instanceof byte[], "unexpected serialization type %s", base.getClass()); return (byte[]) base; } return slice.getBytes(); }
Source:
<code><START> public void deleteSslCert(final DeleteSslCertCmd deleteSslCertCmd) { <END> final CallContext ctx = CallContext.current(); final Account caller = ctx.getCallingAccount(); final Long certId = deleteSslCertCmd.getId(); final SslCertVO certVO = _sslCertDao.findById(certId); if (certVO == null) { throw new InvalidParameterValueException("Invalid certificate id: " + certId); } _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, true, certVO); final List<LoadBalancerCertMapVO> lbCertRule = _lbCertDao.listByCertId(certId); if (lbCertRule != null && !lbCertRule.isEmpty()) { String lbUuids = ""; for (final LoadBalancerCertMapVO rule : lbCertRule) { final LoadBalancerVO lb = _entityMgr.findById(LoadBalancerVO.class, rule.getLbId()); lbUuids += " " + lb.getUuid(); } throw new CloudRuntimeException("Certificate in use by a loadbalancer(s)" + lbUuids); } _sslCertDao.remove(certId); }</code><technical_language>Please consider adding a Preconditions.checkArgument check deleteSslCertCmd is null</technical_language>

Target:
public void deleteSslCert(final DeleteSslCertCmd deleteSslCertCmd) { Preconditions.checkNotNull(deleteSslCertCmd); final CallContext ctx = CallContext.current(); final Account caller = ctx.getCallingAccount(); final Long certId = deleteSslCertCmd.getId(); final SslCertVO certVO = _sslCertDao.findById(certId); if (certVO == null) { throw new InvalidParameterValueException("Invalid certificate id: " + certId); } _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, true, certVO); final List<LoadBalancerCertMapVO> lbCertRule = _lbCertDao.listByCertId(certId); if (lbCertRule != null && !lbCertRule.isEmpty()) { String lbUuids = ""; for (final LoadBalancerCertMapVO rule : lbCertRule) { final LoadBalancerVO lb = _entityMgr.findById(LoadBalancerVO.class, rule.getLbId()); lbUuids += " " + lb.getUuid(); } throw new CloudRuntimeException("Certificate in use by a loadbalancer(s)" + lbUuids); } _sslCertDao.remove(certId); }
Source:
<code>public boolean isConcurrentTaskInWork() { <START> return this.currentTask.getId() < 0 || !getConcurrentTasksInWork().isEmpty(); <END> }</code><technical_language>id smaller 0</technical_language>

Target:
public boolean isConcurrentTaskInWork() { return !getConcurrentTasksInWork().isEmpty(); }
Source:
<code>protected List<Diff> getDifferencesToMerge() { List<Diff> differencesToMerge = newArrayList(selectedDifferences); if (cascadingDifferencesFilterEnabled) { Set<Diff> setToMerge = Sets.newHashSet(differencesToMerge); <START> for (Diff difftoMerge : ImmutableSet.copyOf(setToMerge)) { <END> IMerger merger = mergerRegistry.getHighestRankingMerger(difftoMerge); if (merger instanceof IMerger2) { addAll(setToMerge, ((IMerger2)merger).getDirectMergeDependencies(difftoMerge, !leftToRight)); } } Iterable<Diff> cascadingDifferences = concat(transform(setToMerge, ComparisonUtil .getSubDiffs(leftToRight))); addAll(differencesToMerge, cascadingDifferences); } return differencesToMerge; }</code><technical_language>copy twice? iterate "differencesToMerge"</technical_language>

Target:
protected List<Diff> getDifferencesToMerge() { List<Diff> differencesToMerge = newArrayList(selectedDifferences); if (cascadingDifferencesFilterEnabled) { Set<Diff> setToMerge = Sets.newHashSet(differencesToMerge); for (Diff difftoMerge : differencesToMerge) { IMerger merger = mergerRegistry.getHighestRankingMerger(difftoMerge); if (merger instanceof IMerger2) { addAll(setToMerge, ((IMerger2)merger).getDirectMergeDependencies(difftoMerge, !leftToRight)); } } Iterable<Diff> cascadingDifferences = concat(transform(setToMerge, ComparisonUtil .getSubDiffs(leftToRight))); addAll(differencesToMerge, cascadingDifferences); } return differencesToMerge; }
Source:
<code>private void sendMessage() { TextInputControl messageTextField = messageTextField(); messageTextField.setDisable(true); final String text = messageTextField.getText(); chatService.sendMessageInBackground(receiver, text).thenAccept(message -> { messageTextField.clear(); messageTextField.setDisable(false); messageTextField.requestFocus(); }).exceptionally(throwable -> { <START> throwable = throwable instanceof CompletionException ? throwable.getCause() : throwable; <END> logger.warn("Message could not be sent: {}", text, throwable); notificationService.addNotification(new ImmediateErrorNotification( i18n.get("errorTitle"), i18n.get("chat.sendFailed"), throwable, i18n, reportingService) ); messageTextField.setDisable(false); messageTextField.requestFocus(); return null; }); }</code><technical_language>Amen. This bothered for ages :D</technical_language>

Target:
private void sendMessage() { TextInputControl messageTextField = messageTextField(); messageTextField.setDisable(true); final String text = messageTextField.getText(); chatService.sendMessageInBackground(receiver, text).thenAccept(message -> { messageTextField.clear(); messageTextField.setDisable(false); messageTextField.requestFocus(); }).exceptionally(throwable -> { throwable = ConcurrentUtil.unwrapIfCompletionException(throwable); logger.warn("Message could not be sent: {}", text, throwable); notificationService.addNotification(new ImmediateErrorNotification( i18n.get("errorTitle"), i18n.get("chat.sendFailed"), throwable, i18n, reportingService) ); messageTextField.setDisable(false); messageTextField.requestFocus(); return null; }); }
Source:
<code>private void initialize() { this.contentResolver.registerContentObserver(getContentUri(), true, getContentObserver()); Observable<ContentProviderOperation> operationObservable = updateSubject <START> .flatMap(pair -> createOperation(pair.first, pair.second)); <END> updateSubscription = groupOperations(operationObservable) .observeOn(Schedulers.computation()) .map(ArrayList::new) .doOnNext(list -> Log.v(TAG, "Grouped list of " + list.size())) .doOnNext(operations -> { try { ContentProviderResult[] result = contentResolver.applyBatch(getAuthority(), operations); Log.v(TAG, String.format("Applied %s operations", result.length)); } catch (RemoteException | OperationApplicationException e) { Log.e(TAG, "Error applying operations", e); } }) .flatMap(Observable::from) .map(ContentProviderOperation::getUri) .subscribe(locker::release, error -> Log.e(TAG, "Error while handling data! Processing may be blocked.", error)); }</code><technical_language>scheduler fo createOperation, is this design</technical_language>

Target:
private void initialize() { contentResolver.registerContentObserver(getContentUri(), true, getContentObserver()); Observable<ContentProviderOperation> operationObservable = updateSubject .onBackpressureBuffer() .observeOn(Schedulers.io()) .flatMap(pair -> createOperation(pair.first, pair.second)); updateSubscription = groupOperations(operationObservable) .observeOn(Schedulers.computation()) .map(ArrayList::new) .doOnNext(list -> Log.v(TAG, "Grouped list of " + list.size())) .doOnNext(operations -> { try { ContentProviderResult[] result = contentResolver.applyBatch(getAuthority(), operations); Log.v(TAG, String.format("Applied %s operations", result.length)); } catch (RemoteException | OperationApplicationException e) { Log.e(TAG, "Error applying operations", e); } }) .flatMap(Observable::from) .map(ContentProviderOperation::getUri) .subscribe(locker::release, error -> Log.e(TAG, "Error while handling data update!", error)); }
Source:
<code>private void generateResponseParser(final Ds3Request ds3Request) throws IOException, TemplateException { final Template tmpl = getResponseParserTemplate(ds3Request); final ResponseParser responseParser = toResponseParser(ds3Request); final Path responsePath = toResponseParserPath(responseParser.getName()); <START> LOG.info("Getting outputstream for file:" + responsePath.toString()); <END> try (final OutputStream outStream = fileUtils.getOutputFile(responsePath); final Writer writer = new OutputStreamWriter(outStream)) { tmpl.process(responseParser, writer); } }</code><technical_language>format style instead of concatenation</technical_language>

Target:
private void generateResponseParser(final Ds3Request ds3Request) throws IOException, TemplateException { final Template tmpl = getResponseParserTemplate(ds3Request); final ResponseParser responseParser = toResponseParser(ds3Request); final Path responsePath = toResponseParserPath(responseParser.getName()); LOG.info("Getting outputstream for file: {}", responsePath.toString()); try (final OutputStream outStream = fileUtils.getOutputFile(responsePath); final Writer writer = new OutputStreamWriter(outStream)) { tmpl.process(responseParser, writer); } }
Source:
<code>public static void cleanup(Job job) throws IOException { final Path jobDir = getJobPath(job.getJobID(), job.getWorkingDirectory()); final FileSystem fs = jobDir.getFileSystem(job.getConfiguration()); JobHelper.deleteWithRetry(fs, jobDir, true); <START> JobHelper.deleteWithRetry(fs, getJobClassPathDir(job.getJobName(), job.getWorkingDirectory()), true); <END> }</code><technical_language>this fire of if prior delete succeeds</technical_language>

Target:
public static void cleanup(Job job) throws IOException { final Path jobDir = getJobPath(job.getJobID(), job.getWorkingDirectory()); final FileSystem fs = jobDir.getFileSystem(job.getConfiguration()); RuntimeException e = null; try { JobHelper.deleteWithRetry(fs, jobDir, true); } catch (RuntimeException ex) { e = ex; } try { JobHelper.deleteWithRetry(fs, getJobClassPathDir(job.getJobName(), job.getWorkingDirectory()), true); } catch (RuntimeException ex) { if (e == null) { e = ex; } else { e.addSuppressed(ex); } } if (e != null) { throw e; } }
Source:
<code><START> private DocumentMetadata.Builder createBasicMetadata(Result sourceResult, <END> DocumentMetadata.Builder metaBuilder) { handlePublicationType(sourceResult.getInstance(), metaBuilder); handleTitle(sourceResult.getTitle(), metaBuilder); handleDescription(sourceResult.getDescription(), metaBuilder); handleLanguage(sourceResult.getLanguage(), metaBuilder); handlePublisher(sourceResult.getPublisher(), metaBuilder); if (sourceResult instanceof Publication) { handleJournal(((Publication)sourceResult).getJournal(), metaBuilder); } handleYear(sourceResult.getDateofacceptance(), metaBuilder); handleKeywords(sourceResult.getSubject(), metaBuilder); return metaBuilder; }</code><technical_language>IDE return is</technical_language>

Target:
private void createBasicMetadata(Result sourceResult, DocumentMetadata.Builder metaBuilder) { handlePublicationType(sourceResult.getInstance(), metaBuilder); handleTitle(sourceResult.getTitle(), metaBuilder); handleDescription(sourceResult.getDescription(), metaBuilder); handleLanguage(sourceResult.getLanguage(), metaBuilder); handlePublisher(sourceResult.getPublisher(), metaBuilder); if (sourceResult instanceof Publication) { handleJournal(((Publication)sourceResult).getJournal(), metaBuilder); } handleYear(sourceResult.getDateofacceptance(), metaBuilder); handleKeywords(sourceResult.getSubject(), metaBuilder); }
Source:
<code>public String toString() { <START> return String.format( <END> "%s: '%s' violated quota. Actual: %f, Threshold: %f", getClass().getName(), metricName, value, bound); }</code><technical_language>Do need String.format here? String concat fine</technical_language>

Target:
public String toString() { return getClass().getName() + ": '" + metricName + "' violated quota. Actual: " + value + ", Threshold: " + bound; }