auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public synchronized byte[] getReferenceBases(final SAMSequenceRecord record, final boolean tryNameVariants) { { final String name = record.getSequenceName(); final byte[] bases = findInCache(name); if (bases != null) return bases; } final String md5 = record.getAttribute(SAMSequenceRecord.MD5_TAG); { if (md5 != null) { byte[] bases = findInCache(md5); if (bases != null) return bases; bases = findInCache(md5.toLowerCase()); if (bases != null) return bases; bases = findInCache(md5.toUpperCase()); if (bases != null) return bases; } } byte[] bases; { bases = findBasesByName(record.getSequenceName(), tryNameVariants); if (bases != null) { SequenceUtil.upperCase(bases); cacheW.put(record.getSequenceName(), new WeakReference<byte[]>( bases)); return bases; } } if (Defaults.REF_DOWNLOAD_ENABLED) { <START> if (md5 != null) <END> try { bases = findBasesByMD5(md5.toLowerCase()); } catch (final Exception e) { throw new RuntimeException(e); } if (bases != null) { SequenceUtil.upperCase(bases); cacheW.put(md5, new WeakReference<byte[]>(bases)); return bases; } } return null; }</code><technical_language>Missing { }. fix nested ifs</technical_language>

Target:
public synchronized byte[] getReferenceBases(final SAMSequenceRecord record, final boolean tryNameVariants) { { final String name = record.getSequenceName(); final byte[] bases = findInCache(name); if (bases != null) return bases; } final String md5 = record.getAttribute(SAMSequenceRecord.MD5_TAG); { if (md5 != null) { byte[] bases = findInCache(md5); if (bases != null) return bases; bases = findInCache(md5.toLowerCase()); if (bases != null) return bases; bases = findInCache(md5.toUpperCase()); if (bases != null) return bases; } } byte[] bases; { bases = findBasesByName(record.getSequenceName(), tryNameVariants); if (bases != null) { SequenceUtil.upperCase(bases); cacheW.put(record.getSequenceName(), new WeakReference<byte[]>( bases)); return bases; } } { if (Defaults.USE_CRAM_REF_DOWNLOAD) { if (md5 != null) { try { bases = findBasesByMD5(md5.toLowerCase()); } catch (final Exception e) { throw new RuntimeException(e); } } if (bases != null) { SequenceUtil.upperCase(bases); cacheW.put(md5, new WeakReference<byte[]>(bases)); return bases; } } } return null; }
Source:
<code>public void run() { while (true) { if (Thread.interrupted()) { log.warn("Prefetch thread was interrupted."); break; } <START> if (prefetchCounters.byteSize < maxByteSize && prefetchCounters.size < maxRecordsCount) { <END> try { GetRecordsResult getRecordsResult = getRecordsRetrievalStrategy.getRecords(maxRecordsPerCall); ProcessRecordsInput processRecordsInput = new ProcessRecordsInput() .withRecords(getRecordsResult.getRecords()) .withMillisBehindLatest(getRecordsResult.getMillisBehindLatest()) .withCacheEntryTime(Instant.now()); getRecordsResultQueue.put(processRecordsInput); prefetchCounters.added(processRecordsInput); } catch (InterruptedException e) { log.error("Interrupted while adding records to the cache", e); } } } }</code><technical_language>sense provide counters limits, a method shouldRetrieveData()</technical_language>

Target:
public void run() { while (true) { if (Thread.interrupted()) { log.warn("Prefetch thread was interrupted."); break; } if (prefetchCounters.shouldGetNewRecords()) { try { GetRecordsResult getRecordsResult = getRecordsRetrievalStrategy.getRecords(maxRecordsPerCall); ProcessRecordsInput processRecordsInput = new ProcessRecordsInput() .withRecords(getRecordsResult.getRecords()) .withMillisBehindLatest(getRecordsResult.getMillisBehindLatest()) .withCacheEntryTime(Instant.now()); getRecordsResultQueue.put(processRecordsInput); prefetchCounters.added(processRecordsInput); } catch (InterruptedException e) { log.info("Thread was interrupted, indicating shutdown was called on the cache", e); } } } }
Source:
<code>public void shouldRunQueryFromFile() throws IOException, InterruptedException { try (TempFile file = new TempFile()) { Files.write("select * from hive.default.nation;\n", file.file(), UTF_8); launchPrestoCliWithServerArgument("--file", file.file().getAbsolutePath()); assertThat(trimLines(presto.readRemainingOutputLines())).containsAll(nationTableBatchLines); presto.waitForWithTimeoutAndKill(); } <START> } <END></code><technical_language>assert success cli exits 0</technical_language>

Target:
public void shouldRunQueryFromFile() throws Exception { try (TempFile file = new TempFile()) { Files.write("select * from hive.default.nation;\n", file.file(), UTF_8); launchPrestoCliWithServerArgument("--file", file.file().getAbsolutePath()); assertThat(trimLines(presto.readRemainingOutputLines())).containsAll(nationTableBatchLines); presto.waitForWithTimeoutAndKill(); } }
Source:
<code>protected void setUp() throws Exception { super.setUp(); mSyncthing = new SyncthingRunnable(new MockContext(null), <START> getContext().getApplicationInfo().dataDir+"/"+SyncthingService.BINARY_NAME); <END> mConfig = new ConfigXml(new MockContext(getContext())); mConfig.changeDefaultFolder(); mHttpsCertPath = getContext().getFilesDir()+"/"+SyncthingService.HTTPS_CERT_FILE; final CountDownLatch latch = new CountDownLatch(2); new PollWebGuiAvailableTask() { @Override protected void onPostExecute(Void aVoid) { mApi.onWebGuiAvailable(); latch.countDown(); } }.execute(mHttpsCertPath, mConfig.getWebGuiUrl()); mApi = new RestApi(getContext(), mConfig.getWebGuiUrl(), mConfig.getApiKey(), new RestApi.OnApiAvailableListener() { @Override public void onApiAvailable() { latch.countDown(); } }); latch.await(1, TimeUnit.SECONDS); }</code><technical_language>I prefer spaces +, is in entire code base :p</technical_language>

