auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void create(String tableName, NewTableConfiguration ntc) throws AccumuloSecurityException, AccumuloException, TableExistsException; <START> @Deprecated <END> void importTable(String tableName, String importDirs) throws TableExistsException, AccumuloException, AccumuloSecurityException; void importTable(String tableName, Set<String> importDirs) throws TableExistsException, AccumuloException, AccumuloSecurityException; void exportTable(String tableName, String exportDir) throws TableNotFoundException, AccumuloException, AccumuloSecurityException; void addSplits(String tableName, SortedSet<Text> partitionKeys) throws TableNotFoundException, AccumuloException, AccumuloSecurityException; @Deprecated default Collection<Text> getSplits(String tableName) throws TableNotFoundException { try { return listSplits(tableName); } catch (AccumuloSecurityException | AccumuloException e) { throw new RuntimeException(e); } }</code><technical_language>This deprecated a new method added. Also, do want method removed in future? Starting Java 9, parameters added deprecated annotation forRemoval. default for forRemoval is false. If deprecating, good explicitly set these. if syntax is correct below, I yet. suggestion @Deprecated(since="2.1.0",forRemoval=false) Personally, I method needs deprecated</technical_language>

Target:
void create(String tableName, NewTableConfiguration ntc) throws AccumuloSecurityException, AccumuloException, TableExistsException; default void importTable(String tableName, String importDir) throws TableExistsException, AccumuloException, AccumuloSecurityException { importTable(tableName, Set.of(importDir)); }
Source:
<code>public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getName()).append(" {"); Map<String, Object> attributes = constructSerializationAttributes(); if (attributes != null && !attributes.isEmpty()) { Iterator<Entry<String, Object>> i = attributes.entrySet().iterator(); <START> builder.append(i.next()); <END> while (i.hasNext()) { builder.append(", ").append(i.next()); } } builder.append("}"); return builder.toString(); }</code><technical_language>relying format of Entry.toString(). is part of contract of Entry is in entry implementations..</technical_language>

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getName()).append(" {"); Map<String, Object> attributes = constructStringAttributes(); if (attributes != null && !attributes.isEmpty()) { Iterator<Entry<String, Object>> i = attributes.entrySet().iterator(); appendEntry(builder, i.next()); while (i.hasNext()) { builder.append(", "); appendEntry(builder, i.next()); } } builder.append("}"); return builder.toString(); }
Source:
<code>if (property != null) { try { count = Integer.parseInt(property); if (count < 0 ) { throw new IllegalArgumentException("Skip count should be greater than or equal to 0"); } } catch (Exception ex) { <START> throw new IllegalArgumentException("Error parsing skip count value"); <END> } }</code><technical_language>wrap original exception</technical_language>

Target:
if (property != null) { try { long value = Long.decode(property); if (value < 0 ) { logger.warn("Log gap should be greater than or equal to 0, setting to default"); } else { ERROR_LOG_GAP = value; } } catch (Exception ex) { logger.warn("Unable to parse the log gap property, setting to default", ex); } }
Source:
<code>public long getLong(int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getLong columnIndex: {0}", columnIndex); checkResultSet(columnIndex); if (wasNullFlag) { return 0; } if (isBinary(columnIndex)) { int col = columnIndex - 1; int oid = fields[col].getOID(); return readLongValue(this_row[col], oid, Long.MIN_VALUE, Long.MAX_VALUE, "long"); <START> } <END> Encoding encoding = connection.getEncoding(); if (encoding.hasAsciiNumbers()) { try { return getFastLong(columnIndex); } catch (NumberFormatException ex) { } } return toLong(getFixedString(columnIndex)); }</code><technical_language>check for performance reasons. I personally buys much, however, a big fan of making a chane for sake of change</technical_language>

Target:
public long getLong(int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getLong columnIndex: {0}", columnIndex); checkResultSet(columnIndex); if (wasNullFlag) { return 0; } if (isBinary(columnIndex)) { int col = columnIndex - 1; int oid = fields[col].getOID(); if (oid == Oid.INT8) { return ByteConverter.int8(this_row[col], 0); } return readLongValue(this_row[col], oid, Long.MIN_VALUE, Long.MAX_VALUE, "long"); } Encoding encoding = connection.getEncoding(); if (encoding.hasAsciiNumbers()) { try { return getFastLong(columnIndex); } catch (NumberFormatException ex) { } } return toLong(getFixedString(columnIndex)); }
Source:
<code>public void testV2FetchMixedWantRef() throws Exception { RevCommit one = remote.commit().message("1").create(); RevCommit two = remote.commit().message("2").create(); RevCommit three = remote.commit().message("3").create(); remote.update("one", one); remote.update("two", two); remote.update("three", three); server.getConfig().setBoolean("uploadpack", null, "allowrefinwant", true); ByteArrayInputStream recvStream = uploadPackV2( "command=fetch\n", PacketLineIn.DELIM, "want-ref refs/heads/one\n", <START> "want " + two.toObjectId().getName(), <END> "done\n", PacketLineIn.END); PacketLineIn pckIn = new PacketLineIn(recvStream); assertThat(pckIn.readString(), is("wanted-refs")); assertThat( pckIn.readString(), is(one.toObjectId().getName() + " refs/heads/one")); assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM)); assertThat(pckIn.readString(), is("packfile")); parsePack(recvStream); assertTrue(client.hasObject(one.toObjectId())); assertTrue(client.hasObject(two.toObjectId())); assertFalse(client.hasObject(three.toObjectId())); }</code><technical_language>this get a trailing newline too</technical_language>

