auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void addRow(List<CellData> cells, boolean isHeader) { if (batchRequest == null) { batchRequest = new Request(); rows = new ArrayList<RowData>(BATCH_SIZE); } <START> List<com.google.api.services.sheets.v4.model.CellData> cellDatas = new ArrayList<com.google.api.services.sheets.v4.model.CellData>(); <END> RowData rowData = new RowData(); for (int c = 0; c < cells.size(); c++) { CellData cellData = cells.get(c); if (cellData != null && cellData.text != null) { cellDatas.add(cellData2sheetCellData(cellData)); } } rowData.setValues(cellDatas); rows.add(rowData); row++; if (row % BATCH_SIZE == 0) { sendBatch(rows); } }</code><technical_language>Is reason full import path is here, List<CellData>? Also, migrated Java 8, right-hand side simplified new ArrayList<>();</technical_language>

Target:
public void addRow(List<CellData> cells, boolean isHeader) { if (batchRequest == null) { batchRequest = new Request(); rows = new ArrayList<RowData>(BATCH_SIZE); } List<com.google.api.services.sheets.v4.model.CellData> cellDatas = new ArrayList<>(); RowData rowData = new RowData(); for (int c = 0; c < cells.size(); c++) { CellData cellData = cells.get(c); if (cellData != null && cellData.text != null) { cellDatas.add(cellData2sheetCellData(cellData)); } } rowData.setValues(cellDatas); rows.add(rowData); row++; if (row % BATCH_SIZE == 0) { sendBatch(rows); } }
Source:
<code>public synchronized <S> S getBusinessObject(Class<S> businessInterfaceType) { if (isRemoved()) { <START> throw new NoSuchEJBException("EJB has been removed"); <END> } final String businessInterfaceName = businessInterfaceType.getName(); ManagedReference managedReference = null; if (businessInterfaceToReference == null) { businessInterfaceToReference = new HashMap<String, ManagedReference>(); } else { managedReference = businessInterfaceToReference.get(businessInterfaceName); } if (managedReference == null) { if (viewServices.containsKey(businessInterfaceType)) { final ServiceController<?> serviceController = currentServiceContainer().getRequiredService( viewServices.get(businessInterfaceType)); final ComponentView view = (ComponentView) serviceController.getValue(); try { managedReference = view.createInstance(Collections.<Object, Object> singletonMap(SessionID.class, id)); businessInterfaceToReference.put(businessInterfaceName, managedReference); } catch (Exception e) { throw new RuntimeException(e); } } else { throw WeldLogger.ROOT_LOGGER .viewNotFoundOnEJB(businessInterfaceType.getName(), ejbComponent.getComponentName()); } } return (S) managedReference.getInstance(); }</code><technical_language>needs i18n still. need create a new logger class in this weld/ejb module</technical_language>

Target:
public synchronized <S> S getBusinessObject(Class<S> businessInterfaceType) { if (isRemoved()) { WeldEjbLogger.ROOT_LOGGER.ejbHashBeenRemoved(ejbComponent); } final String businessInterfaceName = businessInterfaceType.getName(); ManagedReference managedReference = null; if (businessInterfaceToReference == null) { businessInterfaceToReference = new HashMap<String, ManagedReference>(); } else { managedReference = businessInterfaceToReference.get(businessInterfaceName); } if (managedReference == null) { if (viewServices.containsKey(businessInterfaceType)) { final ServiceController<?> serviceController = currentServiceContainer().getRequiredService( viewServices.get(businessInterfaceType)); final ComponentView view = (ComponentView) serviceController.getValue(); try { managedReference = view.createInstance(Collections.<Object, Object> singletonMap(SessionID.class, id)); businessInterfaceToReference.put(businessInterfaceName, managedReference); } catch (Exception e) { throw new RuntimeException(e); } } else { throw WeldLogger.ROOT_LOGGER .viewNotFoundOnEJB(businessInterfaceType.getName(), ejbComponent.getComponentName()); } } return (S) managedReference.getInstance(); }
Source:
<code>public void run() { while (!stop) { CastChannel.CastMessage message = null; try { message = read(); <START> if (message.getPayloadType() == CastChannel.CastMessage.PayloadType.STRING) { <END> final String jsonMSG = message.getPayloadUtf8().replaceFirst("\"type\"", "\"responseType\""); if (!jsonMSG.contains("responseType")) { LOG.warn(" <-- {Skipping}", jsonMSG); continue; } Response parsed = jsonMapper.readValue(jsonMSG, Response.class); if (parsed.requestId != null) { ResultProcessor rp = requests.remove(parsed.requestId); if (rp != null) { rp.put(parsed); } else { if (parsed.requestId != 0) { LOG.warn("Unable to process request ID = {}, data: {}", parsed.requestId, jsonMSG); } } } else if (parsed instanceof Response.Ping) { write("urn:x-cast:com.google.cast.tp.heartbeat", Message.pong(), DEFAULT_RECEIVER_ID); } } else { LOG.warn("Received unexpected message", message.getPayloadType()); } } catch (InvalidProtocolBufferException ipbe) { LOG.debug("Error while processing protobuf: {}", ipbe.getLocalizedMessage()); } catch (IOException ioex) { LOG.warn("Error while reading: {}", ioex.getLocalizedMessage()); LOG.warn(" <-- {}", message.getPayloadUtf8()); } } }</code><technical_language>removed debug logging</technical_language>

