auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void activate(Context context) { try { scan = operationScan(); scanner = getStore().getTable().getScanner(scan); readThread = new Thread(new Runnable() { @Override public void run() { try { Result result; while ((result = scanner.next()) != null) { while (!resultQueue.offer(result)) { Thread.sleep(DEF_SLEEP_MILLIS); } } } catch (Exception e) { logger.debug("Exception in fetching results"); <START> throw new RuntimeException(e.getMessage()); <END> } finally { scanner.close(); } } }); } catch (Exception ex) { throw new RuntimeException(ex); } readThread.start(); }</code><technical_language>throw entire stacktrace. log exception message</technical_language>

Target:
public void activate(Context context) { startReadThread(); }
Source:
<code>public ScoredCandidates<Container> generate( Container content, ResultDescription desc, EquivToTelescopeResult equivToTelescopeResult ) { EquivToTelescopeComponent generatorComponent = EquivToTelescopeComponent.create(); generatorComponent.setComponentName("Container Child Equivalence Generator"); OptionalMap<String,EquivalenceSummary> childSummaries = summaryStore.summariesForUris( Iterables.transform(content.getChildRefs(), ChildRef.TO_URI) ); Multiset<String> parents = HashMultiset.create(); for (EquivalenceSummary summary : Optional.presentInstances(childSummaries.values())) { if (publishers == null) { Iterables.addAll(parents, Iterables.filter(Iterables.transform( summary.getEquivalents().values(), TO_PARENT ), Predicates.notNull())); } else { Iterables.addAll(parents, Iterables.filter(summary.getEquivalents() .values() .stream() <START> .filter(input -> publishers == null <END> || publishers.contains(input.getPublisher())) .map(TO_PARENT::apply) .collect(Collectors.toList() ), Predicates.notNull())); } } return scoreContainers( parents, childSummaries.size(), desc, equivToTelescopeResult, generatorComponent ); }</code><technical_language>This is else statement publishers is null. remove if statement remove this null check</technical_language>

Target:
public ScoredCandidates<Container> generate( Container content, ResultDescription desc, EquivToTelescopeResult equivToTelescopeResult ) { EquivToTelescopeComponent generatorComponent = EquivToTelescopeComponent.create(); generatorComponent.setComponentName("Container Child Equivalence Generator"); OptionalMap<String,EquivalenceSummary> childSummaries = summaryStore.summariesForUris( Iterables.transform(content.getChildRefs(), ChildRef.TO_URI) ); Multiset<String> parents = HashMultiset.create(); for (EquivalenceSummary summary : Optional.presentInstances(childSummaries.values())) { Iterables.addAll( parents, summary.getEquivalents() .values() .stream() .filter(input -> publishers == null || publishers.contains(input.getPublisher())) .map(TO_PARENT::apply) .filter(Objects::nonNull) .collect(Collectors.toList()) ); } return scoreContainers( parents, childSummaries.size(), desc, equivToTelescopeResult, generatorComponent ); }
Source:
<code>public void <START> testAttachmentOnCenterLabelSelection() <END> { testAttachmentOnCenterLabelSelection(false); testAttachmentOnCenterLabelSelection(true); }</code><technical_language>This test fails in environment</technical_language>

Target:
public void testAttachmentOnCenterLabelSelection() { testAttachmentOnCenterLabelSelection(false); editor.getDiagramGraphicalViewer().deselectAll(); testAttachmentOnCenterLabelSelection(true); }
Source:
<code>public void testGetAttributeAsStringList() { final VariantContext context = basicBuilder .attribute("DefaultIntegerList", new int[5]) .attribute("ListWithMissing", new Object[]{1, null, null}) .attribute("IntegerList", new int[]{0, 1, 2, 3}) .attribute("DoubleList", new double[]{1.8, 1.6, 2.1}) .attribute("StringList", new String[]{"1", "2"}) .attribute("NotNumeric", new String[]{"A", "B"}) .make(); Assert.assertEquals(context.getAttributeAsStringList("DefaultIntegerList", "empty"), Arrays.asList("0", "0", "0", "0", "0")); Assert.assertEquals(context.getAttributeAsStringList("ListWithMissing", "empty"), Arrays.asList("1", "empty", "empty")); Assert.assertEquals(context.getAttributeAsStringList("IntegerList", "empty"), Arrays.asList("0", "1", "2", "3")); Assert.assertEquals(context.getAttributeAsStringList("DoubleList", "empty"), Arrays.asList("1.8", "1.6", "2.1")); Assert.assertEquals(context.getAttributeAsStringList("StringList", "empty"), Arrays.asList("1", "2")); <START> Assert.assertEquals(context.getAttributeAsStringList("NotNumeric", "empty"), Arrays.asList("A", "B")); <END> }</code><technical_language>please test empty list a missing list (here in other tests too!)</technical_language>

Target:
public void testGetAttributeAsStringList() { final VariantContext context = basicBuilder .attribute("Empty", new int[0]) .attribute("DefaultIntegerList", new int[5]) .attribute("ListWithMissing", new Object[]{1, null, null}) .attribute("IntegerList", new int[]{0, 1, 2, 3}) .attribute("DoubleList", new double[]{1.8, 1.6, 2.1}) .attribute("StringList", new String[]{"1", "2"}) .attribute("NotNumeric", new String[]{"A", "B"}) .make(); Assert.assertTrue(context.getAttributeAsStringList("Empty", "empty").isEmpty()); Assert.assertEquals(context.getAttributeAsStringList("DefaultIntegerList", "empty"), Arrays.asList("0", "0", "0", "0", "0")); Assert.assertEquals(context.getAttributeAsStringList("ListWithMissing", "empty"), Arrays.asList("1", "empty", "empty")); Assert.assertEquals(context.getAttributeAsStringList("IntegerList", "empty"), Arrays.asList("0", "1", "2", "3")); Assert.assertEquals(context.getAttributeAsStringList("DoubleList", "empty"), Arrays.asList("1.8", "1.6", "2.1")); Assert.assertEquals(context.getAttributeAsStringList("StringList", "empty"), Arrays.asList("1", "2")); Assert.assertEquals(context.getAttributeAsStringList("NotNumeric", "empty"), Arrays.asList("A", "B")); Assert.assertTrue(context.getAttributeAsStringList("MissingList", "empty").isEmpty()); }
Source:
<code>private void onSceneAddedInternal(InternalScene scene) { logger.debug(scene.getSceneType()); if (scene != null && scene.getSceneType().equals(sceneType)) { if (!ignoredScene(scene.getSceneID()) && !ignoreGroup(scene.getGroupID())) { ThingUID thingUID = getThingUID(scene); if (thingUID != null) { ThingUID bridgeUID = bridgeHandler.getThing().getUID(); <START> Map<String, Object> properties = new HashMap<>(4); <END> properties.put(ZONE_ID, scene.getZoneID()); properties.put(GROUP_ID, scene.getGroupID()); if (SceneEnum.containsScene(scene.getSceneID())) { properties.put(SCENE_ID, SceneEnum.getScene(scene.getSceneID()).toString()); } else { logger.debug("discovered scene: name '{}' with id have an invalid scene-ID", scene.getSceneName(), scene.getID()); } DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties) .withBridge(bridgeUID).withLabel(scene.getSceneName()).build(); thingDiscovered(discoveryResult); } else { logger.debug("discovered unsupported scene: name '{}' with id {}", scene.getSceneName(), scene.getID()); } } } }</code><technical_language>please remove hashmap size</technical_language>

