auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void mouseUp(MouseEvent e) { if (fPendingMenuDetectEvent != null && e.button == 3 && _dragX == _dragX0) { setCapture(false); _dragState = DRAG_NONE; <START> menuDetectedImpl(fPendingMenuDetectEvent); <END> } if (DRAG_NONE != _dragState) { setCapture(false); if (e.button == 1 && DRAG_TRACE_ITEM == _dragState) { _timeProvider.notifyStartFinishTime(); if (_dragX == _dragX0) { long time = getTimeAtX(e.x); _timeProvider.setSelectedTimeNotify(time, false); } _dragState = DRAG_NONE; } else if (e.button == 1 && DRAG_SPLIT_LINE == _dragState) { redraw(); _dragState = DRAG_NONE; } else if (e.button == 3 && DRAG_ZOOM == _dragState) { Point size = getCtrlSize(); int nameWidth = _timeProvider.getNameSpace(); int x = e.x - nameWidth; if (Math.max(_dragX, _dragX0) > nameWidth && _dragX != _dragX0) { long time0 = getTimeAtX(_dragX0); long time1 = getTimeAtX(_dragX); if (time0 < time1) { _timeProvider.setStartFinishTimeNotify(time0, time1); } else { _timeProvider.setStartFinishTimeNotify(time1, time0); } } else { redraw(); } _dragState = DRAG_NONE; } } }</code><technical_language>In corner case left mouse button is currently drag (DRAG_TRACE_ITEM), mouse is returned start position, right mouse button is clicked, this handle menuDetected event abort left mouse drag. Instead right mouse click ignored</technical_language>

Target:
public void mouseUp(MouseEvent e) { if (fPendingMenuDetectEvent != null && e.button == 3) { menuDetected(fPendingMenuDetectEvent); } if (DRAG_NONE != _dragState) { setCapture(false); if (e.button == 1 && DRAG_TRACE_ITEM == _dragState) { if (_dragX == _dragX0) { long time = getTimeAtX(e.x); _timeProvider.setSelectedTimeNotify(time, false); } else { _timeProvider.notifyStartFinishTime(); } _dragState = DRAG_NONE; } else if (e.button == 1 && DRAG_SPLIT_LINE == _dragState) { redraw(); _dragState = DRAG_NONE; } else if (e.button == 3 && DRAG_ZOOM == _dragState) { int nameWidth = _timeProvider.getNameSpace(); if (Math.max(_dragX, _dragX0) > nameWidth && _dragX != _dragX0) { long time0 = getTimeAtX(_dragX0); long time1 = getTimeAtX(_dragX); if (time0 < time1) { _timeProvider.setStartFinishTimeNotify(time0, time1); } else { _timeProvider.setStartFinishTimeNotify(time1, time0); } } else { redraw(); } _dragState = DRAG_NONE; } } }
Source:
<code>public OMElement serialize(OMElement parent) { OMElement call = fac.createOMElement("call", synNS); saveTracingState(call, this); Endpoint activeEndpoint = getEndpoint(); if (activeEndpoint != null) { call.addChild(EndpointSerializer.getElementFromEndpoint(activeEndpoint)); } <START> call.addAttribute(fac.createOMAttribute("blocking",nullNS,Boolean.toString(getBlocking()))); <END> if (parent != null) { parent.addChild(call); } return call; }</code><technical_language>Add attribute if blocking is true</technical_language>

Target:
public OMElement serialize(OMElement parent) { OMElement call = fac.createOMElement("call", synNS); saveTracingState(call, this); Endpoint activeEndpoint = getEndpoint(); if (activeEndpoint != null) { call.addChild(EndpointSerializer.getElementFromEndpoint(activeEndpoint)); } if (blocking==true) { call.addAttribute(fac.createOMAttribute("blocking", nullNS, Boolean.toString(getBlocking()))); } if (parent != null) { parent.addChild(call); } return call; }
Source:
<code>private void checkDayTypeMapping(final DayProfile dayProfile) { <START> assertEquals(new Integer(BigInteger.TEN.intValue()), dayProfile.getDayId()); <END> assertEquals(new Integer(BigInteger.ZERO.intValue()), dayProfile.getDayProfileActionList().get(0) .getScriptSelector()); assertEquals(10, dayProfile.getDayProfileActionList().get(0).getStartTime().getHour()); assertEquals(35, dayProfile.getDayProfileActionList().get(0).getStartTime().getMinute()); assertEquals(2, dayProfile.getDayProfileActionList().get(0).getStartTime().getSecond()); assertEquals(0, dayProfile.getDayProfileActionList().get(0).getStartTime().getHundredths()); }</code><technical_language>check if for null: - dayProfile - dayProfile.getDayProfileActionList() - dayProfile.getDayProfileActionList().get(0) - dayProfile.getDayProfileActionList().get(0).getStartTime()</technical_language>

Target:
private void checkDayTypeMapping(final DayProfile dayProfile) { assertNotNull(dayProfile); assertNotNull(dayProfile.getDayId()); assertNotNull(dayProfile.getDayProfileActionList()); assertNotNull(dayProfile.getDayProfileActionList().get(0)); assertEquals(new Integer(BigInteger.TEN.intValue()), dayProfile.getDayId()); assertEquals(new Integer(BigInteger.ZERO.intValue()), dayProfile.getDayProfileActionList().get(0) .getScriptSelector()); assertNotNull(dayProfile.getDayProfileActionList().get(0).getStartTime()); }
Source:
<code>public RequestStatus updateRelease(Release release, User user, Iterable<Release._Fields> immutableFields) throws SW360Exception { prepareRelease(release); Release actual = releaseRepository.get(release.getId()); assertNotNull(actual, "Could not find release to update"); if (actual.equals(release)) { return RequestStatus.SUCCESS; } DocumentPermissions<Release> permissions = makePermission(actual, user); boolean hasChangesInEccFields = hasChangesInEccFields(release, actual); if ((hasChangesInEccFields && permissions.isActionAllowed(RequestedAction.WRITE_ECC)) || (!hasChangesInEccFields && permissions.isActionAllowed(RequestedAction.WRITE))) { copyFields(actual, release, immutableFields); autosetReleaseClearingState(release, actual); if (hasChangesInEccFields) { autosetEccUpdaterInfo(release, user); } <START> preventDeletionOfAcceptedAttachments(actual.attachments, release.attachments); <END> releaseRepository.update(release); updateReleaseDependentFieldsForComponentId(release.getComponentId()); attachmentConnector.deleteAttachmentDifference(nullToEmptySet(actual.getAttachments()),nullToEmptySet(release.getAttachments())); sendMailNotificationsForReleaseUpdate(release, user.getEmail()); } else { if (hasChangesInEccFields) { return releaseModerator.updateReleaseEccInfo(release, user); } else { return releaseModerator.updateRelease(release, user); } } return RequestStatus.SUCCESS; }</code><technical_language>getters? IMO, preferable direct field access</technical_language>