Target:
public void testV2FetchMixedWantRef() throws Exception { RevCommit one = remote.commit().message("1").create(); RevCommit two = remote.commit().message("2").create(); RevCommit three = remote.commit().message("3").create(); remote.update("one", one); remote.update("two", two); remote.update("three", three); server.getConfig().setBoolean("uploadpack", null, "allowrefinwant", true); ByteArrayInputStream recvStream = uploadPackV2( "command=fetch\n", PacketLineIn.DELIM, "want-ref refs/heads/one\n", "want " + two.toObjectId().getName() + "\n", "done\n", PacketLineIn.END); PacketLineIn pckIn = new PacketLineIn(recvStream); assertThat(pckIn.readString(), is("wanted-refs")); assertThat( pckIn.readString(), is(one.toObjectId().getName() + " refs/heads/one")); assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM)); assertThat(pckIn.readString(), is("packfile")); parsePack(recvStream); assertTrue(client.hasObject(one.toObjectId())); assertTrue(client.hasObject(two.toObjectId())); assertFalse(client.hasObject(three.toObjectId())); }
Source:
<code>public boolean equals(final Object other) { if(other instanceof EntityQueryNode) { <START> return hashCode() == other.hashCode(); <END> } return false; }</code><technical_language>This a valid implementation of equals. non-equal hash a hash collision</technical_language>

Target:
public boolean equals(final Object other) { if(other instanceof EntityQueryNode) { final EntityQueryNode otherNode = (EntityQueryNode)other; final boolean samePatterns = getPatterns().size() == otherNode.getPatterns().size(); boolean match = true; if(samePatterns) { for(final StatementPattern sp : getPatterns()) { if(!otherNode.getPatterns().contains(sp)) { match = false; break; } } } return Objects.equals(subjectIsConstant, otherNode.subjectIsConstant) && Objects.equals(subjectVar, otherNode.subjectVar) && Objects.equals(type, otherNode.type) && Objects.equals(subjectConstant, otherNode.subjectConstant) && samePatterns && match; } return false; }
Source:
<code>protected Object doInBackground() { hashDb.setIndexing(true); progress = ProgressHandle.createHandle( NbBundle.getMessage(this.getClass(), "HashDbManager.progress.indexingHashSet", hashDb.getHashSetName())); progress.start(); progress.switchToIndeterminate(); try { SleuthkitJNI.createLookupIndexForHashDatabase(hashDb.getHandle()); } catch (TskCoreException ex) { <START> Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error indexing hash database", ex); END> JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "HashDbManager.dlgMsg.errorIndexingHashSet", hashDb.getHashSetName()), NbBundle.getMessage(this.getClass(), "HashDbManager.hashDbIndexingErr"), JOptionPane.ERROR_MESSAGE); } return null; }</code><technical_language>I in debugging if identify database experienced error</technical_language>

Target:
protected Object doInBackground() { hashDb.setIndexing(true); progress = ProgressHandle.createHandle( NbBundle.getMessage(this.getClass(), "HashDbManager.progress.indexingHashSet", hashDb.getHashSetName())); progress.start(); progress.switchToIndeterminate(); try { SleuthkitJNI.createLookupIndexForHashDatabase(hashDb.getHandle()); } catch (TskCoreException ex) { Logger.getLogger(HashDbIndexer.class.getName()).log(Level.SEVERE, "Error indexing hash set " + hashDb.getHashSetName(), ex); JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "HashDbManager.dlgMsg.errorIndexingHashSet", hashDb.getHashSetName()), NbBundle.getMessage(this.getClass(), "HashDbManager.hashDbIndexingErr"), JOptionPane.ERROR_MESSAGE); } return null; }
Source:
<code>public void requiredHeadersInSeparateConnectionHeaders() { <START> setUpServerChannel(); <END> String upgradeString = "GET / HTTP/1.1\r\n" + "Host: example.com\r\n" + "Connection: keep-alive\r\n" + "Connection: HTTP2-Settings\r\n" + "Connection: Upgrade\r\n" + "Upgrade: h2c\r\n" + "HTTP2-Settings: AAMAAABkAAQAAP__\r\n\r\n"; validateClearTextUpgrade(upgradeString); }</code><technical_language>nit: move setUpServerChannel() calls</technical_language>

Target:
public void requiredHeadersInSeparateConnectionHeaders() { String upgradeString = "GET / HTTP/1.1\r\n" + "Host: example.com\r\n" + "Connection: keep-alive\r\n" + "Connection: HTTP2-Settings\r\n" + "Connection: Upgrade\r\n" + "Upgrade: h2c\r\n" + "HTTP2-Settings: AAMAAABkAAQAAP__\r\n\r\n"; validateClearTextUpgrade(upgradeString); }
Source:
<code>public VersionHolder createElement(StudyIdentifier studyId, AppConfigElement element) { checkNotNull(studyId); checkNotNull(element); if (element.getRevision() == null) { element.setRevision(1L); <START> } <END> Validate.entityThrowingException(AppConfigElementValidator.INSTANCE, element); element.setKey(studyId.getIdentifier() + ":" + element.getId()); element.setStudyId(studyId.getIdentifier()); element.setVersion(null); element.setDeleted(false); element.setCreatedOn(getDateTime().getMillis()); element.setModifiedOn(element.getCreatedOn()); AppConfigElement existing = appConfigElementDao.getElementRevision(studyId, element.getId(), element.getRevision()); if (existing != null) { throw new EntityAlreadyExistsException(AppConfigElement.class, ImmutableMap.of("id", existing.getId(), "revision", existing.getRevision())); } return appConfigElementDao.saveElementRevision(element); }</code><technical_language>Do want a test case create element revision</technical_language>

Target:
public VersionHolder createElement(StudyIdentifier studyId, AppConfigElement element) { checkNotNull(studyId); checkNotNull(element); if (element.getRevision() == null) { element.setRevision(1L); } Validate.entityThrowingException(AppConfigElementValidator.INSTANCE, element); element.setStudyId(studyId.getIdentifier()); element.setId(element.getId()); element.setVersion(null); element.setDeleted(false); element.setCreatedOn(DateTime.now().getMillis()); element.setModifiedOn(element.getCreatedOn()); AppConfigElement existing = appConfigElementDao.getElementRevision(studyId, element.getId(), element.getRevision()); if (existing != null) { throw new EntityAlreadyExistsException(AppConfigElement.class, ImmutableMap.of("id", existing.getId(), "revision", existing.getRevision())); } return appConfigElementDao.saveElementRevision(element); }
Source:
<code>private boolean performLiveSnapshot(final Snapshot snapshot) { if(getVm().getClusterCompatibilityVersion().less(new Version("4.4"))) { return performLiveSnapshotDeprecated(snapshot); } else { ActionReturnValue actionReturnValue = runInternalAction(ActionType.CreateLiveSnapshotForVm, createLiveSnapshotParameters(snapshot), getContext()); if (actionReturnValue.getSucceeded()) { setSucceeded(true); return true; } else { log.error("Failed to start live snapshot on VDS"); <START> setSucceeded(false); <END> return false; } } }</code><technical_language>false is default set explictly</technical_language>

