auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void onActivateSnapshot() { if (getConfirmWindow() == null) { return; } ConfirmationModel model = (ConfirmationModel) getConfirmWindow(); if (model.getProgress() != null) { return; } <START> if (getSelectedItems().size() != 1) { <END> return; } model.startProgress(null); Frontend.getInstance().runAction(VdcActionType.ActivateGlusterVolumeSnapshot, new GlusterVolumeSnapshotActionParameters(getEntity().getId(), ((GlusterVolumeSnapshotEntity) getSelectedItem()).getSnapshotName(), true), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { ConfirmationModel localModel = (ConfirmationModel) getConfirmWindow(); localModel.stopProgress(); setConfirmWindow(null); } }); }</code><technical_language>This appears a redundant check is done in updateActionAvailability action disabled right</technical_language>

Target:
private void onActivateSnapshot() { runAction(VdcActionType.ActivateGlusterVolumeSnapshot, new GlusterVolumeSnapshotActionParameters(getEntity().getId(), ((GlusterVolumeSnapshotEntity) getSelectedItem()).getSnapshotName(), true)); }
Source:
<code>protected boolean canDoAction() { if (getParameters() != null) { if (QuotaHelper.getInstance().checkQuotaValidationForAddEdit(getParameters().getQuota(), getReturnValue().getCanDoActionMessages())) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__RUN.toString()); <START> addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM.toString()); <END> } } return true; }</code><technical_language>if true: run vm!!! if this method fails</technical_language>

Target:
protected boolean canDoAction() { if (getParameters() == null) { return false; } else if (!QuotaHelper.getInstance().checkQuotaValidationForAddEdit(getParameters().getQuota(), getReturnValue().getCanDoActionMessages())) { return false; } return true; }
Source:
<code>public void testUpgradeViewIndexIdDataType() throws Exception { byte[] rowKey = SchemaUtil.getColumnKey(null, SYSTEM_SCHEMA_NAME, SYSTEM_CATALOG_TABLE, VIEW_INDEX_ID, PhoenixDatabaseMetaData.TABLE_FAMILY); byte[] syscatBytes = PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME.getBytes(); byte[] viewIndexIdTypeCellValueIn414 = PInteger.INSTANCE.toBytes(Types.SMALLINT); byte[] viewIndexIdTypeCellValueIn416 = PInteger.INSTANCE.toBytes(Types.BIGINT); <START> updateViewIndexIdColumnValue(rowKey, syscatBytes, viewIndexIdTypeCellValueIn414); <END> verifyExpectedCellValue(rowKey,syscatBytes, viewIndexIdTypeCellValueIn414); try (PhoenixConnection conn = getConnection(false, null). unwrap(PhoenixConnection.class); HBaseAdmin admin = conn.getQueryServices().getAdmin()) { UpgradeUtil.updateViewIndexIdColumnDataTypeFromShortToLongIfNeeds(conn, admin); } verifyExpectedCellValue(rowKey,syscatBytes, viewIndexIdTypeCellValueIn416); }</code><technical_language>If fails this modification of SYSTEM.CATALOG for some reason upgrade part run, rest of this work a SYSTEM.CATALOG some modification in right? some finally' block changes</technical_language>

Target:
public void testUpgradeViewIndexIdDataType() throws Exception { byte[] rowKey = SchemaUtil.getColumnKey(null, SYSTEM_SCHEMA_NAME, SYSTEM_CATALOG_TABLE, VIEW_INDEX_ID, PhoenixDatabaseMetaData.TABLE_FAMILY); byte[] syscatBytes = PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME.getBytes(); byte[] viewIndexIdTypeCellValueIn414 = PInteger.INSTANCE.toBytes(Types.SMALLINT); byte[] viewIndexIdTypeCellValueIn416 = PInteger.INSTANCE.toBytes(Types.BIGINT); try (PhoenixConnection conn = getConnection(false, null). unwrap(PhoenixConnection.class)) { updateViewIndexIdColumnValue(rowKey, syscatBytes, viewIndexIdTypeCellValueIn414); assertTrue(UpgradeUtil.isUpdateViewIndexIdColumnDataTypeFromShortToLongNeeded( conn, rowKey, syscatBytes)); verifyExpectedCellValue(rowKey, syscatBytes, viewIndexIdTypeCellValueIn414); UpgradeUtil.updateViewIndexIdColumnDataTypeFromShortToLong(conn, rowKey, syscatBytes); verifyExpectedCellValue(rowKey, syscatBytes, viewIndexIdTypeCellValueIn416); assertFalse(UpgradeUtil.isUpdateViewIndexIdColumnDataTypeFromShortToLongNeeded( conn, rowKey, syscatBytes)); } finally { updateViewIndexIdColumnValue(rowKey, syscatBytes, viewIndexIdTypeCellValueIn416); } }
Source:
<code><START> public void memberShouldNotRedirectPingMessageWhenClientCachedViewIdIsWrong() throws IOException { <END> final String poolName = testName.getMethodName(); parametrizedSetUp(poolName, Collections.singletonList(server1Port)); InternalDistributedMember distributedMember1 = (InternalDistributedMember) server1 .invoke(() -> cacheRule.getCache().getDistributedSystem().getDistributedMember()); client.invoke(() -> { PoolImpl poolImpl = (PoolImpl) PoolManager.find(poolName); distributedMember1.setVmViewId(distributedMember1.getVmViewId() + 1); assertThatThrownBy(() -> { PingOp.execute(poolImpl, new ServerLocation("localhost", server1Port), distributedMember1); }).isInstanceOf(ServerOperationException.class).hasMessageContaining("has different viewId:"); }); }</code><technical_language>exception is thrown in method, removed</technical_language>