Target:
public void run() { while (!stop) { CastChannel.CastMessage message = null; try { message = read(); if (message.getPayloadType() == CastChannel.CastMessage.PayloadType.STRING) { LOG.debug(" <-- {}", message.getPayloadUtf8()); final String jsonMSG = message.getPayloadUtf8().replaceFirst("\"type\"", "\"responseType\""); if (!jsonMSG.contains("responseType")) { LOG.warn(" <-- {Skipping}", jsonMSG); continue; } Response parsed = jsonMapper.readValue(jsonMSG, Response.class); if (parsed.requestId != null) { ResultProcessor rp = requests.remove(parsed.requestId); if (rp != null) { rp.put(parsed); } else { if (parsed.requestId != 0) { LOG.warn("Unable to process request ID = {}, data: {}", parsed.requestId, jsonMSG); } } } else if (parsed instanceof Response.Ping) { write("urn:x-cast:com.google.cast.tp.heartbeat", Message.pong(), DEFAULT_RECEIVER_ID); } } else { LOG.warn("Received unexpected message", message.getPayloadType()); } } catch (InvalidProtocolBufferException ipbe) { LOG.debug("Error while processing protobuf: {}", ipbe.getLocalizedMessage()); } catch (IOException ioex) { LOG.warn("Error while reading: {}", ioex.getLocalizedMessage()); String temp; if (message != null && message.getPayloadUtf8() != null) { temp = message.getPayloadUtf8(); } else { temp = " null payload in message ";} LOG.warn(" <-- {}", temp); } } }
Source:
<code><START> public void testAssignSplitsFromCoordinatorExecutor() throws ExecutionException, InterruptedException, IOException { <END> testAssignSplits(true); }</code><technical_language>Nit: For tests is easier declare throws Exception, a long list of individual exceptions</technical_language>

Target:
public void testAssignSplitsFromCoordinatorExecutor() throws Exception { testAssignSplits(true); }
Source:
<code>public void parentTheme_isApplied() { open(); checkLogsForErrors(); Assert.assertEquals( "Color from parent theme should be applied.", "rgba(0, 255, 255, 1)", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("color")); Assert.assertEquals( "Color from parent theme should be applied.", "5px", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("margin")); <START> <END> }</code><technical_language>a test css parent theme overwritten child? (e.g. Lumo parent customizing a specific color) Edit: is a typo in test well; 'Margin theme applied.'</technical_language>

Target:
public void parentTheme_isApplied() { open(); checkLogsForErrors(); Assert.assertEquals( "Color from parent theme should be applied.", "rgba(0, 255, 255, 1)", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("color")); Assert.assertEquals( "Child theme should override parent theme values", "5px", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("margin")); Assert.assertEquals( "Child theme values should be applied", "5px", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("padding")); TestBenchElement myField = $(TestBenchElement.class).id(MY_POLYMER_ID); TestBenchElement input = myField.$(TestBenchElement.class) .id("vaadin-text-field-input-0"); Assert.assertEquals("Polymer text field should get parent border radius", "0px", input.getCssValue("border-radius")); Assert.assertEquals("Polymer text field should use green as color", "rgba(0, 128, 0, 1)", input.getCssValue("color")); }
Source:
<code>public long initiateFlush(TInfo tinfo, TCredentials c, String tableId) throws ThriftSecurityException, ThriftTableOperationException { <START> String namespaceId; <END> try { namespaceId = Tables.getNamespaceId(instance, tableId); } catch (TableNotFoundException e1) { throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.NOTFOUND, e1.getMessage()); } master.security.canFlush(c, tableId, namespaceId); String zTablePath = Constants.ZROOT + "/" + master.getInstance().getInstanceID() + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_FLUSH_ID; IZooReaderWriter zoo = ZooReaderWriter.getInstance(); byte fid[]; try { fid = zoo.mutate(zTablePath, null, null, new Mutator() { @Override public byte[] mutate(byte[] currentValue) throws Exception { long flushID = Long.parseLong(new String(currentValue)); flushID++; return ("" + flushID).getBytes(); } }); } catch (NoNodeException nne) { throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.NOTFOUND, null); } catch (Exception e) { Master.log.warn("{}", e.getMessage(), e); throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.OTHER, null); } return Long.parseLong(new String(fid)); }</code><technical_language>put 6 lines in a method in class</technical_language>

Target:
public long initiateFlush(TInfo tinfo, TCredentials c, String tableId) throws ThriftSecurityException, ThriftTableOperationException { String namespaceId = getNamespaceIdFromTableId(TableOperation.FLUSH, tableId); master.security.canFlush(c, tableId, namespaceId); String zTablePath = Constants.ZROOT + "/" + master.getInstance().getInstanceID() + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_FLUSH_ID; IZooReaderWriter zoo = ZooReaderWriter.getInstance(); byte fid[]; try { fid = zoo.mutate(zTablePath, null, null, new Mutator() { @Override public byte[] mutate(byte[] currentValue) throws Exception { long flushID = Long.parseLong(new String(currentValue)); flushID++; return ("" + flushID).getBytes(); } }); } catch (NoNodeException nne) { throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.NOTFOUND, null); } catch (Exception e) { Master.log.warn("{}", e.getMessage(), e); throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.OTHER, null); } return Long.parseLong(new String(fid)); }
Source:
<code>public static boolean isOsSupportedForVirtIoScsi(int osId, Version clusterVersion) { <START> ArrayList<String> diskInterfaces = SimpleDependecyInjector.getInstance().get(OsRepository.class).getDiskInterfaces(osId, clusterVersion); <END> return diskInterfaces.contains(DiskInterface.VirtIO_SCSI.toString()); }</code><technical_language>count this ArrayList - a List</technical_language>

Target:
public static boolean isOsSupportedForVirtIoScsi(int osId, Version clusterVersion) { List<String> diskInterfaces = SimpleDependecyInjector.getInstance().get(OsRepository.class).getDiskInterfaces(osId, clusterVersion); return diskInterfaces.contains(DiskInterface.VirtIO_SCSI.toString()); }
Source:
<code>splitCurrentByRegex(SortedMap<TServerInstance,TabletServerStatus> current) { LOG.debug("Performing pool recheck - regrouping tablet servers based on regular expressions"); Map<String,SortedMap<TServerInstance,TabletServerStatus>> newPools = new HashMap<>(); for (Entry<TServerInstance,TabletServerStatus> e : current.entrySet()) { List<String> poolNames = getPoolNamesForHost(e.getKey().host()); for (String pool : poolNames) { SortedMap<TServerInstance,TabletServerStatus> np = newPools.get(pool); if (null == np) { np = new TreeMap<>(current.comparator()); newPools.put(pool, np); } np.put(e.getKey(), e.getValue()); } } if (newPools.get(DEFAULT_POOL) == null) { <START> LOG.info("Default pool is empty; assigning all tablet servers to the default pool"); <END> for (Entry<TServerInstance,TabletServerStatus> e : current.entrySet()) { SortedMap<TServerInstance,TabletServerStatus> np = newPools.get(DEFAULT_POOL); if (null == np) { np = new TreeMap<>(current.comparator()); newPools.put(DEFAULT_POOL, np); } np.put(e.getKey(), e.getValue()); } } pools = newPools; LOG.trace("Pool to TabletServer mapping:"); if (LOG.isTraceEnabled()) { for (Entry<String,SortedMap<TServerInstance,TabletServerStatus>> e : pools.entrySet()) { LOG.trace("\tpool: -> tservers: {}", e.getKey(), e.getValue().keySet()); } } return pools; }</code><technical_language>suggestion LOG.warn("Default pool is empty; assigning tablet servers default pool");</technical_language>

