auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void elementShouldNotContain(String locator, String text, String...params) { String message = robot.getParamsValue(params, 0, StringUtils.EMPTY); Boolean ignoreCase = robot.getParamsValue(params, 1, Boolean.FALSE); String actual = getText(locator); if (!textContains(actual, text, ignoreCase)) { if (StringUtils.isEmpty(message)) { message = String.format("Element should not have contained text '%s', but its text was %s.", text, actual); } logging.info(String.format("Element Should Not Contain: %s => FAILED", text)); throw new SeleniumLibraryNonFatalException(message); } else { logging.info(String.format("Element Should Not Contain: %s => OK", text)); } }

Target:
public void elementShouldNotContain(String locator, String text, String...params) { String message = robot.getParamsValue(params, 0, StringUtils.EMPTY); Boolean ignoreCase = robot.getParamsValue(params, 1, Boolean.FALSE); String actual = getText(locator); if (textContains(actual, text, ignoreCase)) { if (StringUtils.isEmpty(message)) { message = String.format("Element should not have contained text '%s', but its text was %s.", text, actual); } logging.info(String.format("Element Should Not Contain: %s => FAILED", text)); throw new SeleniumLibraryNonFatalException(message); } else { logging.info(String.format("Element Should Not Contain: %s => OK", text)); } }
Source:
public void createIndexOverTwoFields() { String indexName = im.ensureIndexed(Arrays.<Object>asList("name", "age"), "basic"); assertThat(indexName, is(notNullValue())); assertThat(indexName, is("basic")); Map<String, Object> indexes = im.listIndexes(); assertThat(indexes, hasKey("basic")); @SuppressWarnings("unchecked") Map<String, Object> index = (Map<String, Object>) indexes.get("basic"); @SuppressWarnings("unchecked") List<String> fields = (List<String>) index.get("fields"); assertThat(fields, containsInAnyOrder("_id", "_rev", "name", "age")); }

Target:
public void createIndexOverTwoFields() { String indexName = im.ensureIndexed(Arrays.<Object>asList("name", "age"), "basic"); assertThat(indexName, is("basic")); Map<String, Object> indexes = im.listIndexes(); assertThat(indexes, hasKey("basic")); @SuppressWarnings("unchecked") Map<String, Object> index = (Map<String, Object>) indexes.get("basic"); @SuppressWarnings("unchecked") List<String> fields = (List<String>) index.get("fields"); assertThat(fields, containsInAnyOrder("_id", "_rev", "name", "age")); }
Source:
public static Func1<? super Object, Boolean> isEqualTo(@Nonnull final Object... values) { checkNotNull(values, "Values cannot be null"); checkState(values.length > 0, "You need to specify at least one object."); return new Func1<Object, Boolean>() { @Override public Boolean call(final Object o) { for (final Object value : values) { if (Objects.equals(o, value)) { return true; } } return false; } }; }

Target:
public static Func1<? super Object, Boolean> isEqualTo(@Nonnull final Object... values) { checkNotNull(values, "Values cannot be null"); checkState(values.length > 0, "You need to specify at least one object."); return new Func1<Object, Boolean>() { @Override public Boolean call(final Object o) { for (final Object value : values) { if (Objects.equal(o, value)) { return true; } } return false; } }; }
Source:
public int compare(String o1, String o2) { String name1 = tocNames.get(o1); String name2 = tocNames.get(o2); if (name1 == null) { return -1; } if (name2 == null) { return 1; } return Collator.getInstance().compare(name1, name2); }

Target:
public int compare(String o1, String o2) { String name1 = tocNames.get(o1); String name2 = tocNames.get(o2); if (name1 == null) { return (name2 != null) ? -1 : 0; } if (name2 == null) { return 1; } return Collator.getInstance().compare(name1, name2); }
Source:
Set<ObjectId> getShallowCommits() throws IOException { final File shallow = shallowFile; if (!shallow.isFile()) return Collections.emptySet(); final BufferedReader reader = new BufferedReader( new FileReader(shallow)); try { final Set<ObjectId> ids = new HashSet<ObjectId>(); String line; while ((line = reader.readLine()) != null) ids.add(ObjectId.fromString(line)); return ids; } finally { reader.close(); } }

Target:
Set<ObjectId> getShallowCommits() throws IOException { if (shallowFile == null || !shallowFile.isFile()) return Collections.emptySet(); if (shallowFileSnapshot == null || shallowFileSnapshot.isModified(shallowFile)) { shallowCommitsIds = new HashSet<ObjectId>(); final BufferedReader reader = open(shallowFile); try { String line; while ((line = reader.readLine()) != null) shallowCommitsIds.add(ObjectId.fromString(line)); } finally { reader.close(); } shallowFileSnapshot = FileSnapshot.save(shallowFile); } return shallowCommitsIds; }
Source:
public void apply(Queryable.QueryBuilder builder) { if (path != null) { resolvedPath = new Queryable.SelectExpression(path); } if (aggregatedPath != null) { resolvedPath = aggregatedPath.toSelectExpression(); } if (resolvedPath == null) { throw new IllegalStateException("You need to specify a target path for the condition!"); } }

Target:
public void apply(Queryable.QueryBuilder builder) { if (path != null) { resolvedPath = new Queryable.SelectExpression(path); } if (aggregatedPath != null) { resolvedPath = aggregatedPath.toSelectExpression(); } if (path != null && aggregatedPath != null) { throw new IllegalStateException("Condition can only have a single target path!"); } if (resolvedPath == null) { throw new IllegalStateException("You need to specify a target path for the condition!"); } }
Source:
public void testEnvironmentII () { Tier tier = new Tier("name1", new Integer(1), new Integer(5), new Integer(1), null); tier.setRegion("region1"); tier.addNetwork(new Network("uno2", VDC, REGION)); Tier tier3 = new Tier("name3", new Integer(1), new Integer(5), new Integer(1), null); tier3.setRegion("region3"); tier3.addNetwork(new Network("uno2", VDC, REGION)); Tier tier2 = new Tier("name2", new Integer(1), new Integer(5), new Integer(1), null); tier2.setRegion("region2"); tier2.addNetwork(new Network("uno", VDC, REGION)); Set<Tier> tiers = new HashSet<Tier>(); tiers.add(tier); Environment envResult = new Environment("environemntName", tiers); assertEquals (envResult.getTiers().size(), 1); envResult.addTier(tier2); assertEquals (envResult.getTiers().size(), 2); envResult.deleteTier(tier); envResult.updateTier(tier2, tier3); }