Target:
public void memberShouldNotRedirectPingMessageWhenClientCachedViewIdIsWrong() { final String poolName = testName.getMethodName(); parametrizedSetUp(poolName, Collections.singletonList(server1Port)); InternalDistributedMember distributedMember1 = (InternalDistributedMember) server1 .invoke(() -> cacheRule.getCache().getDistributedSystem().getDistributedMember()); client.invoke(() -> { PoolImpl poolImpl = (PoolImpl) PoolManager.find(poolName); distributedMember1.setVmViewId(distributedMember1.getVmViewId() + 1); assertThatThrownBy(() -> { PingOp.execute(poolImpl, new ServerLocation("localhost", server1Port), distributedMember1); }).isInstanceOf(ServerOperationException.class).hasMessageContaining("has different viewId:"); }); }
Source:
<code>private static Set<CfgBlock> difference(Set<CfgBlock> a, Set<CfgBlock> b) { Set<CfgBlock> result = new HashSet<>(a); <START> result.removeIf(b::contains); <END> return result; }</code><technical_language>result.removeAll(b)</technical_language>

Target:
private static Set<CfgBlock> difference(Set<CfgBlock> a, Set<CfgBlock> b) { Set<CfgBlock> result = new HashSet<>(a); result.removeAll(b); return result; }
Source:
<code>public void testkDuplicateKeys() { String baseDir = System.getProperty("basedir"); assumeNotNull(baseDir); String fileName = "AppErrors.properties"; <START> File file = new File(baseDir + "/src/main/resources/bundles/" + fileName); <END> DuplicateKeysCheck.checkDuplicateKeys(file.getAbsolutePath()); }</code><technical_language>fileName a bit redundant - do this in a single line? File file = new File(baseDir + "/src/main/resources/bundles/AppErrors.properties");</technical_language>

Target:
public void testkDuplicateKeys() throws FileNotFoundException { String baseDir = System.getProperty("basedir"); assumeNotNull(baseDir); String fileName = "AppErrors.properties"; File file = new File(baseDir + "/src/main/resources/bundles/" + fileName); DuplicateKeysCheck.assertNoDuplicateKeys(file.getAbsolutePath()); }
Source:
<code>static boolean isUserAdminOrMaintainer(Organization organization, Long userId) { <START> OrganizationUser organizationUser = getUserOrgRole(organization, userId); <END> if (organizationUser == null) { return false; } if (organizationUser.getRole() == OrganizationUser.Role.ADMIN || organizationUser.getRole() == OrganizationUser.Role.MAINTAINER) { return true; } return false; }</code><technical_language>I check for a null organization here. This is a fan of Optional, BTW, clear do check (but do that)</technical_language>

Target:
static boolean isUserAdminOrMaintainer(Organization organization, Long userId) { if (organization == null) { String msg = "Organization not found"; LOG.info(msg); throw new CustomWebApplicationException(msg, HttpStatus.SC_NOT_FOUND); } OrganizationUser organizationUser = getUserOrgRole(organization, userId); if (organizationUser == null) { return false; } if (organizationUser.getRole() == OrganizationUser.Role.ADMIN || organizationUser.getRole() == OrganizationUser.Role.MAINTAINER) { return true; } return false; }
Source:
<code><START> public void setValue(String value) { <END> if (value == null) { clearSelections(); } if (value.isEmpty()) { return; } setValue(value, false); }</code><technical_language>in combination do this: setValue(value, false);</technical_language>

Target:
public void setValue(String value) { setValue(value, false); }
Source:
<code>protected TableEntry getImplicitTable(String tableName, boolean caseSensitive) { <START> final NameSet names = NameSet.immutableCopyOf(schema.getTableNames()); for (String tableName2: names.range(tableName, caseSensitive)) { <END> return tableEntry(tableName2, schema.getTable(tableName2)); } return null; }</code><technical_language>Is this acceptable for performance? Copying tables OK for get... call</technical_language>

Target:
protected TableEntry getImplicitTable(String tableName, boolean caseSensitive) { final String tableName2 = caseSensitive ? tableName : caseInsensitiveLookup( schema.getTableNames(), tableName); if (tableName2 == null) { return null; } final Table table = schema.getTable(tableName2); if (table == null) { return null; } return tableEntry(tableName2, table); }
Source:
<code>public void testJdbcPOJOInputOperatorApplication() throws Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); conf.addResource(this.getClass().getResourceAsStream("/JdbcProperties.xml")); lma.prepareDAG(new JdbcPOJOInputOperatorApplication(), conf); LocalMode.Controller lc = lma.getController(); lc.setHeartbeatMonitoringEnabled(false); ((StramLocalCluster)lc).setExitCondition(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return TupleCount == 10; } }); lc.run(10000); <START> Assert.assertEquals("rows in db", TupleCount, getNumOfRowsinTable(TABLE_POJO_NAME)); <END> } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }</code><technical_language>above. fail intermittently</technical_language>

Target:
public void testJdbcPOJOInputOperatorApplication() throws Exception { testApplication(new JdbcPOJOInputOperatorApplication()); }
Source:
<code>public List<Pair<String, String>> getEvents() { <START> return mEventList; <END> }</code><technical_language>return immutable list. expect caller do read operations, right? #Closed</technical_language>

Target:
public List<Pair<String, String>> getEvents() { return Collections.unmodifiableList(mEventList); }
Source:
<code>public Map<String, String> allocate(Network network, VnicProfile vnicProfile, VmNic nic, VDS host) { Map<String, String> runtimeProperties = new HashMap<>(); <START> runtimeProperties.put("provider_type", "dummy"); <END> return runtimeProperties; }</code><technical_language>add: - plugin_type - this needed if more driver installed, if attempt do automatic host install</technical_language>