Target:
protected void setUp() throws Exception { super.setUp(); new SyncthingRunnable(new MockContext(null), getContext().getApplicationInfo().dataDir + "/" + SyncthingService.BINARY_NAME); ConfigXml config = new ConfigXml(new MockContext(getContext())); config.changeDefaultFolder(); String httpsCertPath = getContext().getFilesDir() + "/" + SyncthingService.HTTPS_CERT_FILE; final CountDownLatch latch = new CountDownLatch(2); new PollWebGuiAvailableTask(httpsCertPath) { @Override protected void onPostExecute(Void aVoid) { mApi.onWebGuiAvailable(); latch.countDown(); } }.execute(config.getWebGuiUrl()); mApi = new RestApi(getContext(), config.getWebGuiUrl(), config.getApiKey(), new RestApi.OnApiAvailableListener() { @Override public void onApiAvailable() { latch.countDown(); } }); latch.await(1, TimeUnit.SECONDS); }
Source:
<code>public void removeDiff(FilePatch2 diffToRemove){ FilePatch2[] temp = new FilePatch2[fDiffs.length - 1]; int counter = 0; for (FilePatch2 <START> fDiff : <END> fDiffs) { if (fDiff != diffToRemove) { temp[counter++] = fDiff; } } fDiffs = temp; }</code><technical_language>a field</technical_language>

Target:
public void removeDiff(FilePatch2 diffToRemove){ FilePatch2[] temp = new FilePatch2[fDiffs.length - 1]; int counter = 0; for (FilePatch2 diff : fDiffs) { if (diff != diffToRemove) { temp[counter++] = diff; } } fDiffs = temp; }
Source:
<code>private Set<File> findLinks(List<FileSet> fileSets) { Set<File> result = new HashSet<>(); for (FileSet fs : fileSets) { DirectoryScanner ds = fs.getDirectoryScanner(getProject()); File dir = fs.getDir(getProject()); Stream.of(ds.getIncludedFiles(), ds.getIncludedDirectories()) .flatMap(Stream::of).forEach(path -> { final File f = new File(dir, path); if (Files.isSymbolicLink(f.toPath())) { <START> result.add(f); <END> } }); } return result; }</code><technical_language>previous code canonicalized link's parent directory deal symlinks tree, I this is important for consumers of returned set record merges entries "directories" links directory. honest real impact I guess existing behavior</technical_language>

Target:
private Set<File> findLinks(List<FileSet> fileSets) { final Set<File> result = new HashSet<>(); for (FileSet fs : fileSets) { DirectoryScanner ds = fs.getDirectoryScanner(getProject()); File dir = fs.getDir(getProject()); Stream.of(ds.getIncludedFiles(), ds.getIncludedDirectories()) .flatMap(Stream::of).forEach(path -> { try { final File f = new File(dir, path); final File pf = f.getParentFile(); final String name = f.getName(); final File parentDirCanonicalizedFile = new File(pf.getCanonicalPath(), name); if (Files.isSymbolicLink(parentDirCanonicalizedFile.toPath())) { result.add(parentDirCanonicalizedFile); } } catch (IOException e) { handleError("IOException: " + path + " omitted"); } }); } return result; }
Source:
<code>private TaskTracker forNewTable() throws Exception { <START> if (isImmutableDataCopy()) { <END> addConsolidatedPartitionDesc(); return tracker; } Iterator<AlterTableAddPartitionDesc> iterator = event.partitionDescriptions(tableDesc).iterator(); while (iterator.hasNext() && tracker.canAddMoreTasks()) { AlterTableAddPartitionDesc currentPartitionDesc = iterator.next(); addPartition(iterator.hasNext(), currentPartitionDesc, null); } return tracker; }</code><technical_language>do this for isImmutableDataCopy repl dump metadata task? This optimization helpful for metadata load right</technical_language>

Target:
private TaskTracker forNewTable() throws Exception { if (isMetaDataOp()) { addConsolidatedPartitionDesc(); return tracker; } Iterator<AlterTableAddPartitionDesc> iterator = event.partitionDescriptions(tableDesc).iterator(); while (iterator.hasNext() && tracker.canAddMoreTasks()) { AlterTableAddPartitionDesc currentPartitionDesc = iterator.next(); addPartition(iterator.hasNext(), currentPartitionDesc, null); } return tracker; }
Source:
<code>public static HazelcastSchema createRootSchema(List<TableResolver> tableResolvers) { Map<String, org.apache.calcite.schema.Table> rootTablesByName = new HashMap<>(); Map<String, Map<String, HazelcastTable>> tablesBySchema = new HashMap<>(); for (TableResolver tableResolver : tableResolvers) { Collection<Table> tables = tableResolver.getTables(); if (tables == null || tables.isEmpty()) { continue; } for (Table table : tables) { HazelcastTable convertedTable = new HazelcastTable( table, createTableStatistic(table) ); <START> if (table.getSchemaName() == null || table.getSchemaName().isEmpty()) { <END> rootTablesByName.put(table.getName(), convertedTable); } else { Map<String, HazelcastTable> schemaTableMap = tablesBySchema.computeIfAbsent(table.getSchemaName(), (k) -> new HashMap<>()); schemaTableMap.put(table.getName(), convertedTable); } } } Map<String, Schema> schemasByName = new HashMap<>(); for (Map.Entry<String, Map<String, HazelcastTable>> schemaEntry : tablesBySchema.entrySet()) { String schemaName = schemaEntry.getKey(); Map schemaTables = schemaEntry.getValue(); HazelcastSchema schema = new HazelcastSchema(emptyMap(), schemaTables); schemasByName.put(schemaName, schema); } HazelcastSchema rootSchema = new HazelcastSchema(schemasByName, rootTablesByName); return createCatalog(rootSchema); }</code><technical_language>empty schema names. A classical object hierarchy is catalog -> schema -> object. object a definitive name for reasons: 1. need displayed in tools talk JDBC 1. reach object naming context. empty schema name, some objects unreachable Other vendors typically a default schema name PUBLIC alike</technical_language>