Target:
public RequestStatus updateRelease(Release release, User user, Iterable<Release._Fields> immutableFields) throws SW360Exception { prepareRelease(release); Release actual = releaseRepository.get(release.getId()); assertNotNull(actual, "Could not find release to update"); if (actual.equals(release)) { return RequestStatus.SUCCESS; } DocumentPermissions<Release> permissions = makePermission(actual, user); boolean hasChangesInEccFields = hasChangesInEccFields(release, actual); if ((hasChangesInEccFields && permissions.isActionAllowed(RequestedAction.WRITE_ECC)) || (!hasChangesInEccFields && permissions.isActionAllowed(RequestedAction.WRITE))) { copyFields(actual, release, immutableFields); autosetReleaseClearingState(release, actual); if (hasChangesInEccFields) { autosetEccUpdaterInfo(release, user); } release.setAttachments( getAllAttachmentsToKeep(actual.getAttachments(), release.getAttachments()) ); releaseRepository.update(release); updateReleaseDependentFieldsForComponentId(release.getComponentId()); attachmentConnector.deleteAttachmentDifference(nullToEmptySet(actual.getAttachments()),nullToEmptySet(release.getAttachments())); sendMailNotificationsForReleaseUpdate(release, user.getEmail()); } else { if (hasChangesInEccFields) { return releaseModerator.updateReleaseEccInfo(release, user); } else { return releaseModerator.updateRelease(release, user); } } return RequestStatus.SUCCESS; }
Source:
<code>public Plural getPlural(int resId, int quantity, String qualifiers) { <START> return getPlural(getResourceIndex().getResName(resId), quantity, qualifiers); <END> }</code><technical_language>this a null check getValue(int, String)</technical_language>

Target:
public Plural getPlural(int resId, int quantity, String qualifiers) { ResName resName = getResourceIndex().getResName(resId); return resName != null ? getPlural(resName, quantity, qualifiers) : null; }
Source:
<code>public ITask refactorTaskId(ITask oldTask, String newTaskId) { TaskTask newTask = new TaskTask(oldTask.getConnectorKind(), oldTask.getRepositoryUrl(), newTaskId); <START> newTask.setSummary(oldTask.getSummary()); <END> newTask.setPriority(oldTask.getPriority()); newTask.setSynchronizationState(oldTask.getSynchronizationState()); newTask.setCompletionDate(oldTask.getCompletionDate()); newTask.setCreationDate(oldTask.getCreationDate()); newTask.setModificationDate(oldTask.getModificationDate()); newTask.setTaskKind(oldTask.getTaskKind()); newTask.setOwnerId(oldTask.getOwnerId()); newTask.setOwner(oldTask.getOwner()); newTask.setTaskKey(oldTask.getTaskKey()); if (oldTask instanceof AbstractTask) { AbstractTask task = (AbstractTask) oldTask; newTask.setSynchronizing(task.isSynchronizing()); newTask.setMarkReadPending(task.isMarkReadPending()); newTask.setNotified(task.isNotified()); newTask.setChanged(task.isChanged()); newTask.setReminded(task.isReminded()); newTask.setStatus(task.getStatus()); newTask.setNotes(task.getNotes()); newTask.setEstimatedTimeHours(task.getEstimatedTimeHours()); addTaskContainers(task, newTask); } Map<String, String> attributeMap = oldTask.getAttributes(); for (String key : attributeMap.keySet()) { newTask.setAttribute(key, attributeMap.get(key)); } deleteTask(oldTask); return newTask; }</code><technical_language>blind apparently</technical_language>

Target:
public AbstractTask refactorTaskId(ITask oldTask, String newTaskId) { TaskTask newTask = new TaskTask(oldTask.getConnectorKind(), oldTask.getRepositoryUrl(), newTaskId); newTask.setSummary(oldTask.getSummary()); newTask.setPriority(oldTask.getPriority()); newTask.setSynchronizationState(oldTask.getSynchronizationState()); newTask.setCompletionDate(oldTask.getCompletionDate()); newTask.setCreationDate(oldTask.getCreationDate()); newTask.setModificationDate(oldTask.getModificationDate()); newTask.setTaskKind(oldTask.getTaskKind()); newTask.setOwnerId(oldTask.getOwnerId()); newTask.setOwner(oldTask.getOwner()); newTask.setTaskKey(oldTask.getTaskKey()); if (oldTask instanceof AbstractTask) { AbstractTask task = (AbstractTask) oldTask; newTask.setSynchronizing(task.isSynchronizing()); newTask.setMarkReadPending(task.isMarkReadPending()); newTask.setNotified(task.isNotified()); newTask.setChanged(task.isChanged()); newTask.setReminded(task.isReminded()); newTask.setStatus(task.getStatus()); newTask.setNotes(task.getNotes()); newTask.setEstimatedTimeHours(task.getEstimatedTimeHours()); addTaskContainers(task, newTask); } Map<String, String> attributeMap = oldTask.getAttributes(); for (String key : attributeMap.keySet()) { newTask.setAttribute(key, attributeMap.get(key)); } deleteTask(oldTask); return newTask; }
Source:
<code>public String getUnifiedDiff() { ByteArrayOutputStream out = new ByteArrayOutputStream(); <START> Repository repo = openRepository(); <END> if (repo != null) { DiffFormatter df = new DiffFormatter(out); df.setRepository(repo); df.setDetectRenames(true); try { PatchList patchList = getPatchList(); df.format(patchList.getOldId(), patchList.getNewId()); } catch (IOException e) { log.error("Cannot format patch", e); } finally { df.release(); } } return RawParseUtils.decode(out.toByteArray()); }</code><technical_language>opened repository needs closed in a try/finally. reference counted resources leak in memory if released use</technical_language>