Target:
public Map<String, String> allocate(Network network, VnicProfile vnicProfile, VmNic nic, VDS host) { Map<String, String> runtimeProperties = new HashMap<>(); runtimeProperties.put("provider_type", "dummy"); runtimeProperties.put("plugin_type", StringUtils.defaultString( provider.getAdditionalProperties().getPluginType())); return runtimeProperties; }
Source:
<code>protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getContentConflictServerHooks().isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS); return false; } for (GlusterServerHook serverHook: getContentConflictServerHooks()) { VDS vds = getVdsDAO().get(serverHook.getServerId()); if (vds == null || vds.getStatus() != VDSStatus.Up) { <START> String vdsName = vds != null ? vds.getName() : "NO SERVER"; <END> setVdsName(vdsName); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP); addCanDoActionMessage(String.format("$%1$s %2$s", "VdsName", vdsName)); return false; } } return true; }</code><technical_language>bfore. considerr a GlusterConstants class for this</technical_language>

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getContentConflictServerHooks().isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS); return false; } for (GlusterServerHook serverHook: getContentConflictServerHooks()) { VDS vds = getVdsDAO().get(serverHook.getServerId()); if (vds == null || vds.getStatus() != VDSStatus.Up) { String vdsName = vds != null ? vds.getName() : GlusterConstants.NO_SERVER; setVdsName(vdsName); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP); addCanDoActionMessage(String.format("$%1$s %2$s", "VdsName", vdsName)); return false; } } return true; }
Source:
<code>private void updateNotification() { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); String type = sp.getString(PREF_NOTIFICATION_TYPE, "low_priority"); boolean foreground = sp.getBoolean(PREF_FOREGROUND_SERVICE, false); if ("none".equals(type) && foreground) <START> type = "low_priority"; END> NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); if ((mCurrentState == State.ACTIVE || mCurrentState == State.STARTING) && !type.equals("none")) { Context appContext = getApplicationContext(); NotificationCompat.Builder builder = new NotificationCompat.Builder(appContext) .setContentTitle(getString(R.string.syncthing_active)) .setSmallIcon(R.drawable.ic_stat_notify) .setOngoing(true) .setContentIntent(PendingIntent.getActivity(appContext, 0, new Intent(appContext, MainActivity.class), 0)); if (type.equals("low_priority")) builder.setPriority(NotificationCompat.PRIORITY_MIN); if (foreground) { builder.setContentText(getString(R.string.syncthing_active_foreground)); startForeground(NOTIFICATION_ACTIVE, builder.build()); } else { stopForeground(false); nm.notify(NOTIFICATION_ACTIVE, builder.build()); } } else { stopForeground(false); nm.cancel(NOTIFICATION_ACTIVE); } }</code><technical_language>This complicated changing of foreground. I get rid of this move builder.setPriority(NotificationCompat.PRIORITY_MIN); line 312</technical_language>

Target:
private void updateNotification() { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); String type = sp.getString(PREF_NOTIFICATION_TYPE, "low_priority"); boolean foreground = sp.getBoolean(PREF_FOREGROUND_SERVICE, false); if ("none".equals(type) && foreground) { type = "low_priority"; } NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); if ((mCurrentState == State.ACTIVE || mCurrentState == State.STARTING) && !type.equals("none")) { Context appContext = getApplicationContext(); NotificationCompat.Builder builder = new NotificationCompat.Builder(appContext) .setContentTitle(getString(R.string.syncthing_active)) .setSmallIcon(R.drawable.ic_stat_notify) .setOngoing(true) .setContentIntent(PendingIntent.getActivity(appContext, 0, new Intent(appContext, MainActivity.class), 0)); if (type.equals("low_priority")) builder.setPriority(NotificationCompat.PRIORITY_MIN); if (foreground) { builder.setContentText(getString(R.string.syncthing_active_foreground)); startForeground(NOTIFICATION_ACTIVE, builder.build()); } else { stopForeground(false); nm.notify(NOTIFICATION_ACTIVE, builder.build()); } } else { stopForeground(false); nm.cancel(NOTIFICATION_ACTIVE); } }
Source:
<code>private boolean visit(String resourceName) { if (resourceName.equals(ResourceRequest.ANY)) { return visitAny(); } List<FSSchedulerNode> nodes = nodeTracker.getNodesByResourceName(resourceName); switch (nodes.size()) { case 0: return false; case 1: <START> return visitNode(nodes.remove(0).getRackName()); <END> default: return visitRack(resourceName); } }</code><technical_language>a check this a 1-node rack, e.g. rack name resource name. worse, marking unvisited request visited vice versa</technical_language>

Target:
private boolean visit(String resourceName) { if (resourceName.equals(ResourceRequest.ANY)) { return visitAny(); } List<FSSchedulerNode> nodes = nodeTracker.getNodesByResourceName(resourceName); int numNodes = nodes.size(); if (numNodes == 0) { LOG.error("Found ResourceRequest for a non-existent node/rack named " + resourceName); return false; } if (numNodes == 1) { FSSchedulerNode node = nodes.get(0); if (node.getNodeName().equals(resourceName)) { return visitNode(node.getRackName()); } } return visitRack(resourceName); }
Source:
<code>int getMessageInfoAndMetadataListSize() { int size = 0; if (version >= VERSION_5) { size += Short.BYTES; } size += Integer.BYTES; if (messageInfoList == null) { return size; } ListIterator<MessageInfo> infoListIterator = messageInfoList.listIterator(); ListIterator<MessageMetadata> metadataListIterator = messageMetadataList.listIterator(); while (infoListIterator.hasNext()) { MessageInfo messageInfo = infoListIterator.next(); MessageMetadata messageMetadata = metadataListIterator.next(); size += messageInfo.getStoreKey().sizeInBytes(); size += Long.BYTES; size += Long.BYTES; size += 1; if (version < VERSION_1 || version > VERSION_MAX) { throw new IllegalArgumentException("Unknown version in MessageInfoList " + version); } if (version >= VERSION_5) { size += 1; } if (version >= VERSION_6) { size += 1; } if (version > VERSION_1) { size += 1; if (messageInfo.getCrc() != null) { size += Long.BYTES; } } if (version > VERSION_2) { size += Short.BYTES; size += Short.BYTES; size += Long.BYTES; } if (version >= VERSION_6) { <START> size += 2; <END> } if (version > VERSION_3) { size += Byte.BYTES; if (messageMetadata != null) { size += messageMetadata.sizeInBytes(); } } } return size; }</code><technical_language>Short.BYTES</technical_language>