Target:
public static HazelcastSchema createRootSchema(List<TableResolver> tableResolvers) { Map<String, Map<String, HazelcastTable>> tableMap = new HashMap<>(); for (TableResolver tableResolver : tableResolvers) { Collection<Table> tables = tableResolver.getTables(); if (tables == null || tables.isEmpty()) { continue; } for (Table table : tables) { HazelcastTable convertedTable = new HazelcastTable( table, createTableStatistic(table) ); Map<String , HazelcastTable> schemaTableMap = tableMap.computeIfAbsent(table.getSchemaName(), (k) -> new HashMap<>()); schemaTableMap.put(table.getName(), convertedTable); } } Map<String, Schema> schemaMap = new HashMap<>(); for (Map.Entry<String, Map<String, HazelcastTable>> schemaEntry : tableMap.entrySet()) { String schemaName = schemaEntry.getKey(); Map schemaTables = schemaEntry.getValue(); HazelcastSchema schema = new HazelcastSchema(Collections.emptyMap(), schemaTables); schemaMap.put(schemaName, schema); } HazelcastSchema rootSchema = new HazelcastSchema(schemaMap, Collections.emptyMap()); return createCatalog(rootSchema); }
Source:
<code>public void onDisable() { StaticLayer.GetConvertor().runShutdownHooks(); stopExecutionQueue(); ExtensionManager.Cleanup(); ClassDiscovery.getDefaultInstance().invalidateCaches(); ClassLoader loader = ClassDiscovery.getDefaultInstance().getDefaultClassLoader(); if (loader instanceof DynamicClassLoader) { DynamicClassLoader dcl = (DynamicClassLoader)loader; dcl.destroy(); } System.gc(); for (File f : CommandHelperFileLocations.getDefault().getExtensionCacheDirectory().listFiles()) { try { Files.delete(f.toPath()); } catch (IOException ex) { System.out.println("[CommandHelper] Could not delete loose file " + f.getAbsolutePath() + ": " + ex.getMessage()); } } <START> <END> ac = null; wep = null; }</code><technical_language>this block, a single function call in this file</technical_language>

Target:
public void onDisable() { StaticLayer.GetConvertor().runShutdownHooks(); stopExecutionQueue(); ExtensionManager.Cleanup(); ac = null; wep = null; }
Source:
<code>public synchronized void init() { new Thread(new Runnable() { @Override public void run() { FrameworkInfo framework = FrameworkInfo.newBuilder() .setUser("") <START> .setName(JenkinsScheduler.this.getMesosCloud().getFrameworkName()) <END> .setCheckpoint(mesosCloud.isCheckpointingEnabled()).build(); LOGGER.info("Initializing the Mesos driver with options" + "\n" + "User: " + framework.getUser() + "\n" + "Framework Name: " + framework.getName() + "\n" + "Checkpointing: " + framework.getCheckpoint() ); driver = new MesosSchedulerDriver(JenkinsScheduler.this, framework, mesosCloud.getMaster()); if (driver.run() != Status.DRIVER_STOPPED) { LOGGER.severe("The mesos driver was aborted!"); } driver = null; } }).start(); }</code><technical_language>s/JenkinsScheduler.this.getMesosCloud()/mesosCloud/</technical_language>

Target:
public synchronized void init() { new Thread(new Runnable() { @Override public void run() { FrameworkInfo framework = FrameworkInfo.newBuilder() .setUser("") .setName(mesosCloud.getFrameworkName()) .setCheckpoint(mesosCloud.isCheckpoint()).build(); LOGGER.info("Initializing the Mesos driver with options" + "\n" + "User: " + framework.getUser() + "\n" + "Framework Name: " + framework.getName() + "\n" + "Checkpointing: " + framework.getCheckpoint() ); driver = new MesosSchedulerDriver(JenkinsScheduler.this, framework, mesosCloud.getMaster()); if (driver.run() != Status.DRIVER_STOPPED) { LOGGER.severe("The mesos driver was aborted!"); } driver = null; } }).start(); }
Source:
<code>public static HadoopDruidIndexerConfig fromDistributedFileSystem(String path) { try { Path pt = new Path(path); <START> FileSystem fs = FileSystem.get(pt.toUri(), new Configuration()); <END> Reader reader = new InputStreamReader(fs.open(pt)); return fromMap( (Map<String, Object>) HadoopDruidIndexerConfig.jsonMapper.readValue( reader, new TypeReference<Map<String, Object>>() { } ) ); } catch (Exception e) { throw Throwables.propagate(e); } }</code><technical_language>this is break paths valid URIs either. a similar issue <LINK_0></technical_language>

Target:
public static HadoopDruidIndexerConfig fromDistributedFileSystem(String path) { try { Path pt = new Path(path); FileSystem fs = pt.getFileSystem(new Configuration()); Reader reader = new InputStreamReader(fs.open(pt)); return fromMap( (Map<String, Object>) HadoopDruidIndexerConfig.jsonMapper.readValue( reader, new TypeReference<Map<String, Object>>() { } ) ); } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
<code>protected int getNumOfElementOnPage(By cssSelectorBy) { changeImplicitWait(500, TimeUnit.MILLISECONDS); <START> int numElementOnPage = 0; <END> try { numElementOnPage = driver.findElements(cssSelectorBy).size(); } catch (Exception ex) { numElementOnPage = 0; } finally { restoreDeaultImplicitWait(); } return numElementOnPage; }</code><technical_language>assigning 0 numElementOnPage, assign some in next line</technical_language>

Target:
protected int getNumOfElementOnPage(By cssSelectorBy) { changeImplicitWait(500, TimeUnit.MILLISECONDS); int numElementOnPage; try { numElementOnPage = driver.findElements(cssSelectorBy).size(); } catch (Exception ex) { numElementOnPage = 0; } finally { restoreDeaultImplicitWait(); } return numElementOnPage; }
Source:
<code><START> public Bit() { <END> super(BIT); }</code><technical_language>I mean, this constructor is in Type. modifier public, reduce contributors' mistakes</technical_language>

Target:
Bit() { super(BIT); }
Source:
<code>public synchronized void schedulingComplete() { if (!stateMachine.transitionToScheduled()) { return; } if (getAllTasks().stream().anyMatch(task -> getState() == StageState.RUNNING)) { stateMachine.transitionToRunning(); } if (finishedTasks.containsAll(allTasks)) { stateMachine.transitionToFinished(); } <START> for (PlanNodeId partitionedSource : stateMachine.getFragment().getTableScanSchedulingOrder()) { <END> schedulingComplete(partitionedSource); } }</code><technical_language>tableScanPlanNodeId</technical_language>

Target:
public synchronized void schedulingComplete() { if (!stateMachine.transitionToScheduled()) { return; } if (getAllTasks().stream().anyMatch(task -> getState() == StageState.RUNNING)) { stateMachine.transitionToRunning(); } if (finishedTasks.containsAll(allTasks)) { stateMachine.transitionToFinished(); } for (PlanNodeId tableScanPlanNodeId : stateMachine.getFragment().getTableScanSchedulingOrder()) { schedulingComplete(tableScanPlanNodeId); } }
Source:
<code>public CacheImpl(String name) { this.name = name; <START> this.contextBuilder = this::getInvocationContextWithImplicitTransaction; <END> this.pferContextBuilder = this::putForExternalReadContext; }</code><technical_language>I prefer initialize inline in field declaration constructor... If I nitpicking much..</technical_language>

Target:
public CacheImpl(String name) { this.name = name; }
Source:
<code>protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { Parser parser = new Parser(PATTERN, (String) msg); if (!parser.matches()) { return null; } Position position = new Position(); position.setProtocol(getProtocolName()); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } position.setDeviceId(deviceSession.getDeviceId()); DateBuilder dateBuilder = new DateBuilder() .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); position.setLongitude(parser.nextDouble()); position.setLatitude(parser.nextDouble()); position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble())); position.setCourse(parser.nextDouble()); double altitude = parser.nextDouble(); int satellites = parser.nextInt(); position.setValid(satellites >= 3); position.set(Position.KEY_SATELLITES, satellites); <START> if (satellites >= 4) { <END> position.setAltitude(altitude); } position.set(Position.KEY_EVENT, parser.next()); position.set(Position.KEY_BATTERY, parser.next()); position.set(Position.PREFIX_TEMP + 1, parser.next()); return position; }</code><technical_language>Why</technical_language>