Target:
splitCurrentByRegex(SortedMap<TServerInstance,TabletServerStatus> current) { LOG.debug("Performing pool recheck - regrouping tablet servers based on regular expressions"); Map<String,SortedMap<TServerInstance,TabletServerStatus>> newPools = new HashMap<>(); for (Entry<TServerInstance,TabletServerStatus> e : current.entrySet()) { List<String> poolNames = getPoolNamesForHost(e.getKey().host()); for (String pool : poolNames) { SortedMap<TServerInstance,TabletServerStatus> np = newPools.get(pool); if (null == np) { np = new TreeMap<>(current.comparator()); newPools.put(pool, np); } np.put(e.getKey(), e.getValue()); } } if (newPools.get(DEFAULT_POOL) == null) { LOG.warn("Default pool is empty; assigning all tablet servers to the default pool"); SortedMap<TServerInstance, TabletServerStatus> dp = new TreeMap<>(current.comparator()); dp.putAll(current); newPools.put(DEFAULT_POOL, dp); } pools = newPools; LOG.trace("Pool to TabletServer mapping:"); if (LOG.isTraceEnabled()) { for (Entry<String,SortedMap<TServerInstance,TabletServerStatus>> e : pools.entrySet()) { LOG.trace("\tpool: -> tservers: {}", e.getKey(), e.getValue().keySet()); } } return pools; }
Source:
<code>private void handleOperations() { <START> eventBus.addHandler(WsAgentStateEvent.TYPE, new WsAgentStateHandler() { <END> @Override public void onWsAgentStarted(WsAgentStateEvent event) { } @Override public void onWsAgentStopped(WsAgentStateEvent event) { dependencyResolver.hide(); } }); eventBus.addHandler(WorkspaceStoppedEvent.TYPE, event -> dependencyResolver.hide()); }</code><technical_language>I remove this handler eventBus.addHandler(WorkspaceStoppedEvent.TYPE, event -> dependencyResolver.hide()); enough</technical_language>

Target:
private void handleOperations() { eventBus.addHandler(WorkspaceStoppedEvent.TYPE, event -> dependencyResolver.hide()); }
Source:
<code>protected String getLogFileLocation() { <START> return Urls.mergePaths("/var/log/riak", "solr.log"); <END> }</code><technical_language>point in mergePaths in this case, return a constant string</technical_language>

Target:
protected String getLogFileLocation() { return "/var/log/riak/solr.log"; }
Source:
<code>protected Integer parseNodeInteger(XmlNode sourceNode, String string, Integer defaultValue) { <START> XmlNode subNode = sourceNode.SelectSingleNode(string, _xmlNS); <END> if (subNode != null && subNode.innerText != null) { Integer ret = Integer.parseInt(subNode.innerText); return ret; } return defaultValue; }</code><technical_language>please selectSingleNode(sourceNode, string, _xmlNS)</technical_language>

Target:
protected Integer parseNodeInteger(XmlNode sourceNode, String string, Integer defaultValue) { XmlNode subNode = selectSingleNode(sourceNode, string, _xmlNS); if (subNode != null && subNode.innerText != null) { Integer ret = Integer.parseInt(subNode.innerText); return ret; } return defaultValue; }
Source:
<code><START> public boolean test(IPerson person) { <END> String personHash = person.getEntityIdentifier().getKey() + hashcode + Thread.currentThread().getId(); logger.debug(personHash); if (currentPersons.contains(personHash)) return false; currentPersons.add(personHash); IGroupMember gmPerson = findPersonAsGroupMember(person); boolean pass = true; Iterator<IEntityGroup> groups = includes.iterator(); while (pass && groups.hasNext()) { IEntityGroup group = groups.next(); if (!gmPerson.isDeepMemberOf(group)) { logger.debug("!! is not a member of {}", person.getUserName(), group.getDescription()); pass = false; } else { logger.debug("{} is a member of {}", person.getUserName(), group.getDescription()); } } groups = excludes.iterator(); while (pass && groups.hasNext()) { IEntityGroup group = groups.next(); if (gmPerson.isDeepMemberOf(group)) { logger.debug("!! is a member of {}", person.getUserName(), group.getDescription()); pass = false; } else { logger.debug("{} is a not member of {}", person.getUserName(), group.getDescription()); } } currentPersons.remove(personHash); return pass; }</code><technical_language>Suggest moving public methods non-public in source file</technical_language>

Target:
public boolean test(IPerson person) { String personHash = person.getEntityIdentifier().getKey() + groupHash + Thread.currentThread().getId(); logger.debug("Entering test() for {}", personHash); IEntityGroup entityGroup = findGroupByName(groupName); if (entityGroup == null) { logger.error("Group named '{}' in ad hoc group tester definition not found!!", groupName); return false; } IGroupMember gmPerson = findPersonAsGroupMember(person); if (currentTests.getQuiet(personHash) != null) { logger.debug("Returning from test() for due to recusion for person = {}", personHash, person.toString()); return false; } Element cacheEl = new Element(personHash, personHash); currentTests.put(cacheEl); boolean isPersonGroupMember = gmPerson.isDeepMemberOf(entityGroup); currentTests.remove(personHash); logger.debug("Returning from test() for {}", personHash); return isPersonGroupMember ^ isNotTest; }
Source:
<code>public LockHelper(final OsmandApplication app) { this.app = app; uiHandler = new Handler(); lockRunnable = new LockRunnable(); mSensorManager = (SensorManager) app.getSystemService(Context.SENSOR_SERVICE); mProximity = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); switchOnSensor(); voiceMessageListener = new VoiceRouter.VoiceMessageListener() { @Override public void onVoiceMessage() { <START> LOG.debug("onVoiceMessage"); <END> unlockEvent(); } }; }</code><technical_language>debug</technical_language>