Target:
private void onSceneAddedInternal(InternalScene scene) { logger.debug("{}", scene.getSceneType()); if (scene != null && scene.getSceneType().equals(sceneType)) { if (!ignoredScene(scene.getSceneID()) && !ignoreGroup(scene.getGroupID())) { ThingUID thingUID = getThingUID(scene); if (thingUID != null) { ThingUID bridgeUID = bridgeHandler.getThing().getUID(); Map<String, Object> properties = new HashMap<>(); properties.put(ZONE_ID, scene.getZoneID()); properties.put(GROUP_ID, scene.getGroupID()); if (SceneEnum.containsScene(scene.getSceneID())) { properties.put(SCENE_ID, SceneEnum.getScene(scene.getSceneID()).toString()); } else { logger.debug("discovered scene: name '{}' with id have an invalid scene-ID", scene.getSceneName(), scene.getID()); } DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties) .withBridge(bridgeUID).withLabel(scene.getSceneName()).build(); thingDiscovered(discoveryResult); } else { logger.debug("discovered unsupported scene: name '{}' with id {}", scene.getSceneName(), scene.getID()); } } } }
Source:
<code>public void popout() { if (rmdPreviewParams_ != null && !rmdPreviewParams_.isShinyDocument()) { globalDisplay_.showHtmlFile(rmdPreviewParams_.getOutputFile()); } else if (frame_ != null && !StringUtil.equals(frame_.getIFrame().getCurrentUrl(), getUrl())) { <START> globalDisplay_.openWindow(frame_.getIFrame().getCurrentUrl()); <END> } else if (unmodifiedUrl_ != null) { globalDisplay_.openWindow(unmodifiedUrl_); } }</code><technical_language>this imply attempt open a null URL if get IFrame URL (e.g. of DOM restrictions)</technical_language>

Target:
public void popout() { if (rmdPreviewParams_ != null && !rmdPreviewParams_.isShinyDocument()) { globalDisplay_.showHtmlFile(rmdPreviewParams_.getOutputFile()); } else if (frame_ != null && frame_.getIFrame().getCurrentUrl() != null && !StringUtil.equals(frame_.getIFrame().getCurrentUrl(), getUrl())) { globalDisplay_.openWindow(frame_.getIFrame().getCurrentUrl()); } else if (unmodifiedUrl_ != null) { globalDisplay_.openWindow(unmodifiedUrl_); } }
Source:
<code>static OperationDefinition getOperationDefinition() { assert TIMEOUT != null; return new SimpleOperationDefinitionBuilder(OPERATION_NAME, HostResolver.getResolver("host.server")) .setParameters(TIMEOUT) <START> .setReplyType(ModelType.STRING) <END> .setRuntimeOnly() .withFlag(OperationEntry.Flag.HOST_CONTROLLER_ONLY) .build(); }</code><technical_language>This emit a reply value</technical_language>

Target:
static OperationDefinition getOperationDefinition() { assert TIMEOUT != null; return new SimpleOperationDefinitionBuilder(OPERATION_NAME, HostResolver.getResolver("host.server")) .setParameters(TIMEOUT) .setRuntimeOnly() .withFlag(OperationEntry.Flag.HOST_CONTROLLER_ONLY) .build(); }
Source:
<code>public static String fromUtf8(final ByteBuffer buffer, final int numBytes) { final byte[] bytes = new byte[numBytes]; buffer.get(bytes); <START> return StringUtils.fromUtf8(bytes); <END> }</code><technical_language>need class qualifier</technical_language>

Target:
public static String fromUtf8(final ByteBuffer buffer, final int numBytes) { final byte[] bytes = new byte[numBytes]; buffer.get(bytes); return fromUtf8(bytes); }
Source:
<code>public Response createEvent( @ApiParam(value = "Event to be created. Category and Text fields required", name = "event", required = true) final Event event) { try { if (null != event) { event.setTenantId(tenantId); if (null != alertsService.getEvent(tenantId, event.getId(), true)) { return ResponseUtil.badRequest("Event with ID [" + event.getId() + "] exists."); } <START> alertsService.sendEvent(event); <END> log.debugf("Event: %s ", event.toString()); return ResponseUtil.ok(event); } else { return ResponseUtil.badRequest("Event is null"); } } catch (Exception e) { log.debugf(e.getMessage(), e); return ResponseUtil.internalError(e.getMessage()); } }</code><technical_language>mentioned discuss this</technical_language>

