auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void copyWalPart(WalPosition startPosition, WalPosition endPosition, long oldWalKey) { try { DataInputStream in = bfs.getInputStream(oldWalKey, WAL_FILE_PREFIX + endPosition.fileId); int length = (int)(startPosition.fileId == endPosition.fileId ? endPosition.offset - startPosition.offset : endPosition.offset); int offset = (int)(startPosition.fileId == endPosition.fileId ? startPosition.offset : 0); logger.info("length = offset = start offset = end offset = File = {}", length, offset, startPosition, endPosition); byte[] buffer = new byte[length]; IOUtils.skip(in, offset); <START> int readBytes = IOUtils.read(in, buffer, 0, length); <END> append(buffer, readBytes); in.close(); flushWal(); walSize = writer.getSize(); logger.info("wal size so far = {}", walSize); } catch (IOException e) { DTThrowable.wrapIfChecked(e); } }</code><technical_language>read entire buffer in memory</technical_language>

Target:
private void copyWalPart(WalPosition startPosition, WalPosition endPosition, long oldWalKey) { try { if (bfs.exists(oldWalKey, WAL_FILE_PREFIX + endPosition.fileId)) { DataInputStream in = bfs.getInputStream(oldWalKey, WAL_FILE_PREFIX + endPosition.fileId); int length = (int)(startPosition.fileId == endPosition.fileId ? endPosition.offset - startPosition.offset : endPosition.offset); int offset = (int)(startPosition.fileId == endPosition.fileId ? startPosition.offset : 0); logger.info("length = offset = start offset = end offset = File = {}", length, offset, startPosition, endPosition); if (copyBuffer == null) { copyBuffer = new byte[BUFFER_SIZE]; } IOUtils.skip(in, offset); while (length > 0) { int readBytes = IOUtils.read(in, copyBuffer, 0, length < BUFFER_SIZE ? length : BUFFER_SIZE); append(copyBuffer, readBytes); length -= readBytes; } in.close(); flushWal(); if (writer != null) { walSize = writer.getSize(); } logger.debug("wal size so far = {}", walSize); } } catch (IOException e) { throw Throwables.propagate(e); } }
Source:
<code><START> public double getCpuLoad() { <END> if (this.collectedCpuStats.isEmpty()) { return -1; } final CpuStats oldestCpuStats = this.collectedCpuStats.pollLast(); final CpuStats newestCpuStats = getCpuStats(); this.collectedCpuStats.push(newestCpuStats); return calcCpuLoad(oldestCpuStats, newestCpuStats); }</code><technical_language>Is calculating newest oldest data points right get CPU load? discuss more it</technical_language>

Target:
public double getCpuLoad() { if (this.collectedCpuStats.isEmpty()) { return -1; } final CpuStats newestCpuStats = getCpuStats(); if (newestCpuStats == null) { return -1; } final CpuStats oldestCpuStats = this.collectedCpuStats.pollLast(); this.collectedCpuStats.push(newestCpuStats); return calcCpuLoad(oldestCpuStats, newestCpuStats); }
Source:
<code>protected static String loadFileTextFromJar(final File jarFile, String path, String fileName) { try (ZipFile zip = new ZipFile(jarFile)) { for (Enumeration e = zip.entries(); e.hasMoreElements(); ) { ZipEntry entry = (ZipEntry) e.nextElement(); if (entry.getName().startsWith(path) && entry.getName().endsWith(fileName)) { return zipEntryToString(zip, entry); } } } catch (ZipException e) { log.error(e.getMessage()); } catch (IOException e) { log.error(e.getMessage()); <START> } catch (NullPointerException e) { <END> log.error(e.getMessage()); } return null; }</code><technical_language>NPE avoided handled</technical_language>

Target:
protected static String loadFileTextFromJar(final File jarFile, String path, String fileName) { if (jarFile != null && fileName != null && !fileName.isEmpty()) { try (ZipFile zip = new ZipFile(jarFile)) { for (Enumeration e = zip.entries(); e.hasMoreElements(); ) { ZipEntry entry = (ZipEntry) e.nextElement(); if (entry.getName().startsWith(path) && entry.getName().endsWith(fileName)) { return zipEntryToString(zip, entry); } } } catch (ZipException e) { log.error(e.getMessage()); } catch (IOException e) { log.error(e.getMessage()); } } return null; }
Source:
<code>public void setUserProperties(final JSONObject userProperties, final boolean replace) { if (replace || this.userProperties == null) { this.userProperties = userProperties; return; } if (userProperties == null) { return; } final JSONObject currentUserProperties = this.userProperties; runOnLogThread(new Runnable() { @Override public void run() { final JSONObject copy; try { <START> copy = new JSONObject(userProperties.toString()); <END> } catch (JSONException e) { Log.e(TAG, e.toString()); return; } Iterator<?> keys = copy.keys(); while (keys.hasNext()) { String key = (String) keys.next(); try { currentUserProperties.put(key, copy.get(key)); } catch (JSONException e) { Log.e(TAG, e.toString()); } } } }); }</code><technical_language>a risk of ConcurrentModification calling toString here</technical_language>

Target:
public void setUserProperties(final JSONObject userProperties, final boolean replace) { runOnLogThread(new Runnable() { @Override public void run() { AmplitudeClient instance = AmplitudeClient.this; if (userProperties == null) { if (replace) { instance.userProperties = null; } return; } JSONObject copy; try { copy = new JSONObject(userProperties.toString()); } catch (JSONException e) { Log.e(TAG, e.toString()); return; } JSONObject currentUserProperties = instance.userProperties; if (replace || currentUserProperties == null) { instance.userProperties = copy; return; } Iterator<?> keys = copy.keys(); while (keys.hasNext()) { String key = (String) keys.next(); try { currentUserProperties.put(key, copy.get(key)); } catch (JSONException e) { Log.e(TAG, e.toString()); } } } }); }
Source:
<code>public void onInstancesChange(Set<String> enabledInstances, List<String> changedInstances) { _enabledInstances = enabledInstances; Set<String> segmentsToUpdate = new HashSet<>(); Map<String, List<String>> instanceToSegmentsMap = _instanceToSegmentsMap; for (String instance : changedInstances) { List<String> segments = instanceToSegmentsMap.get(instance); if (segments != null) { segmentsToUpdate.addAll(segments); } } if (segmentsToUpdate.isEmpty()) { return; } Map<String, List<String>> segmentToOnlineInstancesMap = _segmentToOnlineInstancesMap; Map<String, List<String>> segmentToOfflineInstancesMap = _segmentToOfflineInstancesMap; Map<String, List<String>> segmentToEnabledInstancesMap = _segmentToEnabledInstancesMap; Set<String> currentUnavailableSegments = _unavailableSegments; Set<String> newUnavailableSegments = new HashSet<>(); for (Map.Entry<String, List<String>> entry : segmentToEnabledInstancesMap.entrySet()) { String segment = entry.getKey(); if (segmentsToUpdate.contains(segment)) { List<String> enabledInstancesForSegment = calculateEnabledInstancesForSegment(segment, segmentToOnlineInstancesMap.get(segment), <START> segmentToOfflineInstancesMap, enabledInstances, newUnavailableSegments); <END> entry.setValue(enabledInstancesForSegment); } else { if (currentUnavailableSegments.contains(segment)) { newUnavailableSegments.add(segment); } } } _unavailableSegments = newUnavailableSegments; }</code><technical_language>dont need this variable, _unavailableSegments in line 110 right</technical_language>