Target:
public LockHelper(final OsmandApplication app) { this.app = app; uiHandler = new Handler(); lockRunnable = new LockRunnable(); settings = app.getSettings(); mSensorManager = (SensorManager) app.getSystemService(Context.SENSOR_SERVICE); mProximity = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); voiceMessageListener = new VoiceRouter.VoiceMessageListener() { @Override public void onVoiceMessage() { unlockEvent(); } }; }
Source:
<code><START> public void checkIoExceptionsAreHandled() throws InterruptedException { <END> this.client.failMessageSending.set( true ); AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); processor.scopedInstance = new TestApplicationTemplate().getMySqlVm(); processor.processMessage( new MsgCmdSendInstances()); }</code><technical_language>No, this method throw interrupted exceptions</technical_language>

Target:
public void checkIoExceptionsAreHandled() { this.client.failMessageSending.set( true ); AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); processor.scopedInstance = new TestApplicationTemplate().getMySqlVm(); processor.processMessage( new MsgCmdSendInstances()); }
Source:
<code>private void createExternalWorkspaces() { Snapshot current = this.snapshot.get(); Collection<String> workspaces = current.externalSources(); for (String workspaceName : workspaces) { <START> repository.repositoryCache().createExternalWorkspace(workspaceName, this); <END> } }</code><technical_language>if is existing (normal predefined) workspace name of external sources? Need more error handling this, a policy do. For example, logged reported in repository's Problems external workspace created? Or, a new name found? browsable workspaces default, enabled if needed</technical_language>

Target:
private void createExternalWorkspaces() throws RepositoryException { Snapshot current = this.snapshot.get(); Collection<String> externalSources = current.externalSources(); for (String sourceName : externalSources) { Connector connector = current.getConnectorWithSourceKey(NodeKey.keyForSourceName(sourceName)); if (connector != null && connector.isExposeAsWorkspace()) { repository.repositoryCache().createExternalWorkspace(sourceName, this); } } }
Source:
<code>protected InputStream onSuccessfulProxyRepositoryResponse(InputStream is, String storageId, String repositoryId, String path) throws IOException, NoSuchAlgorithmException, ProviderImplementationException { final Storage storage = configurationManager.getConfiguration().getStorage(storageId); final Repository repository = storage.getRepository(repositoryId); final LayoutProvider layoutProvider = layoutProviderRegistry.getProvider(repository.getLayout()); final RepositoryPath artifactPath = layoutProvider.resolve(repository).resolve(path); final RepositoryFileSystemProvider fileSystemProvider = artifactPath.getFileSystem().provider(); final RepositoryPath tempArtifact = fileSystemProvider.getTempPath(artifactPath); try ( final InputStream remoteIs = new MultipleDigestInputStream(is)) { <START> long totalNumberOfArtifactBytes = layoutProvider.getArtifactManagementService().store(tempArtifact, <END> remoteIs); fileSystemProvider.moveFromTemporaryDirectory(artifactPath); RemoteArtifactEntry artifactEntry = (RemoteArtifactEntry) artifactEntryService.findOneArtifact(storageId, repositoryId, path) .orElse(new RemoteArtifactEntry()); ArtifactCoordinates c = RepositoryFiles.readCoordinates(artifactPath); artifactEntry.setArtifactCoordinates(c); artifactEntry.setStorageId(storageId); artifactEntry.setRepositoryId(repositoryId); artifactEntry.setIsCached(Boolean.TRUE); artifactEntry.setArtifactPath(path); Date now = new Date(); artifactEntry.setLastUpdated(now); artifactEntry.setLastUsed(now); artifactEntry.setSizeInBytes(totalNumberOfArtifactBytes); artifactEntryService.save(artifactEntry); return Files.newInputStream(artifactPath); } }</code><technical_language>talked @sbespalov , please a tempArtifact TODO org.carlspring.strongbox.services.impl.AbstractArtifactManagementService#storeArtifactEntry method</technical_language>

Target:
protected InputStream onSuccessfulProxyRepositoryResponse(InputStream is, String storageId, String repositoryId, String path) throws IOException, NoSuchAlgorithmException, ProviderImplementationException { final Storage storage = configurationManager.getConfiguration().getStorage(storageId); final Repository repository = storage.getRepository(repositoryId); final LayoutProvider layoutProvider = layoutProviderRegistry.getProvider(repository.getLayout()); final RepositoryPath artifactPath = layoutProvider.resolve(repository).resolve(path); final RepositoryPath tempArtifact = RepositoryFiles.temporary(artifactPath); try ( final InputStream remoteIs = new MultipleDigestInputStream(is)) { layoutProvider.getArtifactManagementService().store(tempArtifact, remoteIs); RepositoryFiles.permanent(artifactPath); return Files.newInputStream(artifactPath); } }
Source:
<code>private boolean hasTheSameSchema(Table newTable, Table existingTable) { List<Column> newTableColumns = newTable.getDataColumns(); List<Column> existingTableColumns = existingTable.getDataColumns(); for (Column existingColumn : existingTableColumns) { Optional<Column> createTableColumnMetadata = newTableColumns.stream() <START> .filter(newColumn -> newColumn.getName().equals(existingColumn.getName()) && newColumn.getType().equals(existingColumn.getType())) <END> .findFirst(); if (!createTableColumnMetadata.isPresent()) { return false; } } return true; }</code><technical_language>I thought this line is wrong I realize changed done means. I add a variable, done a local variable in handleException. I prefer handleException inlined due tight logic relation run</technical_language>