Target:
public void testEnvironmentII () { Tier tier = new Tier("name1", new Integer(1), new Integer(5), new Integer(1), null); tier.setRegion("region1"); tier.addNetwork(new Network("uno2", VDC, REGION)); Tier tier3 = new Tier("name3", new Integer(1), new Integer(5), new Integer(1), null); tier3.setRegion("region3"); tier3.addNetwork(new Network("uno2", VDC, REGION)); Tier tier2 = new Tier("name2", new Integer(1), new Integer(5), new Integer(1), null); tier2.setRegion("region2"); tier2.addNetwork(new Network("uno", VDC, REGION)); Set<Tier> tiers = new HashSet<Tier>(); tiers.add(tier); Environment envResult = new Environment("environemntName", tiers); assertEquals (envResult.getTiers().size(), 1); envResult.addTier(tier2); assertEquals (envResult.getTiers().size(), 2); envResult.deleteTier(tier); assertEquals (envResult.getTiers().size(), 1); envResult.updateTier(tier2, tier3); for (Tier t: envResult.getTiers() ) { assertEquals (t.getName(), "name3"); } }
Source:
Optional<String> containFlow(List<AnalyzerMessage> actual) { List<Integer> actualLines = flowToLines(actual, AnalyzerMessage::getLine); List<Map.Entry<String, SortedSet<FlowComment>>> expectedFlows = Multimaps.asMap(flows).entrySet().stream() .filter(e -> flowToLines(e.getValue(), FlowComment::line).equals(actualLines)) .collect(toList()); if (expectedFlows.isEmpty()) { return Optional.empty(); } if (expectedFlows.size() == 1) { String flowId = expectedFlows.get(0).getKey(); seenFlowIds.add(flowId); return Optional.of(flowId); } List<String> actualMessages = actual.stream().map(AnalyzerMessage::getMessage).collect(toList()); return expectedFlows.stream() .filter(e -> e.getValue().stream().map(FlowComment::message).collect(toList()).equals(actualMessages)) .filter(e -> !seenFlowIds.contains(e.getKey())) .limit(1) .map(Map.Entry::getKey) .peek(flowId -> seenFlowIds.add(flowId)) .findFirst(); }

Target:
Optional<String> containFlow(List<AnalyzerMessage> actual) { List<Integer> actualLines = flowToLines(actual, AnalyzerMessage::getLine); Set<String> expectedFlows = flows.keySet().stream() .filter(flowId -> !seenFlowIds.contains(flowId)) .filter(flowId -> flowToLines(flows.get(flowId), FlowComment::line).equals(actualLines)) .collect(Collectors.toSet()); if (expectedFlows.isEmpty()) { return Optional.empty(); } if (expectedFlows.size() == 1) { String flowId = Iterables.getOnlyElement(expectedFlows); seenFlowIds.add(flowId); return Optional.of(flowId); } List<String> actualMessages = actual.stream().map(AnalyzerMessage::getMessage).collect(toList()); Optional<String> foundFlow = expectedFlows.stream().filter(flowId -> hasSameMessages(flowId, actualMessages)).findFirst(); foundFlow.ifPresent(flowId -> seenFlowIds.add(flowId)); return foundFlow; }
Source:
public String getLabel() { String label = fLabel; if (label == null) { StringJoiner sj = new StringJoiner(", "); getValues().forEach((Long value) -> sj.add(NumberFormat.getNumberInstance(Locale.getDefault()).format(value))); label = sj.toString(); fLabel = label; } return label; }

Target:
public String getLabel() { String label = fLabel; if (label == null) { StringJoiner sj = new StringJoiner(", "); getValues().forEach((Long value) -> sj.add(value == null ? String.valueOf(value) : NumberFormat.getNumberInstance(Locale.getDefault()).format(value))); label = sj.toString(); fLabel = label; } return label; }
Source:
void put(final K key, final V value) { clusterRegistry.put(scope, key, value); System.out.println("putting key "+key+" ffrom thread "+Thread.currentThread().getName()); localCacheInsert(key, value); }

Target:
void put(final K key, final V value) { clusterRegistry.put(scope, key, value); localCacheInsert(key, value); }
Source:
private void initVncKeyboardLayout() { final List<String> layouts = (List<String>) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.VncKeyboardLayoutValidValues); final ArrayList<String> vncKeyboardLayoutItems = new ArrayList<String>(); vncKeyboardLayoutItems.add(null); vncKeyboardLayoutItems.addAll(layouts); getVncKeyboardLayout().setItems(vncKeyboardLayoutItems); getVncKeyboardLayout().setIsChangable(false); }

Target:
private void initVncKeyboardLayout() { List<String> layouts = (List<String>) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.VncKeyboardLayoutValidValues); List<String> vncKeyboardLayoutItems = new ArrayList<String>(); vncKeyboardLayoutItems.add(null); vncKeyboardLayoutItems.addAll(layouts); getVncKeyboardLayout().setItems(vncKeyboardLayoutItems); getVncKeyboardLayout().setIsChangable(false); }
Source:
public String toString() { switch(this) { case FILE: return "file"; case BLOCK: return "block"; default: throw new IllegalArgumentException(); } }

Target:
public String toString() { return name().toLowerCase(); }
Source:
public void onActionModeFinished(android.view.ActionMode mode) { nullifyActionMode(); searchBarHideHandler.setForceNoFade(false); super.onActionModeFinished(mode); }

Target:
public void onActionModeFinished(android.view.ActionMode mode) { super.onActionModeFinished(mode); nullifyActionMode(); searchBarHideHandler.setForceNoFade(false); }
Source:
private boolean isJodaTimeInClasspath() { if ( jodaTimeInClassPath != null ) { return jodaTimeInClassPath.booleanValue(); } jodaTimeInClassPath = isClassPresent( JODA_TIME_CLASS_NAME ); return jodaTimeInClassPath.booleanValue(); }