Target:
public void onInstancesChange(Set<String> enabledInstances, List<String> changedInstances) { _enabledInstances = enabledInstances; Set<String> segmentsToUpdate = new HashSet<>(); for (String instance : changedInstances) { List<String> segments = _instanceToSegmentsMap.get(instance); if (segments != null) { segmentsToUpdate.addAll(segments); } } if (segmentsToUpdate.isEmpty()) { return; } Map<String, List<String>> segmentToEnabledInstancesMap = _segmentToEnabledInstancesMap; Set<String> currentUnavailableSegments = _unavailableSegments; Set<String> newUnavailableSegments = new HashSet<>(); for (Map.Entry<String, List<String>> entry : segmentToEnabledInstancesMap.entrySet()) { String segment = entry.getKey(); if (segmentsToUpdate.contains(segment)) { List<String> enabledInstancesForSegment = calculateEnabledInstancesForSegment(segment, _segmentToOnlineInstancesMap.get(segment), newUnavailableSegments); entry.setValue(enabledInstancesForSegment); } else { if (currentUnavailableSegments.contains(segment)) { newUnavailableSegments.add(segment); } } } _unavailableSegments = newUnavailableSegments; }
Source:
<code>public void setColor(RGB rgb) { <START> PreferenceConverter.setValue(fOverlayStore, this.colorKey, rgb); <END> }</code><technical_language>In case a color associated, this method set previousColor</technical_language>

Target:
public void setColor(RGB rgb) { this.previousColor= PreferenceConverter.getColor(fOverlayStore, this.colorKey); PreferenceConverter.setValue(fOverlayStore, this.colorKey, rgb); }
Source:
<code>void fromCommandDispatch() { BlackBoxBoundedContext .with(new TaskAggregateRepository()) .receivesCommand(createTask()) <START> .verifiesThat(acked(1).withoutErrorsOrRejections()) <END> .verifiesThat(emitted(1)) .close(); }</code><technical_language>I acked emitted API methods need more clear users code-readers. Right I I 100% do. I try guess. discuss in person</technical_language>

Target:
void fromCommandDispatch() { BlackBoxBoundedContext .with(new TaskAggregateRepository()) .receivesCommand(createTask()) .verifiesThat(acked(once()).withoutErrorsOrRejections()) .verifiesThat(emitted(once())) .close(); }
Source:
<code>public void testPartialUpdate() throws Exception { Statistics statsNode0 = getStatistics(0); withTxSession(false, sessionFactories[0], s -> { Street street = new Street("hard"); s.persist(street); }); assertEquals(1, statsNode0.getSecondLevelCachePutCount()); assertEquals(0, statsNode0.getSecondLevelCacheMissCount()); assertEquals(0, statsNode0.getSecondLevelCacheHitCount()); Statistics statsNode1 = getStatistics(1); withSession(sessionFactories[1].withOptions(), s -> { final Street street = s.load(Street.class, 1); assertEquals("hard", street.getName()); }); assertEquals(0, statsNode1.getSecondLevelCachePutCount()); assertEquals(0, statsNode1.getSecondLevelCacheMissCount()); assertEquals(1, statsNode1.getSecondLevelCacheHitCount()); statsNode0 = getStatistics(0); final boolean updated = doUpdate(); if (updated) { withSession(sessionFactories[0].withOptions(), s -> { final Street street = s.load(Street.class, 1); assertEquals("hardstrasse", street.getName()); }); withSession(sessionFactories[1].withOptions(), s -> { final Street street = s.load(Street.class, 1); <START> assertEquals("hardstrasse", street.getName()); <END> }); } }</code><technical_language>this called concurrently? add synchronized method..</technical_language>

Target:
public void testPartialUpdate() throws Exception { Statistics statsNode0 = getStatistics(localFactory); withTxSession(localFactory, s -> { Customer customer = new Customer(); customer.setName("JBoss"); s.persist(customer); }); assertEquals(1, statsNode0.getSecondLevelCachePutCount()); assertEquals(0, statsNode0.getSecondLevelCacheMissCount()); assertEquals(0, statsNode0.getSecondLevelCacheHitCount()); waitForRemotePut(); Statistics statsNode1 = getStatistics(remoteFactory); withSession(remoteFactory.withOptions(), s -> { Customer customer = s.load(Customer.class, 1); assertEquals("JBoss", customer.getName()); }); assertEquals(0, statsNode1.getSecondLevelCachePutCount()); assertEquals(0, statsNode1.getSecondLevelCacheMissCount()); assertEquals(1, statsNode1.getSecondLevelCacheHitCount()); final boolean updated = doUpdate(); if (updated) { withSession(localFactory.withOptions(), s -> { Customer customer = s.load(Customer.class, 1); assertEquals("JBoss, a division of Red Hat", customer.getName()); }); withSession(remoteFactory.withOptions(), s -> { Customer customer = s.load(Customer.class, 1); assertEquals("JBoss, a division of Red Hat", customer.getName()); }); } }
Source:
<code><START> public final <R> Single<R> cast(final Class<R> klass) { <END> return lift(new OperatorCast<T, R>(klass)); }</code><technical_language>nit: param need final</technical_language>

Target:
public final <R> Single<R> cast(final Class<R> klass) { return map(new SingleOperatorCast<T, R>(klass)); }
Source:
<code>public void open(GenericInputSplit split) throws IOException { <START> this.partitionNumber = split.getSplitNumber(); <END> if (serializableIter != null) it = serializableIter; else it = this.steam.iterator(); }</code><technical_language>This reproducing super class behavior. is cleaner call super.open(split)</technical_language>