Target:
protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { Parser parser = new Parser(PATTERN, (String) msg); if (!parser.matches()) { return null; } Position position = new Position(); position.setProtocol(getProtocolName()); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } position.setDeviceId(deviceSession.getDeviceId()); DateBuilder dateBuilder = new DateBuilder() .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); position.setLongitude(parser.nextDouble()); position.setLatitude(parser.nextDouble()); position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble())); position.setCourse(parser.nextDouble()); position.setAltitude(parser.nextDouble()); int satellites = parser.nextInt(); position.setValid(satellites >= 3); position.set(Position.KEY_SATELLITES, satellites); position.set(Position.KEY_EVENT, parser.next()); position.set(Position.KEY_BATTERY, parser.next()); position.set(Position.PREFIX_TEMP + 1, parser.next()); return position; }
Source:
<code>public AggregateTestFixture(Class<T> aggregateType) { commandBus = new SimpleCommandBus(); eventStore = new RecordingEventStore(); resources.add(commandBus); resources.add(eventStore); this.aggregateType = aggregateType; clearGivenWhenState(); parameterResolverFactory = MultiParameterResolverFactory.ordered( new SimpleResourceParameterResolverFactory(resources), ClasspathParameterResolverFactory.forClass(aggregateType)); <START> handlerDefinition = new ClasspathHandlerDefinition(Thread.currentThread().getContextClassLoader()); <END> }</code><technical_language>aggregateType's class loader</technical_language>

Target:
public AggregateTestFixture(Class<T> aggregateType) { commandBus = new SimpleCommandBus(); eventStore = new RecordingEventStore(); resources.add(commandBus); resources.add(eventStore); this.aggregateType = aggregateType; clearGivenWhenState(); parameterResolverFactory = MultiParameterResolverFactory.ordered( new SimpleResourceParameterResolverFactory(resources), ClasspathParameterResolverFactory.forClass(aggregateType)); handlerDefinition = ClasspathHandlerDefinition.forClass(aggregateType); }
Source:
<code>public void handle(CacheRpcCommand command, Reply reply, DeliverOrder order) { if (order == DeliverOrder.TOTAL) { unexpectedDeliverMode(command, order); } try { <START> final int commandTopologyId = extractCommandTopologyId(command); <END> if (isCommandSentBeforeFirstTopology(commandTopologyId)) { reply.reply(CacheNotFoundResponse.INSTANCE); return; } final boolean waitTransactionalData = command.getCommandId() != StateRequestCommand.COMMAND_ID; final boolean onExecutorService = executeOnExecutorService(order, command); handleRunnable(createDefaultRunnable(command, reply, commandTopologyId, waitTransactionalData, onExecutorService), onExecutorService); } catch (Throwable throwable) { reply.reply(exceptionHandlingCommand(command, throwable)); } }</code><technical_language>I code? :) Good work</technical_language>

Target:
public void handle(CacheRpcCommand command, Reply reply, DeliverOrder order) { if (order == DeliverOrder.TOTAL) { unexpectedDeliverMode(command, order); } try { final int commandTopologyId = extractCommandTopologyId(command); final boolean waitTransactionalData = command.getCommandId() != StateRequestCommand.COMMAND_ID; final boolean onExecutorService = executeOnExecutorService(order, command); handleRunnable(createDefaultRunnable(command, reply, commandTopologyId, waitTransactionalData, onExecutorService), onExecutorService); } catch (Throwable throwable) { reply.reply(exceptionHandlingCommand(command, throwable)); } }
Source:
<code>private static PushRegistrator getPushRegistrator() { if (mPushRegistrator != null) return mPushRegistrator; int deviceType = osUtils.getDeviceType(); if (deviceType == UserState.DEVICE_TYPE_FIREOS) mPushRegistrator = new PushRegistratorADM(); <START> else if (new OSUtils().getDeviceType() == UserState.DEVICE_TYPE_ANDROID) { <END> if (OSUtils.hasFCMLibrary()) mPushRegistrator = new PushRegistratorFCM(); else mPushRegistrator = new PushRegistratorGCM(); } else mPushRegistrator = new PushRegistratorHMS(); return mPushRegistrator; }</code><technical_language>new utils function</technical_language>