Target:
private boolean hasTheSameSchema(Table newTable, Table existingTable) { List<Column> newTableColumns = newTable.getDataColumns(); List<Column> existingTableColumns = existingTable.getDataColumns(); if (newTableColumns.size() != existingTableColumns.size()) { return false; } for (Column existingColumn : existingTableColumns) { if (newTableColumns.stream() .noneMatch(newColumn -> newColumn.getName().equals(existingColumn.getName()) && newColumn.getType().equals(existingColumn.getType()))) { return false; } } return true; }
Source:
<code>protected boolean validateAttachedDirectLuns() { if (getParameters().getAttachedDirectLunsIds() == null) { return true; } Set<String> <START> idsOfDirectLunsAttachedToVmsInPool = <END> getIdsOfDirectLunsAttachedToVmsInPool(); Collection<String> directLunsNotAttachedToVmInPool = getParameters().getAttachedDirectLunsIds() .stream() .filter(lunId -> !idsOfDirectLunsAttachedToVmsInPool.contains(lunId)) .collect(Collectors.toList()); return directLunsNotAttachedToVmInPool.isEmpty() || failValidation( EngineMessage.ACTION_TYPE_FAILED_CANNOT_SYNC_DIRECT_LUNS_NOT_ATTACHED_TO_VM_IN_POOL, String.format("$lunIds %s", directLunsNotAttachedToVmInPool.stream().sorted().collect(Collectors.joining(","))), String.format("$storagePoolId %s", getParameters().getStoragePoolId())); }</code><technical_language>"Pool" is a bad term, instinctively sounds a VM pool. DataCenter DC StoragePool instead</technical_language>

Target:
protected boolean validateAttachedDirectLuns() { if (getParameters().getAttachedDirectLunsIds() == null) { return true; } Set<String> idsOfDirectLunsAttachedToVmsInStoragePool = getIdsOfDirectLunsAttachedToVmsInPool(); Collection<String> directLunsNotAttachedToVmInPool = getParameters().getAttachedDirectLunsIds() .stream() .filter(lunId -> !idsOfDirectLunsAttachedToVmsInStoragePool.contains(lunId)) .collect(Collectors.toList()); return directLunsNotAttachedToVmInPool.isEmpty() || failValidation( EngineMessage.ACTION_TYPE_FAILED_CANNOT_SYNC_DIRECT_LUNS_NOT_ATTACHED_TO_VM_IN_POOL, String.format("$lunIds %s", directLunsNotAttachedToVmInPool.stream().sorted().collect(Collectors.joining(", "))), String.format("$storagePoolId %s", getParameters().getStoragePoolId())); }
Source:
<code>protected String[] createParamsForTypicalFeedbackSession(String courseId, String fsName) { return new String[] { Const.ParamsNames.COURSE_ID, courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, fsName, Const.ParamsNames.FEEDBACK_SESSION_STARTDATE, "Wed, 01 Feb, 2012", Const.ParamsNames.FEEDBACK_SESSION_STARTTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_ENDDATE, "Thu, 01 Jan, 2015", Const.ParamsNames.FEEDBACK_SESSION_ENDTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_SESSIONVISIBLEBUTTON, Const.INSTRUCTOR_FEEDBACK_SESSION_VISIBLE_TIME_CUSTOM, Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE, "Sun, 01 Jan, 2012", Const.ParamsNames.FEEDBACK_SESSION_VISIBLETIME, "0", Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON, Const.INSTRUCTOR_FEEDBACK_RESULTS_VISIBLE_TIME_ATVISIBLE, Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE, "", Const.ParamsNames.FEEDBACK_SESSION_PUBLISHTIME, "0", <START> Const.ParamsNames.FEEDBACK_SESSION_TIMEZONE, "UTC+08:00", <END> Const.ParamsNames.FEEDBACK_SESSION_GRACEPERIOD, "10", Const.ParamsNames.FEEDBACK_SESSION_INSTRUCTIONS, "instructions" }; }</code><technical_language>I modification session timezone is done in #8687</technical_language>

Target:
protected String[] createParamsForTypicalFeedbackSession(String courseId, String fsName) { return new String[] { Const.ParamsNames.COURSE_ID, courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, fsName, Const.ParamsNames.FEEDBACK_SESSION_STARTDATE, "Wed, 01 Feb, 2012", Const.ParamsNames.FEEDBACK_SESSION_STARTTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_ENDDATE, "Thu, 01 Jan, 2015", Const.ParamsNames.FEEDBACK_SESSION_ENDTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_SESSIONVISIBLEBUTTON, Const.INSTRUCTOR_FEEDBACK_SESSION_VISIBLE_TIME_CUSTOM, Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE, "Sun, 01 Jan, 2012", Const.ParamsNames.FEEDBACK_SESSION_VISIBLETIME, "0", Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON, Const.INSTRUCTOR_FEEDBACK_RESULTS_VISIBLE_TIME_ATVISIBLE, Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE, "", Const.ParamsNames.FEEDBACK_SESSION_PUBLISHTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_TIMEZONE, "Asia/Singapore", Const.ParamsNames.FEEDBACK_SESSION_GRACEPERIOD, "10", Const.ParamsNames.FEEDBACK_SESSION_INSTRUCTIONS, "instructions" }; }
Source:
<code>private Pair<StorageDomainStatic, Guid> executeHSMGetStorageDomainInfo() { return (Pair<StorageDomainStatic, Guid>) runVdsCommand(VDSCommandType.HSMGetStorageDomainInfo, new HSMGetStorageDomainInfoVDSCommandParameters(getVds().getId(), <START> getStorageDomain().getId())).getReturnValue(); <END> }</code><technical_language>calls hard understand. more clear this: return (Pair<StorageDomainStatic, Guid>) runVdsCommand( VDSCommandType.HSMGetStorageDomainInfo, new HSMGetStorageDomainInfoVDSCommandParameters( getVds().getId(), getStorageDomain().getId())) .getReturnValue();</technical_language>

Target:
private StorageDomainStatic executeHSMGetStorageDomainInfo() { return ((Pair<StorageDomainStatic, Guid>) runVdsCommand( VDSCommandType.HSMGetStorageDomainInfo, new HSMGetStorageDomainInfoVDSCommandParameters( getVds().getId(), getStorageDomain().getId())) .getReturnValue()).getFirst(); }
Source:
<code>protected void onHandleIntent(@NonNull Intent intent) { List<ReadingListPageDiskRow> queue = new ArrayList<>(); Collection<ReadingListPageDiskRow> rows = dao.startDiskTransaction(); <START> if (rows.isEmpty()) { <END> return; } for (final ReadingListPageDiskRow row : rows) { if (row.status() == DELETED) { final PageTitle title = makeTitleFrom(row); new SavedPage(title).deleteFromFileSystem(); dao.completeDiskTransaction(row); continue; } if (row.status() == UNSAVED || row.status() == OUTDATED) { queue.add(row); continue; } throw new UnsupportedOperationException("Invalid disk row status: " + row.status().name()); } saveNewEntries(queue); }</code><technical_language>Is this check needed? for-each loop run saveNewEntries stuff queue is nonempty</technical_language>