Target:
private boolean performLiveSnapshot(final Snapshot snapshot) { if(FeatureSupported.isAsyncLiveSnapshotSupported(getVm().getClusterCompatibilityVersion())) { ActionReturnValue actionReturnValue = runInternalAction(ActionType.CreateLiveSnapshotForVm, createLiveSnapshotParameters(snapshot), getContext()); if (actionReturnValue.getSucceeded()) { setSucceeded(true); return true; } else { log.error("Failed to start live snapshot on VDS"); setSucceeded(false); return false; } } else { return performLiveSnapshotDeprecated(snapshot); } }
Source:
<code>public void setValue(String text) { if (isMultiSelect) { String[] valueArr = text.split(VALUE_SEPARATOR); getAttributeMapper().setValues(getTaskAttribute(), <START> FluentIterable.from(Arrays.asList(valueArr)).transform(new Function<String, String>() { <END> @Override public String apply(String input) { return StringUtils.stripToNull(input); } }).filter(Predicates.notNull()).toList()); } else { getAttributeMapper().setValue(getTaskAttribute(), text); } attributeChanged(); }</code><technical_language>this written more simply a predicate filter items input.trim().isEmpty()</technical_language>

Target:
public void setValue(String text) { if (isMultiSelect) { String[] valueArr = text.split(VALUE_SEPARATOR); getAttributeMapper().setValues(getTaskAttribute(), FluentIterable.from(Arrays.asList(valueArr)).transform(new Function<String, String>() { @Override public String apply(String input) { return input == null ? "" : input.trim(); } }).filter(new Predicate<String>() { @Override public boolean apply(String input) { return !Strings.isNullOrEmpty(input); } }).toList()); } else { getAttributeMapper().setValue(getTaskAttribute(), text); } attributeChanged(); }
Source:
<code>private List<RemoteTask> scheduleTasks(int count) { if (count == 0) { return ImmutableList.of(); } List<Node> nodes = nodeSelector.selectRandomNodes(count, scheduledNodes); checkCondition(!scheduledNodes.isEmpty() || !nodes.isEmpty(), NO_NODES_AVAILABLE, "No nodes available to run query"); ImmutableList.Builder<RemoteTask> tasks = ImmutableList.builder(); for (Node node : nodes) { <START> tasks.add(taskScheduler.scheduleTask(node, scheduledNodes.size(), OptionalInt.of(nodes.size()))); <END> scheduledNodes.add(node); } return tasks.build(); }</code><technical_language>I this is want. scheduleTasks method is called repeatedly add more tasks writer tier scales up. I want OptionalInt.empty() here</technical_language>

Target:
private List<RemoteTask> scheduleTasks(int count) { if (count == 0) { return ImmutableList.of(); } List<Node> nodes = nodeSelector.selectRandomNodes(count, scheduledNodes); checkCondition(!scheduledNodes.isEmpty() || !nodes.isEmpty(), NO_NODES_AVAILABLE, "No nodes available to run query"); ImmutableList.Builder<RemoteTask> tasks = ImmutableList.builder(); for (Node node : nodes) { tasks.add(taskScheduler.scheduleTask(node, scheduledNodes.size(), OptionalInt.empty())); scheduledNodes.add(node); } return tasks.build(); }
Source:
<code>public Iterator<Tree> childrenIterator() { <START> if (parameters != null) { <END> return Iterators.concat(Iterators.singletonIterator(lParenthesis), parameters.elementsAndSeparators(Functions.identity()), Iterators.forArray(restParameter, comma, rParenthesis)); } else { return Iterators.forArray(lParenthesis, restParameter, comma, rParenthesis); } }</code><technical_language>@inverno parameters nullable, simplify this method</technical_language>

Target:
public Iterator<Tree> childrenIterator() { return Iterators.concat(Iterators.singletonIterator(lParenthesis), parameters.elementsAndSeparators(Functions.identity()), Iterators.singletonIterator(rParenthesis)); }
Source:
<code>public InstanceKey saveToSnapshot(String owner) throws MachineException { try { final String repository = generateRepository(); final String tag = "latest"; if (locallySnapshot) { return new DockerInstanceKey(repository, tag, createImage(owner, repository, tag)); } else { return new DockerInstanceKey(repository, tag, registry, saveInRegistry(owner, repository, tag)); } } catch (IOException ioEx) { throw new MachineException(ioEx); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); <START> throw new MachineException(ex.getLocalizedMessage(), ex); <END> } }</code><technical_language>localizedMessage for this for previous one. Multicatch</technical_language>

Target:
public InstanceKey saveToSnapshot(String owner) throws MachineException { try { final String repository = generateRepository(); final String tag = "latest"; if(!snapshotUseRegistry) { commitContainer(owner, repository, tag); return new DockerInstanceKey(repository, tag); } final String repositoryName = registry + '/' + repository; commitContainer(owner, repositoryName, tag); Thread.sleep(2000); final ProgressLineFormatterImpl lineFormatter = new ProgressLineFormatterImpl(); final String digest = docker.push(PushParams.create(repository) .withTag(tag) .withRegistry(registry), progressMonitor -> { try { outputConsumer.writeLine(lineFormatter.format(progressMonitor)); } catch (IOException ignored) { } }); docker.removeImage(RemoveImageParams.create(repositoryName).withForce(false)); return new DockerInstanceKey(repository, tag, registry, digest); } catch (IOException ioEx) { throw new MachineException(ioEx); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new MachineException(e.getLocalizedMessage(), e); } }
Source:
<code>public void andThenCompletableCompleteError() { Completable.complete() <START> .andThen(Completable.error(new RuntimeException("test"))) <END> .test() .assertNotComplete() .assertNoValues() .assertError(RuntimeException.class) .assertErrorMessage("test"); }</code><technical_language>Please TestException mistake other RuntimeException failures</technical_language>