Target:
private static PushRegistrator getPushRegistrator() { if (mPushRegistrator != null) return mPushRegistrator; if (OSUtils.isFireOSDeviceType()) mPushRegistrator = new PushRegistratorADM(); else if (OSUtils.isAndroidDeviceType()) { if (OSUtils.hasFCMLibrary()) mPushRegistrator = new PushRegistratorFCM(); else mPushRegistrator = new PushRegistratorGCM(); } else mPushRegistrator = new PushRegistratorHMS(); return mPushRegistrator; }
Source:
<code>private void initViews() { initLangugeSpinner(); <START> initCarModeButton(); <END> }</code><technical_language>Typo: initCardModeButtons()</technical_language>

Target:
private void initViews() { initLangugeSpinner(); initCardModeButton(); }
Source:
<code>private List<VDS> getServersInCluster() { <START> return getVdsDAO().getAllForVdsGroup(getGlusterHook().getClusterId()); <END> }</code><technical_language>cache this avoid multiple db queries</technical_language>

Target:
private List<VDS> getServersInCluster() { if (serversInCluster == null) { serversInCluster = getVdsDAO().getAllForVdsGroup(getGlusterHook().getClusterId()); } return serversInCluster; }
Source:
<code>private void setXmlOvfData() { try { xmlOvfData = new String(Files.readAllBytes(Paths.get(VM_OVF_XML_DATA))); <START> } catch (IOException e) { <END> e.printStackTrace(); } }</code><technical_language>throw upwards</technical_language>

Target:
private void setXmlOvfData() throws IOException { xmlOvfData = new String(Files.readAllBytes(Paths.get(VM_OVF_XML_DATA))); }
Source:
<code>protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fui_activity_register_email); <START> setTitle(R.string.fui_sign_in_default); <END> if (savedInstanceState != null) { if (!getSupportFragmentManager().getFragments().isEmpty()) { if (getSupportFragmentManager().getFragments().get(0) instanceof EmailLinkEmailPromptFragment) { setTitle(R.string.fui_email_link_confirm_email_header); } } return; } boolean linkingFlow = getIntent().getIntExtra(RECOVERY_TYPE_KEY, -1) == RequestCodes.EMAIL_LINK_CROSS_DEVICE_LINKING_FLOW; Fragment fragment; if (linkingFlow) { fragment = EmailLinkCrossDeviceLinkingFragment.newInstance(); } else { setTitle(R.string.fui_email_link_confirm_email_header); fragment = EmailLinkEmailPromptFragment.newInstance(); } switchFragment(fragment, R.id.fragment_register_email, EmailLinkEmailPromptFragment.TAG); }</code><technical_language>This set in AndroidManifest</technical_language>

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fui_activity_register_email); if (savedInstanceState != null) { return; } boolean linkingFlow = getIntent().getIntExtra(RECOVERY_TYPE_KEY, -1) == RequestCodes.EMAIL_LINK_CROSS_DEVICE_LINKING_FLOW; Fragment fragment; if (linkingFlow) { fragment = EmailLinkCrossDeviceLinkingFragment.newInstance(); } else { fragment = EmailLinkPromptEmailFragment.newInstance(); } switchFragment(fragment, R.id.fragment_register_email, EmailLinkPromptEmailFragment.TAG); }
Source:
<code>public Slice getSlice(int field) { checkFieldType(field, ImmutableSet.of(VARCHAR)); Object value = getFieldValue(field); ElasticsearchColumnHandle column = columnHandles.get(field); if (tupleDomain.getDomains().isPresent()) { Map<ColumnHandle, Domain> domains = tupleDomain.getDomains().get(); Domain domain = domains.get(column); if (domain != null) { for (Range range : domain.getValues().getRanges().getOrderedRanges()) { if (range.isSingleValue()) { return Slices.utf8Slice(String.valueOf(getValue(column.getColumnType(), range.getLow().getValue()))); } } } } if (value instanceof Collection) { return Slices.utf8Slice(new JSONArray((List<Map<String, Object>>) value).toString()); } else { <START> return Slices.utf8Slice(String.valueOf(value)); <END> } }</code><technical_language>static import utf8Slice</technical_language>

Target:
public Slice getSlice(int field) { checkFieldType(field, ImmutableSet.of(VARCHAR)); Object value = getFieldValue(field); if (value instanceof Collection) { return utf8Slice(VALUE_CODEC.toJson(value)); } if (value == null) { return EMPTY_SLICE; } return utf8Slice(String.valueOf(value)); }
Source:
<code>protected List<String> getTabCompleteOptions(Server server, User user, String commandLabel, String[] args) { if (args.length == 1) { return Lists.newArrayList(SpawnMob.mobParts(args[0])); } else { <START> return java.util.Collections.emptyList(); <END> } }</code><technical_language>consistent rest of Essentials codebase, I suggest reverting this a fully qualified package name</technical_language>

Target:
protected List<String> getTabCompleteOptions(Server server, User user, String commandLabel, String[] args) { if (args.length == 1) { return Lists.newArrayList(SpawnMob.mobParts(args[0])); } else { return Collections.emptyList(); } }
Source:
<code>protected void updateDocumentStructures(DocumentEvent event) { if (fDocumentPartitioners != null) { fDocumentPartitioningChangedEvent= new DocumentPartitioningChangedEvent(this); for (Entry<String, IDocumentPartitioner> entry : fDocumentPartitioners.entrySet()) { String partitioning= entry.getKey(); <START> IDocumentPartitioner partitioner= fDocumentPartitioners.get(partitioning); <END> if (partitioner instanceof IDocumentPartitionerExtension3) { IDocumentPartitionerExtension3 extension= (IDocumentPartitionerExtension3) partitioner; if (extension.getActiveRewriteSession() != null) continue; } if (partitioner instanceof IDocumentPartitionerExtension) { IDocumentPartitionerExtension extension= (IDocumentPartitionerExtension) partitioner; IRegion r= extension.documentChanged2(event); if (r != null) fDocumentPartitioningChangedEvent.setPartitionChange(partitioning, r.getOffset(), r.getLength()); } else { if (partitioner.documentChanged(event)) fDocumentPartitioningChangedEvent.setPartitionChange(partitioning, 0, event.getDocument().getLength()); } } } if (fPositions.size() > 0) updatePositions(event); }</code><technical_language>this entry.getValue()</technical_language>