Target:
private boolean isJodaTimeInClasspath() { if ( jodaTimeInClassPath == null ) { jodaTimeInClassPath = isClassPresent( JODA_TIME_CLASS_NAME ); } return jodaTimeInClassPath.booleanValue(); }
Source:
protected IRemoteManager createRemoteManager() { GerritConnector connector = (GerritConnector) TasksUi.getRepositoryConnector(getConnectorKind()); GerritClient client = connector.getClient(getTaskRepository()); return new GerritRemoteManager(client); }

Target:
protected RemoteServiceBroker createRemoteManager() { GerritConnector connector = (GerritConnector) TasksUi.getRepositoryConnector(getConnectorKind()); GerritClient client = connector.getClient(getTaskRepository()); return new GerritRemoteBroker(client); }
Source:
private int extractWorkFromLine(String line) { int pos1 = line.indexOf(DLTK_TOTAL_WORK_START); int pos2 = line.indexOf(DLTK_TOTAL_WORK_END); if (pos1 != -1 && pos2 != -1) { String totalWork = line.substring(pos1 + DLTK_TOTAL_WORK_START.length(), pos2); int intValue = Integer.valueOf(totalWork).intValue(); if (intValue == -1) { return IProgressMonitor.UNKNOWN; } return intValue; } return NOT_WORK_COUNT; }

Target:
private int extractWorkFromLine(String line) { int pos1 = line.indexOf(DLTK_TOTAL_WORK_START); int pos2 = line.indexOf(DLTK_TOTAL_WORK_END); if (pos1 != -1 && pos2 != -1) { String totalWork = line.substring(pos1 + DLTK_TOTAL_WORK_START.length(), pos2); int intValue = Integer.parseInt(totalWork); if (intValue == -1) { return IProgressMonitor.UNKNOWN; } return intValue; } return NOT_WORK_COUNT; }
Source:
public void run(Duration timeout) { Preconditions.checkState(app != null, "TestRunner should run for Low Level Task api or High Level Application Api"); Preconditions.checkState(!timeout.isZero() || !timeout.isNegative(), "Timeouts should be positive"); final LocalApplicationRunner runner = new LocalApplicationRunner(app, new MapConfig(configs)); runner.run(); boolean timedOut = !runner.waitForFinish(timeout); Assert.assertFalse("Timed out waiting for application to finish", timedOut); ApplicationStatus status = runner.status(); if (status.getStatusCode() == ApplicationStatus.StatusCode.UnsuccessfulFinish) { throw new SamzaException(ExceptionUtils.getStackTrace(status.getThrowable())); } Path stateDir = Paths.get(configs.get(JobConfig.JOB_NON_LOGGED_STORE_BASE_DIR())); if (!Files.exists(stateDir)) return; try { Files.walk(stateDir).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete); } catch (IOException e) { throw new SamzaException("Could not delete the JOB_NON_LOGGED_STORE_BASE_DIR due to: \n" + e.getMessage()); } }

Target:
public void run(Duration timeout) { Preconditions.checkNotNull(app); Preconditions.checkState(!timeout.isZero() || !timeout.isNegative(), "Timeouts should be positive"); deleteStoreDirectories(); final LocalApplicationRunner runner = new LocalApplicationRunner(app, new MapConfig(configs)); runner.run(); if (!runner.waitForFinish(timeout)) { throw new SamzaException("Timed out waiting for application to finish"); } ApplicationStatus status = runner.status(); deleteStoreDirectories(); if (status.getStatusCode() == ApplicationStatus.StatusCode.UnsuccessfulFinish) { throw new SamzaException("Application could not finish successfully", status.getThrowable()); } }
Source:
public void handleJobExecution(final ISchedulerJob job, final TickSignal signal) throws ProcessingException { final String jobName = "Scheduler." + job.getGroupId() + "." + job.getJobId(); JobEx serverJob = m_serverJobFactory.create(jobName, new ITransactionRunnable() { @Override public IStatus run(IProgressMonitor monitor) throws ProcessingException { job.run(Scheduler.this, signal); return Status.OK_STATUS; } }); serverJob.schedule(); try { serverJob.join(); } catch (InterruptedException ie) { throw new ProcessingException("Interrupted", ie); } serverJob.throwOnError(); }

Target:
public void handleJobExecution(final ISchedulerJob job, final TickSignal signal) throws ProcessingException { final String jobName = "Scheduler." + job.getGroupId() + "." + job.getJobId(); m_serverJobFactory.runNow(jobName, new ITransactionRunnable() { @Override public IStatus run(IProgressMonitor monitor) throws ProcessingException { job.run(Scheduler.this, signal); return Status.OK_STATUS; } }); }
Source:
private static boolean configKeyShouldBePrintedInSeconds(String configKey) { return RegistrationRequest.BROWSER_TIME_OUT.equals(configKey) || RegistrationRequest.TIME_OUT.equals(configKey); }

Target:
private static boolean configKeyShouldBePrintedInSeconds(String configKey) { return CONFIG_KEYS_TO_BE_PRINTED_IN_SECONDS.contains(configKey); }
Source:
public void removeConflicts(@Nullable String namespace) { Optional<File> file = findOrCreateConflictsFile(namespace); if (file.isPresent()) { File f = file.get(); synchronized (f.getAbsolutePath().intern()) { f.delete(); } } }

Target:
public void removeConflicts(@Nullable String namespace) { final Object monitor = resolveConflictsMonitor(namespace); checkState(monitor != null, "Either not inside a repository directory or the staging area is closed"); synchronized (monitor) { File file = resolveConflictsFile(namespace); if (file != null && file.exists()) { checkState(file.delete(), "Unable to delete conflicts file %s", file); } } }
Source:
public static String getDefaultMapping() throws IOException { InputStream mappingSourceStream = Indexer.class.getResourceAsStream("/search/default-mapping.json"); String mappingSource = IOUtils.toString(mappingSourceStream); elasticSearchLog("defaultMapping").addParameter("mappingSource", mappingSource).log(); return mappingSource; }