Target:
public String getUnifiedDiff() { ByteArrayOutputStream out = new ByteArrayOutputStream(); final Repository repo = getRepository(); if (repo != null) { DiffFormatter df = new DiffFormatter(out); try { final PatchList patchList = getPatchList(); if (patchList != null) { df.setRepository(repo); df.setDetectRenames(true); df.format(patchList.getOldId(), patchList.getNewId()); } } catch (IOException e) { log.error("Cannot format patch", e); } finally { df.release(); repo.close(); } } return RawParseUtils.decode(out.toByteArray()); }
Source:
<code>public static long nanosElapsed(long startNanos) { <START> return nanos() - startNanos; <END> }</code><technical_language>I replace this System.nanos() instead of a call nanos. prevent running out of inlinining budget</technical_language>

Target:
public static long nanosElapsed(long startNanos) { return System.nanoTime() - startNanos; }
Source:
<code>public String call(@HeaderParam("clientURL") String clientURL) throws Exception { <START> ResteasyClient client = (ResteasyClient) ResteasyClientBuilder.newBuilder().build(); <END> WebTarget target = client.target(clientURL); Response response = target.request().get(); if (response.getStatus() != HttpResponseCodes.SC_OK) { throw new Exception("Client in deployment received wrong response code"); } String responseText = response.readEntity(String.class); return responseText; }</code><technical_language>Client client = ClientBuilder.newClient(); is enough instead of line above. in case, need close client, for example a try-finally block</technical_language>

Target:
public String call(@HeaderParam("clientURL") String clientURL) throws Exception { Client client = ClientBuilder.newClient(); try { WebTarget target = client.target(clientURL); Response response = target.request().get(); if (response.getStatus() != HttpResponseCodes.SC_OK) { throw new Exception("Client in deployment received wrong response code"); } String responseText = response.readEntity(String.class); return responseText; } finally { client.close(); } }
Source:
<code>public void onRegistered(int imsRadioTech) { <START> if (DBG) { log("onRegistered ::"); } <END> synchronized (mRegistrationListeners) { mRegistrationListeners.forEach(l -> l.onRegistered(imsRadioTech)); } }</code><technical_language>this line</technical_language>

Target:
public void onRegistered(int imsRadioTech) { if (DBG) log("onRegistered ::"); synchronized (mRegistrationListeners) { mRegistrationListeners.forEach(l -> l.onRegistered(imsRadioTech)); } }
Source:
<code><START> public void testStopMigrate() throws Exception { <END> GlusterBrick brick = new GlusterBrick(); GlusterVolume volume = new GlusterVolume(); brick.setId(GUIDS[0].toString()); brick.setBrickDir(brickDir); brick.setServerId(serverId.toString()); volume.setId(volumeId.toString()); brick.setGlusterVolume(volume); GlusterBricks bricks = control.createMock(GlusterBricks.class); expect(bricks.getGlusterBricks()).andReturn(Collections.singletonList(brick)).anyTimes(); setUriInfo(setUpActionExpectations(VdcActionType.StopRemoveGlusterVolumeBricks, GlusterVolumeRemoveBricksParameters.class, new String[] {}, new Object[] {}, true, true)); Action action = new Action(); action.setBricks(bricks); collection.stopMigrate(action); }</code><technical_language>this stopmigrate brick.id, please name add for stopmigrate by.name thanks</technical_language>

Target:
public void testStopMigrate() throws Exception { GlusterBrick brick = new GlusterBrick(); GlusterVolume volume = new GlusterVolume(); brick.setName(serverName + ":" + brickDir); volume.setId(volumeId.toString()); brick.setGlusterVolume(volume); GlusterBricks bricks = control.createMock(GlusterBricks.class); expect(bricks.getGlusterBricks()).andReturn(Collections.singletonList(brick)).anyTimes(); setUriInfo(setUpActionExpectations(VdcActionType.StopRemoveGlusterVolumeBricks, GlusterVolumeRemoveBricksParameters.class, new String[] {}, new Object[] {}, true, true)); Action action = new Action(); action.setBricks(bricks); collection.stopMigrate(action); }
Source:
<code>protected void createAdvancedControls(Composite parent) { super.createAdvancedControls(parent); Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); GridData sd = new GridData(GridData.FILL_HORIZONTAL); separator.setLayoutData(sd); List<String> versions = new ArrayList<String>(); for (CDIVersion v: CDIVersion.ALL_VERSIONS) { versions.add(v.toString()); } <START> versionEditor = SwtFieldEditorFactory.INSTANCE.createComboEditor("version", CDIUIMessages.VERSION_LABEL, versions, versions.get(versions.size() - 1), false, ""); <END> Composite c = new Composite(parent, 0); c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); GridLayout gl = new GridLayout(3, false); gl.marginWidth = 5; gl.marginHeight = 5; gl.verticalSpacing = 0; gl.horizontalSpacing = 5; c.setLayout(gl); versionEditor.doFillIntoGrid(c); }</code><technical_language>actual CDI project version default instead of highest one</technical_language>

Target:
protected void createAdvancedControls(Composite parent) { Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); GridData sd = new GridData(GridData.FILL_HORIZONTAL); separator.setLayoutData(sd); List<String> versions = new ArrayList<String>(); for (CDIVersion v: CDIVersion.ALL_VERSIONS) { versions.add(v.toString()); } versionEditor = SwtFieldEditorFactory.INSTANCE.createComboEditor("version", CDIUIMessages.VERSION_LABEL, versions, getInitialCDIVersion(), false, ""); Composite c = new Composite(parent, 0); c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); GridLayout gl = new GridLayout(3, false); gl.marginWidth = 5; gl.marginHeight = 5; gl.verticalSpacing = 0; gl.horizontalSpacing = 5; c.setLayout(gl); versionEditor.doFillIntoGrid(c); }
Source:
<code>public static Optional<Integer> getPort() { <START> if (jmxServer == null) { <END> return Optional.empty(); } else { return Optional.of(jmxServer.getPort()); } }</code><technical_language>this _could_ shortened Optional.ofNullable(jmxServer).map(JMXServer::getPort);</technical_language>