Target:
protected void onHandleIntent(@NonNull Intent intent) { List<ReadingListPageDiskRow> queue = new ArrayList<>(); Collection<ReadingListPageDiskRow> rows = dao.startDiskTransaction(); for (final ReadingListPageDiskRow row : rows) { if (row.status() == UNSAVED || row.status() == DELETED) { final PageTitle title = makeTitleFrom(row); new SavedPage(title).deleteFromFileSystem(); dao.completeDiskTransaction(row); continue; } if (row.status() == OUTDATED) { queue.add(row); continue; } throw new UnsupportedOperationException("Invalid disk row status: " + row.status().name()); } saveNewEntries(queue); }
Source:
<code>private Integer readLine(Text value) { <START> Retryer<Integer> retryer = RetryerBuilder.<Integer>newBuilder() <END> .retryIfExceptionOfType(IOException.class) .retryIfExceptionOfType(TimeoutException.class) .retryIfRuntimeException() .retryIfResult(Predicates.isNull()) .withWaitStrategy(WaitStrategies.exponentialWait(MAX_SLEEP_MS, TimeUnit.MILLISECONDS)) .withStopStrategy(StopStrategies.stopAfterAttempt(MAX_RETRY_NUMBER)) .build(); try { return retryer.call(() -> { if (isFirstLine) { recordsFromS3 = 0; selectObjectContent = selectClient.getRecordsContent(); reader = new LineReader(selectObjectContent, lineDelimiter.getBytes(StandardCharsets.UTF_8)); isFirstLine = false; } try { return reader.readLine(value); } catch (Exception e) { isFirstLine = true; recordsFromS3 = 0; log.warn("Failed to get the line during retry: %s/%s", selectClient.getBucketName(), selectClient.getKeyName()); throw e; } }); } catch (ExecutionException | RetryException e) { log.error(e, "Failed to get record for key: %s/%s", selectClient.getBucketName(), selectClient.getKeyName()); throw new RuntimeException(e); } }</code><technical_language>is this similar com.facebook.presto.server.remotetask.Backoff ? instead of bringing in new dependency</technical_language>

Target:
private int readLine(Text value) throws IOException { try { return retry() .maxAttempts(maxAttempts) .exponentialBackoff(BACKOFF_MIN_SLEEP, maxBackoffTime, maxRetryTime, 2.0) .stopOn(InterruptedException.class, UnrecoverableS3OperationException.class) .run("readRecordsContentStream", () -> { if (isFirstLine) { recordsFromS3 = 0; selectObjectContent = selectClient.getRecordsContent(selectObjectContentRequest); closer.register(selectObjectContent); reader = new LineReader(selectObjectContent, lineDelimiter.getBytes(StandardCharsets.UTF_8)); closer.register(reader); isFirstLine = false; } try { return reader.readLine(value); } catch (RuntimeException e) { isFirstLine = true; recordsFromS3 = 0; if (e instanceof AmazonS3Exception) { switch (((AmazonS3Exception) e).getStatusCode()) { case SC_FORBIDDEN: case SC_NOT_FOUND: case SC_BAD_REQUEST: throw new UnrecoverableS3OperationException(selectClient.getBucketName(), selectClient.getKeyName(), e); } } throw e; } }); } catch (Exception e) { throwIfInstanceOf(e, IOException.class); throwIfUnchecked(e); throw new RuntimeException(e); } }
Source:
<code>public void onMessage(Message message) { <START> if (this.applicationEventPublisher != null) { <END> this.applicationEventPublisher.publishEvent(new BrokerEvent(this, message.getMessageProperties())); } }</code><technical_language>I need add a WARN log in else. show event received mention add ApplicationEventPublisher</technical_language>

Target:
public void onMessage(Message message) { if (this.applicationEventPublisher != null) { this.applicationEventPublisher.publishEvent(new BrokerEvent(this, message.getMessageProperties())); } else { if (logger.isWarnEnabled()) { logger.warn("No event publisher available for " + message + "; if the BrokerEventListener " + "is not defined as a bean, you must provide an ApplicationEventPublisher"); } } }
Source:
<code>public void apply(RevisionWriter index) throws IOException { <START> for (final Class<?> type : rawDeletions.keySet()) { <END> final Map<Class<?>, Set<String>> map = Collections.<Class<?>, Set<String>> singletonMap(type, Sets.newHashSet(rawDeletions.get(type))); index.writer().removeAll(map); } for (Entry<String, Object> doc : rawMappings.entrySet()) { index.writer().put(doc.getKey(), doc.getValue()); } final Multimap<Class<? extends Revision>, Long> copiedRevision = ImmutableMultimap.copyOf(revisionDeletions); for (Class<? extends Revision> type : copiedRevision.keySet()) { index.remove(type, copiedRevision.get(type)); } for (Entry<Long, Revision> doc : revisionMappings.entrySet()) { if (!revisionDeletions.containsValue(doc.getKey())) { index.put(doc.getKey(), doc.getValue()); } } }</code><technical_language>For purely symmetric purposes, is style in revision-based mappings below, check entry in rawMappings is contained in rawDeletions, if so, calling index.writer().put(...)? Also, this block originally a duplicate</technical_language>