Target:
public void andThenCompletableCompleteError() { Completable.complete() .andThen(Completable.error(new TestException("test"))) .test() .assertNotComplete() .assertNoValues() .assertError(TestException.class) .assertErrorMessage("test"); }
Source:
<code>public HttpResponse doCompleteInstall() throws IOException, ServletException { jenkins.setInstallState(InstallState.INITIAL_SETUP_COMPLETED); InstallUtil.saveLastExecVersion(); PluginServletFilter.removeFilter(FORCE_SETUP_WIZARD_FILTER); <START> <<<<<<< HEAD <END> j.setSetupWizard(null); UpgradeWizard uw = j.getInjector().getInstance(UpgradeWizard.class); if (uw!=null) uw.setCurrentLevel(new VersionNumber("2.0")); ======= jenkins.setSetupWizard(null); >>>>>>> origin/2.0 return HttpResponses.okJSON(); }</code><technical_language>This work</technical_language>

Target:
public HttpResponse doCompleteInstall() throws IOException, ServletException { jenkins.setInstallState(InstallState.INITIAL_SETUP_COMPLETED); InstallUtil.saveLastExecVersion(); PluginServletFilter.removeFilter(FORCE_SETUP_WIZARD_FILTER); jenkins.setSetupWizard(null); UpgradeWizard uw = jenkins.getInjector().getInstance(UpgradeWizard.class); if (uw!=null) uw.setCurrentLevel(new VersionNumber("2.0")); return HttpResponses.okJSON(); }
Source:
<code>public boolean acceptsValue( Value value ) { if ( value == null ) { return false; } if ( value instanceof PointValue ) { PointValue point = (PointValue) value; <START> if ( point.getCRS() == crs ) <END> { return point.withinRange( from, fromInclusive, to, toInclusive ); } } return false; }</code><technical_language>== assuming much? .equals</technical_language>

Target:
public boolean acceptsValue( Value value ) { if ( value == null ) { return false; } if ( value instanceof PointValue ) { PointValue point = (PointValue) value; if ( point.getCRS().equals( crs ) ) { return point.withinRange( from, fromInclusive, to, toInclusive ); } } return false; }
Source:
<code>public Object[] factory() { <START> List testsToRun = new ArrayList<>(); <END> testsToRun.add(new DistributedMultimapCacheTest().fromOwner(false).cacheMode(CacheMode.DIST_SYNC).transactional(false)); testsToRun.add(new DistributedMultimapCacheTest().fromOwner(true).cacheMode(CacheMode.DIST_SYNC).transactional(false)); return testsToRun.toArray(); }</code><technical_language>do trouble array initializers</technical_language>

Target:
public Object[] factory() { return new Object[]{ new DistributedMultimapCacheTest().fromOwner(false).cacheMode(CacheMode.DIST_SYNC).transactional(false), new DistributedMultimapCacheTest().fromOwner(true).cacheMode(CacheMode.DIST_SYNC).transactional(false), }; }
Source:
<code>public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); menu.findItem(R.id.menu_edit).setVisible(false); menu.findItem(R.id.menu_preview).setVisible(true); if (TextUtils.isEmpty(searchQuery)) { searchMenuItem.collapseActionView(); <START> } <END> }</code><technical_language>Is this needed? A similar code snippets is in parent class ..</technical_language>

Target:
public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); menu.findItem(R.id.menu_edit).setVisible(false); menu.findItem(R.id.menu_preview).setVisible(true); }
Source:
<code>public void teardown() throws Exception { if (ddbms != null) { S3GuardTableAccess tableAccess = new S3GuardTableAccess(ddbms); ExpressionSpecBuilder builder = new ExpressionSpecBuilder(); <START> builder.withKeyCondition( <END> ExpressionSpecBuilder.S(PARENT).beginsWith("/test/")); Iterable<DDBPathMetadata> entries = tableAccess.scanMetadata(builder); List<Path> list = new ArrayList<>(); entries.iterator().forEachRemaining(e -> { if (!(e instanceof S3GuardTableAccess.VersionMarker)) { Path p = e.getFileStatus().getPath(); LOG.info("Deleting {}", p); list.add(p); } }); tableAccess.delete(list); } IOUtils.cleanupWithLogger(LOG, ddbms); super.teardown(); }</code><technical_language>withCondition instead of key, filter for VersionMarker</technical_language>

Target:
public void teardown() throws Exception { if (ddbms != null) { S3GuardTableAccess tableAccess = new S3GuardTableAccess(ddbms); ExpressionSpecBuilder builder = new ExpressionSpecBuilder(); builder.withCondition( ExpressionSpecBuilder.S(PARENT).beginsWith("/test/")); Iterable<DDBPathMetadata> entries = tableAccess.scanMetadata(builder); List<Path> list = new ArrayList<>(); entries.iterator().forEachRemaining(e -> { Path p = e.getFileStatus().getPath(); LOG.info("Deleting {}", p); list.add(p); }); tableAccess.delete(list); } IOUtils.cleanupWithLogger(LOG, ddbms); super.teardown(); }
Source:
<code>protected OptionStatus getConcreteEnumCustom(MCOptionStatus abstracted) { <START> if(Static.getServer().getMinecraftVersion().lt(MCVersion.MC1_9_4)) { <END> return null; } return super.getConcreteEnumCustom(abstracted); }</code><technical_language>Added in MC1_9. Check others too. a days of initial release. week builds, 1_9 is fine</technical_language>