Target:
public static Optional<Integer> getPort() { return Optional.ofNullable(jmxServer).map(JMXServer::getPort); }
Source:
<code>public SslConnection accept(StreamConnection tcpConnection, SSLEngine engine) { SslConnection connection = new JsseSslStreamConnection(tcpConnection, engine, socketBufferPool, applicationBufferPool, startTls); if(sslEngineCallback != null) { sslEngineCallback.acceptCallback(connection, engine); } <START> return connection; <END> }</code><technical_language>is purpose of this mechanism</technical_language>

Target:
public SslConnection accept(StreamConnection tcpConnection, SSLEngine engine) { return new JsseSslStreamConnection(tcpConnection, engine, socketBufferPool, applicationBufferPool, startTls); }
Source:
<code>public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.MODULO, ctx -> { BinaryExpression expression = (BinaryExpression) ctx.syntaxNode(); StringLiteral formatString = extractStringLiteral(expression.leftOperand()); if (formatString == null) { return; } Optional<StringFormat> formatOptional = StringFormat.createFromPrintfStyle(ctx, expression.leftOperand(), formatString, formatString.trimmedQuotesValue()); if (!formatOptional.isPresent()) { return; } StringFormat format = formatOptional.get(); Expression rhs = expression.rightOperand(); <START> if (format.hasNamedFields()) { checkNamed(ctx, format, rhs); } else { checkPositional(ctx, format, rhs); <END> } }); }</code><technical_language>if fix current implementation raises FP for: "%%(key)s" % {"other": "str"} # OK. Pylint FP problem is createFromPrintfStyle returns a StringFormat 0 replacement fields, enter checkPositional raise rhs is a tuple. StringFormat return Optional.empty() in case, this logic updated</technical_language>

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.MODULO, ctx -> { BinaryExpression expression = (BinaryExpression) ctx.syntaxNode(); StringLiteral formatString = extractStringLiteral(expression.leftOperand()); if (formatString == null) { return; } Optional<StringFormat> formatOptional = StringFormat.createFromPrintfStyle(ctx, expression.leftOperand(), formatString); if (!formatOptional.isPresent()) { return; } StringFormat format = formatOptional.get(); Expression rhs = expression.rightOperand(); if (format.numExpectedArguments() == 0 && (isMapping(rhs) || rhs.type().canOnlyBe("list"))) { return; } if (format.hasNamedFields()) { checkNamed(ctx, format, rhs); } else { checkPositional(ctx, format, rhs); } }); }
Source:
<code><START> private void insertEntity() { <END> TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() .connectionString("connectionString") .buildAsyncClient(); TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getClient("OfficeSupplies"); String row = "crayolaMarkers"; String partitionKey = "markers"; tableAsyncClient.insertEntity(new TableEntity(row, partitionKey, null)).subscribe(tableEntity -> { logger.info("Insert Entity Successful. Entity: " + tableEntity); }, error -> { logger.error("There was an error inserting the Entity. Error: " + error); }); }</code><technical_language>useful add samples show user verify if a table exists</technical_language>

Target:
private void insertEntity() { TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() .connectionString("connectionString") .buildAsyncClient(); TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getTableAsyncClient("OfficeSupplies"); Map<String, Object> properties = new HashMap<>(); properties.put("RowKey", "crayolaMarkers"); properties.put("PartitionKey", "markers"); tableAsyncClient.createEntity(properties).subscribe(tableEntity -> { System.out.println("Insert Entity Successful. Entity: " + tableEntity); }, error -> { System.err.println("There was an error inserting the Entity. Error: " + error); }); }
Source:
<code>public Response intercept(Chain chain) throws IOException { Request originalRequest = chain.request(); HttpUrl rebasedUrl = urls.redirectToCurrent(originalRequest.url()).orElseThrow(() -> new IOException( "Failed to determine suitable target URL for request URL " + originalRequest.url() + " amongst known base URLs: " + urls.getBaseUrls())); Request request = originalRequest.newBuilder() .url(rebasedUrl) <START> .tag(originalRequest.equals(originalRequest.tag()) ? null : originalRequest.tag()) <END> .build(); return chain.proceed(request); }</code><technical_language>this a bug? if so, a separate PR, please</technical_language>

Target:
public Response intercept(Chain chain) throws IOException { Request originalRequest = chain.request(); HttpUrl rebasedUrl = urls.redirectToCurrent(originalRequest.url()).orElseThrow(() -> new IOException( "Failed to determine suitable target URL for request URL " + originalRequest.url() + " amongst known base URLs: " + urls.getBaseUrls())); Request request = originalRequest.newBuilder() .url(rebasedUrl) .build(); return chain.proceed(request); }
Source:
<code>protected void addConceptSpecificMetadata(ActivityDTO dto, ActivityMetadata metadata) { <START> if (!(metadata instanceof UserMaintenanceActivityMetadata)) { <END> return; } }</code><technical_language>this checking for instanceof AnnouncementActivityMetadata instead</technical_language>

Target:
protected void addConceptSpecificMetadata(ActivityDTO dto, ActivityMetadata metadata) { if (!(metadata instanceof AnnouncementActivityMetadata)) { return; } }
Source:
<code>public ImmutableList<T> init() { <START> return fromBounded(toObjectArray(), 0, this.length - 1); <END> }</code><technical_language>forgot this.s</technical_language>

Target:
public ImmutableList<T> init() { return fromBounded(this.toObjectArray(), 0, this.length - 1); }
Source:
<code>public String process(String query) { _logger.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, _logger); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { String response = processDatastreamStateRequest(uri); _logger.trace("Query: returns response: {}", query, response); return response; } else if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.TOPICPARTITION_STATS.toString())) { <START> final String response = processTopicPartitionStatsRequest(); <END> _logger.trace("Query: returns response: {}", query, response); return response; } else { _logger.warn("Could not process query with path {}", query, path); } } catch (Exception e) { _logger.warn("Failed to process query {}", query); _logger.debug(String.format("Failed to process query %s", query), e); throw new DatastreamRuntimeException(e); } return null; }</code><technical_language>nit: I final locals inconsistent line 384</technical_language>