Target:
public void apply(RevisionWriter index) throws IOException { for (final Class<?> type : rawDeletions.keySet()) { final Map<Class<?>, Set<String>> map = Collections.<Class<?>, Set<String>> singletonMap(type, Sets.newHashSet(rawDeletions.get(type))); index.writer().removeAll(map); } for (Entry<String, Object> doc : rawMappings.entrySet()) { if (!rawDeletions.containsValue(doc.getKey())) { index.writer().put(doc.getKey(), doc.getValue()); } } final Multimap<Class<? extends Revision>, Long> copiedRevision = ImmutableMultimap.copyOf(revisionDeletions); for (Class<? extends Revision> type : copiedRevision.keySet()) { index.remove(type, copiedRevision.get(type)); } for (Entry<Long, Revision> doc : revisionMappings.entrySet()) { if (!revisionDeletions.containsValue(doc.getKey())) { index.put(doc.getKey(), doc.getValue()); } } }
Source:
<code>protected boolean shouldSkipCommandExecution() { <START> return StringUtils.equals(getVm().getCurrentCd(), getParameters().getCdImagePath()); <END> }</code><technical_language>need check getVm() is null in canDoAction new audit log for user skipped. please usage example in StopVmCommandBase ShutdownVmCommand</technical_language>

Target:
protected boolean shouldSkipCommandExecution() { if (getVm() == null) { return false; } return StringUtils.equals(getVm().getCurrentCd(), getParameters().getCdImagePath()); }
Source:
<code>protected boolean isDiskExist(Disk disk) { <START> if (disk == null || isDiskExistInVm(disk)) { <END> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); return false; } return true; }</code><technical_language>a ('!') check.. i relevant, no</technical_language>

Target:
protected boolean isDiskExist(Disk disk) { if (disk == null || !isDiskExistInVm(disk)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); return false; } return true; }
Source:
<code>public void setDescription(@Nullable String text) { <START> if (invokeSource != SUGGESTED_EDITS_ADD_CAPTION && invokeSource != SUGGESTED_EDITS_TRANSLATE_CAPTION) { <END> pageDescriptionText.setText(text); } }</code><technical_language>This break current logic of showing "added" contribution</technical_language>

Target:
public void setDescription(@Nullable String text) { pageDescriptionText.setText(text); }
Source:
<code>protected void processRequestPayload(SignableRequest<?> request, byte[] signature, byte[] signingKey, AWS4SignerRequestParams signerRequestParams) { <START> if (useChunkEncoding(request) && this.isChunkedEncoding) { <END> AwsChunkedEncodingInputStream chunkEncodededStream = new AwsChunkedEncodingInputStream( request.getContent(), signingKey, signerRequestParams.getFormattedSigningDateTime(), signerRequestParams.getScope(), BinaryUtils.toHex(signature), this); request.setContent(chunkEncodededStream); } }</code><technical_language>move part of conditional useChunkEncoding</technical_language>

Target:
protected void processRequestPayload(SignableRequest<?> request, byte[] signature, byte[] signingKey, AWS4SignerRequestParams signerRequestParams) { if (useChunkEncoding(request)) { AwsChunkedEncodingInputStream chunkEncodededStream = new AwsChunkedEncodingInputStream( request.getContent(), signingKey, signerRequestParams.getFormattedSigningDateTime(), signerRequestParams.getScope(), BinaryUtils.toHex(signature), this); request.setContent(chunkEncodededStream); } }
Source:
<code>public void postProcessRequest(RestRequest restRequest, Callback<Void> callback) { Exception exception = null; frontendMetrics.securityServicePostProcessRequestRate.mark(); long startTimeMs = System.currentTimeMillis(); if (!isOpen) { exception = new RestServiceException("SecurityService is closed", RestServiceErrorCode.ServiceUnavailable); } else if (restRequest == null || callback == null) { throw new IllegalArgumentException("RestRequest or Callback is null"); } else if (throttlingHandler.shouldThrottle(restRequest)) { exception = new RestServiceException("Too many requests", RestServiceErrorCode.TooManyRequests); } <START> if (restRequest.getRestMethod() == RestMethod.DELETE || restRequest.getRestMethod() == RestMethod.PUT) { <END> try { accountAndContainerNamePreconditionCheck(restRequest); } catch (Exception e) { exception = e; } } frontendMetrics.securityServicePostProcessRequestTimeInMs.update(System.currentTimeMillis() - startTimeMs); callback.onCompletion(null, exception); }</code><technical_language>line 112 else if</technical_language>

Target:
public void postProcessRequest(RestRequest restRequest, Callback<Void> callback) { Exception exception = null; frontendMetrics.securityServicePostProcessRequestRate.mark(); long startTimeMs = System.currentTimeMillis(); if (!isOpen) { exception = new RestServiceException("SecurityService is closed", RestServiceErrorCode.ServiceUnavailable); } else if (restRequest == null || callback == null) { throw new IllegalArgumentException("RestRequest or Callback is null"); } else if (quotaManager.shouldThrottle(restRequest)) { exception = new RestServiceException("Too many requests", RestServiceErrorCode.TooManyRequests); } else if (restRequest.getRestMethod() == RestMethod.DELETE || restRequest.getRestMethod() == RestMethod.PUT) { try { accountAndContainerNamePreconditionCheck(restRequest); } catch (Exception e) { exception = e; } } frontendMetrics.securityServicePostProcessRequestTimeInMs.update(System.currentTimeMillis() - startTimeMs); callback.onCompletion(null, exception); }
Source:
<code>public void onSignOutButtonClicked() { mSignInClicked = false; Games.signOut(mGoogleApiClient); <START> mGoogleApiClient.disconnect(); <END> mMainMenuFragment.setGreeting(getString(R.string.signed_out_greeting)); mMainMenuFragment.setShowSignInButton(true); mWinFragment.setShowSignInButton(true); }</code><technical_language>do need check for isConnected() first</technical_language>