Target:
int getMessageInfoAndMetadataListSize() { int size = 0; if (version >= VERSION_5) { size += Short.BYTES; } size += Integer.BYTES; if (messageInfoList == null) { return size; } ListIterator<MessageInfo> infoListIterator = messageInfoList.listIterator(); ListIterator<MessageMetadata> metadataListIterator = messageMetadataList.listIterator(); while (infoListIterator.hasNext()) { MessageInfo messageInfo = infoListIterator.next(); MessageMetadata messageMetadata = metadataListIterator.next(); size += messageInfo.getStoreKey().sizeInBytes(); size += Long.BYTES; size += Long.BYTES; size += Byte.BYTES; if (version < VERSION_1 || version > VERSION_MAX) { throw new IllegalArgumentException("Unknown version in MessageInfoList " + version); } if (version >= VERSION_5) { size += Byte.BYTES; } if (version >= VERSION_6) { size += Byte.BYTES; } if (version > VERSION_1) { size += Byte.BYTES; if (messageInfo.getCrc() != null) { size += Long.BYTES; } } if (version > VERSION_2) { size += Short.BYTES; size += Short.BYTES; size += Long.BYTES; } if (version >= VERSION_6) { size += Short.BYTES; } if (version > VERSION_3) { size += Byte.BYTES; if (messageMetadata != null) { size += messageMetadata.sizeInBytes(); } } } return size; }
Source:
<code>private boolean internalValidateAndSetQuota() { if (isInternalExecution()) { return true; } if (getStoragePool() == null) { throw new InvalidQuotaParametersException("Command: " + this.getClass().getName() + ". Storage pool is not available for quota calculation. "); } QuotaConsumptionParametersWrapper quotaConsumptionParametersWrapper = new QuotaConsumptionParametersWrapper(this, <START> getReturnValue().getCanDoActionMessages()); <END> quotaConsumptionParametersWrapper.setParameters(getQuotaConsumptionParameters()); if (quotaConsumptionParametersWrapper.getParameters() == null) { throw new InvalidQuotaParametersException("Command: " + this.getClass().getName() + ". No Quota parameters available."); } boolean result = true; setQuotaChanged(result); return result; }</code><technical_language>fold this previous line</technical_language>

Target:
private boolean internalValidateAndSetQuota() { if (isInternalExecution() || !isQuotaDependant()) { return true; } if (getStoragePool() == null) { throw new InvalidQuotaParametersException("Command: " + this.getClass().getName() + ". Storage pool is not available for quota calculation. "); } QuotaConsumptionParametersWrapper quotaConsumptionParametersWrapper = new QuotaConsumptionParametersWrapper(this, getReturnValue().getCanDoActionMessages()); quotaConsumptionParametersWrapper.setParameters(getQuotaConsumptionParameters()); if (quotaConsumptionParametersWrapper.getParameters() == null) { throw new InvalidQuotaParametersException("Command: " + this.getClass().getName() + ". No Quota parameters available."); } boolean result = true; setQuotaChanged(result); return result; }
Source:
<code>private static void recursiveCopy(File srcFile, File destFile, Map<String, String> tokens) { if (srcFile.isDirectory()) { destFile.mkdirs(); <START> if (destFile.mkdirs()) { <END> System.out.println("Created " + destFile.getAbsolutePath()); } else { System.out.println("Failed to create " + destFile.getAbsolutePath()); } for (File child : srcFile.listFiles()) { recursiveCopy(child, new File(destFile, child.getName()), tokens); } } else if (destFile.getName().equals("cake.png")) { String icon = tokens.get("@@icon@@"); if (icon != null && icon.length() > 0) { destFile = new File(destFile.getParentFile(), icon); try { FileUtils.copyFile(srcFile, destFile); } catch (IOException e) { System.out.println("Failed to copy file to " + destFile.getAbsolutePath()); e.printStackTrace(); } } } else { try { String fileContents = FileUtils.readFileToString(srcFile); for (Entry<String, String> entry : tokens.entrySet()) { fileContents = fileContents.replaceAll(entry.getKey(), entry.getValue()); } FileUtils.write(destFile, fileContents); System.out.println("Created file " + destFile.getAbsolutePath()); } catch (IOException e) { System.out.println("Failed to create file " + destFile.getAbsolutePath()); e.printStackTrace(); } } }</code><technical_language>method mkdirs is called twice, is purpose</technical_language>

Target:
private static void recursiveCopy(File srcFile, File destFile, Map<String, String> tokens) throws IOException { if (srcFile.isDirectory()) { if (!destFile.isDirectory()) { if (destFile.mkdirs()) { System.out.println("Created " + destFile.getAbsolutePath()); } else { throw new IOException("Failed to create " + destFile.getAbsolutePath()); } } for (File child : srcFile.listFiles()) { recursiveCopy(child, new File(destFile, child.getName()), tokens); } } else if (destFile.getName().equals("cake.png")) { String icon = tokens.get("@@icon@@"); if (icon != null && icon.length() > 0) { destFile = new File(destFile.getParentFile(), icon); try { FileUtils.copyFile(srcFile, destFile); } catch (IOException e) { System.out.println("Failed to copy file to " + destFile.getAbsolutePath()); e.printStackTrace(); } } } else { try { String fileContents = FileUtils.readFileToString(srcFile); for (Entry<String, String> entry : tokens.entrySet()) { fileContents = fileContents.replaceAll(entry.getKey(), entry.getValue()); } FileUtils.write(destFile, fileContents); System.out.println("Created file " + destFile.getAbsolutePath()); } catch (IOException e) { System.out.println("Failed to create file " + destFile.getAbsolutePath()); e.printStackTrace(); } } }
Source:
<code>private void refreshAndSelectSite(Map<String, Object> site) { <START> Map<String, Object> primaryBlog = site; <END> refreshBlogContent(primaryBlog); WordPress.setCurrentBlog((Integer) primaryBlog.get("id")); }</code><technical_language>variable primaryBlog is redundant here</technical_language>

Target:
private void refreshAndSelectSite(Map<String, Object> site) { refreshBlogContent(site); WordPress.setCurrentBlog((Integer) site.get("id")); }
Source:
<code>@Override public TypedBytes toBody(Object object) { try { return new JsonTypedBytes(gson.toJson(object).getBytes(UTF_8)); } catch (UnsupportedEncodingException e) { <START> throw new IllegalStateException(UTF_8 + " encoding does not exist.", e); <END> } }</code><technical_language>AssertionError</technical_language>