Target:
public String process(String query) { _logger.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, _logger); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { String response = processDatastreamStateRequest(uri); _logger.trace("Query: returns response: {}", query, response); return response; } else if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.PARTITIONS.toString())) { String response = processTopicPartitionStatsRequest(); _logger.trace("Query: returns response: {}", query, response); return response; } else { _logger.warn("Could not process query with path {}", query, path); } } catch (Exception e) { _logger.warn("Failed to process query {}", query); _logger.debug(String.format("Failed to process query %s", query), e); throw new DatastreamRuntimeException(e); } return null; }
Source:
<code>public static void achieveConsensusForNamespace(TimelockNamespaces timelockNamespaces, String namespace) { TimeLockServices timeLockServices = timelockNamespaces.get(namespace); <START> Long timestamp = timeLockServices.getTimelockService().getFreshTimestamp() + 1000000L; <END> timeLockServices.getTimestampManagementService().fastForwardTimestamp(timestamp); }</code><technical_language>nit: is a need explicitly box timestamp</technical_language>

Target:
public static void achieveConsensusForNamespace(TimelockNamespaces timelockNamespaces, String namespace) { TimeLockServices timeLockServices = timelockNamespaces.get(namespace); long timestamp = timeLockServices.getTimelockService().getFreshTimestamp() + 1000000L; timeLockServices.getTimestampManagementService().fastForwardTimestamp(timestamp); }
Source:
<code>public void testAddWholeRepo() throws Exception { <START> assertTrue(new File(db.getWorkTree(), "sub").mkdir()); <END> File file = new File(db.getWorkTree(), "sub/a.txt"); FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File file2 = new File(db.getWorkTree(), "sub/b.txt"); FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); Git git = new Git(db); git.add().addFilepattern(".").call(); assertEquals( "[sub/a.txt, mode:100644, content:content]" + "[sub/b.txt, mode:100644, content:content b]", indexState(CONTENT)); }</code><technical_language>FileUtils.mkdirs</technical_language>

Target:
public void testAddWholeRepo() throws Exception { FileUtils.mkdir(new File(db.getWorkTree(), "sub")); File file = new File(db.getWorkTree(), "sub/a.txt"); FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File file2 = new File(db.getWorkTree(), "sub/b.txt"); FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); Git git = new Git(db); git.add().addFilepattern(".").call(); assertEquals( "[sub/a.txt, mode:100644, content:content]" + "[sub/b.txt, mode:100644, content:content b]", indexState(CONTENT)); }
Source:
<code>public CDOLockState[] getLockStates(int viewID, Collection<CDOID> ids) { <START> throw new UnsupportedOperationException(); <END> }</code><technical_language>Instead call getLockStates(viewID, ids, CDOLockState.DEPTH_NONE);</technical_language>

Target:
public CDOLockState[] getLockStates(int viewID, Collection<CDOID> ids) { return getLockStates(viewID, ids, CDOLockState.DEPTH_NONE); }
Source:
<code>public void clickOnSingleEnabledCategory(){ driver.switchTo().defaultContent(); driver.switchTo().frame(mapFrame); <START> waitForElementByElement(enabledPinTypesCollection.get(0)); <END> enabledPinTypesCollection.get(0).click(); PageObjectLogging.log("clickOnSingleEnabledCategory","Single enabled category was clicked", true); driver.switchTo().activeElement(); }</code><technical_language>move 0 private constant in lines, easier change in future if needed</technical_language>

Target:
public void clickOnSingleEnabledCategory() { driver.switchTo().defaultContent(); driver.switchTo().frame(mapFrame); waitForElementByElement(enabledPinTypesCollection.get(InteractiveMapsContent.pinTypeIndex)); enabledPinTypesCollection.get(InteractiveMapsContent.pinTypeIndex).click(); PageObjectLogging.log("clickOnSingleEnabledCategory", "Single enabled category was clicked", true); driver.switchTo().activeElement(); }
Source:
<code>public ProcessView() { super(); IExtensionPointLimiter extensionPointLimiter = new ExtensionPointLimiterImpl( "org.talend.designer.runprocess.runprocess_view_helper", "runprocess_view_helper"); IExtensionPointLimiter debugextensionPointLimiter = new ExtensionPointLimiterImpl( "org.talend.designer.runprocess.debugprocess_view_helper", "debugprocess_view_helper"); debugViewHelpers = new HashMap<String, IDebugViewHelper>(); ExtensionImplementationProvider.getInstance(debugextensionPointLimiter, null).forEach(e -> { if (e instanceof IDebugViewHelper) { IDebugViewHelper helper = (IDebugViewHelper) e; debugViewHelpers.put(helper.getDebugType(), helper); } }); IProcessViewHelper processViewHelperPrm = ExtensionImplementationProvider.getSingleInstance(extensionPointLimiter, null); if (processViewHelperPrm == null) { processViewHelperPrm = new DefaultProcessViewHelper(); } tabFactory = new HorizontalTabFactory(); setProcessViewHelper(processViewHelperPrm); <START> if(debugViewHelpers.size() == 0) { <END> DefaultDebugviewHelper defaultDebugViewHelper = new DefaultDebugviewHelper(); debugViewHelpers.put(defaultDebugViewHelper.getDebugType(), defaultDebugViewHelper); } rubjobManager = ProcessManager.getInstance(); ProxyRepositoryFactory.getInstance().addPropertyChangeListener(this); }</code><technical_language>is find another decide add TOS helper? in case add some other type helper in TOS, default tos helper registed this logic</technical_language>

Target:
public ProcessView() { super(); IExtensionPointLimiter extensionPointLimiter = new ExtensionPointLimiterImpl( "org.talend.designer.runprocess.runprocess_view_helper", "runprocess_view_helper"); IExtensionPointLimiter debugextensionPointLimiter = new ExtensionPointLimiterImpl( "org.talend.designer.runprocess.debugprocess_view_helper", "debugprocess_view_helper"); debugViewHelpers = new HashMap<EDebugProcessType, IDebugViewHelper>(); ExtensionImplementationProvider.getInstance(debugextensionPointLimiter, null).forEach(e -> { if (e instanceof IDebugViewHelper) { IDebugViewHelper helper = (IDebugViewHelper) e; debugViewHelpers.put(helper.getDebugType(), helper); } }); IProcessViewHelper processViewHelperPrm = ExtensionImplementationProvider.getSingleInstance(extensionPointLimiter, null); if (processViewHelperPrm == null) { processViewHelperPrm = new DefaultProcessViewHelper(); } tabFactory = new HorizontalTabFactory(); setProcessViewHelper(processViewHelperPrm); if(!debugViewHelpers.containsKey(EDebugProcessType.DI)) { DefaultDebugviewHelper defaultDebugViewHelper = new DefaultDebugviewHelper(); debugViewHelpers.put(EDebugProcessType.DI, defaultDebugViewHelper); } rubjobManager = ProcessManager.getInstance(); ProxyRepositoryFactory.getInstance().addPropertyChangeListener(this); }
Source:
<code>private void assertNoLongerExposesEmbeddedTimestampService() { TimestampService timestampClient = createEteClientFor(TimestampService.class); softAssertions.assertThat( ((AtlasDbRemoteException) catchThrowable(timestampClient::getFreshTimestamp)).getStatus()) .as("no longer exposes an embedded timestamp service"); <START> } <END></code><technical_language>I want check status is equal 404 well..</technical_language>