Target:
protected void updateDocumentStructures(DocumentEvent event) { if (fDocumentPartitioners != null) { fDocumentPartitioningChangedEvent= new DocumentPartitioningChangedEvent(this); for (Entry<String, IDocumentPartitioner> entry : fDocumentPartitioners.entrySet()) { String partitioning= entry.getKey(); IDocumentPartitioner partitioner= entry.getValue(); if (partitioner instanceof IDocumentPartitionerExtension3) { IDocumentPartitionerExtension3 extension= (IDocumentPartitionerExtension3) partitioner; if (extension.getActiveRewriteSession() != null) continue; } if (partitioner instanceof IDocumentPartitionerExtension) { IDocumentPartitionerExtension extension= (IDocumentPartitionerExtension) partitioner; IRegion r= extension.documentChanged2(event); if (r != null) fDocumentPartitioningChangedEvent.setPartitionChange(partitioning, r.getOffset(), r.getLength()); } else { if (partitioner.documentChanged(event)) fDocumentPartitioningChangedEvent.setPartitionChange(partitioning, 0, event.getDocument().getLength()); } } } if (fPositions.size() > 0) updatePositions(event); }
Source:
<code>public static @Nullable Set<Integer> getActiveThreadsForRange(KernelAnalysisModule module, long rangeStart, long rangeEnd) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return null; } List<ITmfStateInterval> query; List<Integer> threadQuarks; try { query = ss.queryFullState(rangeStart); int threadsQuark = ss.getQuarkAbsolute(Attributes.THREADS); threadQuarks = ss.getSubAttributes(threadsQuark, false); <START> } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { <END> return null; } return threadQuarks.stream() .filter(threadQuark -> { int activeStateQuark = ss.optQuarkRelative(threadQuark, Attributes.ACTIVE_STATE); if (activeStateQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return false; } ITmfStateInterval activeInterval = query.get(activeStateQuark); if (activeInterval.getStateValue().equals(StateValues.PROCESS_ACTIVE_STATE_ACTIVE)) { return true; } if (activeInterval.getEndTime() < rangeEnd) { return true; } return false; }) .map(ss::getAttributeName) .filter(attribName -> !attribName.startsWith(Attributes.THREAD_0_PREFIX)) .map(Integer::parseInt) .collect(Collectors.toSet()); }</code><technical_language>log exception? hiding a bug</technical_language>

Target:
public static @Nullable Set<Integer> getActiveThreadsForRange(KernelAnalysisModule module, long rangeStart, long rangeEnd) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return null; } List<ITmfStateInterval> query; List<Integer> threadQuarks; try { query = ss.queryFullState(rangeStart); int threadsQuark = ss.getQuarkAbsolute(Attributes.THREADS); threadQuarks = ss.getSubAttributes(threadsQuark, false); } catch (AttributeNotFoundException | StateSystemDisposedException e) { return null; } return threadQuarks.stream() .filter(threadQuark -> { int activeStateQuark = ss.optQuarkRelative(threadQuark, Attributes.ACTIVE_STATE); if (activeStateQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return false; } ITmfStateInterval activeInterval = query.get(activeStateQuark); if (activeInterval.getStateValue().equals(StateValues.PROCESS_ACTIVE_STATE_ACTIVE)) { return true; } if (activeInterval.getEndTime() < rangeEnd) { return true; } return false; }) .map(ss::getAttributeName) .filter(attribName -> !attribName.startsWith(Attributes.THREAD_0_PREFIX)) .map(Integer::parseInt) .collect(Collectors.toSet()); }
Source:
<code><START> public ClientStats getClientStats() { <END> final ChannelManager channelManager = requestSender.getChannelManager(); final long activeConnectionCount = channelManager.getOpenChannels().stream().filter(channel -> !channel.isOpen()).count(); final long idleConnectionCount = channelManager.getOpenChannels().stream().filter(Channel::isOpen).count(); return new ClientStats(activeConnectionCount, idleConnectionCount); }</code><technical_language>declared in AsyncHttpClient interface. Implementation flagged @Override</technical_language>

Target:
public ClientStats getClientStats() { return channelManager.getClientStats(); }
Source:
<code>protected boolean canDoAction() { if (!super.canDoAction()) { return false; } storage_domains dom = getStorageDomain(); <START> if (dom == null) { <END> addCanDoActionMessage(VdcBllMessages.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_STORAGE_DOMAIN_ID); return false; } VDS vds = getVds(); boolean format = getParameters().getDoFormat(); boolean localFs = isLocalFs(dom); addCanDoActionMessage(VdcBllMessages.VAR__ACTION__REMOVE); if (!CheckStorageDomain() || !checkStorageDomainSharedStatusNotLocked(dom)) { return false; } if (!localFs && !CheckStorageDomainNotInPool()) { return false; } if (localFs && isDomainAttached(dom) && !canDetachDomain(getParameters().getDestroyingPool(), false, true)) { return false; } if (vds == null) { if (localFs) { if (!InitializeVds()) { return false; } } else { addCanDoActionMessage(VdcBllMessages.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_HOST_ID); return false; } } if (isDataDomain(dom) && !format) { addCanDoActionMessage(VdcBllMessages.ERROR_CANNOT_REMOVE_STORAGE_DOMAIN_DO_FORMAT); return false; } return true; }</code><technical_language>error message for missing storage domain - ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST, please remove a new added message, case domain is removed, means execute fail host side, check for null is ok, solution is full</technical_language>

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } storage_domains dom = getStorageDomain(); if (dom == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); return false; } VDS vds = getVds(); boolean format = getParameters().getDoFormat(); boolean localFs = isLocalFs(dom); addCanDoActionMessage(VdcBllMessages.VAR__ACTION__REMOVE); if (!CheckStorageDomain() || !checkStorageDomainSharedStatusNotLocked(dom)) { return false; } if (!localFs && !CheckStorageDomainNotInPool()) { return false; } if (localFs && isDomainAttached(dom) && !canDetachDomain(getParameters().getDestroyingPool(), false, true)) { return false; } if (vds == null) { if (localFs) { if (!InitializeVds()) { return false; } } else { addCanDoActionMessage(VdcBllMessages.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_HOST_ID); return false; } } if (isDataDomain(dom) && !format) { addCanDoActionMessage(VdcBllMessages.ERROR_CANNOT_REMOVE_STORAGE_DOMAIN_DO_FORMAT); return false; } return true; }
Source:
<code>public DataSet<ExecRow> getDataSet(DataSetProcessor dsp) throws StandardException { if (!isOpen) throw new IllegalStateException("Operation is not open"); OperationContext operationContext = dsp.createOperationContext(this); operationContext.pushScope(); SConfiguration configuration= EngineDriver.driver().getConfiguration(); int MAX_LOOP = configuration.getRecursiveQueryIterationLimit(); Pair<Pair<DataSet, DataSet>, Integer> right = leftResultSet.getDataSet(dsp).persistIt2(); DataSet resultDS = right.getFirst().getFirst(); rightDS = right.getFirst().getSecond(); right = rightResultSet.getDataSet(dsp).persistIt2(); int loop = 0; <START> while (right.getSecond() > 0 && loop < MAX_LOOP) { <END> loop ++; Pair<DataSet, Integer> result = resultDS.union(right.getFirst().getFirst(), operationContext).persistIt(); resultDS.unpersistIt(); rightDS = right.getFirst().getSecond(); resultDS = result.getFirst(); right = rightResultSet.getDataSet(dsp).persistIt2(); rightDS.unpersistIt(); } operationContext.popScope(); return resultDS; }</code><technical_language>Other DBs raise exception if limit is reached, I do same. else suggested useful for MAX_LOOP a session level property</technical_language>