Target:
@Override public TypedBytes toBody(Object object) { try { return new JsonTypedBytes(gson.toJson(object).getBytes(UTF_8)); } catch (UnsupportedEncodingException e) { throw new AssertionError(e); } }
Source:
<code>public final ChannelPipeline addFirst(String name, ChannelHandler handler) { final AbstractChannelHandlerContext newCtx; checkMultiplicity(handler); if (name == null) { name = generateName(handler); } synchronized (handlers) { if (context(name) != null) { throw new IllegalArgumentException("Duplicate handler name: " + name); } newCtx = newContext(name, handler); handlers.add(0, newCtx); } EventExecutor executor = executor(); if (executor.inEventLoop()) { addFirst0(newCtx); } else { try { <START> executor.execute(() -> addFirst0(newCtx)); <END> } catch (Throwable cause) { synchronized (handlers) { handlers.remove(newCtx); } throw cause; } } return this; }</code><technical_language>I else logic needs moved synchronized block ensure ordering consistency array list linked list</technical_language>

Target:
public final ChannelPipeline addFirst(String name, ChannelHandler handler) { checkMultiplicity(handler); if (name == null) { name = generateName(handler); } AbstractChannelHandlerContext newCtx = newContext(name, handler); EventExecutor executor = executor(); boolean inEventLoop = executor.inEventLoop(); synchronized (handlers) { if (context(name) != null) { throw new IllegalArgumentException("Duplicate handler name: " + name); } handlers.add(0, newCtx); if (!inEventLoop) { try { executor.execute(() -> addFirst0(newCtx)); return this; } catch (Throwable cause) { handlers.remove(0); throw cause; } } } addFirst0(newCtx); return this; }
Source:
<code>private void sendMetrics(String queryString, String body) throws IOException { HttpURLConnection conn = createAndConfigureConnection(); writeMetrics(conn, body); int responseCode = conn.getResponseCode(); if (responseCode / 100 != 2) { throw new RuntimeException("Failed to write metrics, response code: " + responseCode + ", response message: " + conn.getResponseMessage()); } <START> String response = readResponse(conn); <END> logger.log(getTraceLevel(), "Response from influx: " + response); }</code><technical_language>sense org.jmxtrans.agent.util.io.IoUtils#closeQuietly(java.net.URLConnection) ensure connection is returned http connection pool</technical_language>

Target:
private void sendMetrics(String queryString, String body) throws IOException { HttpURLConnection conn = createAndConfigureConnection(); try { sendMetrics(body, conn); } finally { IoUtils.closeQuietly(conn); } }
Source:
<code>public void testList() throws Exception { final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; <START> verify(checkConfig, getPath("InputGh47.java"), expected); <END> }</code><technical_language>this file name change too</technical_language>

Target:
public void testList() throws Exception { final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verify(checkConfig, getPath("InputGenericWhitespaceList.java"), expected); }
Source:
<code>private void unresolveConstraints(BundleDescriptionImpl bundle) { HostSpecificationImpl host = (HostSpecificationImpl) bundle.getHost(); if (host != null) host.setHosts(null); bundle.setSelectedExports(null); bundle.setResolvedImports(null); bundle.setResolvedRequires(null); bundle.setSubstitutedExports(null); bundle.setSelectedCapabilities(null); bundle.setResolvedCapabilities(null); bundle.setStateWires(null); bundle.clearAddedDynamicImportPackages(); NativeCodeSpecificationImpl nativeCode = (NativeCodeSpecificationImpl) bundle.getNativeCodeSpecification(); if (nativeCode != null) nativeCode.setSupplier(null); ImportPackageSpecification[] imports = bundle.getImportPackages(); for (ImportPackageSpecification <START> import1 : <END> imports) { ((ImportPackageSpecificationImpl) import1).setSupplier(null); } BundleSpecification[] requires = bundle.getRequiredBundles(); for (BundleSpecification require : requires) { ((BundleSpecificationImpl) require).setSupplier(null); } GenericSpecification[] genericRequires = bundle.getGenericRequires(); if (genericRequires.length > 0) for (GenericSpecification genericRequire : genericRequires) { ((GenericSpecificationImpl) genericRequire).setSupplers(null); } bundle.removeDependencies(); }</code><technical_language>rename importSpecification</technical_language>

Target:
private void unresolveConstraints(BundleDescriptionImpl bundle) { HostSpecificationImpl host = (HostSpecificationImpl) bundle.getHost(); if (host != null) host.setHosts(null); bundle.setSelectedExports(null); bundle.setResolvedImports(null); bundle.setResolvedRequires(null); bundle.setSubstitutedExports(null); bundle.setSelectedCapabilities(null); bundle.setResolvedCapabilities(null); bundle.setStateWires(null); bundle.clearAddedDynamicImportPackages(); NativeCodeSpecificationImpl nativeCode = (NativeCodeSpecificationImpl) bundle.getNativeCodeSpecification(); if (nativeCode != null) nativeCode.setSupplier(null); ImportPackageSpecification[] imports = bundle.getImportPackages(); for (ImportPackageSpecification importSpecification : imports) { ((ImportPackageSpecificationImpl) importSpecification).setSupplier(null); } BundleSpecification[] requires = bundle.getRequiredBundles(); for (BundleSpecification require : requires) { ((BundleSpecificationImpl) require).setSupplier(null); } GenericSpecification[] genericRequires = bundle.getGenericRequires(); if (genericRequires.length > 0) for (GenericSpecification genericRequire : genericRequires) { ((GenericSpecificationImpl) genericRequire).setSupplers(null); } bundle.removeDependencies(); }
Source:
<code>public void executeForRefundsOnly(Long startId, OptionalLong maybeMaxId, Long doNotRetryEmitUntilDuration) { try { MDC.put(HEADER_REQUEST_ID, "HistoricalEventEmitterWorker-" + RandomUtils.nextLong(0, 10000)); initializeHistoricalEventEmitter(doNotRetryEmitUntilDuration); maxId = maybeMaxId.orElseGet(refundDao::findMaxId); logger.info("Starting emitting refunds from up to {}", startId, maxId); for (long currentId = startId; currentId <= maxId; currentId++) { <START> Optional<RefundEntity> mayBeRefundEntity = refundDao.findById(currentId); <END> if (mayBeRefundEntity.isPresent()) { final RefundEntity refundEntity = mayBeRefundEntity.get(); historicalEventEmitter.processRefundEvents(refundEntity.getChargeExternalId()); } else { logger.info("Refund [{}/{}] - not found", currentId, maxId); } } } catch (Exception e) { logger.error("Error attempting to process refunds events on job [start={}] [max={}] [error={}]", startId, maxId, e); } finally { MDC.remove(HEADER_REQUEST_ID); } logger.info("Terminating"); }</code><technical_language>I this written as: java refundDao.findById(currentId) .map(refund::getChargeExternalId) .map(historicalEventEmitter::processRefundEvents); orElse log in there. thought</technical_language>