Target:
public void open(GenericInputSplit split) throws IOException { super.open(split); if (serializableIter != null) { it = serializableIter; } else { it = this.dataSet.iterator(); } }
Source:
<code>public void fetchEndOffsetsShouldRethrowInterruptedExceptionAsStreamsException() throws Exception { final Admin adminClient = EasyMock.createMock(AdminClient.class); final ListOffsetsResult result = EasyMock.createNiceMock(ListOffsetsResult.class); final KafkaFuture<Map<TopicPartition, ListOffsetsResultInfo>> allFuture = EasyMock.createMock(KafkaFuture.class); EasyMock.expect(adminClient.listOffsets(EasyMock.anyObject())).andStubReturn(result); EasyMock.expect(result.all()).andStubReturn(allFuture); <START> EasyMock.expect(allFuture.get(60000L, TimeUnit.MILLISECONDS)).andThrow(new InterruptedException()); <END> replay(adminClient, result, allFuture); assertThrows(StreamsException.class, () -> fetchEndOffsets(emptyList(), adminClient, 60_000L)); verify(adminClient); }</code><technical_language>(also below) nit: 60_000L (if 60 TimeUnit.SECONDS?)</technical_language>

Target:
public void fetchEndOffsetsShouldRethrowInterruptedExceptionAsStreamsException() throws Exception { final Admin adminClient = EasyMock.createMock(AdminClient.class); final ListOffsetsResult result = EasyMock.createNiceMock(ListOffsetsResult.class); final KafkaFuture<Map<TopicPartition, ListOffsetsResultInfo>> allFuture = EasyMock.createMock(KafkaFuture.class); EasyMock.expect(adminClient.listOffsets(EasyMock.anyObject())).andStubReturn(result); EasyMock.expect(result.all()).andStubReturn(allFuture); EasyMock.expect(allFuture.get()).andThrow(new InterruptedException()); replay(adminClient, result, allFuture); assertThrows(StreamsException.class, () -> fetchEndOffsets(emptyList(), adminClient)); verify(adminClient); }
Source:
<code><START> public Map<String, List<String>> getHeaders() { <END> return headers; }</code><technical_language>This API change, convert a MultivaluedMap for compatiblity</technical_language>

Target:
public MultivaluedMap<String, String> getHeaders() { final MultivaluedHashMap<String, String> toReturn = new MultivaluedHashMap<String, String>(); toReturn.putAll(headers); return toReturn; }
Source:
<code>private void testNotifyVisibilityChange(boolean isStandalone) { final WorkbenchMenuBarPresenter presenter = getMenuBarPresenter(isStandalone); presenter.onPerspectiveVisibilityChange(new PerspectiveVisibiltiyChangeEvent("perspectiveId", false)); <START> verify(presenter, times(1)).onPerspectiveVisibilityChange(any()); <END> }</code><technical_language>verify(presenter) is verify(presenter, times(1))</technical_language>

Target:
private void testNotifyVisibilityChange(boolean isStandalone) { final WorkbenchMenuBarPresenter presenter = getMenuBarPresenter(isStandalone); presenter.onPerspectiveVisibilityChange(new PerspectiveVisibiltiyChangeEvent("perspectiveId", false)); verify(presenter).onPerspectiveVisibilityChange(any()); }
Source:
<code>private static String getTestingAlias(GoImportSpec testingImportSpec) { String alias = GoConstants.TESTING_PATH; <START> if (testingImportSpec != null) { <END> alias = !testingImportSpec.isDot() ? StringUtil.notNullize(testingImportSpec.getAlias(), GoConstants.TESTING_PATH) : ""; } return alias; }</code><technical_language>alias variable is redundant</technical_language>

Target:
private static String getTestingAlias(GoImportSpec testingImportSpec) { return testingImportSpec == null ? GoConstants.TESTING_PATH : !testingImportSpec.isDot() ? StringUtil.notNullize(testingImportSpec.getAlias(), GoConstants.TESTING_PATH) : ""; }
Source:
<code>public void localFailTest() { initialize(); ot = new SimpleOperationTracker(datanodes.get(0).getDatacenterName(), mockPartition, false, 2, 3); assertFalse(ot.hasSucceeded()); Iterator<ReplicaId> itr = ot.getReplicaIterator(); ReplicaId nextReplica; while (itr.hasNext()) { nextReplica = itr.next(); assertNotNull(nextReplica); sendReplica(nextReplica); itr.remove(); } for (int i = 0; i < 2; i++) { ot.onResponse(inflightReplicas.poll(), new Exception()); } assertFalse(ot.hasSucceeded()); assertTrue(ot.isDone()); <START> ot.onResponse(inflightReplicas.poll(), null); <END> assertFalse(ot.hasSucceeded()); assertTrue(ot.isDone()); }</code><technical_language>something. operation is set done, status change done cost? right. So, checking this condition holds good is it</technical_language>

Target:
public void localFailTest() { initialize(); ot = new SimpleOperationTracker(localDcName, mockPartition, false, 2, 3); assertFalse(ot.hasSucceeded()); Iterator<ReplicaId> itr = ot.getReplicaIterator(); ReplicaId nextReplica; while (itr.hasNext()) { nextReplica = itr.next(); assertNotNull(nextReplica); sendReplica(nextReplica); itr.remove(); } for (int i = 0; i < 2; i++) { ot.onResponse(inflightReplicas.poll(), new Exception()); } assertFalse(ot.hasSucceeded()); assertTrue(ot.isDone()); ot.onResponse(inflightReplicas.poll(), null); assertFalse(ot.hasSucceeded()); assertTrue(ot.isDone()); }
Source:
<code>public void transition(RMNodeImpl rmNode, RMNodeEvent event) { Integer timeout = null; if (RMNodeDecommissioningEvent.class.isInstance(event)) { RMNodeDecommissioningEvent e = ((RMNodeDecommissioningEvent) event); timeout = e.getDecommissioningTimeout(); } if (rmNode.getState() == NodeState.DECOMMISSIONING) { if (!Objects.equals(rmNode.getDecommissioningTimeout(), timeout)) { LOG.info("Update " + rmNode.getNodeID() + " DecommissioningTimeout to be " + timeout); rmNode.decommissioningTimeout = timeout; } else { LOG.info(rmNode.getNodeID() + " is already DECOMMISSIONING"); } return; } LOG.info("Put Node " + rmNode.nodeId + " in DECOMMISSIONING."); rmNode.updateMetricsForGracefulDecommission(initState, finalState); rmNode.decommissioningTimeout = timeout; rmNode.context.getDispatcher().getEventHandler().handle( new NodesListManagerEvent( <START> NodesListManagerEventType.NODE_USABLE, rmNode)); <END> if (rmNode.originalTotalCapability == null){ rmNode.originalTotalCapability = Resources.clone(rmNode.totalCapability); LOG.info("Preserve original total capability: " + rmNode.originalTotalCapability); } }</code><technical_language>Hmmm.. sending NODE_USABLE event here.. technically, is usable. consider creating a new NODE_DECOMMISSIONING event</technical_language>