Target:
public static String getDefaultMapping() throws IOException { try (InputStream mappingSourceStream = ZebedeeContentIndexer.class.getResourceAsStream("/search/default-mapping.json")) { String mappingSource = IOUtils.toString(mappingSourceStream); elasticSearchLog("defaultMapping").addParameter("mappingSource", mappingSource).log(); return mappingSource; } }
Source:
protected VmAndTemplatesGenerationsDAO getVmAndTemplatesGenerationsDao() { return DbFacade.getInstance().getVmAndTemplatesGenerationsDAO(); }

Target:
protected VmAndTemplatesGenerationsDAO getVmAndTemplatesGenerationsDao() { return DbFacade.getInstance().getVmAndTemplatesGenerationsDao(); }
Source:
protected void createIndex(Connection conn, String indexExt, String columnName) throws PersistenceException { if (metaData.isIndexingDisabled()) return; boolean indexExists = indexExists(getIndexName(false, indexExt), conn); if (!indexExists) { String ddl = String.format("CREATE INDEX %s ON %s (%s)", getIndexName(true, indexExt), getTableName(), columnName); if (log.isTraceEnabled()) { log.tracef("Adding index with following DDL: '%s'.", ddl); } executeUpdateSql(conn, ddl); } }

Target:
private void createIndex(Connection conn, String indexExt, String columnName) throws PersistenceException { if (metaData.isIndexingDisabled()) return; boolean indexExists = indexExists(getIndexName(false, indexExt), conn); if (!indexExists) { String ddl = String.format("CREATE INDEX %s ON %s (%s)", getIndexName(true, indexExt), getTableName(), columnName); if (log.isTraceEnabled()) { log.tracef("Adding index with following DDL: '%s'.", ddl); } executeUpdateSql(conn, ddl); } }
Source:
public ContiguousIntervalUsageInArrear build(final boolean closedInterval) { Preconditions.checkState(!isBuilt.get()); Preconditions.checkState((!closedInterval && billingEvents.size() >= 1) || (closedInterval && billingEvents.size() >= 2)); final LocalDate startDate = internalTenantContext.toLocalDate(billingEvents.get(0).getEffectiveDate()); if (targetDate.isBefore(startDate)) { return this; } final LocalDate endDate = closedInterval ? internalTenantContext.toLocalDate(billingEvents.get(billingEvents.size() - 1).getEffectiveDate()) : targetDate; if (startDate.compareTo(rawUsageStartDate) >= 0) { transitionTimes.add(startDate); } for (int i = 0; i < billingEvents.size(); i++) { final BillingEvent billingEvent = billingEvents.get(i); if (i == billingEvents.size() - 1) { addTransitionTimesForBillingEvent(startDate, endDate, billingEvent.getBillCycleDayLocal()); } else { final BillingEvent nextBillingEvent = billingEvents.get(i + 1); final LocalDate nextEndDate = internalTenantContext.toLocalDate(nextBillingEvent.getEffectiveDate()); addTransitionTimesForBillingEvent(startDate, nextEndDate, billingEvent.getBillCycleDayLocal()); } } if (closedInterval && transitionTimes.size() > 0 && endDate.isAfter(transitionTimes.get(transitionTimes.size() - 1))) { transitionTimes.add(endDate); } isBuilt.set(true); return this; }

Target:
public ContiguousIntervalUsageInArrear build(final boolean closedInterval) { Preconditions.checkState(!isBuilt.get()); Preconditions.checkState((!closedInterval && billingEvents.size() >= 1) || (closedInterval && billingEvents.size() >= 2)); final LocalDate startDate = internalTenantContext.toLocalDate(billingEvents.get(0).getEffectiveDate()); if (targetDate.isBefore(startDate)) { return this; } final LocalDate endDate = closedInterval ? internalTenantContext.toLocalDate(billingEvents.get(billingEvents.size() - 1).getEffectiveDate()) : targetDate; if (startDate.compareTo(rawUsageStartDate) >= 0) { transitionTimes.add(startDate); } for (int i = 0; i < billingEvents.size(); i++) { final BillingEvent billingEvent = billingEvents.get(i); final LocalDate transitionStartDate = internalTenantContext.toLocalDate(billingEvent.getEffectiveDate()); if (i == billingEvents.size() - 1) { addTransitionTimesForBillingEvent(transitionStartDate, endDate, billingEvent.getBillCycleDayLocal()); } else { final BillingEvent nextBillingEvent = billingEvents.get(i + 1); final LocalDate nextEndDate = internalTenantContext.toLocalDate(nextBillingEvent.getEffectiveDate()); addTransitionTimesForBillingEvent(transitionStartDate, nextEndDate, billingEvent.getBillCycleDayLocal()); } } if (closedInterval && transitionTimes.size() > 0 && endDate.isAfter(transitionTimes.get(transitionTimes.size() - 1))) { transitionTimes.add(endDate); } isBuilt.set(true); return this; }
Source:
private void printCacheContents() { log.debugf("------------------------- %d cache manager(s) -------------------------", getCacheManagers().size()); for (int i = 0; i < getCacheManagers().size(); i++) { log.debugf(" Contents of Cache with CacheManager #%d (%s, all members: %s", i, address(i), manager(i).getMembers() + ")"); Cache<String, String> testCache = manager(i).getCache(testCacheName); Set<String> keySet = testCache.keySet(); log.debugf(" keySet = %s", keySet); for (String key : keySet) { log.debugf(" key: %s value: %s", key, testCache.get(key)); } } }

Target:
private void printCacheContents() { log.debugf("%d cache manager(s)", getCacheManagers().size()); for (int i = 0; i < getCacheManagers().size(); i++) { Cache<String, String> testCache = manager(i).getCache(testCacheName); log.debugf(" Contents of Cache with CacheManager #%d (%s, all members: %s)", i, address(i), testCache.getAdvancedCache().getRpcManager().getMembers()); Set<String> keySet = testCache.keySet(); log.debugf(" keySet = %s", keySet); for (String key : keySet) { log.debugf(" key: %s value: %s", key, testCache.get(key)); } } }
Source:
public boolean waitInvisibility(WebElement webElement, int timeout) { return webDriverWaitFactory.get(timeout).until(invisibilityOfAllElements(asList(webElement))); }