Target:
public void executeForRefundsOnly(Long startId, OptionalLong maybeMaxId, Long doNotRetryEmitUntilDuration) { try { MDC.put(HEADER_REQUEST_ID, "HistoricalEventEmitterWorker-" + RandomUtils.nextLong(0, 10000)); initializeHistoricalEventEmitter(doNotRetryEmitUntilDuration); maxId = maybeMaxId.orElseGet(refundDao::findMaxId); logger.info("Starting emitting refunds from up to {}", startId, maxId); for (long currentId = startId; currentId <= maxId; currentId++) { long finalCurrentId = currentId; refundDao.findById(currentId) .ifPresentOrElse( refundEntity -> historicalEventEmitter.processRefundEvents(refundEntity.getChargeExternalId()), () -> logger.info("Refund [{}/{}] - not found", finalCurrentId, maxId)); } } catch (Exception e) { logger.error("Error attempting to process refunds events on job [start={}] [max={}] [error={}]", startId, maxId, e); } finally { MDC.remove(HEADER_REQUEST_ID); } logger.info("Terminating"); }
Source:
<code>protected void logToAudit(){ <START> AuditLogableBase auditLogableBase = new AuditLogableBase(){ <END> public AuditLogType getAuditLogTypeValue() { return AuditLogType.IRS_BROKER_COMMAND_FAILURE; } }; auditLogableBase.addCustomValue("message", getReturnStatus().mMessage); AuditLogDirector auditLogDirector = new AuditLogDirector(); auditLogDirector.log(auditLogableBase); }</code><technical_language>anonymous class instead of simply creating instance, using: auditLogDirector.log(auditLogableBase, AuditLogType.IRS_BROKER_COMMAND_FAILURE;);</technical_language>

Target:
protected void logToAudit(){ AuditLogableBase auditLogableBase = new AuditLogableBase(); auditLogableBase.addCustomValue("message", getReturnStatus().mMessage); auditLogDirector.log(auditLogableBase, AuditLogType.IRS_BROKER_COMMAND_FAILURE); }
Source:
<code>@Test public void testAsciiFunc() { tester.setFor(SqlStdOperatorTable.ASCII); <START> tester.checkScalarExact("ASCII('')", "0"); <END> tester.checkScalarExact("ASCII('abc')", "97"); tester.checkScalarExact("ASCII('ABC')", "65"); tester.checkNull("ASCII(cast(null as varchar(1)))"); }</code><technical_language>is a non-ASCII character</technical_language>

Target:
@Test public void testAsciiFunc() { tester.setFor(SqlStdOperatorTable.ASCII); tester.checkScalarExact("ASCII('')", "0"); tester.checkScalarExact("ASCII('a')", "97"); tester.checkScalarExact("ASCII('1')", "49"); tester.checkScalarExact("ASCII('abc')", "97"); tester.checkScalarExact("ASCII('ABC')", "65"); tester.checkScalarExact("ASCII(_UTF8'\u0082')", "130"); tester.checkScalarExact("ASCII(_UTF8'\u5B57')", "23383"); tester.checkScalarExact("ASCII(_UTF8'Ω')", "937"); tester.checkNull("ASCII(cast(null as varchar(1)))"); }
Source:
<code>public void testSubstrings() { int index = 1; int len = 3; ExtractionFn extractionFn = new SubstringDimExtractionFn(index, len); Set<String> extracted = Sets.newHashSet(); for (String testString : testStrings) { extracted.add(extractionFn.apply(testString)); } Assert.assertEquals(7, extracted.size()); <START> Assert.assertTrue(extracted.contains("ppl")); <END> Assert.assertTrue(extracted.contains("wes")); Assert.assertTrue(extracted.contains("syl")); Assert.assertTrue(extracted.contains("usi")); Assert.assertTrue(extracted.contains("e")); Assert.assertTrue(extracted.contains("ool")); Assert.assertTrue(extracted.contains(null)); }</code><technical_language>please explain do testing for "same" ? e.g. enough? Assert.assertEquals("xxx", extractionFn.apply("bxxxb")); Assert.assertEquals("xxx", extractionFn.apply("axxxa")); test sameness of "xxx"</technical_language>

Target:
public void testSubstrings() { ExtractionFn extractionFn = new SubstringDimExtractionFn(1, 3); Assert.assertEquals("ppl", extractionFn.apply("apple")); Assert.assertEquals("e", extractionFn.apply("be")); Assert.assertEquals("ool", extractionFn.apply("cool")); Assert.assertEquals(null, extractionFn.apply("a")); }
Source:
<code>public void process(MetadataRepository repository, ComplexTypeMetadata type, XSDAnnotation annotation, XmlSchemaAnnotationProcessorState state) { if (annotation != null) { EList<Element> appInfoElements = annotation.getApplicationInformation(); List<Category> categories = new ArrayList<>(); for (Element appInfo : appInfoElements) { String source = appInfo.getAttribute("source"); if (source != null && source.equals("X_Category")) { NodeList childNodes = appInfo.getChildNodes(); Map<Locale, String> labels = new LinkedHashMap<>(); List<String> fields = new ArrayList<>(); String categoryName = null; for (int i = 0; i < childNodes.getLength(); i++) { Node node = childNodes.item(i); String localName = node.getLocalName(); if (localName != null) { Node subChild = node.getFirstChild(); if (subChild != null) { String nodeValue = subChild.getNodeValue(); if (nodeValue != null) { if (localName.equalsIgnoreCase("name")) { categoryName = nodeValue; } else if (localName.startsWith("label_")) { String lang = localName.substring(6); Locale locale = new Locale(lang.toLowerCase()); labels.put(locale, nodeValue); } else if (localName.equalsIgnoreCase("field") && nodeValue != null) { fields.add(nodeValue); } } } } } if (categoryName != null) { <START> Category category = new Category(); <END> category.setName(categoryName); category.setLabels(labels); category.setFields(fields); categories.add(category); state.setCategories(categories); } } } } }</code><technical_language>provide a constructor parameters, default constructor</technical_language>