Target:
public Response createEvent( @ApiParam(value = "Event to be created. Category and Text fields required", name = "event", required = true) final Event event) { try { if (null != event) { event.setTenantId(tenantId); if (null != alertsService.getEvent(tenantId, event.getId(), true)) { return ResponseUtil.badRequest("Event with ID [" + event.getId() + "] exists."); } alertsService.addEvents(Collections.singletonList(event)); log.debugf("Event: %s ", event.toString()); return ResponseUtil.ok(event); } else { return ResponseUtil.badRequest("Event is null"); } } catch (Exception e) { log.debugf(e.getMessage(), e); return ResponseUtil.internalError(e.getMessage()); } }
Source:
<code><START> public ObjectId <END> insert(final int type, long len, final InputStream is, boolean createDuplicate) throws IOException { if (len <= buffer().length) { byte[] buf = buffer(); int actLen = IO.readFully(is, buf, 0); return insert(type, buf, 0, actLen, createDuplicate); } else { MessageDigest md = digest(); File tmp = toTemp(md, type, len, is); ObjectId id = ObjectId.fromRaw(md.digest()); return insertOneObject(tmp, id, createDuplicate); } }</code><technical_language>Likewise</technical_language>

Target:
ObjectId insert(final int type, long len, final InputStream is, boolean createDuplicate) throws IOException { if (len <= buffer().length) { byte[] buf = buffer(); int actLen = IO.readFully(is, buf, 0); return insert(type, buf, 0, actLen, createDuplicate); } else { MessageDigest md = digest(); File tmp = toTemp(md, type, len, is); ObjectId id = ObjectId.fromRaw(md.digest()); return insertOneObject(tmp, id, createDuplicate); } }
Source:
<code>private void globalRebalance(ResourceControllerDataProvider clusterData, Map<String, Resource> resourceMap, final CurrentStateOutput currentStateOutput, RebalanceAlgorithm algorithm) throws HelixRebalanceException { _changeDetector.updateSnapshots(clusterData); final Map<HelixConstants.ChangeType, Set<String>> clusterChanges = _changeDetector.getChangeTypes().stream() .collect(Collectors.toMap(changeType -> changeType, changeType -> { Set<String> itemKeys = new HashSet<>(); itemKeys.addAll(_changeDetector.getAdditionsByType(changeType)); itemKeys.addAll(_changeDetector.getChangesByType(changeType)); itemKeys.addAll(_changeDetector.getRemovalsByType(changeType)); return itemKeys; })).entrySet().stream().filter(changeEntry -> !changeEntry.getValue().isEmpty()) .collect(Collectors .toMap(changeEntry -> changeEntry.getKey(), changeEntry -> changeEntry.getValue())); if (clusterChanges.keySet().stream() .anyMatch(GLOBAL_REBALANCE_REQUIRED_CHANGE_TYPES::contains)) { Map<String, ResourceAssignment> currentBaseline = getBaselineAssignment(_assignmentMetadataStore, currentStateOutput, resourceMap.keySet()); ClusterModel clusterModel; try { clusterModel = ClusterModelProvider .generateClusterModelForBaseline(clusterData, resourceMap, clusterData.getAllInstances(), clusterChanges, currentBaseline); } catch (Exception ex) { throw new HelixRebalanceException("Failed to generate cluster model for global rebalance.", HelixRebalanceException.Type.INVALID_CLUSTER_STATUS, ex); } <START> refreshBaseline(clusterModel, algorithm); <END> } }</code><technical_language>rename more specific? more readable if refreshBaseline(calculateAssignment(clusterModel, algorithm)); private method persist data, else</technical_language>

Target:
private void globalRebalance(ResourceControllerDataProvider clusterData, Map<String, Resource> resourceMap, final CurrentStateOutput currentStateOutput, RebalanceAlgorithm algorithm) throws HelixRebalanceException { _changeDetector.updateSnapshots(clusterData); final Map<HelixConstants.ChangeType, Set<String>> clusterChanges = _changeDetector.getAllChanges(); if (clusterChanges.keySet().stream() .anyMatch(GLOBAL_REBALANCE_REQUIRED_CHANGE_TYPES::contains)) { Map<String, ResourceAssignment> currentBaseline = getBaselineAssignment(_assignmentMetadataStore, currentStateOutput, resourceMap.keySet()); ClusterModel clusterModel; try { clusterModel = ClusterModelProvider .generateClusterModelForBaseline(clusterData, resourceMap, clusterData.getAllInstances(), clusterChanges, currentBaseline); } catch (Exception ex) { throw new HelixRebalanceException("Failed to generate cluster model for global rebalance.", HelixRebalanceException.Type.INVALID_CLUSTER_STATUS, ex); } calculateAndUpdateBaseline(clusterModel, algorithm); } }
Source:
<code>public void testResourceLoadingAtOpenSession() throws Exception { <START> SessionManager.INSTANCE.addSessionsListener(new SessionManagerListener.Stub() { <END> @Override public void notify(Session updated, int notification) { super.notify(updated, notification); if (notification == SessionListener.OPENING) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); assertEquals("Wrong number of ResourceSet resources at SessionListener.OPENING notification", 2, resources.size()); } } @Override public void notifyAddSession(Session newSession) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); assertEquals("Wrong number of ResourceSet resources at notifyAddSession", 1, resources.size()); } }); copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, PATH, AIRD_MODEL_FILENAME, SEMANTIC_MODEL_FILENAME); URI sessionResourceURI = URI.createPlatformResourceURI("/" + TEMPORARY_PROJECT_NAME + "/" + AIRD_MODEL_FILENAME, true); session = SessionFactory.INSTANCE.createSession(sessionResourceURI, new NullProgressMonitor()); session.open(new NullProgressMonitor()); }</code><technical_language>This session listener removed avoid for tests (and fail: "+1080 errors")</technical_language>

Target:
public void testResourceLoadingAtOpenSession() throws Exception { copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, PATH, AIRD_MODEL_FILENAME, SEMANTIC_MODEL_FILENAME); URI sessionResourceURI = URI.createPlatformResourceURI("/" + TEMPORARY_PROJECT_NAME + "/" + AIRD_MODEL_FILENAME, true); session = SessionFactory.INSTANCE.createSession(sessionResourceURI, new NullProgressMonitor()); session.open(new NullProgressMonitor()); }
Source:
<code>public void arrayOverridenInYaml() throws Exception { Map<String, Object> twoMap = new LinkedHashMap<String, Object>(); twoMap.put("a.b[0]", "f"); twoMap.put("a.b[1]", "h"); this.environment.add(new PropertySource("two", twoMap)); Map<String, Object> oneMap = new LinkedHashMap<String, Object>(); oneMap.put("a.b[0]", "c"); oneMap.put("a.b[1]", "d"); oneMap.put("a.b[2]", "z"); this.environment.add(new PropertySource("one", oneMap)); Mockito.when(this.repository.findOne("foo", "bar", null)).thenReturn(this.environment); String yaml = this.controller.yaml("foo", "bar", false).getBody(); <START> assertEquals("a:\n b:\n - f\n - h\n", yaml); <END> }</code><technical_language>I feel need assertion content of Environment is consistent YAML</technical_language>