Target:
public void waitInvisibility(WebElement webElement, int timeout) { webDriverWaitFactory.get(timeout).until(invisibilityOfAllElements(asList(webElement))); }
Source:
public boolean quit() { if (stateManager.getAnyTaskRunning().getValue()) { if (!(dialogService.showBackgroundProgressDialogAndWait( Localization.lang("Please wait..."), Localization.lang("Waiting for background tasks to finish. Quit anyway?"), stateManager ).orElse(ButtonType.CANCEL) == ButtonType.YES)) { return false; } } List<String> filenames = new ArrayList<>(); for (int i = 0; i < tabbedPane.getTabs().size(); i++) { BasePanel panel = getBasePanelAt(i); final BibDatabaseContext context = panel.getBibDatabaseContext(); if (panel.isModified() && (context.getLocation() == DatabaseLocation.LOCAL)) { tabbedPane.getSelectionModel().select(i); if (!confirmClose(panel)) { return false; } } else if (context.getLocation() == DatabaseLocation.SHARED) { context.convertToLocalDatabase(); context.getDBMSSynchronizer().closeSharedDatabase(); context.clearDBMSSynchronizer(); } AutosaveManager.shutdown(context); BackupManager.shutdown(context); context.getDatabasePath().map(Path::toAbsolutePath).map(Path::toString).ifPresent(filenames::add); } WaitForSaveFinishedDialog waitForSaveFinishedDialog = new WaitForSaveFinishedDialog(dialogService); waitForSaveFinishedDialog.showAndWait(getBasePanelList()); tearDownJabRef(filenames); Platform.exit(); return true; }

Target:
public boolean quit() { if (stateManager.getAnyTaskRunning().getValue()) { Optional<ButtonType> shouldClose = dialogService.showBackgroundProgressDialogAndWait( Localization.lang("Please wait..."), Localization.lang("Waiting for background tasks to finish. Quit anyway?"), stateManager ); if (!(shouldClose.isPresent() && shouldClose.get() == ButtonType.YES)) { return false; } } List<String> filenames = new ArrayList<>(); for (int i = 0; i < tabbedPane.getTabs().size(); i++) { BasePanel panel = getBasePanelAt(i); final BibDatabaseContext context = panel.getBibDatabaseContext(); if (panel.isModified() && (context.getLocation() == DatabaseLocation.LOCAL)) { tabbedPane.getSelectionModel().select(i); if (!confirmClose(panel)) { return false; } } else if (context.getLocation() == DatabaseLocation.SHARED) { context.convertToLocalDatabase(); context.getDBMSSynchronizer().closeSharedDatabase(); context.clearDBMSSynchronizer(); } AutosaveManager.shutdown(context); BackupManager.shutdown(context); context.getDatabasePath().map(Path::toAbsolutePath).map(Path::toString).ifPresent(filenames::add); } WaitForSaveFinishedDialog waitForSaveFinishedDialog = new WaitForSaveFinishedDialog(dialogService); waitForSaveFinishedDialog.showAndWait(getBasePanelList()); tearDownJabRef(filenames); Platform.exit(); return true; }
Source:
public void render(Screen screen) { if (active) { int xOffset = xLoc; int yOffset = yLoc; if (!closing) { Font.defaultFont().drawAlpha(screen, now, xOffset, yOffset, alpha); } yOffset -= 8 * memory.size() + 8; for (int i = 0; i < memory.size(); i++) { Font.defaultFont().drawAlpha(screen, memory.get(i), xOffset, (yOffset += 8), alpha); } } }

Target:
public void render(Screen screen) { if (active) { int xOffset = xLoc; int yOffset = yLoc; if (!closing) { Font.defaultFont().drawOpaque(screen, "> "+now, xOffset, yOffset, alpha); } yOffset -= 8 * memory.size() + 8; for (int i = 0; i < memory.size(); i++) { Font.defaultFont().drawOpaque(screen, "> "+memory.get(i), xOffset, (yOffset += 8), alpha); } } }
Source:
public RemoveQuotaCommand(T parameters) { super(parameters); setStoragePoolId(parameters.getStoragePoolId()); }

Target:
public RemoveQuotaCommand(T parameters) { super(parameters); }
Source:
public CertificateSerialDTO populate(ModelTranslator translator, CertificateSerial source, CertificateSerialDTO dest) { if (source == null) { throw new IllegalArgumentException("source is null"); } if (dest == null) { throw new IllegalArgumentException("dest is null"); } Date created = source.getCreated(); dest.setCreated(created != null ? Instant.ofEpochMilli(created.getTime()).atZone(ZoneId.systemDefault()).toLocalDate(): null); Date updated = source.getUpdated(); dest.setUpdated(updated != null ? Instant.ofEpochMilli(updated.getTime()).atZone(ZoneId.systemDefault()).toLocalDate() : null); dest.id(source.getId() == null ? null : source.getId().toString()); dest.serial(source.getSerial() == null ? null : source.getSerial().toString()); Date expirationDate = source.getExpiration(); dest.expiration(expirationDate != null ? Instant.ofEpochMilli(expirationDate.getTime()).atZone(ZoneId.systemDefault()).toLocalDate() : null); dest.collected(source.isCollected()); dest.revoked(source.isRevoked()); return dest; }

Target:
public CertificateSerialDTO populate(ModelTranslator translator, CertificateSerial source, CertificateSerialDTO dest) { if (source == null) { throw new IllegalArgumentException("source is null"); } if (dest == null) { throw new IllegalArgumentException("dest is null"); } Date created = source.getCreated(); dest.setCreated(created != null ? created.toInstant().atOffset(ZoneOffset.UTC) : null); Date updated = source.getUpdated(); dest.setUpdated(updated != null ? updated.toInstant().atOffset(ZoneOffset.UTC) : null); dest.id(source.getId() == null ? null : source.getId().toString()); dest.serial(source.getSerial() == null ? null : source.getSerial().toString()); Date expirationDate = source.getExpiration(); dest.expiration(expirationDate != null ? expirationDate.toInstant().atOffset(ZoneOffset.UTC) : null); dest.collected(source.isCollected()); dest.revoked(source.isRevoked()); return dest; }
Source:
@Override public String toString(boolean pretty) { return new StringBuilder("ModelsComposition [").append(pretty ? "\n\t" : "") .append("aggregator = ").append(predictionsAggregator.toString(pretty)).append(pretty ? "\n\t" : ", ") .append("models = [").append(pretty ? "\n\t\t" : "") .append(models.stream().map(x -> x.toString(false)).collect(Collectors.joining(pretty ? "\n\t\t" : ", "))) .append(pretty ? "\n\t]\n]" : "]]").toString(); }