Target:
public void onSignOutButtonClicked() { mSignInClicked = false; Games.signOut(mGoogleApiClient); if (mGoogleApiClient.isConnected()) { mGoogleApiClient.disconnect(); } mMainMenuFragment.setGreeting(getString(R.string.signed_out_greeting)); mMainMenuFragment.setShowSignInButton(true); mWinFragment.setShowSignInButton(true); }
Source:
<code>protected void ExecuteVdsBrokerCommand() { final Map<String, String> domains = new HashMap<String, String>(); final Version vdsVersion = new Version(getVds().getsoftware_version()); final Version hostIdMinVersion = new Version( Config.<String> GetValue(ConfigValues.ReconstructMasterHostIdVdsMinVersion)); for (storage_pool_iso_map domain : getParameters().getDomainsList()) { domains.put(domain.getstorage_id().toString(), domain.getstatus() != null ? domain.getstatus() == StorageDomainStatus.InActive ? "attached" : domain.getstatus().toString().toLowerCase() : StorageDomainStatus.Unknown.toString() .toLowerCase()); } if (vdsVersion.compareTo(hostIdMinVersion) < 0) { status = getBroker().reconstructMaster(getParameters().getStoragePoolId().toString(), getParameters().getStoragePoolName(), getParameters().getMasterDomainId().toString(), domains, getParameters().getMasterVersion(), Config.<String> GetValue(ConfigValues.LockPolicy), Config.<Integer> GetValue(ConfigValues.LockRenewalIntervalSec), Config.<Integer> GetValue(ConfigValues.LeaseTimeSec), Config.<Integer> GetValue(ConfigValues.IoOpTimeoutSec), Config.<Integer> GetValue(ConfigValues.LeaseRetries)); } else { <START> status = getBroker().reconstructMaster(getParameters().getStoragePoolId().toString(), <END> getParameters().getVdsSpmId(), getParameters().getStoragePoolName(), getParameters().getMasterDomainId().toString(), domains, getParameters().getMasterVersion(), Config.<String> GetValue(ConfigValues.LockPolicy), Config.<Integer> GetValue(ConfigValues.LockRenewalIntervalSec), Config.<Integer> GetValue(ConfigValues.LeaseTimeSec), Config.<Integer> GetValue(ConfigValues.IoOpTimeoutSec), Config.<Integer> GetValue(ConfigValues.LeaseRetries)); } ProceedProxyReturnValue(); }</code><technical_language>if VdsSpmId passed argument instead of in middle send VDSMs treat 'options' ignore while newer VDSM's treat properly it. need changes</technical_language>

Target:
protected void ExecuteVdsBrokerCommand() { final Map<String, String> domains = new HashMap<String, String>(); for (storage_pool_iso_map domain : getParameters().getDomainsList()) { domains.put(domain.getstorage_id().toString(), domain.getstatus() != null ? domain.getstatus() == StorageDomainStatus.InActive ? "attached" : domain.getstatus().toString().toLowerCase() : StorageDomainStatus.Unknown.toString() .toLowerCase()); } status = getBroker().reconstructMaster(getParameters().getStoragePoolId().toString(), getParameters().getStoragePoolName(), getParameters().getMasterDomainId().toString(), domains, getParameters().getMasterVersion(), Config.<String> GetValue(ConfigValues.LockPolicy), Config.<Integer> GetValue(ConfigValues.LockRenewalIntervalSec), Config.<Integer> GetValue(ConfigValues.LeaseTimeSec), Config.<Integer> GetValue(ConfigValues.IoOpTimeoutSec), Config.<Integer> GetValue(ConfigValues.LeaseRetries), getParameters().getVdsSpmId()); ProceedProxyReturnValue(); }
Source:
<code>public boolean onMenuItemClick(MenuItem item) { if (controller == null) { return false; } Playable media = controller.getMedia(); if (media == null) { return false; } final @Nullable FeedItem feedItem = (media instanceof FeedMedia) ? ((FeedMedia) media).getItem() : null; if (feedItem != null && FeedItemMenuHandler.onMenuItemClicked(this, item.getItemId(), feedItem)) { return true; } switch (item.getItemId()) { case R.id.disable_sleeptimer_item: case R.id.set_sleeptimer_item: <START> new SleepTimerDialog().show(getParentFragmentManager(), "SleepTimerDialog"); <END> return true; case R.id.audio_controls: PlaybackControlsDialog dialog = PlaybackControlsDialog.newInstance(false); dialog.show(getParentFragmentManager(), "playback_controls"); return true; case R.id.open_feed_item: if (feedItem != null) { Intent intent = MainActivity.getIntentToOpenFeed(getContext(), feedItem.getFeedId()); startActivity(intent); } return true; } return false; }</code><technical_language>parent child fragment manager? I understood fragment manager, this (and some others in this commit) child fragment manager. I it, though</technical_language>

Target:
public boolean onMenuItemClick(MenuItem item) { if (controller == null) { return false; } Playable media = controller.getMedia(); if (media == null) { return false; } final @Nullable FeedItem feedItem = (media instanceof FeedMedia) ? ((FeedMedia) media).getItem() : null; if (feedItem != null && FeedItemMenuHandler.onMenuItemClicked(this, item.getItemId(), feedItem)) { return true; } switch (item.getItemId()) { case R.id.disable_sleeptimer_item: case R.id.set_sleeptimer_item: new SleepTimerDialog().show(getChildFragmentManager(), "SleepTimerDialog"); return true; case R.id.audio_controls: PlaybackControlsDialog dialog = PlaybackControlsDialog.newInstance(false); dialog.show(getChildFragmentManager(), "playback_controls"); return true; case R.id.open_feed_item: if (feedItem != null) { Intent intent = MainActivity.getIntentToOpenFeed(getContext(), feedItem.getFeedId()); startActivity(intent); } return true; } return false; }
Source:
<code>public void eachNonZeroInRow(int i, MatrixProcedure procedure) { <START> eachInRow(i,procedure); <END> }</code><technical_language>I this is correct. need a separate implementation for non-zero elements here</technical_language>

Target:
public void eachNonZeroInRow(int i, MatrixProcedure procedure) { for (int j = rowPointers[i]; j < rowPointers[i + 1]; j++) { procedure.apply(i, columnIndices[j], values[j]); } }
Source:
<code><START> public String getEmergencyNumber() { <END> return emergencyNumber; }</code><technical_language>remove public</technical_language>

Target:
String getEmergencyNumber() { return emergencyNumber; }
Source:
<code>private short rangeMap(final float speed) { <START> return (short) rangeMap(speed, -1f, 1f, MAX_FORWARD, MAX_REVERSE); <END> }</code><technical_language>Add .5f for rounding</technical_language>

Target:
private short rangeMap(final float speed) { return (short) Math.round(rangeMap(speed, -1f, 1f, MAX_FORWARD, MAX_REVERSE)); }