Target:
public void arrayOverridenInYaml() throws Exception { Map<String, Object> oneMap = new LinkedHashMap<String, Object>(); oneMap.put("a.b[0]", "c"); oneMap.put("a.b[1]", "d"); oneMap.put("a.b[2]", "z"); this.environment.add(new PropertySource("one", oneMap)); Map<String, Object> twoMap = new LinkedHashMap<String, Object>(); twoMap.put("a.b[0]", "f"); twoMap.put("a.b[1]", "h"); this.environment.addFirst(new PropertySource("two", twoMap)); Mockito.when(this.repository.findOne("foo", "bar", null)).thenReturn(this.environment); String yaml = this.controller.yaml("foo", "bar", false).getBody(); assertEquals("a:\n b:\n - f\n - h\n", yaml); }
Source:
<code>private String removeNonAlphanumericChars(final String answer, final String rule) { String strippedAnswer = answer; List<String> nonAlphanumericCharsNotInRule = NON_ALPHANUMERIC_CHARS.codePoints() .mapToObj(nonAlphaCodePoint -> String.valueOf((char) nonAlphaCodePoint)) .filter(nonAlphaString -> !rule.contains(nonAlphaString)) .collect(Collectors.toList()); <START> for (String nonAlphanumericChar : nonAlphanumericCharsNotInRule) { <END> strippedAnswer = strippedAnswer.replace(nonAlphanumericChar, " "); } return strippedAnswer; }</code><technical_language>I this loop characters in NON_ALPHANUMERIC_CHARS replace if do feature in rule? avoid looping twice, require complicated streams</technical_language>

Target:
private String removeNonAlphanumericChars(final String answer, final String rule) { String strippedAnswer = answer; for (char nonAlphanumericChar : NON_ALPHANUMERIC_CHARS.toCharArray()) { String nonAlphanumericCharStr = String.valueOf(nonAlphanumericChar); if (!rule.contains(nonAlphanumericCharStr)) { strippedAnswer = strippedAnswer.replace(nonAlphanumericCharStr, " "); } } return strippedAnswer; }
Source:
<code><START> public ValidationResult validateUniqueId() { <END> if (StringUtils.isBlank(host.getUniqueId()) && Config.<Boolean> getValue(ConfigValues.InstallVds)) { return new ValidationResult(VdcBllMessages.VDS_NO_UUID); } return ValidationResult.VALID; }</code><technical_language>please other methods shorten format: i.e. return ValidationResult.failWith(VdcBllMessages.VDS_NO_UUID) .when(StringUtils.isBlank(host.getUniqueId()) && Config.<Boolean> getValue(ConfigValues.InstallVds));</technical_language>

Target:
public ValidationResult validateUniqueId() { return ValidationResult.failWith(VdcBllMessages.VDS_NO_UUID) .when(StringUtils.isBlank(host.getUniqueId()) && Config.<Boolean> getValue(ConfigValues.InstallVds)); }
Source:
<code>public void execute(Environment environment, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException { Map<String, String> outputParams = new HashMap<>(); HttpRequestParametersHashModel requestParams = (HttpRequestParametersHashModel) params.get("params"); TemplateModelIterator iter = requestParams.keys().iterator(); while (iter.hasNext()) { String key = iter.next().toString(); TemplateModel value = requestParams.get(key); outputParams.put(key, value.toString()); } Object name = params.get("name"); if (name != null) { outputParams.put(name.toString(), params.get("value").toString()); } List<NameValuePair> paramList = new ArrayList<>(outputParams.size()); for (Object key : outputParams.keySet()) { <START> paramList.add(new BasicNameValuePair((String) key, outputParams.get(key))); <END> } environment.getOut().write(URLEncodedUtils.format(paramList, "UTF-8")); }</code><technical_language>get rid of cast key if declare String key top of for-loop</technical_language>

Target:
public void execute(Environment environment, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException { Map<String, String> outputParams = new HashMap<>(); HttpRequestParametersHashModel requestParams = (HttpRequestParametersHashModel) params.get("params"); TemplateModelIterator iter = requestParams.keys().iterator(); while (iter.hasNext()) { String key = iter.next().toString(); TemplateModel value = requestParams.get(key); outputParams.put(key, value.toString()); } Object name = params.get("name"); if (name != null) { outputParams.put(name.toString(), params.get("value").toString()); } List<NameValuePair> paramList = new ArrayList<>(outputParams.size()); for (String key : outputParams.keySet()) { paramList.add(new BasicNameValuePair(key, outputParams.get(key))); } environment.getOut().write(URLEncodedUtils.format(paramList, "UTF-8")); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; <START> if (getClass() != obj.getClass()) <END> return false; DefaultAccessRule other = (DefaultAccessRule) obj; if (discouraged != other.discouraged) return false; if (pattern == null) { if (other.pattern != null) return false; } else if (!pattern.equals(other.pattern)) return false; return true; }</code><technical_language>why</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AccessRule)) { return false; } AccessRule other = (AccessRule) obj; return isDiscouraged() == other.isDiscouraged() && getPattern().equals(other.getPattern()); }
Source:
<code>public void addVariable(String variable, String type) { if (variables.containsKey(variable)) { String existingType = variables.get(variable); if (!existingType.equals(type)) { valid = false; <START> errors.add("Wrong type for variable task variable '" + variable + "': expected type was '" + existingType + "' but received '" + type + "'."); <END> } } else { variables.put(variable, type); } }</code><technical_language>I a problem this error - user expected type (it is added other task)</technical_language>