Target:
protected OptionStatus getConcreteEnumCustom(MCOptionStatus abstracted) { if(Static.getServer().getMinecraftVersion().lt(MCVersion.MC1_9)) { return null; } return super.getConcreteEnumCustom(abstracted); }
Source:
<code>public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRestoreSnapshotCommand())) { restoreSnapshot(); } else if (command.getName().equals("onRestoreSnapshot")) { <START> onRestoreSnapshot(); <END> } else if (command.equals(getDeleteSnapshotCommand())) { deleteSnapshot(); } else if (command.getName().equals("onDeleteSnapshot")) { onDeleteSnapshot(); } else if (command.equals(getDeleteAllSnapshotsCommand())) { deleteAllSnapshots(); } else if (command.getName().equals("onDeleteAllSnapshots")) { onDeleteAllSnapshots(); } else if (command.equals(getActivateSnapshotCommand())) { activateSnapshot(); } else if (command.getName().equals("onActivateSnapshot")) { onActivateSnapshot(); } else if (command.equals(getDeactivateSnapshotCommand())) { deactivateSnapshot(); } else if (command.getName().equals("onDeactivateSnapshot")) { onDeactivateSnapshot(); } else if (command.getName().equals("CancelConfirmation")) { setConfirmWindow(null); } }</code><technical_language>kindly group on<Actions> end commands beginning</technical_language>

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRestoreSnapshotCommand())) { restoreSnapshot(); } else if (command.equals(getDeleteSnapshotCommand())) { deleteSnapshot(); } else if (command.equals(getDeleteAllSnapshotsCommand())) { deleteAllSnapshots(); } else if (command.equals(getActivateSnapshotCommand())) { activateSnapshot(); } else if (command.equals(getDeactivateSnapshotCommand())) { deactivateSnapshot(); } else if (command.getName().equals("onRestoreSnapshot")) { onRestoreSnapshot(); } else if (command.getName().equals("onDeleteSnapshot")) { onDeleteSnapshot(); } else if (command.getName().equals("onDeleteAllSnapshots")) { onDeleteAllSnapshots(); } else if (command.getName().equals("onActivateSnapshot")) { onActivateSnapshot(); } else if (command.getName().equals("onDeactivateSnapshot")) { onDeactivateSnapshot(); } else if (command.getName().equals("cancelConfirmation")) { setConfirmWindow(null); } }
Source:
<code>public void process(Exchange exchange) throws CatalogTransformerException, MimeTypeParseException, IOException { LOGGER.debug("ENTERING: process"); LOGGER.debug("exchange pattern = {}", exchange.getPattern()); Message in = exchange.getIn(); Object metacard = null; String transformerId = in.getHeader(CatalogComponent.ID_PARAMETER, String.class); String mimeType = in.getHeader(CatalogComponent.MIME_TYPE_PARAMETER, String.class); if (transformerId != null) { LOGGER.debug("transformerId retrieved from message header"); in.removeHeader(CatalogComponent.ID_PARAMETER); } else { LOGGER.debug("transformerId retrieved from CamelCatalogEndpoint"); transformerId = endpoint.getTransformerId(); } LOGGER.debug("transformerId = {}", transformerId); if (mimeType != null) { in.removeHeader(CatalogComponent.MIME_TYPE_PARAMETER); } else { LOGGER.debug("MIME Type retrieved from CamelCatalogEndpoint"); mimeType = endpoint.getMimeType(); } LOGGER.debug("MIME Type = {}", mimeType); Transform transform = endpoint.getComponent().getTransform(); if (transform != null) { <START> LOGGER.debug("Got a Transform service"); <END> metacard = transform(in, metacard, mimeType, transformerId); } else { LOGGER.debug("Did not find a Transform service"); throw new CatalogTransformerException("Did not find a Transform service"); } exchange.getOut().setBody(metacard); LOGGER.debug("EXITING: process"); }</code><technical_language>this trace</technical_language>

Target:
public void process(Exchange exchange) throws CatalogTransformerException, MimeTypeParseException, IOException { LOGGER.debug("ENTERING: process"); LOGGER.debug("exchange pattern = {}", exchange.getPattern()); Message in = exchange.getIn(); Object metacard = null; String transformerId = in.getHeader(CatalogComponent.ID_PARAMETER, String.class); String mimeType = in.getHeader(CatalogComponent.MIME_TYPE_PARAMETER, String.class); if (transformerId != null) { LOGGER.debug("transformerId retrieved from message header"); in.removeHeader(CatalogComponent.ID_PARAMETER); } else { LOGGER.debug("transformerId retrieved from CamelCatalogEndpoint"); transformerId = endpoint.getTransformerId(); } LOGGER.debug("transformerId = {}", transformerId); if (mimeType != null) { in.removeHeader(CatalogComponent.MIME_TYPE_PARAMETER); } else { LOGGER.debug("MIME Type retrieved from CamelCatalogEndpoint"); mimeType = endpoint.getMimeType(); } LOGGER.debug("MIME Type = {}", mimeType); Transform transform = endpoint.getComponent().getTransform(); if (transform != null) { LOGGER.trace("Got a Transform service"); metacard = transform(in, metacard, mimeType, transformerId); } else { throw new CatalogTransformerException("Did not find a Transform service"); } exchange.getOut().setBody(metacard); LOGGER.debug("EXITING: process"); }
Source:
<code>public void delete(Long id) { <START> Page page = pageRepository.findById(id).orElseThrow(() -> new RestException("Not found", 404)); <END> Long publicationId = page.getPublication().getId(); List<PageId> order = pageRepository.getPageOrderByPublicationId(publicationId); order.remove(new PageId(id)); setPageOrder(order, publicationId); messagingService.broadcastEntityAction(page, Action.DELETE); pageRepository.deleteById(id); }</code><technical_language>HttpServletResponse.SC_NOT_FOUND</technical_language>

Target:
public void delete(Long id) { Page page = pageRepository.findById(id).orElseThrow(() -> new RestException("Not found", HttpServletResponse.SC_NOT_FOUND)); Long publicationId = page.getPublication().getId(); List<PageId> order = pageRepository.getPageOrderByPublicationId(publicationId); order.remove(new PageId(id)); setPageOrder(order, publicationId); messagingService.broadcastEntityAction(page, Action.DELETE); pageRepository.deleteById(id); }
Source:
<code>public void testBorrow() throws Exception { AsyncQueue<Integer> queue = new AsyncQueue<>(4, executor); queue.offer(1); queue.offer(2); queue.offer(3); queue.offer(4); queue.offer(5); Runnable runnable = () -> { for (int i = 0; i < 700; i++) { getFutureValue(queue.borrowBatchAsync(3, elements -> new BorrowResult<>(elements, null))); } }; Future<?> future1 = executor.submit(runnable); Future<?> future2 = executor.submit(runnable); Future<?> future3 = executor.submit(runnable); future1.get(); future2.get(); future3.get(); queue.finish(); assertFalse(queue.isFinished()); AtomicBoolean done = new AtomicBoolean(); executor.submit(() -> { <START> if (!done.get()) { <END> assertFalse(queue.isFinished()); } }); future1 = executor.submit(runnable); future2 = executor.submit(runnable); future3 = executor.submit(runnable); future1.get(); future2.get(); future3.get(); done.set(true); assertFalse(queue.isFinished()); ArrayList<Integer> list = new ArrayList<>(queue.getBatchAsync(100).get()); list.sort(Integer::compare); assertEquals(list, ImmutableList.of(1, 2, 3, 4, 5)); assertTrue(queue.isFinished()); }</code><technical_language>while</technical_language>