Target:
@Override public String toString(boolean pretty) { return ModelTrace.builder("Models composition", pretty) .addField("aggregator", predictionsAggregator.toString(pretty)) .addField("models", models) .toString(); }
Source:
public long put(String key, T value, String context, Integer ttlInSeconds) { Objects.requireNonNull(key); Objects.requireNonNull(value); long now = System.currentTimeMillis(); try { upsertStatement.setString(1, key); upsertStatement.setString(2, context); upsertStatement.setTimestamp(3, new java.sql.Timestamp(now)); upsertStatement.setTimestamp(6, new java.sql.Timestamp(now)); if (ttlInSeconds != null) { long expireTime = now + TimeUnit.MILLISECONDS.convert(ttlInSeconds, TimeUnit.SECONDS); upsertStatement.setTimestamp(4, new java.sql.Timestamp(expireTime)); upsertStatement.setTimestamp(7, new java.sql.Timestamp(expireTime)); } else { upsertStatement.setNull(4, Types.DATE); upsertStatement.setNull(7, Types.DATE); } upsertStatement.setObject(5, getSQLTypeFromValueType(value)); upsertStatement.setObject(8, getSQLTypeFromValueType(value)); upsertStatement.execute(); } catch (SQLException e) { throw new RuntimeException(e); } return now; }

Target:
public long put(String key, T value, String context, Integer ttlInSeconds) { Objects.requireNonNull(key); Objects.requireNonNull(value); long now = System.currentTimeMillis(); try (Connection connection = dataSource.getConnection()) { try (PreparedStatement upsertStatement = getUpsertStatement(connection)) { upsertStatement.setString(1, key); upsertStatement.setString(2, context); upsertStatement.setTimestamp(3, new java.sql.Timestamp(now)); upsertStatement.setTimestamp(6, new java.sql.Timestamp(now)); if (ttlInSeconds != null) { long expireTime = now + TimeUnit.MILLISECONDS.convert(ttlInSeconds, TimeUnit.SECONDS); upsertStatement.setTimestamp(4, new java.sql.Timestamp(expireTime)); upsertStatement.setTimestamp(7, new java.sql.Timestamp(expireTime)); } else { upsertStatement.setNull(4, Types.DATE); upsertStatement.setNull(7, Types.DATE); } upsertStatement.setObject(5, getSQLTypeFromValueType(value)); upsertStatement.setObject(8, getSQLTypeFromValueType(value)); upsertStatement.execute(); } } catch (SQLException e) { throw new RuntimeException(e); } return now; }
Source:
private void showMediaAboveText() { alignMediaAtTop(videoView); alignMediaAtTop(qrView); alignMediaAtTop(imageView); alignMediaAtTop(resizingImageView); alignMediaAtTop(missingMediaBackground); alignMediaAtTop(downloadIcon); alignMediaAtTop(progressBar); alignTextContainerBelowMediaView(audioButton); alignTextContainerBelowMediaView(textViewContainer); }

Target:
private void showMediaAboveText() { questionBottomBarrier.setReferencedIds(new int[]{ R.id.top_guideline }); mediaLayoutBottomBarrier.setReferencedIds(new int[]{ R.id.missing_media_tv, R.id.inline_video_view, R.id.qr_view, R.id.image, R.id.resizing_image }); }
Source:
long checkConfigAndRunSweep(SweepLocks locks) throws InterruptedException { if (isSweepEnabled.get()) { return grabLocksAndRun(locks); } else { log.debug("Skipping sweep because it is currently disabled."); } return 20 * (1000 + sweepPauseMillis.get()); }

Target:
long checkConfigAndRunSweep(SweepLocks locks) throws InterruptedException { if (isSweepEnabled.get()) { return grabLocksAndRun(locks); } else { log.debug("Skipping sweep because it is currently disabled."); } return getBackoffTimeWhenSweepHasNotRun(); }
Source:
public Iterable<Map.Entry<String, Object>> orderMap(DataMap map) { return Data.orderMapEntries(map); }

Target:
public Iterable<Map.Entry<String, Object>> orderMap(DataMap map) { if (_orderMapEntriesByKey) { return Data.orderMapEntries(map); } else { return map.entrySet(); } }
Source:
public Set<ApprovalCategoryValue.Id> getApprovals() { return Collections.unmodifiableSet(approvals); }

Target:
public Set<ApprovalCategoryValue.Id> getApprovals() { return approvals; }
Source:
public void testInvalidNullDefaultForInt() throws Exception { MessageSpec testMessageSpec = MessageGenerator.JSON_SERDE.readValue(String.join("", Arrays.asList( "{", " \"type\": \"request\",", " \"name\": \"FooBar\",", " \"validVersions\": \"0-2\",", " \"fields\": [", " { \"name\": \"field1\", \"type\": \"int32\", \"versions\": \"0+\", \"default\": \"null\" }", " ]", "}")), MessageSpec.class); try { new MessageDataGenerator("test").generate(testMessageSpec); fail("Expected MessageDataGenerator#generate to fail"); } catch (Throwable e) { assertTrue("Invalid error message: " + e.getMessage(), e.getMessage().contains("Invalid default for int32")); } }

Target:
public void testInvalidNullDefaultForInt() throws Exception { MessageSpec testMessageSpec = MessageGenerator.JSON_SERDE.readValue(String.join("", Arrays.asList( "{", " \"type\": \"request\",", " \"name\": \"FooBar\",", " \"validVersions\": \"0-2\",", " \"fields\": [", " { \"name\": \"field1\", \"type\": \"int32\", \"versions\": \"0+\", \"default\": \"null\" }", " ]", "}")), MessageSpec.class); try { new MessageDataGenerator("org.apache.kafka.common.message").generate(testMessageSpec); fail("Expected MessageDataGenerator#generate to fail"); } catch (Throwable e) { assertTrue("Invalid error message: " + e.getMessage(), e.getMessage().contains("Invalid default for int32")); } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MetricOptions version = (MetricOptions) o; return options.equals(version.options); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MetricOptions other = (MetricOptions) o; return options.equals(other.options); }
Source:
public HttpPipeline build() { if (httpClient == null) { return new HttpPipeline(HttpClient.createDefault(), pipelinePolicies); } else { return new HttpPipeline(httpClient, pipelinePolicies); } }