Target:
private void assertNoLongerExposesEmbeddedTimestampService() { TimestampService timestampClient = createEteClientFor(TimestampService.class); softAssertions.assertThat( ((AtlasDbRemoteException) catchThrowable(timestampClient::getFreshTimestamp)).getStatus()) .isEqualTo(404) .as("no longer exposes an embedded timestamp service"); }
Source:
<code>public String createAction(Element node, IXmlStateSystemContainer container) { String id = <START> TmfXmlActionCu.compileNamedAction(container.getAnalysisCompilationData(), node); <END> if (id == null) { throw new NullPointerException("Named action did not compile correctly"); } return id; }</code><technical_language>return Objects.requireNotNull(thethingy, "Named action not...");</technical_language>

Target:
public String createAction(Element node, IXmlStateSystemContainer container) { return Objects.requireNonNull(TmfXmlActionCu.compileNamedAction(container.getAnalysisCompilationData(), node), "Named action did not compile correctly"); }
Source:
<code>public void draw(int mouseX, int mouseY, float partialTick) { RenderHelper.enableGUIStandardItemLighting(); <START> GL11.glEnable(GL11.GL_BLEND); <END> RenderUtil.renderQuad2D(8, 8, 0, getXSize() - 11, getYSize() - 11, new Vector4f(0, 0, 0, 1)); RenderUtil.renderQuad2D(10, 10, 0, getXSize() - 15, getYSize() - 15, new Vector4f(0.6, 0.6, 0.6, 1)); RenderItem itemRenderer = mc.getRenderItem(); GL11.glEnable(GL11.GL_DEPTH_TEST); NNList<ItemStack> snapshot = filter.getSnapshot(); int x = 15; int y = 10; int count = 0; for (ItemStack st : snapshot) { if (!st.isEmpty()) { itemRenderer.renderItemAndEffectIntoGUI(st, x, y); } x += 20; count++; if (count % 9 == 0) { x = 15; y += 20; } } }</code><technical_language>GlStateManager.enableBlend()</technical_language>

Target:
public void draw(int mouseX, int mouseY, float partialTick) { RenderHelper.enableGUIStandardItemLighting(); GlStateManager.enableBlend(); RenderUtil.renderQuad2D(8, 8, 0, getXSize() - 11, getYSize() - 11, new Vector4f(0, 0, 0, 1)); RenderUtil.renderQuad2D(10, 10, 0, getXSize() - 15, getYSize() - 15, new Vector4f(0.6, 0.6, 0.6, 1)); RenderItem itemRenderer = mc.getRenderItem(); GlStateManager.enableDepth(); NNList<ItemStack> snapshot = filter.getSnapshot(); int x = 15; int y = 10; int count = 0; for (ItemStack st : snapshot) { if (!st.isEmpty()) { itemRenderer.renderItemAndEffectIntoGUI(st, x, y); } x += 20; count++; if (count % 9 == 0) { x = 15; y += 20; } } }
Source:
<code>public List<FirmwareVersionDto> execute(final ClientConnection conn, final DlmsDevice device, final Void useless) throws ProtocolAdapterException { final List<FirmwareVersionDto> resultList = new ArrayList<>(); final List<GetResult> getResultList = this.dlmsHelperService.getAndCheck(conn, device, <START> "retrieve actual meter reads", ATTRIBUTE_ADDRESSES); <END> resultList.add(new FirmwareVersionDto(ACTIVE_FIRMWARE, this.dlmsHelperService.readString( getResultList.get(INDEX_ACTIVE_FIRMWARE_VERSION).resultData(), ACTIVE_FIRMWARE))); resultList.add(new FirmwareVersionDto(MODULE_ACTIVE_FIRMWARE, this.dlmsHelperService.readString(getResultList .get(INDEX_MODULE_ACTIVE_FIRMWARE_VERSION).resultData(), MODULE_ACTIVE_FIRMWARE))); resultList.add(new FirmwareVersionDto(COMMUNICATION_MODULE_ACTIVE_FIRMWARE, this.dlmsHelperService.readString( getResultList.get(INDEX_COMMUNICATION_MODULE_ACTIVE_FIRMWARE_VERSION).resultData(), COMMUNICATION_MODULE_ACTIVE_FIRMWARE))); return resultList; }</code><technical_language>I firmware version do retrieve actual meter reads</technical_language>

Target:
public List<FirmwareVersionDto> execute(final ClientConnection conn, final DlmsDevice device, final Void useless) throws ProtocolAdapterException { final List<FirmwareVersionDto> resultList = new ArrayList<>(); final List<GetResult> getResultList = this.dlmsHelperService.getAndCheck(conn, device, "retrieve firmware versions", ATTRIBUTE_ADDRESSES); resultList.add(new FirmwareVersionDto(ACTIVE_FIRMWARE, this.dlmsHelperService.readString( getResultList.get(INDEX_ACTIVE_FIRMWARE_VERSION).resultData(), ACTIVE_FIRMWARE))); resultList.add(new FirmwareVersionDto(MODULE_ACTIVE_FIRMWARE, this.dlmsHelperService.readString(getResultList .get(INDEX_MODULE_ACTIVE_FIRMWARE_VERSION).resultData(), MODULE_ACTIVE_FIRMWARE))); resultList.add(new FirmwareVersionDto(COMMUNICATION_MODULE_ACTIVE_FIRMWARE, this.dlmsHelperService.readString( getResultList.get(INDEX_COMMUNICATION_MODULE_ACTIVE_FIRMWARE_VERSION).resultData(), COMMUNICATION_MODULE_ACTIVE_FIRMWARE))); return resultList; }
Source:
<code>doRequest(ConnectionConfig config, HttpUriRequest method, Map<String, String> requestHeaders, Request request, ResponseHandler<Request, Response> handler, int expectedStatusCode) { <START> return doRequest(config, 60000, method, requestHeaders, request, handler, expectedStatusCode); <END> }</code><technical_language>DEFAULT_HTTP_TIMEOUT</technical_language>