Target:
public DataSet<ExecRow> getDataSet(DataSetProcessor dsp) throws StandardException { if (!isOpen) throw new IllegalStateException("Operation is not open"); OperationContext operationContext = dsp.createOperationContext(this); operationContext.pushScope(); Pair<DataSet, Integer> right = leftResultSet.getDataSet(dsp).persistIt(); DataSet resultDS = right.getFirst(); rightDS = right.getFirst().getClone(); right = rightResultSet.getDataSet(dsp).persistIt(); int loop = 0; while (right.getSecond() > 0 && loop < iterationLimit) { loop ++; Pair<DataSet, Integer> result = resultDS.union(right.getFirst(), operationContext).persistIt(); resultDS.unpersistIt(); rightDS = right.getFirst().getClone(); resultDS = result.getFirst(); right = rightResultSet.getDataSet(dsp).persistIt(); rightDS.unpersistIt(); } if (loop == iterationLimit) { throw new RuntimeException("Recursive query execution iteration limit of " + iterationLimit + " reached!"); } operationContext.popScope(); return resultDS; }
Source:
<code>public Response add(GlusterVolume volume) { validateParameters(volume, "name", "volumeType", "bricks"); <START> if (volume.isSetVolumeType()) <END> { validateEnum(GlusterVolumeType.class, volume.getVolumeType().toUpperCase()); } if (volume.isSetTransportTypes()) { for (String transportType : volume.getTransportTypes().getTransportTypes()) { validateEnum(TransportType.class, transportType.toUpperCase()); } } if (volume.isSetAccessProtocols()) { for (String accessProtocol : volume.getAccessProtocols().getAccessProtocols()) { validateEnum(AccessProtocol.class, accessProtocol.toUpperCase()); } } GlusterVolumeEntity volumeEntity = getMapper(GlusterVolume.class, GlusterVolumeEntity.class).map(volume, null); volumeEntity.setClusterId(asGuid(parent.get().getId())); mapBricks(volume, volumeEntity); return performCreation(VdcActionType.CreateGlusterVolume, new CreateGlusterVolumeParameters(volumeEntity), new QueryIdResolver(VdcQueryType.GetGlusterVolumeById, IdQueryParameters.class), true); }</code><technical_language>validateParameters volumeType is set. this if condition is required</technical_language>

Target:
public Response add(GlusterVolume volume) { validateParameters(volume, "name", "volumeType", "bricks"); validateEnumParameters(volume); GlusterVolumeEntity volumeEntity = getMapper(GlusterVolume.class, GlusterVolumeEntity.class).map(volume, null); volumeEntity.setClusterId(asGuid(parent.get().getId())); mapBricks(volume, volumeEntity); return performCreation(VdcActionType.CreateGlusterVolume, new CreateGlusterVolumeParameters(volumeEntity), new QueryIdResolver(VdcQueryType.GetGlusterVolumeById, IdQueryParameters.class), true); }
Source:
<code>public void run() { <START> if (dialectEditor != null && editingSession.getEditors().contains(dialectEditor)) { <END> if (dialectEditor.getSite() != null && dialectEditor.getSite().getShell() != null) { dialectEditor.getDialogFactory().editorWillBeClosedInformationDialog(dialectEditor.getSite().getShell()); } DialectUIManager.INSTANCE.closeEditor(dialectEditor, false); editingSession.detachEditor(dialectEditor); } }</code><technical_language>This dialect editor detached, tests if is closed</technical_language>

Target:
public void run() { if (dialectEditor != null && editingSession.getEditors().contains(dialectEditor)) { if (dialectEditor.getSite() != null && dialectEditor.getSite().getShell() != null) { dialectEditor.getDialogFactory().editorWillBeClosedInformationDialog(dialectEditor.getSite().getShell()); } editingSession.closeEditors(false, dialectEditor); } }
Source:
<code>public Date getTimestamp(MavenSession session, MavenProject project, MojoExecution execution) throws MojoExecutionException { FileRepositoryBuilder builder = new FileRepositoryBuilder() .readEnvironment() .findGitDir(project.getBasedir()) .setMustExist(true); try { <START> Repository repository = builder.build(); <END> RevWalk walk = new RevWalk(repository); String relPath = getRelPath(repository, project); if (relPath != null && relPath.length() > 0) { walk.setTreeFilter(AndTreeFilter.create(new PathFilter(relPath, getIgnoreFilter(execution)), TreeFilter.ANY_DIFF)); } ObjectId headId = repository.resolve(Constants.HEAD); walk.markStart(walk.lookupCommit(headId)); RevCommit commit = walk.iterator().next(); return new Date(commit.getCommitTime() * 1000L); } catch (IOException e) { throw new MojoExecutionException("Could not determine git commit timestamp", e); } }</code><technical_language>close repository done in a finally, hold open a number of file descriptors</technical_language>