Target:
public void transition(RMNodeImpl rmNode, RMNodeEvent event) { Integer timeout = null; if (RMNodeDecommissioningEvent.class.isInstance(event)) { RMNodeDecommissioningEvent e = ((RMNodeDecommissioningEvent) event); timeout = e.getDecommissioningTimeout(); } if (rmNode.getState() == NodeState.DECOMMISSIONING) { if (!Objects.equals(rmNode.getDecommissioningTimeout(), timeout)) { LOG.info("Update " + rmNode.getNodeID() + " DecommissioningTimeout to be " + timeout); rmNode.decommissioningTimeout = timeout; } else { LOG.info(rmNode.getNodeID() + " is already DECOMMISSIONING"); } return; } LOG.info("Put Node " + rmNode.nodeId + " in DECOMMISSIONING."); rmNode.updateMetricsForGracefulDecommission(initState, finalState); rmNode.decommissioningTimeout = timeout; rmNode.context.getDispatcher().getEventHandler().handle( new NodesListManagerEvent( NodesListManagerEventType.NODE_DECOMMISSIONING, rmNode)); if (rmNode.originalTotalCapability == null){ rmNode.originalTotalCapability = Resources.clone(rmNode.totalCapability); LOG.info("Preserve original total capability: " + rmNode.originalTotalCapability); } }
Source:
<code>public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { mRootView = inflater.inflate(R.layout.fragment_login, container, false); initViewFields(mRootView); mPasswordInput.setHint(Html.fromHtml(getString(R.string.login_password_hint) + getString(R.string.req_star))); <START> mUsernameInput.setHint(Html.fromHtml(getString(R.string.login_username_hint) + getString(R.string.req_star))); <END> initListeners(); if (mLastCorrectURL.equals(ApplicationConstants.EMPTY_STRING)) { mUrl.setText(OpenMRS.getInstance().getServerUrl()); mLastCorrectURL = OpenMRS.getInstance().getServerUrl(); } else { mUrl.setText(mLastCorrectURL); } hideURLDialog(); FontsUtil.setFont(this.getActivity().findViewById(android.R.id.content)); return mRootView; }</code><technical_language>[These 2 lines](<LINK_0> initViewFields method</technical_language>

Target:
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { mRootView = inflater.inflate(R.layout.fragment_login, container, false); initViewFields(mRootView); initListeners(); if (mLastCorrectURL.equals(ApplicationConstants.EMPTY_STRING)) { mUrl.setText(OpenMRS.getInstance().getServerUrl()); mLastCorrectURL = OpenMRS.getInstance().getServerUrl(); } else { mUrl.setText(mLastCorrectURL); } hideURLDialog(); FontsUtil.setFont(this.getActivity().findViewById(android.R.id.content)); return mRootView; }
Source:
<code>protected void executeQueryCommand() { <START> getQueryReturnValue().setReturnValue(DbFacade.getInstance() <END> .getGlusterVolumeDao() .getById(getParameters().getVolumeId())); }</code><technical_language>please extract method : protected GlusterVolumeInfoDao getGlusterVolumeInfoDao() reason for this, is able write a test mockito (and pockermock / static mocking) for this query</technical_language>

Target:
protected void executeQueryCommand() { getQueryReturnValue().setReturnValue(getGlusterVolumeDao().getById(getParameters().getVolumeId())); }
Source:
<code>public static Block sequenceTimestampYearToMonth( ConnectorSession session, @SqlType(StandardTypes.TIMESTAMP) long start, @SqlType(StandardTypes.TIMESTAMP) long end, @SqlType(StandardTypes.INTERVAL_YEAR_TO_MONTH) long step) { checkCondition(step != 0, INVALID_FUNCTION_ARGUMENT, "interval must not be zero"); checkCondition(step > 0 ? end >= start : end <= start, INVALID_FUNCTION_ARGUMENT, "sequence end value should be greater than or equal to start value if step is greater than zero otherwise end should be less than start"); int length = toIntExact(diffTimestamp(session, MONTH, start, end) / step + 1); <START> checkCondition(length <= MAX_LENGTH, INVALID_FUNCTION_ARGUMENT, "sequence should be no greater than " + MAX_LENGTH); <END> BlockBuilder blockBuilder = BIGINT.createBlockBuilder(new BlockBuilderStatus(), length); int value = 0; for (int i = 0; i < length; ++i) { BIGINT.writeLong(blockBuilder, DateTimeOperators.timestampPlusIntervalYearToMonth(session, start, value)); value += step; } return blockBuilder.build(); }</code><technical_language>result of sequence function more MAX_LENGTH entries</technical_language>

Target:
public static Block sequenceTimestampYearToMonth( ConnectorSession session, @SqlType(StandardTypes.TIMESTAMP) long start, @SqlType(StandardTypes.TIMESTAMP) long end, @SqlType(StandardTypes.INTERVAL_YEAR_TO_MONTH) long step) { checkCondition(step != 0, INVALID_FUNCTION_ARGUMENT, "interval must not be zero"); checkCondition(step > 0 ? end >= start : end <= start, INVALID_FUNCTION_ARGUMENT, "sequence end value should be greater than or equal to start value if step is greater than zero otherwise end should be less than start"); int length = toIntExact(diffTimestamp(session, MONTH, start, end) / step + 1); checkCondition(length <= MAX_RESULT_ENTRIES, INVALID_FUNCTION_ARGUMENT, "result of sequence function must not have more than 10000 entries"); BlockBuilder blockBuilder = BIGINT.createBlockBuilder(new BlockBuilderStatus(), length); int value = 0; for (int i = 0; i < length; ++i) { BIGINT.writeLong(blockBuilder, DateTimeOperators.timestampPlusIntervalYearToMonth(session, start, value)); value += step; } return blockBuilder.build(); }
Source:
<code>protected void createFieldEditors() { <START> NpmHomeFieldEditor bowerHomeEditor = new NpmHomeFieldEditor(NpmPreferenceHolder.PREF_NPM_LOCATION, <END> Messages.NpmPreferencePage_NpmLocationLabel, getFieldEditorParent()); addField(bowerHomeEditor); }</code><technical_language>bowerHode...->nmpHome..</technical_language>

Target:
protected void createFieldEditors() { NpmHomeFieldEditor npmHomeEditor = new NpmHomeFieldEditor(NpmPreferenceHolder.PREF_NPM_LOCATION, Messages.NpmPreferencePage_NpmLocationLabel, getFieldEditorParent()); addField(npmHomeEditor); }
Source:
<code>private void continueChain(final OperationChain opChain) { synchronized (opChain.testFutures) { OperationType nextOp = opChain.operations.poll(); if (nextOp == null) { opChain.latch.countDown(); return; } GetOptions options = GetOptions.None; switch (nextOp) { case PUT: startPutBlob(opChain); break; case GET_INFO_DELETED_SUCCESS: options = GetOptions.Include_Deleted_Blobs; case GET_INFO: case GET_INFO_DELETED: <START> startGetBlobInfo(options, nextOp.afterDelete && options.equals(GetOptions.None), opChain); <END> break; case GET_DELETED_SUCCESS: options = GetOptions.Include_Deleted_Blobs; case GET: case GET_DELETED: startGetBlob(options, nextOp.afterDelete && options.equals(GetOptions.None), opChain); break; case DELETE: startDeleteBlob(opChain); break; case AWAIT_CREATION: startAwaitCreation(opChain); break; case AWAIT_DELETION: startAwaitDeletion(opChain); break; default: throw new IllegalArgumentException("Unknown op: " + nextOp); } } }</code><technical_language>instead change flag nextOp.afterDelete nextOp.checkDeleted. Then, need check GetOptions type here</technical_language>

Target:
private void continueChain(final OperationChain opChain) { synchronized (opChain.testFutures) { OperationType nextOp = opChain.operations.poll(); if (nextOp == null) { opChain.latch.countDown(); return; } GetOption options = GetOption.None; switch (nextOp) { case PUT: startPutBlob(opChain); break; case GET_INFO_DELETED_SUCCESS: options = GetOption.Include_Deleted_Blobs; case GET_INFO: case GET_INFO_DELETED: startGetBlobInfo(options, nextOp.checkDeleted, opChain); break; case GET_DELETED_SUCCESS: options = GetOption.Include_Deleted_Blobs; case GET: case GET_DELETED: startGetBlob(options, nextOp.checkDeleted, opChain); break; case DELETE: startDeleteBlob(opChain); break; case AWAIT_CREATION: startAwaitCreation(opChain); break; case AWAIT_DELETION: startAwaitDeletion(opChain); break; default: throw new IllegalArgumentException("Unknown op: " + nextOp); } } }
Source:
<code>private void setupServices() { graphLoadService = new GraphLoadService(); graphLoadService.setOnFailed(e -> new ExceptionDialog(fileOpenPane.getParent(), graphLoadService.getException(), "Error loading graph files!")); graphLoadService.setOnRunning(e -> progressDialog.show()); graphLoadService.setOnSucceeded(e -> { graphProperty.setValue(graphLoadService.getValue()); <START> done.setValue(!done.getValue()); <END> progressDialog.close(); }); newickLoadService = new NewickLoadService(); newickLoadService.setOnFailed(e -> new ExceptionDialog(fileOpenPane.getParent(), newickLoadService.getException(), "Error loading newick file!")); newickLoadService.setOnSucceeded(e -> treeProperty.setValue(newickLoadService.getValue())); gffLoadService = new GFFLoadService(); gffLoadService.setOnFailed(e -> new ExceptionDialog(fileOpenPane.getParent(), gffLoadService.getException(), "Error loading annotations file!")); gffLoadService.graphProperty().bind(graphProperty); }</code><technical_language>this done.setValue(true)</technical_language>

Target:
private void setupServices() { graphLoadService = new GraphLoadService(); graphLoadService.setOnFailed(e -> { progressDialog.close(); new ExceptionDialog(fileOpenPane.getParent(), graphLoadService.getException(), "Error loading graph files!"); }); graphLoadService.setOnRunning(e -> progressDialog.show()); graphLoadService.setOnSucceeded(e -> { progressDialog.close(); graphProperty.setValue(graphLoadService.getValue()); }); newickLoadService = new NewickLoadService(); newickLoadService.setOnFailed(e -> new ExceptionDialog(fileOpenPane.getParent(), newickLoadService.getException(), "Error loading newick file!")); newickLoadService.setOnSucceeded(e -> treeProperty.setValue(newickLoadService.getValue())); }
Source:
<code>public World getWorld() { <START> World world = this.world != null ? this.world.get() : null; <END> if (world == null) { world = DimensionManager.getWorld(getDimId()); this.world = new WeakReference<World>(world); } return world; }</code><technical_language>I avoid ternary statement checking if (this.world == null) instead, returning this.world.get() end</technical_language>

Target:
public World getWorld() { World world = this.world != null ? this.world.get() : null; if (world == null) { world = FMLCommonHandler.instance().getMinecraftServerInstance().getWorld(getDimId()); this.world = new WeakReference<World>(world); } return world; }
Source:
<code><START> public ITmfTrace getTrace() throws RuntimeException { <END> for (ITmfTrace trace : TmfTraceManager.getInstance().getOpenedTraces()) { if (trace.getResource().equals(getResource())) { return trace; } } return null; }</code><technical_language>receive a RuntimeException anymore</technical_language>

Target:
public ITmfTrace getTrace() { for (ITmfTrace trace : TmfTraceManager.getInstance().getOpenedTraces()) { if (trace.getResource().equals(getResource())) { return trace; } } return null; }
Source:
<code>public Construct exec(Target t, Environment env, Construct... args) throws CancelCommandException, ConfigRuntimeException { if (!(args[0] instanceof CString)) { <START> throw new CREFormatException(this.getName() + " expects a string as first argument, but type " <END> + args[0].typeof() + " was found.", t); } Static.AssertNonCNull(t, args); String teststring = args[0].nval(); String keyword = args[1].nval(); boolean ret = teststring.startsWith(keyword); return CBoolean.get(ret); }</code><technical_language>CastException, format</technical_language>

Target:
public Construct exec(Target t, Environment env, Construct... args) throws CancelCommandException, ConfigRuntimeException { Static.AssertNonCNull(t, args); String teststring = args[0].nval(); String keyword = args[1].nval(); boolean ret = teststring.startsWith(keyword); return CBoolean.get(ret); }
Source:
<code>public void testPolicies() { String name = UUID.randomUUID().toString(); Policy policy = new Policy("/", name, "^foo.", null, 0, Collections.<String, Object>singletonMap("message-ttl", 1000)); this.template.addPolicy(policy); List<Policy> list = this.template.policies(); assertTrue(list.size() > 0); Policy out = null; for (Policy policyOut : list) { if (policyOut.getName().equals(name)) { out = policyOut; break; } } assertNotNull(out); list = this.template.policies("/"); assertTrue(list.size() > 0); out = null; for (Policy policyOut : list) { if (policyOut.getName().equals(name)) { out = policyOut; break; } } assertNotNull(out); this.template.removePolicy("/", name); list = this.template.policies(); out = null; for (Policy policyOut : list) { if (policyOut.getName().equals(name)) { out = policyOut; break; } <START> } <END> }</code><technical_language>this test ins't finished. assertNull(out); ins end</technical_language>

Target:
public void testPolicies() { String name = UUID.randomUUID().toString(); Policy policy = new Policy("/", name, "^foo.", null, 0, Collections.<String, Object>singletonMap("message-ttl", 1000)); this.template.addPolicy(policy); List<Policy> list = this.template.policies(); assertTrue(list.size() > 0); Policy out = null; for (Policy policyOut : list) { if (policyOut.getName().equals(name)) { out = policyOut; break; } } assertNotNull(out); list = this.template.policies("/"); assertTrue(list.size() > 0); out = null; for (Policy policyOut : list) { if (policyOut.getName().equals(name)) { out = policyOut; break; } } assertNotNull(out); this.template.removePolicy("/", name); list = this.template.policies(); out = null; for (Policy policyOut : list) { if (policyOut.getName().equals(name)) { out = policyOut; break; } } assertNull(out); }
Source:
<code>public String buildSql(List<HiveColumnHandle> columns, TupleDomain<HiveColumnHandle> tupleDomain) { StringBuilder sql = new StringBuilder(); <START> sql.append("SELECT "); <END> if (columns.isEmpty()) { sql.append("' '"); } else { String columnNames = columns.stream() .map(column -> String.format("s._%d", column.getHiveColumnIndex() + 1)) .collect(joining(", ")); sql.append(columnNames); } sql.append(" FROM "); sql.append(DATA_SOURCE); List<String> clauses = toConjuncts(columns, tupleDomain); if (!clauses.isEmpty()) { sql.append(" WHERE ") .append(Joiner.on(" AND ").join(clauses)); } return sql.toString(); }</code><technical_language>move "SELECT" StringBuilder constructor call above</technical_language>

Target:
String buildSql(List<HiveColumnHandle> columns, TupleDomain<HiveColumnHandle> tupleDomain) { StringBuilder sql = new StringBuilder("SELECT "); if (columns.isEmpty()) { sql.append("' '"); } else { String columnNames = columns.stream() .map(column -> format("s._%d", column.getHiveColumnIndex() + 1)) .collect(joining(", ")); sql.append(columnNames); } sql.append(" FROM "); sql.append(DATA_SOURCE); List<String> clauses = toConjuncts(columns, tupleDomain); if (!clauses.isEmpty()) { sql.append(" WHERE ") .append(Joiner.on(" AND ").join(clauses)); } return sql.toString(); }
Source:
<code>public String put(StorageMetadata metadata, File localFile) { <START> hdfsAuth.authorize(); <END> final Path projectsPath = new Path(rootUri.getPath(), String.valueOf(metadata.getProjectId())); try { if (hdfs.mkdirs(projectsPath)) { log.info("Created project dir: " + projectsPath); } final Path targetPath = createTargetPath(metadata, localFile, projectsPath); if ( hdfs.exists( targetPath )) { throw new StorageException(String.format( "Error: Target file already exists. targetFile: %s, Metadata: %s", targetPath, metadata)); } log.info(String.format("Creating project artifact: meta: %s path: %s", metadata, targetPath)); hdfs.copyFromLocalFile(new Path(localFile.getAbsolutePath()), targetPath); return URI.create(rootUri.getPath()).relativize(targetPath.toUri()).getPath(); } catch (IOException e) { log.error("error in put(): Metadata: " + metadata); throw new StorageException(e); } }</code><technical_language>if authrorize failed, continue running</technical_language>

Target:
public String put(StorageMetadata metadata, File localFile) { hdfsAuth.authorize(); final Path projectsPath = new Path(rootUri.getPath(), String.valueOf(metadata.getProjectId())); try { if (hdfs.mkdirs(projectsPath)) { log.info("Created project dir: " + projectsPath); } final Path targetPath = createTargetPath(metadata, localFile, projectsPath); if (hdfs.exists(targetPath)) { log.info( String.format("Duplicate Found: meta: %s path: %s", metadata, targetPath)); return getRelativePath(targetPath); } log.info(String.format("Creating project artifact: meta: %s path: %s", metadata, targetPath)); hdfs.copyFromLocalFile(new Path(localFile.getAbsolutePath()), targetPath); return getRelativePath(targetPath); } catch (IOException e) { log.error("error in put(): Metadata: " + metadata); throw new StorageException(e); } }
Source:
<code>private void cleanQuotaWatchers(QuotaWatcher quotaWatcher) { quotaWatchers.remove(quotaWatcher); log.info("Millis QuotaWatcher was alive: {}", (System.currentTimeMillis() - quotaWatcher.startMS)); <START> <END> quotaWatchers.removeIf(qw -> { if (System.currentTimeMillis() - qw.startMS > 120_000) { log.info("Removing QuotaWatcher with MS alive: {}", (System.currentTimeMillis() - qw.startMS)); return true; } return false; }); }</code><technical_language>This method breaks Single Responsibility contract i.e. performs 2 tasks - removing supplied watcher *and* removing watchers. inline line 438? work</technical_language>

Target:
private void cleanQuotaWatchers(QuotaWatcher quotaWatcher) { log.info("Millis QuotaWatcher was alive: {}", (System.currentTimeMillis() - quotaWatcher.startMS)); quotaWatchers.entrySet().removeIf(qw -> { if (System.currentTimeMillis() - qw.getValue().startMS > 120_000) { log.info("Removing QuotaWatcher with MS alive: {}", (System.currentTimeMillis() - qw.getValue().startMS)); return true; } return false; }); }
Source:
<code>public void onPlayerInteraction(final PlayerInteractEvent event) { final Player player = event.getPlayer(); final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player); if (event.getAction() == Action.RIGHT_CLICK_BLOCK) { if (!RIGHT_CLICK_INTERACT.contains(player.getUniqueId())) { final UUID uuid = player.getUniqueId(); RIGHT_CLICK_INTERACT.add(uuid); new BukkitRunnable() { @Override public void run() { RIGHT_CLICK_INTERACT.remove(uuid); } }.runTaskLater(this.plugin, 5); } if (event.getHand() == EquipmentSlot.HAND) { if (bPlayer.canCurrentlyBendWithWeapons()) { if (event.getClickedBlock() != null) { ComboManager.addComboAbility(player, ClickType.RIGHT_CLICK_BLOCK); } else { ComboManager.addComboAbility(player, ClickType.RIGHT_CLICK); } } } if (bPlayer.getBoundAbilityName().equalsIgnoreCase("EarthSmash")) { new EarthSmash(player, ClickType.RIGHT_CLICK); } } if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) { if (bPlayer.getBoundAbilityName().equalsIgnoreCase("IceBlast")) { if (CoreAbility.hasAbility(player, IceBullet.class)) { CoreAbility.getAbility(player, IceBullet.class).doRightClick(); } } } if (MovementHandler.isStopped(player) || Bloodbending.isBloodbent(player) || Suffocate.isBreathbent(player)) { event.setCancelled(true); <START> Bukkit.broadcastMessage("the 3 combo thingy set the event as cancelled"+MovementHandler.isStopped(player)+Bloodbending.isBloodbent(player)+Suffocate.isBreathbent(player)); <END> } }</code><technical_language>This is extremely uninformative debug message. useful I this in pull request I able identify this message means</technical_language>