Target:
public void testBorrow() throws Exception { AsyncQueue<Integer> queue = new AsyncQueue<>(4, executor); queue.offer(1); queue.offer(2); queue.offer(3); queue.offer(4); queue.offer(5); Runnable runnable = () -> { for (int i = 0; i < 700; i++) { getFutureValue(queue.borrowBatchAsync(3, elements -> new BorrowResult<>(elements, null))); } }; Future<?> future1 = executor.submit(runnable); Future<?> future2 = executor.submit(runnable); Future<?> future3 = executor.submit(runnable); future1.get(); future2.get(); future3.get(); queue.finish(); assertFalse(queue.isFinished()); AtomicBoolean done = new AtomicBoolean(); executor.submit(() -> { while (!done.get()) { assertFalse(queue.isFinished() || done.get()); } }); future1 = executor.submit(runnable); future2 = executor.submit(runnable); future3 = executor.submit(runnable); future1.get(); future2.get(); future3.get(); done.set(true); assertFalse(queue.isFinished()); ArrayList<Integer> list = new ArrayList<>(queue.getBatchAsync(100).get()); list.sort(Integer::compare); assertEquals(list, ImmutableList.of(1, 2, 3, 4, 5)); assertTrue(queue.isFinished()); }
Source:
<code>public CrewMember translateLegacyCrewMember(org.atlasapi.media.entity.CrewMember legacy) { <START> if(! legacy.getClass().getName().equals("org.atlasapi.media.entity.CrewMember")) { <END> log.warn("Generic legacy CrewMember type: class={} id={} name='{}' role='{}', best effort migration", Objects.toString(legacy.getClass().getName(), "unidentifed"), Objects.toString(legacy.getId(), "?"), Objects.toString(legacy.name(), "?"), Objects.toString(legacy.role(), "?") ); } CrewMember translated = new CrewMember(legacy.getCanonicalUri(), legacy.getCurie(), legacy.publisher()); addIdentified(legacy, translated); addCrewMember(legacy, translated); return translated; }</code><technical_language>For want this is better: legacy.getClass() != CrewMember.class</technical_language>

Target:
public CrewMember translateLegacyCrewMember(org.atlasapi.media.entity.CrewMember legacy) { if (legacy.getClass() != org.atlasapi.media.entity.CrewMember.class) { log.warn("Generic legacy CrewMember type: class={} id={} name='{}' role='{}', best effort migration", Objects.toString(legacy.getClass().getName(), "unidentifed"), Objects.toString(legacy.getId(), "?"), Objects.toString(legacy.name(), "?"), Objects.toString(legacy.role(), "?") ); } CrewMember translated = new CrewMember(legacy.getCanonicalUri(), legacy.getCurie(), legacy.publisher()); addIdentified(legacy, translated); addCrewMember(legacy, translated); return translated; }
Source:
<code>public void createsRedirectResponseWithURL() throws IOException { final String url = "/about"; MatcherAssert.assertThat( new RsPrint( new TkRedirect(url).act() ).print(), Matchers.equalTo( Joiner.on(NEWLINE).join( "HTTP/1.1 303 See Other", <START> LOCATION + url, <END> "", "" ) ) ); }</code><technical_language>@d-molotchko String.format instead of '+'</technical_language>

Target:
public void createsRedirectResponseWithURL() throws IOException { final String url = "/about"; MatcherAssert.assertThat( new RsPrint( new TkRedirect(url).act() ).print(), Matchers.equalTo( Joiner.on(TkRedirectTest.NEWLINE).join( "HTTP/1.1 303 See Other", String.format(TkRedirectTest.LOCATION, url), "", "" ) ) ); }
Source:
<code>public ListBranchesResult call() throws NoSuchProjectException, IOException { ProjectControl pctl = projectControlFactory.validateFor(projectName, ProjectControl.OWNER | ProjectControl.VISIBLE); try { List<Branch> branches = Lists.newArrayList(); List<BranchInfo> branchInfos = listBranchesProvider.get().apply(new ProjectResource(pctl)); for (BranchInfo info : branchInfos) { Branch b = new Branch(new Branch.NameKey(projectName, info.ref)); b.setRevision(new RevId(info.revision)); <START> b.setCanDelete(info.canDelete != null ? true : false); <END> branches.add(b); } return new ListBranchesResult(branches, pctl.canAddRefs(), false); } catch (ResourceNotFoundException e) { throw new NoSuchProjectException(projectName); } }</code><technical_language>I prefer use: Objects.firstNonNull(info.canDelete, false) if canDelete=Boolean.FALSE honored here</technical_language>

Target:
public ListBranchesResult call() throws NoSuchProjectException, IOException { ProjectControl pctl = projectControlFactory.validateFor(projectName, ProjectControl.OWNER | ProjectControl.VISIBLE); try { List<Branch> branches = Lists.newArrayList(); List<BranchInfo> branchInfos = listBranchesProvider.get().apply(new ProjectResource(pctl)); for (BranchInfo info : branchInfos) { Branch b = new Branch(new Branch.NameKey(projectName, info.ref)); b.setRevision(new RevId(info.revision)); b.setCanDelete(Objects.firstNonNull(info.canDelete, false)); branches.add(b); } return new ListBranchesResult(branches, pctl.canAddRefs(), false); } catch (ResourceNotFoundException e) { throw new NoSuchProjectException(projectName); } }
Source:
<code>private static ExpressionTree getActualArgument(MethodInvocationTree mit) { int arity = mit.arguments().size(); ExpressionTree arg = mit.arguments().get(arity - 1); <START> if (arity > 2 && (arity == 4 || mit.arguments().stream().allMatch(AssertionArgumentOrderCheck::isDouble))) { <END> arg = mit.arguments().get(arity - 2); } return arg; }</code><technical_language>is assertEquals(float expected, float actual, float delta) method float a delta. caught this</technical_language>