Target:
doRequest(ConnectionConfig config, HttpUriRequest method, Map<String, String> requestHeaders, Request request, ResponseHandler<Request, Response> handler, int expectedStatusCode) { return doRequest(config, Defaults.DEFAULT_HTTP_TIMEOUT, method, requestHeaders, request, handler, expectedStatusCode); }
Source:
<code>public void remove(String noteId, String notePath , AuthenticationInfo subject) throws IOException { LOG.info("====remove {}:{}", noteId, notePath); folders.deleteOne(eq(Fields.ID, noteId)); notes.deleteOne(eq(Fields.ID, noteId)); String[] pathArray = toPathArray(notePath, false); for (int i = pathArray.length; i >= 0; i--) { String[] current = Arrays.copyOfRange(pathArray, 0, i); String folderId = findFolder(current); boolean isEmpty = folders.count(eq(Fields.PID, folderId)) <= 0; if (isEmpty) { <START> folders.deleteOne(eq(Fields.ID, folderId)); <END> } else { break; } } }</code><technical_language>this a race condition? if a new note is added in folder</technical_language>

Target:
public void remove(String noteId, String notePath, AuthenticationInfo subject) throws IOException { LOG.debug("remove note, noteId:{}, notePath:{}", noteId, notePath); try (AutoLock autoLock = lock.lockForWrite()) { folders.deleteOne(eq(Fields.ID, noteId)); notes.deleteOne(eq(Fields.ID, noteId)); String[] pathArray = toPathArray(notePath, false); for (int i = pathArray.length; i >= 0; i--) { String[] current = Arrays.copyOfRange(pathArray, 0, i); String folderId = findFolder(current); boolean isEmpty = folders.count(eq(Fields.PID, folderId)) <= 0; if (isEmpty) { folders.deleteOne(eq(Fields.ID, folderId)); } else { break; } } } }
Source:
<code>protected boolean isTagLoadedOnOasis() { <START> return isElementVisible(elementInVebatim); <END> }</code><technical_language><LINK_0></technical_language>

Target:
protected boolean isTagLoadedOnOasis() { throw new NotImplementedException(); }
Source:
<code>private static boolean hasCommonTraceType(TmfExperiment experiment) { String commonTraceType = null; for (final ITmfTrace trace : experiment.getTraces()) { String traceType = trace.getTraceTypeId(); if <START> ((commonTraceType != null) && <END> !commonTraceType.equals(traceType)) { return false; } commonTraceType = traceType; } return commonTraceType != null ? true : false; }</code><technical_language>rm parenthesis</technical_language>

Target:
private static boolean hasCommonTraceType(TmfExperiment experiment) { String commonTraceType = null; for (ITmfTrace trace : experiment.getTraces()) { String traceType = trace.getTraceTypeId(); if (commonTraceType != null && !commonTraceType.equals(traceType)) { return false; } commonTraceType = traceType; } return commonTraceType != null; }
Source:
<code>public Validator validate(Object object, Class<?>... groups) { if (object != null) { Set<ConstraintViolation<Object>> violations = bvalidator.validate(object, groups); for (ConstraintViolation<Object> v : violations) { BeanValidatorContext ctx = new BeanValidatorContext(v); String msg = interpolator.interpolate(v.getMessageTemplate(), ctx, locale); String category = v.getPropertyPath().toString(); add(new SimpleMessage(category, msg)); <START> logger.debug("added message {}={} for contraint violation", category, msg); <END> } } return this; }</code><technical_language>This code is duplicated MethodValidator. reuse somehow</technical_language>

Target:
public Validator validate(Object object, Class<?>... groups) { if (object != null) { addAll(bvalidator.validate(object, groups)); } return this; }
Source:
<code>private PlanPhasePriceOverride[] createOverrides(final Plan defaultPlan, final List<CatalogOverridePhaseDefinitionModelDao> phaseDefs, final InternalTenantContext context) { final PlanPhasePriceOverride[] result = new PlanPhasePriceOverride[defaultPlan.getAllPhases().length]; for (int i = 0; i < defaultPlan.getAllPhases().length; i++) { final PlanPhase curPhase = defaultPlan.getAllPhases()[i]; final CatalogOverridePhaseDefinitionModelDao overriddenPhase = Iterables.tryFind(phaseDefs, new Predicate<CatalogOverridePhaseDefinitionModelDao>() { @Override public boolean apply(final CatalogOverridePhaseDefinitionModelDao input) { return input.getParentPhaseName().equals(curPhase.getName()); } }).orNull(); if(overriddenPhase != null){ List<UsagePriceOverride> usagePriceOverrides = getUsagePriceOverrides(curPhase, overriddenPhase, context); result[i] = new DefaultPlanPhasePriceOverride(curPhase.getName(), Currency.valueOf(overriddenPhase.getCurrency()), overriddenPhase.getFixedPrice(), overriddenPhase.getRecurringPrice(), usagePriceOverrides); } <START> else <END> result[i] = null; } return result; }</code><technical_language>Nit: prefer explicitly add curly braces (same remark below)</technical_language>