Target:
public void process(MetadataRepository repository, ComplexTypeMetadata type, XSDAnnotation annotation, XmlSchemaAnnotationProcessorState state) { if (annotation != null) { EList<Element> appInfoElements = annotation.getApplicationInformation(); List<Category> categories = new ArrayList<>(); for (Element appInfo : appInfoElements) { String source = appInfo.getAttribute("source"); if (source != null && source.equals("X_Category")) { NodeList childNodes = appInfo.getChildNodes(); Map<Locale, String> labels = new LinkedHashMap<>(); List<String> fields = new ArrayList<>(); String categoryName = null; for (int i = 0; i < childNodes.getLength(); i++) { Node node = childNodes.item(i); String localName = node.getLocalName(); if (localName != null) { localName = localName.toLowerCase(); Node subChild = node.getFirstChild(); if (subChild != null) { String nodeValue = subChild.getNodeValue(); if (nodeValue != null) { if (localName.equals("name")) { categoryName = nodeValue; } else if (localName.startsWith("label_")) { String lang = localName.substring(6); Locale locale = new Locale(lang); labels.put(locale, nodeValue); } else if (localName.equals("field") && nodeValue != null) { fields.add(nodeValue); } } } } } if (categoryName != null) { Category category = new Category(categoryName, fields, labels); categories.add(category); state.setCategories(categories); } } } } }
Source:
<code>private List<String> sortIds(Set<String> docIdSet, List<Map<String, String>> sortDocument, Map<String, Object> indexes, SQLDatabase db) { boolean smallResultSet = (docIdSet.size() < SMALL_RESULT_SET_SIZE_THRESHOLD); SqlParts orderBy = sqlToSortIds(docIdSet, sortDocument, indexes); <START> List<String> sortedIds = new ArrayList<String>(); <END> if (orderBy != null) { Cursor cursor = null; try { cursor = db.rawQuery(orderBy.sqlWithPlaceHolders, orderBy.placeHolderValues); if (smallResultSet) { while (cursor.moveToNext()) { String candidateId = cursor.getString(0); sortedIds.add(candidateId); } } else { while (cursor.moveToNext()) { String candidateId = cursor.getString(0); if (docIdSet.contains(candidateId)) { sortedIds.add(candidateId); } } } } catch (SQLException e) { logger.log(Level.SEVERE, "Failed to sort doc ids.", e); return null; } finally { DatabaseUtils.closeCursorQuietly(cursor); } } else { return null; } return sortedIds; }</code><technical_language>move assignment if, return null else, mirror assignment nil in objc code early return. easy for accidentally change this code return empty array null</technical_language>

Target:
private List<String> sortIds(Set<String> docIdSet, List<Map<String, String>> sortDocument, Map<String, Object> indexes, SQLDatabase db) { boolean smallResultSet = (docIdSet.size() < SMALL_RESULT_SET_SIZE_THRESHOLD); SqlParts orderBy = sqlToSortIds(docIdSet, sortDocument, indexes); List<String> sortedIds = null; if (orderBy != null) { Cursor cursor = null; try { cursor = db.rawQuery(orderBy.sqlWithPlaceHolders, orderBy.placeHolderValues); while (cursor.moveToNext()) { if (sortedIds == null) { sortedIds = new ArrayList<String>(); } String candidateId = cursor.getString(0); if (smallResultSet) { sortedIds.add(candidateId); } else { if (docIdSet.contains(candidateId)) { sortedIds.add(candidateId); } } } } catch (SQLException e) { logger.log(Level.SEVERE, "Failed to sort doc ids.", e); return null; } finally { DatabaseUtils.closeCursorQuietly(cursor); } } else { sortedIds = null; } return sortedIds; }
Source:
<code>public static Collection<String> attributes() { <START> return Stream.of(Attribute.values()).map(a->a.getAttributeName()).collect(Collectors.toList()); <END> }</code><technical_language>Lambda replaced method reference Attribute::getAttributeName</technical_language>

Target:
public static Collection<String> attributes() { return Stream.of(Attribute.values()).map(Attribute::getAttributeName).collect(Collectors.toList()); }
Source:
<code>public GroupChatInvitation parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException { <START> return new GroupChatInvitation( <END> ParserUtils.getBareJidAttribute(parser, ATTR_JID), parser.getAttributeValue(ATTR_PASSWORD), parser.getAttributeValue(ATTR_REASON), ParserUtils.getBooleanAttribute(parser, ATTR_CONTINUE, false), parser.getAttributeValue(ATTR_THREAD)); }</code><technical_language>I density here. I prefer if arguments of constructor declared local variables</technical_language>

Target:
public GroupChatInvitation parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException { EntityBareJid roomJid = ParserUtils.getBareJidAttribute(parser, ATTR_JID); String password = parser.getAttributeValue(ATTR_PASSWORD); String reason = parser.getAttributeValue(ATTR_REASON); boolean isContinue = ParserUtils.getBooleanAttribute(parser, ATTR_CONTINUE, false); String thread = parser.getAttributeValue(ATTR_THREAD); return new GroupChatInvitation(roomJid, password, reason, isContinue, thread); }
Source:
<code>public void setPortParameters(int baudRate, int dataBits, int stopBits, int parity, int flowControl) throws XBeeException { if (serialPort != null) { try { <START> serialPort.setSerialPortParams(baudRate, dataBits, stopBits, parity); <END> serialPort.setFlowControlMode(flowControl); } catch (UnsupportedCommOperationException e) { throw new XBeeException(XBeeException.INVALID_OPERATION, e.getMessage()); } } }</code><technical_language>this operation require close/open connection?, also, save port parameters</technical_language>