Target:
public void addVariable(String variable, String type) { addVariable(Optional.empty(), variable, type); }
Source:
<code>public ConfigSaveState updateFullConfig(FullConfigUpdateCommand command) { ConfigSaveState configSaveState; LOGGER.info("Config update request by is in queue - {}", UserHelper.getUserName().getUsername(), command); synchronized (GoConfigWriteLock.class) { try { LOGGER.info("Config update request by is being processed", UserHelper.getUserName().getUsername()); configSaveState = cachedConfigService.writeFullConfigWithLock(command); } catch (Exception e) { <START> LOGGER.info("Full config update failed", e); <END> throw e; } finally { LOGGER.info("Config update request by is completed", UserHelper.getUserName().getUsername()); } } return configSaveState; }</code><technical_language>change log level error</technical_language>

Target:
public ConfigSaveState updateFullConfig(FullConfigUpdateCommand command) { ConfigSaveState configSaveState; LOGGER.info("Config update request by is in queue - {}", UserHelper.getUserName().getUsername(), command); synchronized (GoConfigWriteLock.class) { try { LOGGER.info("Config update request by is being processed", UserHelper.getUserName().getUsername()); configSaveState = cachedConfigService.writeFullConfigWithLock(command); } catch (Exception e) { LOGGER.error("Full config update failed", e); throw e; } finally { LOGGER.info("Config update request by is completed", UserHelper.getUserName().getUsername()); } } return configSaveState; }
Source:
<code>public void setLastSnapshotTransferCompleteTimestamp(long topologyConfigId, long ts) { CorfuStoreMetadata.Timestamp timestamp = corfuStore.getTimestamp(); long persistedTopologyConfigId = query(timestamp, LogReplicationMetadataType.TOPOLOGY_CONFIG_ID); long persistedSnapshotStart = query(timestamp, LogReplicationMetadataType.LAST_SNAPSHOT_STARTED); log.debug("setLastSnapTransferDone snapshotStart topologyConfigId={}, ts={}, persistedTopologyConfigID={}," + " persistedSiteConfigID={}, persistedSnapshotStart={}", topologyConfigId, ts, persistedTopologyConfigId, persistedSnapshotStart); <START> if (topologyConfigId != persistedTopologyConfigId || ts <= persistedTopologyConfigId) { <END> log.warn("Metadata mismatch, persisted={}, intended={}. Snapshot Transfer complete timestamp " + "will not be persisted, current={}", persistedTopologyConfigId, topologyConfigId, ts, persistedSnapshotStart); return; } TxBuilder txBuilder = corfuStore.tx(NAMESPACE); appendUpdate(txBuilder, LogReplicationMetadataType.TOPOLOGY_CONFIG_ID, topologyConfigId); appendUpdate(txBuilder, LogReplicationMetadataType.LAST_SNAPSHOT_TRANSFERRED, ts); txBuilder.commit(timestamp); log.debug("Commit snapshot transfer complete timestamp={}, for topologyConfigId={}", ts, topologyConfigId); }</code><technical_language>ts <= persistedTopologyConfigId persistedSnapshotStart</technical_language>

Target:
public void setLastSnapshotTransferCompleteTimestamp(long topologyConfigId, long ts) { CorfuStoreMetadata.Timestamp timestamp = corfuStore.getTimestamp(); long persistedTopologyConfigId = query(timestamp, LogReplicationMetadataType.TOPOLOGY_CONFIG_ID); long persistedSnapshotStart = query(timestamp, LogReplicationMetadataType.LAST_SNAPSHOT_STARTED); log.debug("Update last snapshot transfer completed, topologyConfigId={}, transferCompleteTs={}," + " persistedTopologyConfigID={}, persistedSnapshotStart={}", topologyConfigId, ts, persistedTopologyConfigId, persistedSnapshotStart); if (topologyConfigId != persistedTopologyConfigId || ts < persistedSnapshotStart) { log.warn("Metadata mismatch, persisted={}, intended={}. Snapshot Transfer complete timestamp " + "will not be persisted, current={}", persistedTopologyConfigId, topologyConfigId, ts, persistedSnapshotStart); return; } TxBuilder txBuilder = corfuStore.tx(NAMESPACE); appendUpdate(txBuilder, LogReplicationMetadataType.TOPOLOGY_CONFIG_ID, topologyConfigId); appendUpdate(txBuilder, LogReplicationMetadataType.LAST_SNAPSHOT_TRANSFERRED, ts); txBuilder.commit(timestamp); log.debug("Commit snapshot transfer complete timestamp={}, for topologyConfigId={}", ts, topologyConfigId); }
Source:
<code><IO> VersionOrdinal getVersionForDataStream(final IO in) { if (in instanceof VersionedDataStream) { final VersionOrdinal v = ((VersionedDataStream) in).getVersion(); <START> return v != null ? v : Version.getCurrentVersion(); <END> } else { return Version.getCurrentVersion(); } }</code><technical_language>return Version VersionOrdinal, do want upcast downcast ensure returning a single type? a problem currently</technical_language>

Target:
<IO> Version getVersionForDataStream(final IO in) { if (in instanceof VersionedDataStream) { final Version v = ((VersionedDataStream) in).getVersion(); return v != null ? v : Version.getCurrentVersion(); } else { return Version.getCurrentVersion(); } }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); final boolean isUserProfileEnabled = environment.getConfig().isUserProfilesEnabled(); if (isUserProfileEnabled) { profile = loginPrefs.getCurrentUserProfile(); if (profile != null) { sendGetUpdatedAccountCall(); } } if (!isUserProfileEnabled) { <START> toolbarCallbacks.getProfileView().setVisibility(View.GONE); <END> } EventBus.getDefault().register(this); }</code><technical_language>long this change in a separate commit squashed end other changes, fine</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); EventBus.getDefault().register(this); }
Source:
<code>public void testImportMultiFilesPKViolations() throws Exception { try(PreparedStatement ps = methodWatcher.prepareStatement(format("call SYSCS_UTIL.IMPORT_DATA(" + "'%s'," + "'%s'," + "null," + "'%s'," + "','," + "null," + "null," + "null," + "null," + "-1," + "'%s'," + "'true'," + "null)", spliceSchemaWatcher.schemaName,multiPK.tableName, getResourceDirectory()+"/multiFilePKViolation", BADDIR.getCanonicalPath()))){ try (ResultSet rs = ps.executeQuery()) { assertTrue(rs.next()); int failed = rs.getInt(2); assertEquals("Failed rows don't match", 4, failed); boolean exists = existsBadFile(BADDIR, "multiFilePKViolation.bad"); List<String> badFiles = getAllBadFiles(BADDIR, "multiFilePKViolation.bad"); assertTrue("Bad file " +badFiles+" does not exist.",exists); List<String> badLines = new ArrayList<>(); for(String badFile : badFiles) { badLines.addAll(Files.readAllLines((new File(BADDIR, badFile)).toPath(), Charset.defaultCharset())); } <START> assertTrue("Expected some lines in bad files "+badFiles, badLines.size()==4); <END> } } try(ResultSet rs = methodWatcher.executeQuery("select count(*) from "+multiPK)){ Assert.assertTrue("Did not return a row!",rs.next()); long c = rs.getLong(1); Assert.assertEquals("Incorrect row count!",9,c); Assert.assertFalse("Returned too many rows!",rs.next()); } }</code><technical_language>assertEquals</technical_language>