Target:
public void onPlayerInteraction(final PlayerInteractEvent event) { final Player player = event.getPlayer(); final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player); if (event.getAction() == Action.RIGHT_CLICK_BLOCK) { if (!RIGHT_CLICK_INTERACT.contains(player.getUniqueId())) { final UUID uuid = player.getUniqueId(); RIGHT_CLICK_INTERACT.add(uuid); new BukkitRunnable() { @Override public void run() { RIGHT_CLICK_INTERACT.remove(uuid); } }.runTaskLater(this.plugin, 5); } if (event.getHand() == EquipmentSlot.HAND) { if (bPlayer.canCurrentlyBendWithWeapons()) { if (event.getClickedBlock() != null) { ComboManager.addComboAbility(player, ClickType.RIGHT_CLICK_BLOCK); } else { ComboManager.addComboAbility(player, ClickType.RIGHT_CLICK); } } } if (bPlayer.getBoundAbilityName().equalsIgnoreCase("EarthSmash")) { new EarthSmash(player, ClickType.RIGHT_CLICK); } } if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) { if (bPlayer.getBoundAbilityName().equalsIgnoreCase("IceBlast")) { if (CoreAbility.hasAbility(player, IceBullet.class)) { CoreAbility.getAbility(player, IceBullet.class).doRightClick(); } } } if (MovementHandler.isStopped(player) || Bloodbending.isBloodbent(player) || Suffocate.isBreathbent(player)) { event.setCancelled(true); } }
Source:
<code>public void setUp() throws Exception { executeDataSet("org/openmrs/module/idgen/include/TestData.xml"); <START> this.service = Context.getService(IdentifierSourceService.class); <END> }</code><technical_language>do service? if do, is more once</technical_language>