Target:
private static ExpressionTree getActualArgument(MethodInvocationTree mit) { int arity = mit.arguments().size(); ExpressionTree arg = mit.arguments().get(arity - 1); if (arity > 2 && (arity == 4 || mit.arguments().stream().allMatch(AssertionArgumentOrderCheck::isDoubleOrFloat))) { arg = mit.arguments().get(arity - 2); } return arg; }
Source:
<code>protected int getNextVersionNumer(Context c, VersionHistory vh) throws SQLException { TableRow row = DatabaseManager.querySingle(c, "SELECT (COALESCE(MAX(" + VersionDAO.VERSION_NUMBER + "), 0) + 1)" + " AS nextversionnumber FROM " + VersionDAO.TABLE_NAME + " WHERE " + VersionDAO.HISTORY_ID +" = ?", vh.getVersionHistoryId()); int next = row.getIntColumn("nextversionnumber"); if (vh.getLatestVersion() != null && vh.getLatestVersion().getVersionNumber() >= next) { log.debug("New version number: vh.getLatest....getVersionNumber... = " <START> + Integer.toString(vh.getLatestVersion().getVersionNumber() + 1)); <END> return vh.getLatestVersion().getVersionNumber() + 1; } log.debug("New version number: " + Integer.toString(next)); return next; }</code><technical_language>This line appears obsolete</technical_language>

Target:
protected int getNextVersionNumer(Context c, VersionHistory vh) throws SQLException{ int next = versionDAO.getNextVersionNumber(c, vh); if (versionHistoryService.getLatestVersion(c, vh) != null && versionHistoryService.getLatestVersion(c, vh).getVersionNumber() >= next) { next = versionHistoryService.getLatestVersion(c, vh).getVersionNumber() + 1; } return next; }
Source:
<code>public String getAddonText() { <START> return addonText; <END> }</code><technical_language>autotranslate</technical_language>

Target:
public String getAddonText() { return NLS.smartGet(addonText); }
Source:
<code>public void onClick(View v) { <START> if (listItemClickListener != null) { <END> int position = getAdapterPosition(); if (position != RecyclerView.NO_POSITION) { listItemClickListener.onItemClick(position); } } }</code><technical_language>This null; check that. Nesting code readable, gain lose</technical_language>

Target:
public void onClick(View v) { listItemClickListener.onItemClick(position); }
Source:
<code><START> String getDownloadAnalyticsEvent(int downloadedFormCount) { <END> return downloadedFormCount == 0 ? FIRST_FORM_DOWNLOAD : SUBSEQUENT_FORM_DOWNLOAD; }</code><technical_language>methods (getDownloadAnalyticsEvent getDownloadAnalyticsDescription) feel private helpers for logDownloadAnalyticsEvents feel part of external interface of object. reworking tests a bit</technical_language>

Target:
private String getDownloadAnalyticsEvent(int downloadedFormCount) { return downloadedFormCount == 0 ? FIRST_FORM_DOWNLOAD : SUBSEQUENT_FORM_DOWNLOAD; }
Source:
<code>public void setUp() throws Exception { <START> testContext = getInstrumentation().getContext(); <END> }</code><technical_language>need a super.setUp() call here</technical_language>

Target:
public void setUp() throws Exception { super.setUp(); testContext = getInstrumentation().getContext(); }
Source:
<code>public UnusedPrivateFieldRule() throws ClassNotFoundException { <START> NEGLECT_ANNOTATIONS_TYPE.add(Class.forName("javafx.fxml.FXML")); <END> }</code><technical_language>add(javafx.fxml.FXML.class) IMO. Also, note @Deprecated fields I consider in this rule too, if deprecating a private field is unusual ^^</technical_language>

Target:
public UnusedPrivateFieldRule() { definePropertyDescriptor(IGNORED_ANNOTATIONS_DESCRIPTOR); }
Source:
<code>public TableBuilderComponentObject clickAddTableButton(){ <START> waitForElementClickableByElement(addTableButton); <END> addTableButton.click(); PageObjectLogging.log("addTable", "add table button clicked", true); return new TableBuilderComponentObject(driver); }</code><technical_language>wait for</technical_language>

Target:
public TableBuilderComponentObject clickAddTableButton(){ addTableButton.click(); PageObjectLogging.log("addTable", "add table button clicked", true); return new TableBuilderComponentObject(driver); }
Source:
<code>public void handlePushNotificationAlarm(final DeviceMessageMetadata deviceMessageMetadata, final PushNotificationAlarmDto pushNotificationAlarm) { LOGGER.info("handlePushNotificationAlarm for MessageType: {}", deviceMessageMetadata.getMessageType()); final PushNotificationAlarm pushNotificationAlarmDomain = this.mapperFactory.getMapperFacade() .map(pushNotificationAlarm, PushNotificationAlarm.class); <START> this.webServiceResponseMessageSender.send( <END> ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()) .withResult(ResponseMessageResultType.OK).withDataObject(pushNotificationAlarmDomain) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }</code><technical_language>Extract building of ResponseMessage variable (in eclipse, select text, right-click > refactor > extract local variable / select code + shift+alt+L). This code a bit more readable, especially passing in other besides ResponseMessage</technical_language>

Target:
public void handlePushNotificationAlarm(final DeviceMessageMetadata deviceMessageMetadata, final PushNotificationAlarmDto pushNotificationAlarm) { LOGGER.info("handlePushNotificationAlarm for MessageType: {}", deviceMessageMetadata.getMessageType()); final PushNotificationAlarm pushNotificationAlarmDomain = this.mapperFactory.getMapperFacade() .map(pushNotificationAlarm, PushNotificationAlarm.class); final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()) .withResult(ResponseMessageResultType.OK).withDataObject(pushNotificationAlarmDomain) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
<code>public QuotaDAO getQuotaDAO() { return DbFacade.getInstance() <START> .getQuotaDao(); <END> }</code><technical_language>Also, while here, .getQuotaDao() a line</technical_language>