Target:
public void testImportMultiFilesPKViolations() throws Exception { try(PreparedStatement ps = methodWatcher.prepareStatement(format("call SYSCS_UTIL.IMPORT_DATA(" + "'%s'," + "'%s'," + "null," + "'%s'," + "','," + "null," + "null," + "null," + "null," + "-1," + "'%s'," + "'true'," + "null)", spliceSchemaWatcher.schemaName,multiPK.tableName, getResourceDirectory()+"/multiFilePKViolation", BADDIR.getCanonicalPath()))){ try (ResultSet rs = ps.executeQuery()) { assertTrue(rs.next()); int failed = rs.getInt(2); assertEquals("Failed rows don't match", 4, failed); boolean exists = existsBadFile(BADDIR, "multiFilePKViolation.bad"); List<String> badFiles = getAllBadFiles(BADDIR, "multiFilePKViolation.bad"); assertTrue("Bad file " +badFiles+" does not exist.",exists); List<String> badLines = new ArrayList<>(); for(String badFile : badFiles) { badLines.addAll(Files.readAllLines((new File(BADDIR, badFile)).toPath(), Charset.defaultCharset())); } assertEquals("Expected some lines in bad files "+badFiles, 4, badLines.size()); } } try(ResultSet rs = methodWatcher.executeQuery("select count(*) from "+multiPK)){ Assert.assertTrue("Did not return a row!",rs.next()); long c = rs.getLong(1); Assert.assertEquals("Incorrect row count!",9,c); Assert.assertFalse("Returned too many rows!",rs.next()); } }
Source:
<code>public static List<PluginData> listPluginsAndRemoveTempFiles(SitePaths site) throws IOException { <START> return listPlugins(site, false); <END> }</code><technical_language>this true? ;-)</technical_language>

Target:
public static List<PluginData> listPluginsAndRemoveTempFiles(SitePaths site) throws IOException { return listPlugins(site, true); }
Source:
<code>public synchronized void step() { <START> tree.rebuild(layoutModel.getGraph().nodes(), layoutModel); <END> super.step(); }</code><technical_language>If passing in LayoutModel anyway, pass in nodes separately here? misunderstood changed design, LayoutModel is source of truth for graph anyway, I want for pass in a set of nodes of graph LayoutModel retaining</technical_language>

Target:
public synchronized void step() { tree.rebuild(layoutModel); super.step(); }
Source:
<code>public void start() { config.load(); consoleManager.setupConsole(); opsList.load(); whitelist.load(); banManager.load(); loadPlugins(); DefaultPermissions.registerCorePermissions(); SpoutCommandMap.initSpoutPermissions(this); commandMap.register(new MeCommand(this)); commandMap.register(new ColorCommand(this)); commandMap.register(new KickCommand(this)); commandMap.register(new ListCommand(this)); commandMap.register(new TimeCommand(this)); commandMap.register(new WhitelistCommand(this)); commandMap.register(new BanCommand(this)); commandMap.register(new GameModeCommand(this)); commandMap.register(new OpCommand(this)); commandMap.register(new DeopCommand(this)); commandMap.register(new StopCommand(this)); commandMap.register(new SaveCommand(this)); commandMap.register(new SayCommand(this)); commandMap.removeAllOfType(ReloadCommand.class); commandMap.register(new ReloadCommand(this)); <START> commandMap.register(new GiveCommand(this)); <END> commandMap.register(new HelpCommand(this, commandMap.getKnownCommands(false))); enablePlugins(PluginLoadOrder.STARTUP); String world = config.getString("server.world-name", "world"); createWorld(WorldCreator.name(world).environment(Environment.NORMAL)); if (getAllowNether()) { createWorld(WorldCreator.name(world + "_nether").environment(Environment.NETHER)); } if (getAllowEnd()) { createWorld(WorldCreator.name(world + "_the_end").environment(Environment.THE_END)); } enablePlugins(PluginLoadOrder.POSTWORLD); commandMap.registerServerAliases(); consoleManager.refreshCommands(); }</code><technical_language>Tabs vs. Spaces</technical_language>

Target:
public void start() { config.load(); consoleManager.setupConsole(); opsList.load(); whitelist.load(); banManager.load(); loadPlugins(); DefaultPermissions.registerCorePermissions(); SpoutCommandMap.initSpoutPermissions(this); commandMap.register(new MeCommand(this)); commandMap.register(new ColorCommand(this)); commandMap.register(new KickCommand(this)); commandMap.register(new ListCommand(this)); commandMap.register(new TimeCommand(this)); commandMap.register(new WhitelistCommand(this)); commandMap.register(new BanCommand(this)); commandMap.register(new GameModeCommand(this)); commandMap.register(new OpCommand(this)); commandMap.register(new DeopCommand(this)); commandMap.register(new StopCommand(this)); commandMap.register(new SaveCommand(this)); commandMap.register(new SayCommand(this)); commandMap.register(new TpCommand(this)); commandMap.removeAllOfType(ReloadCommand.class); commandMap.register(new ReloadCommand(this)); commandMap.register(new GiveCommand(this)); commandMap.register(new HelpCommand(this, commandMap.getKnownCommands(false))); enablePlugins(PluginLoadOrder.STARTUP); String world = config.getString("server.world-name", "world"); createWorld(WorldCreator.name(world).environment(Environment.NORMAL)); if (getAllowNether()) { createWorld(WorldCreator.name(world + "_nether").environment(Environment.NETHER)); } if (getAllowEnd()) { createWorld(WorldCreator.name(world + "_the_end").environment(Environment.THE_END)); } enablePlugins(PluginLoadOrder.POSTWORLD); commandMap.registerServerAliases(); consoleManager.refreshCommands(); }
Source:
<code>public ValidationResult canAddRngDevice(VDSGroup cluster, VmRngDevice rngDevice) { VmRngDevice.Source source = rngDevice.getSource(); boolean supported = cluster != null && isFeatureSupported(cluster.getcompatibility_version()) && cluster.getRequiredRngSources().contains(source); if (supported) { return ValidationResult.VALID; } <START> return new ValidationResult(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); <END> }</code><technical_language>suggestion: return ValidationResult if !supported by-default return VALID. I this validator extended in future adding additional validations easier modify way</technical_language>