Target:
public void setUp() throws Exception { executeDataSet("org/openmrs/module/idgen/include/TestData.xml"); }
Source:
<code>private static void waitForCrateFramework() { <START> Awaitility.await().atMost(90, TimeUnit.SECONDS).pollInterval(1, TimeUnit.SECONDS).until(new Callable<Boolean>() { <END> @Override public Boolean call() throws Exception { for (MesosAgent mesosAgent : cluster.getAgents()) { if (!mesosAgent.getState().getFrameworks().isEmpty()) { try { int status = Unirest.head( String.format("http://%s:%d/cluster", mesosAgent.getIpAddress(), API_PORT) ).asJson().getStatus(); crateMesosFrameworkHostIp = mesosAgent.getIpAddress(); return status == 200; } catch (UnirestException e) { } } } return false; } }); }</code><technical_language>a global WAIT_TIMEOUT</technical_language>

Target:
private static void waitForCrateFramework() { Awaitility.await().atMost(WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS) .pollInterval(1, TimeUnit.SECONDS).until(new Callable<Boolean>() { @Override public Boolean call() throws Exception { for (MesosAgent mesosAgent : cluster.getAgents()) { if (!mesosAgent.getState().getFrameworks().isEmpty()) { try { int status = Unirest.head( String.format("http://%s:%d/cluster", mesosAgent.getIpAddress(), API_PORT) ).asJson().getStatus(); crateMesosFrameworkHostIp = mesosAgent.getIpAddress(); return status == 200; } catch (UnirestException e) { } } } return false; } }); }
Source:
<code><START> public long getInternalNumericId(){ <END> return internalNumericId; }</code><technical_language>opposed this change this class is API public. I internal numeric ID exposes implementation detail part of a public API</technical_language>