Target:
public HttpPipeline build() { List<HttpPipelinePolicy> policies = (pipelinePolicies == null) ? new ArrayList<>() : pipelinePolicies; HttpClient client = (httpClient == null) ? HttpClient.createDefault() : httpClient; return new HttpPipeline(client, policies); }
Source:
@SuppressWarnings("checkstyle:magicnumber") private void init(@NonNull String qNumber) { inflate(getContext(), R.layout.view_description_edit_revert_help, this); ButterKnife.bind(this); helpText.setMovementMethod(new LinkMovementMethod()); Spanned helpStr = StringUtil.fromHtml(getString(R.string.description_edit_revert_help_body) .replaceAll(":revertSubtitle", getString(R.string.description_edit_revert_subtitle)) .replaceAll(":revertIntro", getString(R.string.description_edit_revert_intro)) .replaceAll(":revertHistory", String.format(getString(R.string.description_edit_revert_history), getHistoryUri(qNumber)))); SpannableString revertReason1 = new SpannableString(StringUtil.fromHtml(String.format(getString(R.string.description_edit_revert_reason1), getString(R.string.wikidata_description_guide_url)))); SpannableString revertReason2 = new SpannableString(StringUtil.fromHtml(getString(R.string.description_edit_revert_reason2))); revertReason1.setSpan(new BulletSpan(16), 0, revertReason1.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); revertReason2.setSpan(new BulletSpan(16), 0, revertReason2.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); SpannableString helpSpan = new SpannableString(TextUtils.expandTemplate(helpStr, revertReason1, revertReason2)); helpText.setText(helpSpan); }

Target:
@SuppressWarnings("checkstyle:magicnumber") private void init(@NonNull String qNumber) { inflate(getContext(), R.layout.view_description_edit_revert_help, this); ButterKnife.bind(this); helpText.setMovementMethod(new LinkMovementMethod()); Spanned helpStr = StringUtil.fromHtml(getString(R.string.description_edit_revert_help_body) .replaceAll(":revertSubtitle", getString(R.string.description_edit_revert_subtitle)) .replaceAll(":revertIntro", getString(R.string.description_edit_revert_intro)) .replaceAll(":revertHistory", String.format(getString(R.string.description_edit_revert_history), getHistoryUri(qNumber)))); int gapWidth = DimenUtil.roundedDpToPx(8); SpannableString revertReason1 = new SpannableString(StringUtil.fromHtml(String.format(getString(R.string.description_edit_revert_reason1), getString(R.string.wikidata_description_guide_url)))); SpannableString revertReason2 = new SpannableString(StringUtil.fromHtml(getString(R.string.description_edit_revert_reason2))); revertReason1.setSpan(new BulletSpan(gapWidth), 0, revertReason1.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); revertReason2.setSpan(new BulletSpan(gapWidth), 0, revertReason2.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); SpannableString helpSpan = new SpannableString(TextUtils.expandTemplate(helpStr, revertReason1, revertReason2)); helpText.setText(helpSpan); }
Source:
public void testIncrementalDumpEmptyDumpDirectory() throws Throwable { WarehouseInstance.Tuple tuple = primary.dump(primaryDbName, null); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); tuple = primary.dump(primaryDbName, tuple.lastReplicationId); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); String testDbName = primaryDbName + "_test"; tuple = primary.run(" create database " + testDbName) .run("create table " + testDbName + ".tbl (fld int)") .dump(primaryDbName, tuple.lastReplicationId); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); Database replicaDb = replica.getDatabase(replicatedDbName); assertTrue(replicaDb.getParameters().get("repl.last.id").equalsIgnoreCase(tuple.lastReplicationId)); tuple = primary.dump("someJunkDB", tuple.lastReplicationId); CommandProcessorResponse response = replica.runCommand("REPL LOAD someJunkDB from " + tuple.dumpLocation); response.getErrorMessage().toLowerCase().contains("org.apache.hadoop.hive.ql.metadata.hiveException: " + "database does not exist"); tuple = primary.dump("someJunkDB", null); response = replica.runCommand("REPL LOAD someJunkDB from " + tuple.dumpLocation); response.getErrorMessage().toLowerCase().contains("org.apache.hadoop.hive.ql.parse.semanticException:" + " no data to load in path"); primary.run(" drop database if exists " + testDbName + " cascade"); replica.run(" drop database if exists " + testDbName + " cascade"); }