Target:
public ValidationResult canAddRngDevice(VDSGroup cluster, VmRngDevice rngDevice) { VmRngDevice.Source source = rngDevice.getSource(); boolean supported = cluster != null && isFeatureSupported(cluster.getcompatibility_version()) && cluster.getRequiredRngSources().contains(source); if (!supported) { return new ValidationResult(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); } return ValidationResult.VALID; }
Source:
<code>public void init(final IEditorSite site, final IEditorInput input) throws PartInitException { setSite(site); setInput(input); if (input instanceof FileEditorInput) { final FileEditorInput fileEI = (FileEditorInput) input; final IFile file = fileEI.getFile(); final IPath path = file.getFullPath(); final String pathStr = path.toString(); final URI uri = URI.createPlatformResourceURI(pathStr, true); this.resourceSet = new ResourceSetImpl(); this.resource = this.resourceSet.getResource(uri, true); } else if (input instanceof ResourceEditorInput) { final ResourceEditorInput resourceEI = (ResourceEditorInput) input; this.resource = resourceEI.getResource(); this.resourceSet = this.resource.getResourceSet(); } else if (input instanceof ResourceSetEditorInput) { final ResourceSetEditorInput resourceSetEI = (ResourceSetEditorInput) input; this.resourceSet = resourceSetEI.getResourceSet(); } <START> if (this.resourceSet == null) { this.resourceSet = new ResourceSetImpl(); this.resourceSet.getResources().add(this.resource); } <END> final AdapterFactory adapterFactory = new AdapterFactoryImpl(); final CommandStack commandStack = new BasicCommandStack(); this.editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, this.resourceSet); }</code><technical_language>assignment necessary. removed eventually replaced a throw of java.lang.IllegalArgumentException</technical_language>

Target:
public void init(final IEditorSite site, final IEditorInput input) throws PartInitException { setSite(site); setInput(input); if (input instanceof FileEditorInput) { final FileEditorInput fileEI = (FileEditorInput) input; final IFile file = fileEI.getFile(); final IPath path = file.getFullPath(); final String pathStr = path.toString(); final URI uri = URI.createPlatformResourceURI(pathStr, true); this.resourceSet = new ResourceSetImpl(); this.resource = this.resourceSet.getResource(uri, true); } else if (input instanceof ResourceEditorInput) { final ResourceEditorInput resourceEI = (ResourceEditorInput) input; this.resource = resourceEI.getResource(); this.resourceSet = this.resource.getResourceSet(); } else if (input instanceof ResourceSetEditorInput) { final ResourceSetEditorInput resourceSetEI = (ResourceSetEditorInput) input; this.resourceSet = resourceSetEI.getResourceSet(); } if (this.resourceSet == null) { final String message = String .format("The EditorInput (%s) is not compatible with the TreeEditor", input.getClass().getName()); throw new IllegalArgumentException(message); } final AdapterFactory adapterFactory = new AdapterFactoryImpl(); final CommandStack commandStack = new BasicCommandStack(); this.editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, this.resourceSet); }
Source:
<code>public void testSkippedMessageIsAddedWhenTheMessageAttributeIsNull() throws IOException, URISyntaxException { TestResult testResult = new TestResult(); testResult.parse(getDataFile("SKIPPED_MESSAGE/skippedTestResult.xml"), null); List<SuiteResult> suiteResults = new ArrayList<>(testResult.getSuites()); CaseResult caseResult = suiteResults.get(0).getCases().get(0); <START> assertNotNull(caseResult.getSkippedMessage()); <END> assertEquals("Given skip This Test........................................................pending\n", caseResult.getSkippedMessage()); }</code><technical_language>Nit: superfluous equals null</technical_language>