Target:
long getInternalNumericId(){ return internalNumericId; }
Source:
<code><START> private Set<Integer> getOidSet(String oidList) throws PSQLException { <END> Set<Integer> oids = new HashSet<Integer>(); StringTokenizer tokenizer = new StringTokenizer(oidList, ","); while (tokenizer.hasMoreTokens()) { String oid = tokenizer.nextToken(); oids.add(Oid.valueOf(oid)); } return oids; }</code><technical_language>consider making this static</technical_language>

Target:
private static Set<Integer> getOidSet(String oidList) throws PSQLException { Set<Integer> oids = new HashSet<Integer>(); StringTokenizer tokenizer = new StringTokenizer(oidList, ","); while (tokenizer.hasMoreTokens()) { String oid = tokenizer.nextToken(); oids.add(Oid.valueOf(oid)); } return oids; }
Source:
<code>public RealmResults<Session> getSessionsByLocation(String location) { <START> return realm.where(Session.class).equalTo("microlocation.name", location).findAllSortedAsync(Session.Companion.getSTART_TIME()); <END> }</code><technical_language>Companion</technical_language>

Target:
public RealmResults<Session> getSessionsByLocation(String location) { return realm.where(Session.class) .equalTo("microlocation.name", location) .sort(Session.START_TIME) .findAllAsync(); }
Source:
<code>public void processEvent(CloudTrailEvent event) { List<String> instanceIds = getInstanceIds(event); Map<String, String> metaData = newHashMap(); for (String id : instanceIds) { Map userData; final String accountId = event.getEventData().getUserIdentity().getAccountId(); final String region = event.getEventData().getAwsRegion(); try { userData = userDataProvider.getUserData(accountId, region, id); } catch (AmazonServiceException e) { LOG.error(e.getMessage()); violationSink.put(violationFor(event).withInstanceId(id).withPluginFullyQualifiedClassName( SnapshotSourcePlugin.class).withType(MISSING_USER_DATA).build()); return; } if (userData == null) { violationSink.put(violationFor(event).withInstanceId(id).withPluginFullyQualifiedClassName( SnapshotSourcePlugin.class).withType(MISSING_USER_DATA).build()); return; } String source = (String) userData.get(SOURCE); if (source == null) { violationSink.put(violationFor(event).withInstanceId(id).withPluginFullyQualifiedClassName( SnapshotSourcePlugin.class).withType(MISSING_SOURCE_IN_USER_DATA).build()); } else if (source.matches(SNAPSHOT_REGEX)) { <START> metaData.put("errorMessage", "EC2 should be deployed within docker and an immutable tag."); <END> metaData.put("application", source); violationSink.put(violationFor(event).withInstanceId(id).withPluginFullyQualifiedClassName( SnapshotSourcePlugin.class).withType(EC2_WITH_A_SNAPSHOT_IMAGE).withMetaInfo(metaData).build()); } } }</code><technical_language>I is a typo here: "within" is wrong</technical_language>