Target:
private PlanPhasePriceOverride[] createOverrides(final Plan defaultPlan, final List<CatalogOverridePhaseDefinitionModelDao> phaseDefs, final InternalTenantContext context) { final PlanPhasePriceOverride[] result = new PlanPhasePriceOverride[defaultPlan.getAllPhases().length]; for (int i = 0; i < defaultPlan.getAllPhases().length; i++) { final PlanPhase curPhase = defaultPlan.getAllPhases()[i]; final CatalogOverridePhaseDefinitionModelDao overriddenPhase = Iterables.tryFind(phaseDefs, new Predicate<CatalogOverridePhaseDefinitionModelDao>() { @Override public boolean apply(final CatalogOverridePhaseDefinitionModelDao input) { return input.getParentPhaseName().equals(curPhase.getName()); } }).orNull(); if(overriddenPhase != null) { List<UsagePriceOverride> usagePriceOverrides = getUsagePriceOverrides(curPhase, overriddenPhase, context); result[i] = new DefaultPlanPhasePriceOverride(curPhase.getName(), Currency.valueOf(overriddenPhase.getCurrency()), overriddenPhase.getFixedPrice(), overriddenPhase.getRecurringPrice(), usagePriceOverrides); } else { result[i] = null; } } return result; }
Source:
<code><START> public void updateVmDataChangedTime() { <END> vmDataChangedTime = System.nanoTime(); }</code><technical_language>I mark final. is safe non-final methods in ctor. override do foolish</technical_language>

Target:
public final void updateVmDataChangedTime() { vmDataChangedTime = System.nanoTime(); }
Source:
<code>private static FeedItem createFeedItem(File f, Feed whichFeed) { long globalId = 0; Date date = new Date(); <START> FeedItem item = new FeedItem(globalId, f.getName(), "item" + Long.toString(date.getTime()), END> f.toString(), date, FeedItem.UNPLAYED, whichFeed); item.setAutoDownload(false); long duration = getFileDuration(f); long size = f.length(); FeedMedia media = new FeedMedia(0, item, (int)duration, 0, size, "audio/mp3", f.getAbsolutePath(), f.getAbsolutePath(), true, null, 0, 0); item.setMedia(media); return item; }</code><technical_language>UUID.randomUUID().toString() ID unique. > <LINK_0> > for a in a billion chance of duplication, 103 trillion version 4 UUIDs generated</technical_language>

Target:
private static FeedItem createFeedItem(File f, Feed whichFeed) { long globalId = 0; Date date = new Date(); String uuid = UUID.randomUUID().toString(); FeedItem item = new FeedItem(globalId, f.getName(), uuid, f.toString(), date, FeedItem.UNPLAYED, whichFeed); item.setAutoDownload(false); long duration = getFileDuration(f); long size = f.length(); String absPath = f.getAbsolutePath(); FeedMedia media = new FeedMedia(0, item, (int)duration, 0, size, getMimeType(absPath), absPath, absPath, true, null, 0, 0); item.setMedia(media); return item; }
Source:
<code><START> public ArrayInterface setBlob(int index, Blob value) { <END> return setObject(index, value); }</code><technical_language>I return Array here</technical_language>

Target:
public Array setBlob(int index, Blob value) { return setObject(index, value); }
Source:
<code>void clearStates() { <START> exceptionOnEncryption = new AtomicReference<>(); <END> exceptionOnDecryption = new AtomicReference<>(); }</code><technical_language>minor: set null</technical_language>

Target:
void clearStates() { exceptionOnEncryption.set(null); exceptionOnDecryption.set(null); }
Source:
<code>public void searchMethodsExist() throws Exception { <START> context.turnOffAuthorisationSystem(); <END> getClient().perform(get("/api/core/metadatafields")) .andExpect(jsonPath("$._links.search.href", notNullValue())); getClient().perform(get("/api/core/metadatafields/search")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$._links.bySchema", notNullValue())); }</code><technical_language>I Auth system remain in this method</technical_language>

Target:
public void searchMethodsExist() throws Exception { getClient().perform(get("/api/core/metadatafields")) .andExpect(jsonPath("$._links.search.href", notNullValue())); getClient().perform(get("/api/core/metadatafields/search")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$._links.bySchema", notNullValue())); }
Source:
<code><START> public String retryOrAbortStatus(Integer failureCount) { <END> if (failureCount < maxRetries) { return RETRYING; } return ABORTED; }</code><technical_language>methods required</technical_language>

Target:
public String retryOrAbortStatus(Integer failureCount) { if (failureCount < maxRetries) { return DeliveryStatuses.RETRYING; } return DeliveryStatuses.ABORTED; }
Source:
<code>public void onClose(Status status, Metadata trailers) { if (status == Status.UNAUTHENTICATED) { <START> LOG.warn("Got unauthenticated response from server, revoking the current token"); <END> revokeUnauthToken(origToken); } super.onClose(status, trailers); }</code><technical_language>this incur a bunch of logging time</technical_language>

Target:
public void onClose(Status status, Metadata trailers) { if (status == Status.UNAUTHENTICATED) { revokeUnauthToken(origToken); } super.onClose(status, trailers); }
Source:
<code>public void updateAllInTransaction(List<VmNetworkStatistics> vmInterfaceStatisticsToSave) { updateAllInBatch("updatevm_interface_statistics", vmInterfaceStatisticsToSave, new MapSqlParameterMapper<VmNetworkStatistics>() { @Override public MapSqlParameterSource map(VmNetworkStatistics entity) { MapSqlParameterSource paramValue = new MapSqlParameterSource(); <START> paramValue.addValue("id", entity.getId()); <END> paramValue.addValue("rx_drop", entity.getReceiveDropRate()); paramValue.addValue("rx_rate", entity.getReceiveRate()); paramValue.addValue("tx_drop", entity.getTransmitDropRate()); paramValue.addValue("tx_rate", entity.getTransmitRate()); paramValue.addValue("iface_status", entity.getStatus()); paramValue.addValue("vm_id", entity.getVmId()); return paramValue; } }); }</code><technical_language>yeh</technical_language>

Target:
public void updateAllInTransaction(List<VmNetworkStatistics> vmInterfaceStatisticsToSave) { updateAllInBatch("updatevm_interface_statistics", vmInterfaceStatisticsToSave, new MapSqlParameterMapper<VmNetworkStatistics>() { @Override public MapSqlParameterSource map(VmNetworkStatistics entity) { MapSqlParameterSource paramValue = new MapSqlParameterSource() .addValue("id", entity.getId()) .addValue("rx_drop", entity.getReceiveDropRate()) .addValue("rx_rate", entity.getReceiveRate()) .addValue("tx_drop", entity.getTransmitDropRate()) .addValue("tx_rate", entity.getTransmitRate()) .addValue("iface_status", entity.getStatus()) .addValue("vm_id", entity.getVmId()); return paramValue; } }); }