Target:
public void testSkippedMessageIsAddedWhenTheMessageAttributeIsNull() throws IOException, URISyntaxException { TestResult testResult = new TestResult(); testResult.parse(getDataFile("SKIPPED_MESSAGE/skippedTestResult.xml"), null); List<SuiteResult> suiteResults = new ArrayList<>(testResult.getSuites()); CaseResult caseResult = suiteResults.get(0).getCases().get(0); assertEquals("Given skip This Test........................................................pending\n", caseResult.getSkippedMessage()); }
Source:
<code>public Status scan(String table, String startKey, int recordCount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { try { Query<String, User> goraQuery = dataStore.newQuery(); goraQuery.setStartKey(startKey); goraQuery.setLimit(recordCount); Result<String, User> resultSet = goraQuery.execute(); while (resultSet.next()) { HashMap<String, ByteIterator> hm = new HashMap<>(); for (int i = 0; i < fieldCount; i++) { String field = FIELDS[i + 1]; int fieldIndex = i + 1; String value = resultSet.get().get(fieldIndex).toString(); hm.put(field, new StringByteIterator(value)); } result.add(hm); } } catch (Exception e) { <START> LOG.info("There is a problem in scanning data from the table \n"+e.getMessage(), e); <END> return Status.ERROR; } return Status.OK; }</code><technical_language>Please parameterized logging here</technical_language>

Target:
public Status scan(String table, String startKey, int recordCount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { try { Query<String, User> goraQuery = dataStore.newQuery(); goraQuery.setStartKey(startKey); goraQuery.setLimit(recordCount); Result<String, User> resultSet = goraQuery.execute(); while (resultSet.next()) { HashMap<String, ByteIterator> resultsMap = new HashMap<>(); for (int fieldCount = 0; fieldCount < totalFieldCount; fieldCount++) { String field = FIELDS[fieldCount + 1]; int fieldIndex = fieldCount + 1; String value = resultSet.get().get(fieldIndex).toString(); resultsMap.put(field, new StringByteIterator(value)); } result.add(resultsMap); } } catch (Exception e) { LOG.info("There is a problem in scanning data from the table \n {}", e.getMessage(), e); return Status.ERROR; } return Status.OK; }
Source:
<code>public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { FeedData feedData = feedsData.get(position); if (feedData == null) { ((FeedHeaderHolder) holder).bind(headersData.get(position)); } else { boolean isFirst = feedsData.get(position - 1) == null; <START> boolean isLast = getItemCount() - 1 == position || feedsData.get(position + 1) == null; <END> ((FeedHolder) holder).bind(feedData.getUserFeed(), feedData.getAvatarUrl(), isFirst, isLast); } }</code><technical_language>getItemCount() - 1 == position condition is useless</technical_language>

Target:
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { FeedData feedData = feedsData.get(position); if (feedData == null) { ((FeedHeaderHolder) holder).bind(headersData.get(position)); } else { ((FeedHolder) holder).bind(feedData.getUserFeed(), feedData.getAvatarUrl(), feedsData.get(position - 1) == null, feedsData.get(position + 1) == null); } }
Source:
<code>private IMethod[] getAllRippleMethods(IProgressMonitor pm, WorkingCopyOwner owner) throws CoreException { IMethod[] rippleMethods= findAllRippleMethods(pm, owner); if (fDeclarationToMatch == null) return rippleMethods; <START> List<IMethod> rippleMethodsList= new ArrayList<>(Arrays.asList(rippleMethods)); <END> List<IMethod> filteredMethods= new ArrayList<>(rippleMethodsList.size()); for (Iterator<IMethod> iter= rippleMethodsList.iterator(); iter.hasNext(); ) { IMethod currentMethod= iter.next(); Object match= fDeclarationToMatch.get(currentMethod); if (match != null) { filteredMethods.add(currentMethod); fBinaryRefs.add((SearchMatch) match); } } fDeclarationToMatch= null; return filteredMethods.toArray(new IMethod[filteredMethods.size()]); }</code><technical_language>Minor: need copy array if do modify anymore</technical_language>

Target:
private IMethod[] getAllRippleMethods(IProgressMonitor pm, WorkingCopyOwner owner) throws CoreException { IMethod[] rippleMethods= findAllRippleMethods(pm, owner); if (fDeclarationToMatch == null) return rippleMethods; List<IMethod> rippleMethodsList= Arrays.asList(rippleMethods); List<IMethod> filteredMethods= new ArrayList<>(rippleMethodsList.size()); for (Iterator<IMethod> iter= rippleMethodsList.iterator(); iter.hasNext(); ) { IMethod currentMethod= iter.next(); Object match= fDeclarationToMatch.get(currentMethod); if (match != null) { fBinaryRefs.add((SearchMatch) match); } else { filteredMethods.add(currentMethod); } } fDeclarationToMatch= null; return filteredMethods.toArray(new IMethod[filteredMethods.size()]); }
Source:
<code>public boolean nextResult() throws IOException{ cellScannerIndex=0; previousResult = currentResult; currentResult = this.resultScanner.next(); if(currentResult == null) { throw new DoNotRetryIOException("Memstore scanner shouldn't end prematurely"); } if (currentResult.rawCells() != null && CellUtil.matchingFamily(currentResult.rawCells()[0], FLUSH) ) { if (LOG.isTraceEnabled()) LOG.trace("CURRENT CELL: " + currentResult.rawCells()[0]); assert currentResult.rawCells().length == 1; if (previousResult != null && previousResult.rawCells() != null) { assert previousResult.rawCells().length > 0; KeyValue previousCell = (KeyValue) previousResult.rawCells()[previousResult.rawCells().length - 1]; if (LOG.isTraceEnabled()) LOG.trace("PREVIOUS CELL: " + previousCell); if (CellUtil.matchingRows(currentResult.rawCells()[0], HConstants.EMPTY_START_ROW)) { byte[] rowId = Bytes.add( CellUtil.cloneRow(previousCell), <START> CellUtil.cloneRow(currentResult.rawCells()[0])); <END> currentResult = Result.create(new KeyValue[]{new KeyValue(rowId, FLUSH, FLUSH, previousCell.getTimestamp(), new byte[0])}); if (LOG.isTraceEnabled()) LOG.trace("NEW CELL: " + currentResult.rawCells()[0]); } } } cells=currentResult.rawCells(); peakKeyValue = (KeyValue) current(); rows++; return true; }</code><technical_language>append a NULL byte, RowId of Flush cell</technical_language>

Target:
public boolean nextResult() throws IOException{ cellScannerIndex=0; previousResult = currentResult; currentResult = this.resultScanner.next(); if(currentResult == null) { throw new DoNotRetryIOException("Memstore scanner shouldn't end prematurely"); } if (currentResult.rawCells() != null && CellUtil.matchingFamily(currentResult.rawCells()[0], FLUSH) ) { if (LOG.isTraceEnabled()) LOG.trace("CURRENT CELL: " + currentResult.rawCells()[0]); assert currentResult.rawCells().length == 1; if (previousResult != null && previousResult.rawCells() != null) { assert previousResult.rawCells().length > 0; KeyValue previousCell = (KeyValue) previousResult.rawCells()[previousResult.rawCells().length - 1]; if (LOG.isTraceEnabled()) LOG.trace("PREVIOUS CELL: " + previousCell); if (CellUtil.matchingRows(currentResult.rawCells()[0], HConstants.EMPTY_START_ROW)) { byte[] rowId = Bytes.add(CellUtil.cloneRow(previousCell), new byte[]{0}); currentResult = Result.create(new KeyValue[]{new KeyValue(rowId, FLUSH, FLUSH, previousCell.getTimestamp(), new byte[0])}); if (LOG.isTraceEnabled()) LOG.trace("NEW CELL: " + currentResult.rawCells()[0]); } } } cells=currentResult.rawCells(); peakKeyValue = (KeyValue) current(); rows++; return true; }