Target:
public void processEvent(CloudTrailEvent event) { List<String> instanceIds = getInstanceIds(event); for (String id : instanceIds) { Map userData; final String accountId = event.getEventData().getUserIdentity().getAccountId(); final String region = event.getEventData().getAwsRegion(); try { userData = userDataProvider.getUserData(accountId, region, id); } catch (AmazonServiceException e) { LOG.error(e.getMessage()); violationSink.put(violationFor(event).withInstanceId(id).withPluginFullyQualifiedClassName( SnapshotSourcePlugin.class).withType(MISSING_USER_DATA).build()); return; } if (userData == null) { violationSink.put(violationFor(event).withInstanceId(id).withPluginFullyQualifiedClassName( SnapshotSourcePlugin.class).withType(MISSING_USER_DATA).build()); return; } String source = (String) userData.get(SOURCE); if (source == null) { violationSink.put(violationFor(event).withInstanceId(id).withPluginFullyQualifiedClassName( SnapshotSourcePlugin.class).withType(MISSING_SOURCE_IN_USER_DATA).build()); } else if (source.matches(SNAPSHOT_REGEX)) { violationSink.put(violationFor(event).withInstanceId(id).withPluginFullyQualifiedClassName( SnapshotSourcePlugin.class).withType(EC2_WITH_A_SNAPSHOT_IMAGE).withMetaInfo(singletonMap("deployment_artifact", source)).build()); } } }
Source:
<code>private void printSingleLineDescription(PrintWriter out, String prefix, String s) { <START> String comment = StringEscapeUtils.escapeJson(s); <END> out.printf("%s\"%s\"\n", prefix, comment); }</code><technical_language>I a JSON string encoder in code base hand I recall do</technical_language>

Target:
private void printSingleLineDescription(PrintWriter out, String prefix, String s) { String desc = escapeJsonString(s); out.printf("%s\"%s\"\n", prefix, desc); }
Source:
<code>private void updateTransform() { if (mTransformCallback != null) { mTransformCallback.getTransform(mParentTransform); mTransformCallback.getRootBounds(mRootBounds); } else { mParentTransform.reset(); mRootBounds.set(getBounds()); } mBitmapBounds.set(0, 0, getBitmap().getWidth(), getBitmap().getHeight()); mDrawableBounds.set(getBounds()); mBoundsTransform.setRectToRect(mBitmapBounds, mDrawableBounds, Matrix.ScaleToFit.FILL); if (!mParentTransform.equals(mPrevParentTransform) || !mBoundsTransform.equals(mPrevBoundsTransform)) { mIsShaderTransformDirty = true; mParentTransform.invert(mInverseParentTransform); mTransform.set(mParentTransform); <START> if (!mBoundsTransform.isIdentity()) { <END> mTransform.preConcat(mBoundsTransform); } mPrevParentTransform.set(mParentTransform); mPrevBoundsTransform.set(mBoundsTransform); } if (!mRootBounds.equals(mPrevRootBounds)) { mIsPathDirty = true; mPrevRootBounds.set(mRootBounds); } }</code><technical_language>this is worth doing? preConcat end in <LINK_0> check internally</technical_language>

Target:
private void updateTransform() { if (mTransformCallback != null) { mTransformCallback.getTransform(mParentTransform); mTransformCallback.getRootBounds(mRootBounds); } else { mParentTransform.reset(); mRootBounds.set(getBounds()); } mBitmapBounds.set(0, 0, getBitmap().getWidth(), getBitmap().getHeight()); mDrawableBounds.set(getBounds()); mBoundsTransform.setRectToRect(mBitmapBounds, mDrawableBounds, Matrix.ScaleToFit.FILL); if (!mParentTransform.equals(mPrevParentTransform) || !mBoundsTransform.equals(mPrevBoundsTransform)) { mIsShaderTransformDirty = true; mParentTransform.invert(mInverseParentTransform); mTransform.set(mParentTransform); mTransform.preConcat(mBoundsTransform); mPrevParentTransform.set(mParentTransform); mPrevBoundsTransform.set(mBoundsTransform); } if (!mRootBounds.equals(mPrevRootBounds)) { mIsPathDirty = true; mPrevRootBounds.set(mRootBounds); } }
Source:
<code>private List<Patient> filterNotDownloadedPatients(List<Patient> patients) { List<Patient> newPatientList = new LinkedList<>(); for (Patient patient: patients){ <START> if(!new PatientDAO().isUserAlreadySaved(patient.getUuid())){ <END> newPatientList.add(patient); } } return newPatientList; }</code><technical_language>more efficient create patient dao once</technical_language>

Target:
private List<Patient> filterNotDownloadedPatients(List<Patient> patients) { List<Patient> newPatientList = new LinkedList<>(); for (Patient patient: patients){ PatientDAO patientDAO = new PatientDAO(); if(!patientDAO.isUserAlreadySaved(patient.getUuid())){ newPatientList.add(patient); } } return newPatientList; }
Source:
<code>public int hashCode() { <START> return Objects.hash(super.hashCode(), time); <END> }</code><technical_language>This is a private class for tracking, change super fields, time is changing variable here, need hash time here</technical_language>

Target:
public int hashCode() { return Objects.hash(time); }