Target:
public void setPortParameters(int baudRate, int dataBits, int stopBits, int parity, int flowControl) throws XBeeException { parameters = new SerialPortParameters(baudRate, dataBits, stopBits, parity, flowControl); if (serialPort != null) { try { serialPort.setSerialPortParams(baudRate, dataBits, stopBits, parity); serialPort.setFlowControlMode(flowControl); } catch (UnsupportedCommOperationException e) { throw new XBeeException(XBeeException.INVALID_OPERATION, e.getMessage()); } } }
Source:
<code>public void addTail(final MessageReference ref, final boolean direct) { enterCritical(CRITICAL_PATH_ADD_TAIL); try { if (scheduleIfPossible(ref)) { return; } synchronized (directDeliveryGuard) { if (supportsDirectDeliver && !directDeliver && direct && System.currentTimeMillis() - lastDirectDeliveryCheck > CHECK_QUEUE_SIZE_PERIOD) { lastDirectDeliveryCheck = System.currentTimeMillis(); if (intermediateMessageReferences.isEmpty() && messageReferences.isEmpty() && !pageIterator.hasNext() && !pageSubscription.isPaging()) { <START> if (internalFlushExecutor(500, false) && flushDeliveriesInTransit()) { <END> directDeliver = supportsDirectDeliver; } } } } if (direct && supportsDirectDeliver && directDeliver && deliveriesInTransit.getCount() == 0 && deliverDirect(ref)) { return; } queueMemorySize.addAndGet(ref.getMessageMemoryEstimate()); intermediateMessageReferences.add(ref); directDeliver = false; deliverAsync(); } finally { leaveCritical(CRITICAL_PATH_ADD_TAIL); } }</code><technical_language>500 100, if issue previously long surely want this small safely possible</technical_language>

Target:
public void addTail(final MessageReference ref, final boolean direct) { enterCritical(CRITICAL_PATH_ADD_TAIL); try { if (scheduleIfPossible(ref)) { return; } if (supportsDirectDeliver && !directDeliver && direct && System.currentTimeMillis() - lastDirectDeliveryCheck > CHECK_QUEUE_SIZE_PERIOD) { if (logger.isTraceEnabled()) { logger.trace("Checking to re-enable direct deliver on queue " + this.getName()); } lastDirectDeliveryCheck = System.currentTimeMillis(); synchronized (directDeliveryGuard) { if (deliveriesInTransit.getCount() == 0 && getExecutor().isFlushed() && intermediateMessageReferences.isEmpty() && messageReferences.isEmpty() && !pageIterator.hasNext() && !pageSubscription.isPaging()) { directDeliver = supportsDirectDeliver; if (logger.isTraceEnabled()) { logger.trace("Setting direct deliverer to " + supportsDirectDeliver); } } else { if (logger.isTraceEnabled()) { logger.trace("Couldn't set direct deliver back"); } } } } if (direct && supportsDirectDeliver && directDeliver && deliveriesInTransit.getCount() == 0 && deliverDirect(ref)) { return; } queueMemorySize.addAndGet(ref.getMessageMemoryEstimate()); intermediateMessageReferences.add(ref); directDeliver = false; deliverAsync(); } finally { leaveCritical(CRITICAL_PATH_ADD_TAIL); } }
Source:
<code>private TokenBackedBasicResultsPage<RowResult<Set<Long>>, Token> getTimestampsPageInternal( DbReadTable table, RangeRequest range, long timestamp, long batchSize, Token token) { Set<byte[]> rows = Sets.newHashSet(); int maxRows = getMaxRowsFromBatchHint(range.getBatchHint()); try (ClosableIterator<AgnosticLightResultRow> rangeResults = table.getRange(range, timestamp, maxRows)) { while (rows.size() < maxRows && rangeResults.hasNext()) { byte[] rowName = rangeResults.next().getBlob(ROW); if (rowName != null) { rows.add(rowName); } } if (rows.isEmpty()) { return SimpleTokenBackedResultsPage.create(null, ImmutableList.<RowResult<Set<Long>>>of(), false); } } ColumnSelection cols = range.getColumnNames().isEmpty() ? ColumnSelection.all() : ColumnSelection.create(range.getColumnNames()); <START> ResultWithToken result = getTimestampsByCell(table, rows, cols, timestamp, batchSize, range.isReverse(), token); <END> NavigableMap<byte[], SortedMap<byte[], Set<Long>>> cellsByRow = Cells.breakCellsUpByRow(Multimaps.asMap(result.entries)); if (range.isReverse()) { cellsByRow = cellsByRow.descendingMap(); } List<RowResult<Set<Long>>> finalResults = new ArrayList<>(); cellsByRow.entrySet().forEach(entry -> finalResults.add(RowResult.create(entry.getKey(), entry.getValue()))); return SimpleTokenBackedResultsPage.create(result.token, finalResults, result.mayHaveMoreResults); }</code><technical_language>This is a lot of parameters. good do a refactor (in a future PR), extracting a method object parameter object (or both). For I leave as-is</technical_language>

Target:
private TokenBackedBasicResultsPage<RowResult<Set<Long>>, Token> getTimestampsPageInternal( DbReadTable table, RangeRequest range, long timestamp, long batchSize, Token token) { Set<byte[]> rows = Sets.newHashSet(); int maxRows = getMaxRowsFromBatchHint(range.getBatchHint()); try (ClosableIterator<AgnosticLightResultRow> rangeResults = table.getRange(range, timestamp, maxRows)) { while (rows.size() < maxRows && rangeResults.hasNext()) { byte[] rowName = rangeResults.next().getBytes(ROW); if (rowName != null) { rows.add(rowName); } } if (rows.isEmpty()) { return SimpleTokenBackedResultsPage.create(null, ImmutableList.<RowResult<Set<Long>>>of(), false); } } ColumnSelection cols = range.getColumnNames().isEmpty() ? ColumnSelection.all() : ColumnSelection.create(range.getColumnNames()); TimestampsByCellResultWithToken result = getTimestampsByCell(table, rows, cols, timestamp, batchSize, range.isReverse(), token); NavigableMap<byte[], SortedMap<byte[], Set<Long>>> cellsByRow = Cells.breakCellsUpByRow(Multimaps.asMap(result.entries)); if (range.isReverse()) { cellsByRow = cellsByRow.descendingMap(); } List<RowResult<Set<Long>>> finalResults = cellsByRow.entrySet().stream() .map(entry -> RowResult.create(entry.getKey(), entry.getValue())) .collect(Collectors.toList()); return SimpleTokenBackedResultsPage.create(result.getToken(), finalResults, result.mayHaveMoreResults()); }