Target:
public void testIncrementalDumpEmptyDumpDirectory() throws Throwable { WarehouseInstance.Tuple tuple = primary.dump(primaryDbName, null); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); tuple = primary.dump(primaryDbName, tuple.lastReplicationId); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); String testDbName = primaryDbName + "_test"; tuple = primary.run(" create database " + testDbName) .run("create table " + testDbName + ".tbl (fld int)") .dump(primaryDbName, tuple.lastReplicationId); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); tuple = primary.dump("someJunkDB", tuple.lastReplicationId); CommandProcessorResponse response = replica.runCommand("REPL LOAD someJunkDB from " + tuple.dumpLocation); response.getErrorMessage().toLowerCase().contains("org.apache.hadoop.hive.ql.metadata.hiveException: " + "database does not exist"); tuple = primary.dump("someJunkDB", null); response = replica.runCommand("REPL LOAD someJunkDB from " + tuple.dumpLocation); response.getErrorMessage().toLowerCase().contains("org.apache.hadoop.hive.ql.parse.semanticException:" + " no data to load in path"); primary.run(" drop database if exists " + testDbName + " cascade"); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.preview_image_fragment, container, false); mProgressBar = view.findViewById(R.id.syncProgressBar); DisplayUtils.colorPreLollipopHorizontalProgressBar(mProgressBar); mImageView = view.findViewById(R.id.photo_view); mImageView.setVisibility(View.GONE); mImageView.setOnClickListener(v -> { if(getActivity() != null) { ((PreviewImageActivity) getActivity()).toggleFullScreen(); } }); TextView mMessageView = view.findViewById(R.id.message); mMessageView.setVisibility(View.GONE); ProgressBar mProgressWheel = view.findViewById(R.id.progressWheel); mProgressWheel.setVisibility(View.VISIBLE); return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.preview_image_fragment, container, false); mProgressBar = view.findViewById(R.id.syncProgressBar); DisplayUtils.colorPreLollipopHorizontalProgressBar(mProgressBar); mImageView = view.findViewById(R.id.photo_view); mImageView.setVisibility(View.GONE); mImageView.setOnClickListener(v -> { if(getActivity() != null) { ((PreviewImageActivity) getActivity()).toggleFullScreen(); } }); TextView messageview = view.findViewById(R.id.message); messageview.setVisibility(View.GONE); ProgressBar progressWheel = view.findViewById(R.id.progressWheel); progressWheel.setVisibility(View.VISIBLE); return view; }
Source:
protected Proc runSvnServe(File repo) throws Exception { LocalLauncher launcher = new LocalLauncher(StreamTaskListener.fromStdout()); try { launcher.launch().cmds("svnserve","--help").start().join(); } catch (IOException e) { Assert.fail("Failed to launch svnserve. Do you have subversion installed?\n" + e); } Socket s = null; try { s = new Socket("localhost", 3690); fail("Port 3690 is currently in use. Please kill anything running on this port and re-run."); } catch (IOException e) { } finally { if (s != null) { s.close(); } } return launcher.launch().cmds( "svnserve","-d","--foreground","-r",repo.getAbsolutePath()).pwd(repo).start(); }

Target:
protected Proc runSvnServe(File repo) throws Exception { LocalLauncher launcher = new LocalLauncher(StreamTaskListener.fromStdout()); try { launcher.launch().cmds("svnserve","--help").start().join(); } catch (IOException e) { Assert.fail("Failed to launch svnserve. Do you have subversion installed?\n" + e); } Socket s = null; ServerSocket serverSocket = null; int port = 3690; try { s = new Socket("localhost", 3690); System.err.println("Port 3690 is currently in use. Using a random port."); serverSocket = new ServerSocket(0); port = serverSocket.getLocalPort(); serverSocket.close(); } catch (IOException e) { } finally { if (s != null) { s.close(); } } return launcher.launch().cmds( "svnserve","-d","--foreground","-r",repo.getAbsolutePath(), "--listen-port", String.valueOf(port)).pwd(repo).start(); }
Source:
private short readShort( long pageId, int pageOffset ) throws IOException { if ( pageSize - pageOffset < 2 ) { long originalPageId = currentPageId; int originalPageOffset = currentPageOffset; try { currentPageId = pageId; currentPageOffset = pageOffset; return super.readShort(); } finally { currentPageId = originalPageId; currentPageOffset = originalPageOffset; } } moveCursor( pageId, pageOffset ); short val; do { val = cursor.getShort( pageOffset ); } while ( cursor.shouldRetry() ); boundsCheck(); return val; }

Target:
private short readShort( long pageId, int pageOffset ) throws IOException { if ( pageSize - pageOffset < 2 ) { byte byte1 = readByte( pageId, pageOffset ); byte byte2 = readByte( pageId + 1, 0 ); return (short) (((byte1 & 0xFF) << 8) | (byte2 & 0xFF)); } moveCursorTo( pageId, pageOffset ); short val; do { val = cursor.getShort( pageOffset ); } while ( cursor.shouldRetry() ); if ( cursor.checkAndClearBoundsFlag() ) { throw newEOFException( "Cursor bounds check failed" ); } return val; }
Source:
private int readNoFilter(int[] positions, int positionCount) throws IOException { int maxPositionCount = positions[positionCount - 1] + 1; if (maxPositionCount * (1 - BATCH_EXECUTION_FILTERRATE_THRESHOLD) <= positionCount) { if (presentStream != null) { int nonNullCount = maxPositionCount - presentStream.getUnsetBits(maxPositionCount, nulls); dataStream.next(values, nonNullCount); if (maxPositionCount != positionCount) { if (maxPositionCount != nonNullCount) { unpackByteNulls(values, nulls, maxPositionCount, nonNullCount); } packBytesForPositions(values, positions, positionCount); packBooleansForPositions(nulls, positions, positionCount); } else if (maxPositionCount != nonNullCount) { unpackByteNulls(values, nulls, maxPositionCount, nonNullCount); } } else { dataStream.next(values, maxPositionCount); if (maxPositionCount != positionCount) { packBytesForPositions(values, positions, positionCount); } } outputPositionCount = positionCount; return maxPositionCount; } int streamPosition = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skip(position - streamPosition); streamPosition = position; } if (presentStream != null && !presentStream.nextBit()) { nulls[i] = true; } else { values[i] = dataStream.next(); if (presentStream != null) { nulls[i] = false; } } streamPosition++; } outputPositionCount = positionCount; return streamPosition; }

Target:
private int readNoFilter(int[] positions, int positionCount) throws IOException { int totalPositionCount = positions[positionCount - 1] + 1; if (totalPositionCount * (1 - BATCH_EXECUTION_FILTERRATE_THRESHOLD) <= positionCount) { if (presentStream != null) { int nonNullCount = totalPositionCount - presentStream.getUnsetBits(totalPositionCount, nulls); dataStream.next(values, nonNullCount); unpackByteNulls(values, nulls, totalPositionCount, nonNullCount); if (totalPositionCount > positionCount) { packBytesForPositions(values, positions, positionCount); packBooleansForPositions(nulls, positions, positionCount); } } else { dataStream.next(values, totalPositionCount); if (totalPositionCount > positionCount) { packBytesForPositions(values, positions, positionCount); } } outputPositionCount = positionCount; return totalPositionCount; } int streamPosition = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skip(position - streamPosition); streamPosition = position; } if (presentStream != null && !presentStream.nextBit()) { nulls[i] = true; } else { values[i] = dataStream.next(); if (presentStream != null) { nulls[i] = false; } } streamPosition++; } outputPositionCount = positionCount; return streamPosition; }