Target:
public Date getTimestamp(MavenSession session, MavenProject project, MojoExecution execution) throws MojoExecutionException { FileRepositoryBuilder builder = new FileRepositoryBuilder() .readEnvironment() .findGitDir(project.getBasedir()) .setMustExist(true); try { Repository repository = builder.build(); try { RevWalk walk = new RevWalk(repository); try { String relPath = getRelPath(repository, project); if (relPath != null && relPath.length() > 0) { walk.setTreeFilter(AndTreeFilter.create(new PathFilter(relPath, getIgnoreFilter(execution)), TreeFilter.ANY_DIFF)); } ObjectId headId = repository.resolve(Constants.HEAD); walk.markStart(walk.parseCommit(headId)); RevCommit commit = walk.next(); return new Date(commit.getCommitTime() * 1000L); } finally { walk.release(); } } finally { repository.close(); } } catch (IOException e) { throw new MojoExecutionException("Could not determine git commit timestamp", e); } }
Source:
<code>protected String putMultipartBlob(String container, Blob blob, PutOptions overrides) { MultipartUpload mpu = initiateMultipartUpload(container, blob.getMetadata()); List<MultipartPart> parts = Lists.newArrayList(); long contentLength = blob.getMetadata().getContentMetadata().getContentLength(); <START> long partSize = getMaximumMultipartPartSize(); END> int partNumber = 1; for (Payload payload : slicer.slice(blob.getPayload(), partSize)) { MultipartPart part = uploadMultipartPart(mpu, partNumber, payload); parts.add(part); ++partNumber; } return completeMultipartUpload(mpu, parts); }</code><technical_language>AWS Java S3 SDK following: java public static long calculateOptimalPartSize(PutObjectRequest putObjectRequest, TransferManagerConfiguration configuration) { double contentLength = TransferManagerUtils.getContentLength(putObjectRequest); double optimalPartSize = (double)contentLength / (double)MAXIMUM_UPLOAD_PARTS; // push upload maximum number of parts optimalPartSize = Math.ceil(optimalPartSize); return (long)Math.max(optimalPartSize, configuration.getMinimumUploadPartSize()); } AWS SDK defaults a maximum of 10000 parts. minimum default part size is 5MB. So, uploading a 51GB file, for example, 8500 6MB parts. jclouds a similar mechanism. sense expose configuration parameters able change default behavior</technical_language>

Target:
protected String putMultipartBlob(String container, Blob blob, PutOptions overrides) { MultipartUpload mpu = initiateMultipartUpload(container, blob.getMetadata()); List<MultipartPart> parts = Lists.newArrayList(); long contentLength = blob.getMetadata().getContentMetadata().getContentLength(); MultipartUploadSlicingAlgorithm algorithm = new MultipartUploadSlicingAlgorithm( getMinimumMultipartPartSize(), getMaximumMultipartPartSize(), getMaximumNumberOfParts()); long partSize = algorithm.calculateChunkSize(contentLength); int partNumber = 1; for (Payload payload : slicer.slice(blob.getPayload(), partSize)) { MultipartPart part = uploadMultipartPart(mpu, partNumber, payload); parts.add(part); ++partNumber; } return completeMultipartUpload(mpu, parts); }
Source:
<code><START> public DuplicatedEventTypeNameException(Exception e, String name) { <END> this.exception = e; this.name = name; }</code><technical_language>final params</technical_language>

Target:
public DuplicatedEventTypeNameException(Exception e, String name) { super(); this.exception = e; this.name = name; }
Source:
<code>public static boolean isAllowedForServerAdapter(IResource resource) { <START> return SERVER_ADDAPTER_ALLOWED_RESOURCE_TYPESS.stream().anyMatch(kind -> kind.equals(resource.getKind())); <END> }</code><technical_language>this done simpler contains method of java.util.Collection</technical_language>

Target:
public static boolean isAllowedForServerAdapter(IResource resource) { return SERVER_ADAPTER_ALLOWED_RESOURCE_TYPES.contains(resource.getKind()); }
Source:
<code>public synchronized Tuple next() throws SQLException { initScanner(); try { lastTuple = scanIterator.next(); if (lastTuple != null) { ImmutableBytesWritable ptr = new ImmutableBytesWritable(); lastTuple.getKey(ptr); } } catch (SQLException e) { try { throw ServerUtil.parseServerException(e); } catch(StaleRegionBoundaryCacheException e1) { if(scan.getAttribute(NON_AGGREGATE_QUERY)!=null) { Scan newScan = ScanUtil.newScan(scan); if(lastTuple != null) { lastTuple.getKey(ptr); byte[] startRowSuffix = ByteUtil.copyKeyBytesIfNecessary(ptr); if(ScanUtil.isLocalIndex(newScan)) { newScan.setAttribute(SCAN_START_ROW_SUFFIX, ByteUtil.nextKey(startRowSuffix)); } else { <START> newScan.setStartRow(ByteUtil.nextKey(startRowSuffix)); <END> } } plan.getContext().getConnection().getQueryServices().clearTableRegionCache(htable.getTableName()); this.scanIterator = plan.iterator(DefaultParallelScanGrouper.getInstance(), newScan); lastTuple = scanIterator.next(); } else { throw e; } } } return lastTuple; }</code><technical_language>convinced this nextKey universally work. (if want get next key) add a 0 byte instead. reason is incrementing key nextKey call</technical_language>

Target:
public synchronized Tuple next() throws SQLException { initScanner(); try { lastTuple = scanIterator.next(); if (lastTuple != null) { ImmutableBytesWritable ptr = new ImmutableBytesWritable(); lastTuple.getKey(ptr); } } catch (SQLException e) { try { throw ServerUtil.parseServerException(e); } catch(StaleRegionBoundaryCacheException e1) { if(ScanUtil.isNonAggregateScan(scan)) { Scan newScan = ScanUtil.newScan(scan); if(lastTuple != null) { lastTuple.getKey(ptr); byte[] startRowSuffix = ByteUtil.copyKeyBytesIfNecessary(ptr); if(ScanUtil.isLocalIndex(newScan)) { newScan.setAttribute(SCAN_START_ROW_SUFFIX, ByteUtil.nextKey(startRowSuffix)); } else { newScan.setStartRow(ByteUtil.nextKey(startRowSuffix)); } } plan.getContext().getConnection().getQueryServices().clearTableRegionCache(htable.getTableName()); this.scanIterator = plan.iterator(scanGrouper, newScan); lastTuple = scanIterator.next(); } else { throw e; } } } return lastTuple; }