Target:
protected QuotaDAO getQuotaDAO() { return DbFacade.getInstance().getQuotaDao(); }
Source:
<code>public Builder addOptions(String... keyValuePairs) { <START> Preconditions.checkArgument(keyValuePairs.length % 2 == 0, "Require an even number of arguments, got %s", keyValuePairs.length); <END> for (int i = 0; i < keyValuePairs.length; i += 2) { addOption(keyValuePairs[i], keyValuePairs[i + 1]); } return this; }</code><technical_language>Check for positive numbers too</technical_language>

Target:
public Builder addOptions(String... keyValuePairs) { Preconditions.checkArgument(keyValuePairs.length % 2 == 0 && keyValuePairs.length > 0, "Require an even, positive number of arguments, got %s", keyValuePairs.length); for (int i = 0; i < keyValuePairs.length; i += 2) { addOption(keyValuePairs[i], keyValuePairs[i + 1]); } return this; }
Source:
<code>public void checkForMultipleRecordsPerformsCorrectly() throws QueryException, XWikiRestException { Query q = mock(DefaultQuery.class); doReturn(q).when(this.qm) .createQuery("where doc.object(PhenoTips.PatientClass).external_id = :eid", Query.XWQL); List<String> results = new ArrayList<>(); results.add(this.eid); results.add(this.eid); doReturn(results).when(q).execute(); when(this.repository.getPatientByExternalId(this.eid)).thenReturn(null); <START> Response response = this.component.getPatient(this.eid); <END> verify(this.logger).debug("Retrieving patient record with external ID via REST", this.eid); verify(this.logger).debug("Multiple patient records ({}) with external ID [{}]: {}", 2, this.eid, results); assertEquals(300, response.getStatus()); }</code><technical_language>This tested for updatePatient deletePatient</technical_language>

Target:
public void checkForMultipleRecordsPerformsCorrectly() throws QueryException { Query q = mock(DefaultQuery.class); doReturn(q).when(this.qm) .createQuery("where doc.object(PhenoTips.PatientClass).external_id = :eid", Query.XWQL); List<String> results = new ArrayList<>(); results.add(this.eid); results.add(this.eid); doReturn(results).when(q).execute(); when(this.repository.getPatientByExternalId(this.eid)).thenReturn(null); Response responseGet = this.component.getPatient(this.eid); Response responseUpdate = this.component.updatePatient(this.eid, this.eid); Response responseDelete = this.component.deletePatient(this.eid); verify(this.logger, times(3)).debug("Multiple patient records ({}) with external ID [{}]: {}", 2, this.eid, results); verify(this.factory, times(3)).createAlternatives(anyListOf(String.class), eq(this.uriInfo)); assertEquals(300, responseGet.getStatus()); assertEquals(300, responseUpdate.getStatus()); assertEquals(300, responseDelete.getStatus()); }
Source:
<code>private static void checkMethods(FunctionDef suspiciousMethod, List<FunctionDef> methods, int index, SubscriptionContext ctx) { StatementList suspiciousBody = suspiciousMethod.body(); if (isException(suspiciousMethod)) { return; } for (int j = 0; j < index; j++) { FunctionDef originalMethod = methods.get(j); Tree originalBody = originalMethod.body(); if (CheckUtils.areEquivalent(originalBody, suspiciousBody)) { int line = originalMethod.name().firstToken().line(); String message = String.format(MESSAGE, originalMethod.name().name(), line); <START> ctx.addIssue(suspiciousMethod.name(), message).secondary(IssueLocation.preciseLocation(originalMethod.name(), "Original")); <END> break; } } }</code><technical_language>* secondary location tested. * .secondary(originalMethod.name(), "Original")</technical_language>

Target:
private static void checkMethods(FunctionDef suspiciousMethod, List<FunctionDef> methods, int index, SubscriptionContext ctx) { StatementList suspiciousBody = suspiciousMethod.body(); if (isException(suspiciousMethod)) { return; } for (int j = 0; j < index; j++) { FunctionDef originalMethod = methods.get(j); Tree originalBody = originalMethod.body(); if (CheckUtils.areEquivalent(originalBody, suspiciousBody)) { int line = originalMethod.name().firstToken().line(); String message = String.format(MESSAGE, originalMethod.name().name(), line); ctx.addIssue(suspiciousMethod.name(), message).secondary(originalMethod.name(), "Original"); break; } } }
Source:
<code><START> public <T> void put(String family, String qualifier, long timestamp, T value) throws IOException { <END> final KijiColumnName kijiColumnName = new KijiColumnName(family, qualifier); final HBaseColumnName columnName = mTranslator.toHBaseColumnName(kijiColumnName); final CellSpec cellSpec = mTable.getLayout().getCellSpec(kijiColumnName) .setSchemaTable(mTable.getKiji().getSchemaTable()); final KijiCellEncoder cellEncoder = DefaultKijiCellEncoderFactory.get().create(cellSpec); final byte[] encoded = cellEncoder.encode(value); mLGNames.add(mTable.getLayout().getFamilyMap().get(family).getLocalityGroup().getName()); mHopper.add(new KeyValue( mId, columnName.getFamily(), columnName.getQualifier(), timestamp, encoded)); }</code><technical_language>checkState(mPut != null)</technical_language>

Target:
public <T> void put(String family, String qualifier, long timestamp, T value) throws IOException { Preconditions.checkState(mPut != null, "calls to put() must be between calls to begin() and " + "commit(), checkAndCommit(), or rollback()"); final KijiColumnName kijiColumnName = new KijiColumnName(family, qualifier); final HBaseColumnName columnName = mTranslator.toHBaseColumnName(kijiColumnName); final CellSpec cellSpec = mTable.getLayout().getCellSpec(kijiColumnName) .setSchemaTable(mTable.getKiji().getSchemaTable()); final KijiCellEncoder cellEncoder = DefaultKijiCellEncoderFactory.get().create(cellSpec); final byte[] encoded = cellEncoder.encode(value); mLGNames.add(mTable.getLayout().getFamilyMap().get(family).getLocalityGroup().getName()); mHopper.add(new KeyValue( mId, columnName.getFamily(), columnName.getQualifier(), timestamp, encoded)); }