auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static RelDataType deriveRowType(RelDataTypeFactory typeFactory, final RelDataType inputRowType, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, final List<AggregateCall> aggCalls) { final IntList groupList = groupSet.toList(); assert groupList.size() == groupSet.cardinality(); final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder(); final List<RelDataTypeField> fieldList = inputRowType.getFieldList(); final Set<String> containedNames = Sets.newHashSet(); for (int groupKey : groupList) { final RelDataTypeField field = fieldList.get(groupKey); containedNames.add(field.getName()); builder.add(field); } if (indicator) { for (int groupKey : groupList) { final RelDataType booleanType = typeFactory.createTypeWithNullability( typeFactory.createSqlType(SqlTypeName.BOOLEAN), false); String name = "i$" + fieldList.get(groupKey).getName(); int i = 0; while (containedNames.contains(name)) { name += "_" + i++; <START> } <END> containedNames.add(name); builder.add(name, booleanType); } } for (Ord<AggregateCall> aggCall : Ord.zip(aggCalls)) { String name; if (aggCall.e.name != null) { name = aggCall.e.name; } else { name = "$f" + (groupList.size() + aggCall.i); } int i = 0; while (containedNames.contains(name)) { name += "_" + i++; } containedNames.add(name); builder.add(name, aggCall.e.type); } return builder.build(); }</code><technical_language>Do intend creating long column names? replace name += name = base + "_" + i++</technical_language>

Target:
public static RelDataType deriveRowType(RelDataTypeFactory typeFactory, final RelDataType inputRowType, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, final List<AggregateCall> aggCalls) { final IntList groupList = groupSet.toList(); assert groupList.size() == groupSet.cardinality(); final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder(); final List<RelDataTypeField> fieldList = inputRowType.getFieldList(); final Set<String> containedNames = Sets.newHashSet(); for (int groupKey : groupList) { final RelDataTypeField field = fieldList.get(groupKey); containedNames.add(field.getName()); builder.add(field); } if (indicator) { for (int groupKey : groupList) { final RelDataType booleanType = typeFactory.createTypeWithNullability( typeFactory.createSqlType(SqlTypeName.BOOLEAN), false); final String base = "i$" + fieldList.get(groupKey).getName(); String name = base; int i = 0; while (containedNames.contains(name)) { name = base + "_" + i++; } containedNames.add(name); builder.add(name, booleanType); } } for (Ord<AggregateCall> aggCall : Ord.zip(aggCalls)) { final String base; if (aggCall.e.name != null) { base = aggCall.e.name; } else { base = "$f" + (groupList.size() + aggCall.i); } String name = base; int i = 0; while (containedNames.contains(name)) { name = base + "_" + i++; } containedNames.add(name); builder.add(name, aggCall.e.type); } return builder.build(); }
Source:
<code>protected PackagingOptions buildPackagingOptions() { boolean isMuleApplicationTemplate = Classifier.MULE_APPLICATION_TEMPLATE.equals(classifier); boolean isMuleApplicationExample = Classifier.MULE_APPLICATION_EXAMPLE.equals(classifier); <START> boolean isMuleReusableApp = Classifier.MULE_PLUGIN.equals(classifier); <END> return new PackagingOptions(isMuleApplicationTemplate || onlyMuleSources, isMuleReusableApp || lightweightPackage, isMuleApplicationExample || attachMuleSources, testJar); }</code><technical_language>static import</technical_language>

Target:
protected PackagingOptions buildPackagingOptions() { boolean isMuleApplicationTemplate = MULE_APPLICATION_TEMPLATE.equals(classifier); boolean isMuleApplicationExample = MULE_APPLICATION_EXAMPLE.equals(classifier); boolean isMuleReusableApp = MULE_PLUGIN.equals(classifier); return new PackagingOptions(isMuleApplicationTemplate || onlyMuleSources, isMuleReusableApp || lightweightPackage, isMuleApplicationExample || attachMuleSources, testJar); }
Source:
<code>public List<T> executeAndCollect(String jobExecutionName, int limit) throws Exception { Preconditions.checkState(limit > 0, "Limit must be greater than 0"); ClientAndIterator<T> clientAndIterator = executeAndCollectWithClient(jobExecutionName); try { List<T> results = new ArrayList<>(limit); while (clientAndIterator.iterator.hasNext() && limit > 0) { results.add(clientAndIterator.iterator.next()); limit--; } return results; } finally { <START> clientAndIterator.iterator.close(); <END> clientAndIterator.client.cancel(); } }</code><technical_language>ClientAndIterator AutoCloseable two</technical_language>

Target:
public List<T> executeAndCollect(String jobExecutionName, int limit) throws Exception { Preconditions.checkState(limit > 0, "Limit must be greater than 0"); try (ClientAndIterator<T> clientAndIterator = executeAndCollectWithClient(jobExecutionName)){ List<T> results = new ArrayList<>(limit); while (clientAndIterator.iterator.hasNext() && limit > 0) { results.add(clientAndIterator.iterator.next()); limit--; } return results; } }
Source:
<code>private HashSet<TopicPartition> getActivePartitions() throws InterruptedException, ExecutionException { Set<String> topics = spec.activeTopics().materialize().keySet(); Properties props = new Properties(); props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, this.spec.bootstrapServers()); WorkerUtils.addConfigsToProperties(props, this.spec.commonClientConf(), this.spec.commonClientConf()); <START> HashSet<TopicPartition> active = new HashSet<>(); <END> AdminClient client = AdminClient.create(props); Map<String, TopicDescription> topicDetails = client.describeTopics(spec.activeTopics().get().keySet()).all().get(); for (String topic : topics) { for (TopicPartitionInfo tpi : topicDetails.get(topic).partitions()) { active.add(new TopicPartition(topic, tpi.partition())); } } return active; }</code><technical_language>nit: reason return more general <Set></technical_language>

Target:
private HashSet<TopicPartition> getActivePartitions() throws InterruptedException, ExecutionException { Set<String> topics = spec.activeTopics().materialize().keySet(); Properties props = new Properties(); props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, this.spec.bootstrapServers()); WorkerUtils.addConfigsToProperties(props, this.spec.commonClientConf(), this.spec.commonClientConf()); HashSet<TopicPartition> active = new HashSet<>(); Admin client = Admin.create(props); Map<String, TopicDescription> topicDetails = client.describeTopics(spec.activeTopics().get().keySet()).all().get(); for (String topic : topics) { for (TopicPartitionInfo tpi : topicDetails.get(topic).partitions()) { active.add(new TopicPartition(topic, tpi.partition())); } } client.close(); return active; }
Source:
<code>private void setThreadCount(int threadCount) { <START> if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { <END> setMaximumPoolSize(threadCount); setCorePoolSize(threadCount); } else { setCorePoolSize(threadCount); setMaximumPoolSize(threadCount); } }</code><technical_language>need "23" here, constant</technical_language>

Target:
private void setThreadCount(int threadCount) { if (Build.VERSION.SDK_INT > 23) { setMaximumPoolSize(threadCount); setCorePoolSize(threadCount); } else { setCorePoolSize(threadCount); setMaximumPoolSize(threadCount); } }
Source:
<code>private AtomicReference<CpuClock> setupCpuClockAtomicReference() { AtomicReference<CpuClock> cpuClock = new AtomicReference<>( CpuClock.NOT_AVAILABLE ); if ( config.get( GraphDatabaseSettings.track_query_cpu_time ) ) { <START> cpuClock.set( CpuClock.CPU_CLOCK ); <END> } BiConsumer<Boolean,Boolean> cpuClockUpdater = ( before, after ) -> { if ( after ) { cpuClock.set( CpuClock.CPU_CLOCK ); } else { cpuClock.set( CpuClock.NOT_AVAILABLE ); } }; config.registerDynamicUpdateListener( GraphDatabaseSettings.track_query_cpu_time, cpuClockUpdater ); return cpuClock; }</code><technical_language>I consider calling java cpuClockUpdater( null, config.get( GraphDatabaseSettings.track_query_cpu_time ) ); avoid double boolean CpuClock conversion</technical_language>

Target:
private AtomicReference<CpuClock> setupCpuClockAtomicReference() { AtomicReference<CpuClock> cpuClock = new AtomicReference<>( CpuClock.NOT_AVAILABLE ); BiConsumer<Boolean,Boolean> cpuClockUpdater = ( before, after ) -> { if ( after ) { cpuClock.set( CpuClock.CPU_CLOCK ); } else { cpuClock.set( CpuClock.NOT_AVAILABLE ); } }; cpuClockUpdater.accept( null, config.get( GraphDatabaseSettings.track_query_cpu_time ) ); config.registerDynamicUpdateListener( GraphDatabaseSettings.track_query_cpu_time, cpuClockUpdater ); return cpuClock; }
Source:
<code>public MinioClient(String endpoint, int port, String accessKey, String secretKey, boolean secure) throws InvalidEndpointException, InvalidPortException { if (endpoint == null) { throw new InvalidEndpointException("(null)", "null endpoint"); } <START> if (!this.isValidEndpoint(endpoint)) { <END> throw new InvalidEndpointException(endpoint, "invalid host"); } if (endpoint.endsWith(".amazonaws.com") && !endpoint.equals("s3.amazonaws.com")) { throw new InvalidEndpointException(endpoint, "for amazon S3, host should be 's3.amazonaws.com'"); } if (port < 0 || port > 65535) { throw new InvalidPortException(port, "port must be in range of 1 to 65535"); } Scheme scheme = Scheme.HTTP; if (secure) { scheme = Scheme.HTTPS; } if (port == 0) { this.baseUrl = new HttpUrl.Builder() .scheme(scheme.toString()) .host(endpoint) .build(); } else { this.baseUrl = new HttpUrl.Builder() .scheme(scheme.toString()) .host(endpoint) .port(port) .build(); } this.accessKey = accessKey; this.secretKey = secretKey; }</code><technical_language>This right fix. This is needed</technical_language>

Target:
public MinioClient(String endpoint, int port, String accessKey, String secretKey, boolean secure) throws InvalidEndpointException, InvalidPortException { if (endpoint == null) { throw new InvalidEndpointException("(null)", "null endpoint"); } HttpUrl url = HttpUrl.parse(endpoint); if (url != null) { if (!"/".equals(url.encodedPath())) { throw new InvalidEndpointException(endpoint, "no path allowed in endpoint"); } if(secure && !url.isHttps()){ throw new InvalidEndpointException(endpoint, "endpoint is not https, but a secured connection is required"); } String amzHost = url.host(); if (amzHost.endsWith(".amazonaws.com") && !amzHost.equals("s3.amazonaws.com")) { throw new InvalidEndpointException(endpoint, "for Amazon S3, host should be 's3.amazonaws.com' in endpoint"); } this.baseUrl = url; this.accessKey = accessKey; this.secretKey = secretKey; if (port == 0 || url.port() == port){ return; } } if (!this.isValidEndpoint(endpoint)) { throw new InvalidEndpointException(endpoint, "invalid host"); } if (endpoint.endsWith(".amazonaws.com") && !endpoint.equals("s3.amazonaws.com")) { throw new InvalidEndpointException(endpoint, "for amazon S3, host should be 's3.amazonaws.com'"); } if (port < 0 || port > 65535) { throw new InvalidPortException(port, "port must be in range of 1 to 65535"); } Scheme scheme = Scheme.HTTP; if (secure) { scheme = Scheme.HTTPS; } if (port == 0) { this.baseUrl = new HttpUrl.Builder() .scheme(scheme.toString()) .host(endpoint) .build(); } else { this.baseUrl = new HttpUrl.Builder() .scheme(scheme.toString()) .host(endpoint) .port(port) .build(); } this.accessKey = accessKey; this.secretKey = secretKey; }
Source:
<code>private void createToolbarMenu(final MToolBar toolbarModel, Control renderedCtrl) { <START> toolbarMenu = new Menu(renderedCtrl); <END> MenuItem hideItem = new MenuItem(toolbarMenu, SWT.NONE); hideItem.setText(Messages.ToolBarManagerRenderer_MenuCloseText); hideItem.addListener(SWT.Selection, new Listener() { public void handleEvent(org.eclipse.swt.widgets.Event event) { toolbarModel.getTags().add(IPresentationEngine.HIDDEN_BY_USER); } }); new MenuItem(toolbarMenu, SWT.SEPARATOR); MenuItem restoreHiddenItems = new MenuItem(toolbarMenu, SWT.NONE); restoreHiddenItems.setText(Messages.ToolBarManagerRenderer_MenuRestoreText); restoreHiddenItems.addListener(SWT.Selection, new Listener() { public void handleEvent(org.eclipse.swt.widgets.Event event) { removeHiddenByUserTags(); } }); renderedCtrl.setMenu(toolbarMenu); }</code><technical_language>this menu reflect hide show? this menu apply entire MTrimBar</technical_language>

Target:
private void createToolbarMenu(final MToolBar toolbarModel, Control renderedCtrl) { toolbarMenu = new Menu(renderedCtrl); MenuItem hideItem = new MenuItem(toolbarMenu, SWT.NONE); hideItem.setText(Messages.ToolBarManagerRenderer_MenuCloseText); hideItem.addListener(SWT.Selection, new Listener() { public void handleEvent(org.eclipse.swt.widgets.Event event) { toolbarModel.getTags().add(HIDDEN_BY_USER); } }); new MenuItem(toolbarMenu, SWT.SEPARATOR); MenuItem restoreHiddenItems = new MenuItem(toolbarMenu, SWT.NONE); restoreHiddenItems.setText(Messages.ToolBarManagerRenderer_MenuRestoreText); restoreHiddenItems.addListener(SWT.Selection, new Listener() { public void handleEvent(org.eclipse.swt.widgets.Event event) { removeHiddenByUserTags(); } }); renderedCtrl.setMenu(toolbarMenu); }
Source:
<code>protected abstract void bankTransferTest() throws AssertionError, Exception; @Test public void runWithRetries() throws Exception { int maxRetries = 3; for (int i = 0; i < maxRetries; i++) { try { this.bankTransferTest(); break; } catch (AssertionError e) { if (i == maxRetries-1) { throw e; } Thread.sleep(1000); <START> continue; <END> } } }</code><technical_language>this continue do anything</technical_language>

Target:
protected abstract void bankTransferTest() throws AssertionError, Exception; @Test public void runWithRetries() throws Exception { int maxRetries = 3; for (int i = 0; i < maxRetries; i++) { try { this.bankTransferTest(); break; } catch (AssertionError e) { if (i == maxRetries-1) { throw e; } Thread.sleep(1000); } } }
Source:
<code>public ApiFuture<Backup> createBackupAsync(CreateBackupRequest request) { return ApiFutureUtil.transformAndAdapt( delegate.createBackupAsync( request.toProto(instanceName.getProjectId(), instanceName.getInstanceId())), new Function<Operation, Backup>() { @Override public Backup apply(Operation operation) { try { return Backup.fromProto( operation.getResponse().unpack(com.google.bigtable.admin.v2.Backup.class)); } catch (InvalidProtocolBufferException e) { <START> return Backup.fromProto(com.google.bigtable.admin.v2.Backup.getDefaultInstance()); <END> } } }); }</code><technical_language>ping</technical_language>

Target:
public ApiFuture<Backup> createBackupAsync(CreateBackupRequest request) { ListenableFuture<Operation> backupAsync = delegate.createBackupAsync( request.toProto(instanceName.getProjectId(), instanceName.getInstanceId())); Function<Operation, Backup> function = new Function<Operation, Backup>() { @Override public Backup apply(final Operation operation) { try { Future<Operation> operationFuture = batchThreadPool.submit( new Callable<Operation>() { @Override public Operation call() throws Exception { return delegate.waitForOperation(operation); } }); return Backup.fromProto( operationFuture .get() .getResponse() .unpack(com.google.bigtable.admin.v2.Backup.class)); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException("Interrupted while waiting for operation to finish"); } catch (ExecutionException | InvalidProtocolBufferException e) { throw new IllegalStateException(e); } } }; return ApiFutureUtil.transformAndAdapt(backupAsync, function); }
Source:
<code>protected Collection<String> lookupCommitSha1s( @SuppressWarnings("rawtypes") Run run, FilePath workspace, TaskListener listener) { if (commitSha1 != null && commitSha1.trim().length() > 0) { PrintStream logger = listener.getLogger(); try { if (run instanceof AbstractBuild) { return Arrays.asList(TokenMacro.expandAll((AbstractBuild) run, listener, commitSha1)); } else { return Arrays.asList(TokenMacro.expandAll(run, workspace, listener, commitSha1)); } } catch (IOException | InterruptedException | MacroEvaluationException e) { logger.println("Unable to expand commit SHA value"); e.printStackTrace(logger); return Arrays.asList(); } } <START> Collection<String> sha1s = new HashSet<>(); <END> for (BuildData buildData : run.getActions(BuildData.class)) { Revision lastBuiltRevision = buildData.getLastBuiltRevision(); if (lastBuiltRevision == null) { continue; } String lastBuiltSha1 = lastBuiltRevision.getSha1String(); if (!lastBuiltSha1.isEmpty()) { sha1s.add(lastBuiltSha1); } String markedSha1 = buildData.lastBuild.getMarked().getSha1String(); if (!markedSha1.isEmpty()) { sha1s.add(markedSha1); } } return sha1s; }</code><technical_language>Is this bumping java reqs 8</technical_language>

Target:
protected Collection<String> lookupCommitSha1s( @SuppressWarnings("rawtypes") Run run, FilePath workspace, TaskListener listener) { if (commitSha1 != null && commitSha1.trim().length() > 0) { PrintStream logger = listener.getLogger(); try { if (run instanceof AbstractBuild) { return Collections.singletonList(TokenMacro.expandAll((AbstractBuild) run, listener, commitSha1)); } else { return Collections.singletonList(TokenMacro.expandAll(run, workspace, listener, commitSha1)); } } catch (IOException | InterruptedException | MacroEvaluationException e) { logger.println("Unable to expand commit SHA value"); e.printStackTrace(logger); return Collections.emptyList(); } } Collection<String> sha1s = new HashSet<>(); for (BuildData buildData : run.getActions(BuildData.class)) { Revision lastBuiltRevision = buildData.getLastBuiltRevision(); if (lastBuiltRevision == null) { continue; } String lastBuiltSha1 = lastBuiltRevision.getSha1String(); if (!lastBuiltSha1.isEmpty()) { sha1s.add(lastBuiltSha1); } String markedSha1 = buildData.lastBuild.getMarked().getSha1String(); if (!markedSha1.isEmpty()) { sha1s.add(markedSha1); } } return sha1s; }
Source:
<code>void poll(RequestRegistrationCallback<GetOperation> requestRegistrationCallback) { <START> if (!maybeProcessDecryptCallbackAndCompleteOperation()) { <END> cleanupExpiredInFlightRequests(); checkAndMaybeComplete(); if (!isComplete() && !onDecryptMode()) { fetchRequests(requestRegistrationCallback); } } }</code><technical_language>I I prefer this conditional move processDecryptCallback logic checkAndMaybeComplete</technical_language>

Target:
void poll(RequestRegistrationCallback<GetOperation> requestRegistrationCallback) { cleanupExpiredInFlightRequests(); maybeProcessCallbacks(); checkAndMaybeComplete(); if (!isComplete()) { fetchRequests(requestRegistrationCallback); } }
Source:
<code>public void gcDeletedSnapshot(String snapshotRoot, String snapshotName) throws IOException { final String operationName = "gcDeletedSnapshot"; String rootPath = null; final INode.BlocksMapUpdateInfo blocksToBeDeleted; checkOperation(OperationCategory.WRITE); writeLock(); try { checkOperation(OperationCategory.WRITE); rootPath = Snapshot.getSnapshotPath(snapshotRoot, snapshotName); checkNameNodeSafeMode("Cannot gcDeletedSnapshot for " + rootPath); <START> final long now = Time.now(); <END> final INodesInPath iip = dir.resolvePath(null, snapshotRoot, DirOp.WRITE); blocksToBeDeleted = FSDirSnapshotOp.deleteSnapshot( dir, snapshotManager, iip, snapshotName, now); } finally { writeUnlock(operationName, getLockReportInfoSupplier(rootPath)); } removeBlocks(blocksToBeDeleted); }</code><technical_language>Lets assert xattr is set snapshot this is snapshot deleted</technical_language>

Target:
public void gcDeletedSnapshot(String snapshotRoot, String snapshotName) throws IOException { final String operationName = "gcDeletedSnapshot"; String rootPath = null; final INode.BlocksMapUpdateInfo blocksToBeDeleted; checkOperation(OperationCategory.WRITE); writeLock(); try { checkOperation(OperationCategory.WRITE); rootPath = Snapshot.getSnapshotPath(snapshotRoot, snapshotName); checkNameNodeSafeMode("Cannot gcDeletedSnapshot for " + rootPath); final long now = Time.now(); final INodesInPath iip = dir.resolvePath(null, snapshotRoot, DirOp.WRITE); snapshotManager.assertMarkedAsDeleted(iip, snapshotName); blocksToBeDeleted = FSDirSnapshotOp.deleteSnapshot( dir, snapshotManager, iip, snapshotName, now); } finally { writeUnlock(operationName, getLockReportInfoSupplier(rootPath)); } removeBlocks(blocksToBeDeleted); }
Source:
<code>public String getEventString(int index) { if (fData != null) { processData(); } <START> return fColumnData[index].getValue().toString(); <END> }</code><technical_language>add some kind of bounds check here</technical_language>

Target:
public String getEventString(int index) { if (fData != null) { processData(); } if (index < 0 || index >= fColumnData.length) { return ""; } return fColumnData[index].getValue().toString(); }
Source:
<code>public OverthereProcess startProcess(CmdLine cmd) { checkNotNull(cmd, "Cannot execute null command line"); checkArgument(cmd.getArguments().size() > 0, "Cannot execute empty command line"); final String obfuscatedCmd = cmd.toCommandLine(os, true); logger.info("Starting command on [{}]", obfuscatedCmd, this); File wd = null; if (workingDirectory != null) { wd = ((LocalFile) workingDirectory).getFile(); } try { logger.debug("Creating " + os + " process with command line [{}]", obfuscatedCmd); <START> String[] args = cmd.toCommandArray(os, false); <END> if (isWindows(os)) args = getArgsWithWindowsCmd(args); final ProcessBuilder pb = new ProcessBuilder(args); if (wd != null) { logger.debug("Setting working directory to [{}]", wd); pb.directory(wd); } else { logger.debug("Not setting working directory"); } logger.debug("Starting process"); final Process p = pb.start(); return new LocalProcess(p); } catch (IOException exc) { throw new RuntimeIOException(format("Cannot start command [%s] on [%s]", obfuscatedCmd, this), exc); } }</code><technical_language>toCommandArray here, check if, pass CmdLine argument method, return new CmdLine it</technical_language>

Target:
public OverthereProcess startProcess(CmdLine cmd) { checkNotNull(cmd, "Cannot execute null command line"); checkArgument(cmd.getArguments().size() > 0, "Cannot execute empty command line"); final String obfuscatedCmd = cmd.toCommandLine(os, true); logger.info("Starting command on [{}]", obfuscatedCmd, this); File wd = null; if (workingDirectory != null) { wd = ((LocalFile) workingDirectory).getFile(); } try { logger.debug("Creating " + os + " process with command line [{}]", obfuscatedCmd); CmdLine command = isWindows(os) ? getCmdForWindows(cmd) : cmd; final ProcessBuilder pb = new ProcessBuilder(command.toCommandArray(os, false)); if (wd != null) { logger.debug("Setting working directory to [{}]", wd); pb.directory(wd); } else { logger.debug("Not setting working directory"); } logger.debug("Starting process"); final Process p = pb.start(); return new LocalProcess(p); } catch (IOException exc) { throw new RuntimeIOException(format("Cannot start command [%s] on [%s]", obfuscatedCmd, this), exc); } }
Source:
<code>public void switchToCameraWithFlash() { if (hasCurrentCameraFlash()) { return; } <START> if (frontCameraInformation.flashAvailable) { <END> updateCamera(frontCameraInformation); } else if (backCameraInformation.flashAvailable) { updateCamera(backCameraInformation); } }</code><technical_language>for this if-else-construct -> NPE if frontCameraInformation is initialized (because front camera exists)</technical_language>

Target:
public void switchToCameraWithFlash() { if (hasCurrentCameraFlash()) { return; } if (hasFrontCameraFlash()) { updateCamera(frontCameraInformation); } else if (hasBackCameraFlash()) { updateCamera(backCameraInformation); } }
Source:
<code><START> shutdown_test() throws Exception { <END> final int port = 17256; final DummyStatsDServer server = new DummyStatsDServer(port); final AtomicBoolean slow = new AtomicBoolean(true); final NonBlockingStatsDClient client = new NonBlockingStatsDClient("my.prefix.shutdownTest", "localhost", port) { @Override protected StatsDSender createSender(final Callable<SocketAddress> addressLookup, final int queueSize, final StatsDClientErrorHandler handler, final DatagramChannel clientChannel) { return new SlowStatsDSender(addressLookup, new SlowBlockingQueue(slow), handler, clientChannel, slow); } }; try { for (int i = 0; i < 1000; i++) { client.count("mycounter", 5); } client.stop(); assertEquals(1000, server.messagesReceived().size()); } finally { client.stop(); server.close(); } }</code><technical_language>Odd formatting. I public void this line</technical_language>

Target:
public void shutdown_test() throws Exception { final int port = 17256; final DummyStatsDServer server = new DummyStatsDServer(port); final CountDownLatch lock = new CountDownLatch(1); final NonBlockingStatsDClient client = new NonBlockingStatsDClient("my.prefix.shutdownTest", "localhost", port) { @Override protected StatsDSender createSender(final Callable<SocketAddress> addressLookup, final int queueSize, final StatsDClientErrorHandler handler, final DatagramChannel clientChannel) { return new SlowStatsDSender(addressLookup, new SlowBlockingQueue(lock), handler, clientChannel, lock); } }; try { client.count("mycounter", 5); assertEquals(0, server.messagesReceived().size()); client.stop(); assertEquals(1, server.messagesReceived().size()); } finally { client.stop(); server.close(); } }
Source:
<code><START> public boolean getIsPassive() { <END> return this.isPassive; }</code><technical_language>Please add a @since 5.5 tag of methods introduce. Also, consider adding a link in description points authoritative source explaining of values mean</technical_language>

Target:
public Boolean getIsPassive() { return this.isPassive; }
Source:
<code>public static SchedulingPolicyUnit map(PolicyUnit entity, SchedulingPolicyUnit template) { SchedulingPolicyUnit model = template != null ? template : new SchedulingPolicyUnit(); model.setId(entity.getId().toString()); model.setName(entity.getName()); model.setDescription(entity.getDescription()); String policyUnitTypeName = null; switch (entity.getPolicyUnitType()) { case FILTER: <START> policyUnitTypeName = org.ovirt.engine.api.model.PolicyUnitType.FILTER.name().toLowerCase(); <END> break; case WEIGHT: policyUnitTypeName = org.ovirt.engine.api.model.PolicyUnitType.WEIGHT.name().toLowerCase(); break; case LOAD_BALANCING: policyUnitTypeName = org.ovirt.engine.api.model.PolicyUnitType.LOAD_BALANCING.name().toLowerCase(); break; default: assert (false) : "unknown Policy Unit Type value: " + model.toString(); return null; } model.setType(policyUnitTypeName); model.setEnabled(entity.isEnabled()); model.setInternal(entity.isInternal()); if (entity.getParameterRegExMap() != null && !entity.getParameterRegExMap().isEmpty()) { model.setPropertiesMetaData(CustomPropertiesParser.fromMap(entity.getParameterRegExMap())); } return model; }</code><technical_language>right thing, a bit simpler more consistent other mappers in API, please write methods: 1) map API enum Engine enum 2) map Engine enum API enum. mappers full of examples of this, if need a reference. methods written, invoke instead of this code inline</technical_language>

Target:
public static SchedulingPolicyUnit map(PolicyUnit entity, SchedulingPolicyUnit template) { SchedulingPolicyUnit model = template != null ? template : new SchedulingPolicyUnit(); model.setId(entity.getId().toString()); model.setName(entity.getName()); model.setDescription(entity.getDescription()); model.setType(map(entity.getPolicyUnitType(), null).name().toLowerCase()); model.setEnabled(entity.isEnabled()); model.setInternal(entity.isInternal()); if (entity.getParameterRegExMap() != null && !entity.getParameterRegExMap().isEmpty()) { model.setPropertiesMetaData(CustomPropertiesParser.fromMap(entity.getParameterRegExMap())); } return model; }
Source:
<code>protected String fixEntryName(String entryName){ if(entryName.indexOf('\\') > 0) { return entryName.replaceAll("\\\\", CompressedHelper.SEPARATOR); <START> } if(entryName.indexOf(CompressedHelper.SEPARATOR_CHAR) == 0) { <END> return entryName.substring(entryName.lastIndexOf(CompressedHelper.SEPARATOR_CHAR)+1); } else { return entryName; } }</code><technical_language>startsWith()? confusing if positioning, else if</technical_language>

Target:
protected String fixEntryName(String entryName){ if(entryName.indexOf('\\') >= 0) { return fixEntryName(entryName.replaceAll("\\\\", SEPARATOR)); } else if(entryName.indexOf(SEPARATOR_CHAR) == 0) { return entryName.replaceAll("^/+", ""); } else { return entryName; } }
Source:
<code>public void close_stops_started_components() { final DefaultStartable defaultStartable = new DefaultStartable(); final EagerStartable eagerStartable = new EagerStartable(); <START> TaskContainerImpl ceContainer = new TaskContainerImpl(parent, new ContainerPopulator<TaskContainer>() { <END> @Override public void populateContainer(TaskContainer container) { container.add(defaultStartable); container.add(eagerStartable); } }); ceContainer.bootup(); ceContainer.close(); assertThat(defaultStartable.startCalls).isEqualTo(0); assertThat(defaultStartable.stopCalls).isEqualTo(0); assertThat(eagerStartable.startCalls).isEqualTo(1); assertThat(eagerStartable.stopCalls).isEqualTo(1); }</code><technical_language>big deal replaced : java TaskContainerImpl ceContainer = new TaskContainerImpl(parent, container -> { container.add(defaultStartable); container.add(eagerStartable); });</technical_language>

Target:
public void close_stops_started_components() { final DefaultStartable defaultStartable = new DefaultStartable(); final EagerStartable eagerStartable = new EagerStartable(); TaskContainerImpl ceContainer = new TaskContainerImpl(parent, container -> { container.add(defaultStartable); container.add(eagerStartable); }); ceContainer.bootup(); ceContainer.close(); assertThat(defaultStartable.startCalls).isEqualTo(0); assertThat(defaultStartable.stopCalls).isEqualTo(0); assertThat(eagerStartable.startCalls).isEqualTo(1); assertThat(eagerStartable.stopCalls).isEqualTo(1); }
Source:
<code>public void test() throws IOException, InterruptedException { <START> final String version = "3.12-SNAPSHOT"; <END> assertThat(trimSnapshot(jenkins.getPlugin("remoting").getVersion()), is(version)); File jar = tmp.newFile(); FileUtils.copyURLToFile(jenkins.url("jnlpJars/slave.jar"),jar); try (JarFile j = new JarFile(jar)) { Attributes main = j.getManifest().getMainAttributes(); assertThat(main.getValue("Version"),is(version)); } }</code><technical_language>need fix this</technical_language>

Target:
public void test() throws IOException, InterruptedException { final String version = ucmp.get(jenkins).plugins.get("remoting").getVersion(); assertThat(trimSnapshot(jenkins.getPlugin("remoting").getVersion()), is(version)); File jar = tmp.newFile(); FileUtils.copyURLToFile(jenkins.url("jnlpJars/slave.jar"),jar); try (JarFile j = new JarFile(jar)) { Attributes main = j.getManifest().getMainAttributes(); assertThat(main.getValue("Version"),is(version)); } }
Source:
<code>public QueryList findQueryList(Object id) { <START> AccessPointEntity apEntity = datastore.findOne(AccessPointEntity.class, Filter.where("_id").is(id)); <END> if (apEntity == null) { throw new NotFoundException("Unsuccessful retrieving of query list due to missing AP"); } Object operatorId = apEntity.operatorId; OperatorEntity operatorEntity = datastore.findOne(OperatorEntity.class, Filter.where("_id").is(operatorId)); if (operatorEntity == null) { throw new NotFoundException("Unsuccessful retrieving of query list due to missing operator"); } IpType ipType = IpType.valueOf(operatorEntity.ipAddressType); Optional<Integer> response = catalog.get(ipType); List<Integer> values = Lists.newArrayList(response.get()); return new QueryList(values); }</code><technical_language>next time findById method</technical_language>

Target:
public QueryList findQueryList(Object id) { AccessPointEntity apEntity = datastore.findById(AccessPointEntity.class, id); if (apEntity == null) { throw new NotFoundException("Unsuccessful retrieving of query list due to missing AP"); } OperatorEntity operatorEntity = datastore.findById(OperatorEntity.class, apEntity.operatorId); if (operatorEntity == null) { throw new NotFoundException("Unsuccessful retrieving of query list due to missing operator"); } Optional<Integer> response = catalog.findId(operatorEntity.ipType); return new QueryList(response.get()); }
Source:
<code>protected Boolean loadIfNeeded(InvocationContext ctx, Object key, boolean isRetrieval, FlagAffectedCommand cmd) throws Throwable { try { <START> cdl.lock(key); <END> InternalCacheEntry ice = dataContainer.get(key); if (ice != null) { if (cmd instanceof ApplyDeltaCommand) { ctx.putLookedUpEntry(key, ice); entryFactory.wrapEntryForDelta(ctx, key, ((ApplyDeltaCommand) cmd).getDelta()); } else { entryFactory.wrapEntryForPut(ctx, key, ice, false, cmd, false); } return null; } Boolean loaded = super.loadIfNeeded(ctx, key, isRetrieval, cmd); if (loaded == Boolean.TRUE) { if (enabled && isManualEviction) { CacheEntry e = ctx.lookupEntry(key); if (e != null && e.isLoaded()) { cdl.commitEntry(e, null, cmd, ctx); removeFromStoreIfNeeded(key); } } } return loaded; } finally { cdl.unlock(key); } }</code><technical_language>Good catch if 2 threads in 1 activates other check DC</technical_language>

Target:
protected Boolean loadIfNeeded(InvocationContext ctx, Object key, boolean isRetrieval, FlagAffectedCommand cmd) throws Throwable { CacheEntry entry = ctx.lookupEntry(key); if (entry != null && !entry.isNull() && entry.getValue() != null) { return null; } try { while (!cdl.lock(key, false)); InternalCacheEntry ice = dataContainer.get(key); if (ice != null) { if (cmd instanceof ApplyDeltaCommand) { ctx.putLookedUpEntry(key, ice); entryFactory.wrapEntryForDelta(ctx, key, ((ApplyDeltaCommand) cmd).getDelta()); } else { entryFactory.wrapEntryForPut(ctx, key, ice, false, cmd, false); } return null; } Boolean loaded = super.loadIfNeeded(ctx, key, isRetrieval, cmd); if (loaded == Boolean.TRUE) { if (enabled && isManualEviction) { CacheEntry e = ctx.lookupEntry(key); if (e != null && e.isLoaded()) { cdl.commitEntry(e, null, cmd, ctx); removeFromStoreIfNeeded(key); } } } return loaded; } finally { cdl.unlock(key); } }
Source:
<code>private static String toString(Object obj) { if (obj instanceof Class) { return getCanonicalName((Class<?>) obj); } else if (obj instanceof Object[]) { return Arrays.toString((Object[]) obj); } else { return String.valueOf(obj); <START> } <END> }</code><technical_language>This unrelated "fix". please move this a separate PR outlining rationale for change</technical_language>

Target:
private static String toString(Object obj) { if (obj instanceof Class) { return getCanonicalName((Class<?>) obj); } return StringUtils.nullSafeToString(obj); }
Source:
<code>private boolean tryFetchNext() { while ( recordBuffer.isEmpty() ) { if ( done ) { <START> connectionHandler.resultBuffered(); <END> return false; } connection.receiveOne(); } return true; }</code><technical_language>if do connectionHandler.resultBuffered() place done is set true, address failure/ignore cases too</technical_language>

Target:
private boolean tryFetchNext() { while ( recordBuffer.isEmpty() ) { if ( done ) { return false; } receiveOne(); } return true; }
Source:
<code>protected void emitAnchorHref(String href) { <START> if (convertMarkupPageLinks && href.indexOf('.') == -1 && !ABSOLUTE_URL_PATTERN.matcher(href).matches()) { <END> int split = href.indexOf('#'); if (split > 0) { href = href.substring(0, split) + ".html" + href.substring(split); } else if (split == -1) { href += ".html"; } } writer.writeAttribute("href", makeUrlAbsolute(href)); }</code><technical_language>href.indexOf('.') == -1 is a pretty unreliable test for a file extension (folders a dot)</technical_language>

Target:
protected void emitAnchorHref(String href) { String[] names = href.split("/"); String name = names[names.length - 1]; if (convertMarkupPageLinks && name.indexOf('.') == -1 && !ABSOLUTE_URL_PATTERN.matcher(href).matches()) { int split = href.indexOf('#'); if (split > 0) { href = getHtmlFilenameFormat().replace("$1", href.substring(0, split)) + href.substring(split); } else if (split == -1) { href = getHtmlFilenameFormat().replace("$1", href); } } writer.writeAttribute("href", makeUrlAbsolute(href)); }
Source:
<code>public void testStreamingAppend() throws Exception { testStreamingWrite(false, false, false, (p) -> { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(1); StreamTableEnvironment tEnv = HiveTestUtils.createTableEnvWithBlinkPlannerStreamMode(env); tEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog); tEnv.useCatalog(hiveCatalog.getName()); try { tEnv.executeSql( "insert into db1.sink_table select 6,'a','b','2020-05-03','12'") .await(); } catch (Exception e) { <START> throw new TableException("Failed to execute sql", e); <END> } assertBatch("db1.sink_table", Arrays.asList( "1,a,b,2020-05-03,7", "1,a,b,2020-05-03,7", "2,p,q,2020-05-03,8", "2,p,q,2020-05-03,8", "3,x,y,2020-05-03,9", "3,x,y,2020-05-03,9", "4,x,y,2020-05-03,10", "4,x,y,2020-05-03,10", "5,x,y,2020-05-03,11", "5,x,y,2020-05-03,11", "6,a,b,2020-05-03,12")); }); }</code><technical_language>throw AssertionError in tests Assert.fail()</technical_language>

Target:
public void testStreamingAppend() throws Exception { testStreamingWrite(false, false, "parquet", (p) -> { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(1); StreamTableEnvironment tEnv = HiveTestUtils.createTableEnvWithBlinkPlannerStreamMode(env); tEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog); tEnv.useCatalog(hiveCatalog.getName()); try { tEnv.executeSql( "insert into db1.sink_table select 6,'a','b','2020-05-03','12'") .await(); } catch (Exception e) { Assert.fail("Failed to execute sql: " + e.getMessage()); } assertBatch("db1.sink_table", Arrays.asList( "1,a,b,2020-05-03,7", "1,a,b,2020-05-03,7", "2,p,q,2020-05-03,8", "2,p,q,2020-05-03,8", "3,x,y,2020-05-03,9", "3,x,y,2020-05-03,9", "4,x,y,2020-05-03,10", "4,x,y,2020-05-03,10", "5,x,y,2020-05-03,11", "5,x,y,2020-05-03,11", "6,a,b,2020-05-03,12")); }); }
Source:
<code>private List<FeedbackResponseAttributes> getViewableFeedbackResponsesForStudentForQuestion( FeedbackQuestionAttributes question, String studentEmail) { List<FeedbackResponseAttributes> viewableResponses = new ArrayList<FeedbackResponseAttributes>(); if (question.isResponseVisibleTo(FeedbackParticipantType.STUDENTS)) { addNewResponses(viewableResponses, getFeedbackResponsesForQuestion(question.getId())); return viewableResponses; } StudentAttributes student = studentsLogic.getStudentForEmail(question.courseId, studentEmail); if ((question.recipientType.isTeam() || question.recipientType == FeedbackParticipantType.CUSTOM && question.isFeedbackPathsRecipientTypeTeams()) <START> && question.isResponseVisibleTo(FeedbackParticipantType.RECEIVER)) { <END> addNewResponses( viewableResponses, getFeedbackResponsesForReceiverForQuestion( question.getId(), student.team)); } if (question.giverType == FeedbackParticipantType.TEAMS || question.isResponseVisibleTo(FeedbackParticipantType.OWN_TEAM_MEMBERS)) { addNewResponses(viewableResponses, getFeedbackResponsesFromTeamForQuestion( question.getId(), question.courseId, student.team)); } if (question .isResponseVisibleTo(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS)) { addNewResponses( viewableResponses, getFeedbackResponsesForTeamMembersOfStudent( question.getId(), student)); } return viewableResponses; }</code><technical_language>Consider extracting explaining variable for this large condition</technical_language>

Target:
private List<FeedbackResponseAttributes> getViewableFeedbackResponsesForStudentForQuestion( FeedbackQuestionAttributes question, String studentEmail) { List<FeedbackResponseAttributes> viewableResponses = new ArrayList<FeedbackResponseAttributes>(); if (question.isResponseVisibleTo(FeedbackParticipantType.STUDENTS)) { addNewResponses(viewableResponses, getFeedbackResponsesForQuestion(question.getId())); return viewableResponses; } StudentAttributes student = studentsLogic.getStudentForEmail(question.courseId, studentEmail); if (question.isRecipientATeam() && question.isResponseVisibleTo(FeedbackParticipantType.RECEIVER)) { addNewResponses( viewableResponses, getFeedbackResponsesForReceiverForQuestion( question.getId(), student.team)); } if (question.giverType == FeedbackParticipantType.TEAMS || question.isResponseVisibleTo(FeedbackParticipantType.OWN_TEAM_MEMBERS)) { addNewResponses(viewableResponses, getFeedbackResponsesFromTeamForQuestion( question.getId(), question.courseId, student.team)); } if (question .isResponseVisibleTo(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS)) { addNewResponses( viewableResponses, getFeedbackResponsesForTeamMembersOfStudent( question.getId(), student)); } return viewableResponses; }
Source:
<code>public void decorateRequest(ClientRequestContext requestContext, Span span) { String uri = requestContext.getUri().toString(); <START> String saltPath = StringUtils.substringAfterLast(uri, "/saltboot/"); <END> Object entity = requestContext.getEntity(); StringBuilder operationName = new StringBuilder("Salt - ").append(saltPath); if (entity instanceof Pillar) { String resourcePath = ((Pillar) entity).getPath(); operationName.append(" ").append(resourcePath); } span.setOperationName(operationName.toString()); TracingUtil.setTagsFromMdc(span); }</code><technical_language>salt calls /saltapi/run. SaltEndpoint#SALT_RUN this StringUtils.substringAfterLast return empty string</technical_language>

Target:
public void decorateRequest(ClientRequestContext requestContext, Span span) { setOperationName(requestContext, span); setTags(requestContext, span); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { <START> if (ActivityCompat.shouldShowRequestPermissionRationale(this, <END> Manifest.permission.WRITE_EXTERNAL_STORAGE)) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, MY_PERMISSIONS_REQUEST_READ_CONTACTS); } else { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, MY_PERMISSIONS_REQUEST_READ_CONTACTS); } } setTitle(getName()); setContentView(R.layout.player_simple_frame_layout); EMBED = getIntent().getExtras().getString("embed_code"); PCODE = getIntent().getExtras().getString("pcode"); DOMAIN = getIntent().getExtras().getString("domain"); OoyalaPlayerLayout playerLayout = (OoyalaPlayerLayout) findViewById(R.id.ooyalaPlayer); Options options = new Options.Builder().setUseExoPlayer(true).build(); player = new OoyalaPlayer(PCODE, new PlayerDomain(DOMAIN), options); playerLayoutController = new OptimizedOoyalaPlayerLayoutController(playerLayout, player); player.addObserver(this); @SuppressWarnings("unused") OoyalaFreewheelManager fwManager = new OoyalaFreewheelManager(this, playerLayoutController); if (player.setEmbedCode(EMBED)) { } }</code><technical_language>This is a sample app, need this method. this is user denied permission previously decide show a UI explain need for</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.player_simple_frame_layout); completePlayerSetup(asked); }
Source:
<code><START> private List<ColumnChunkMetaData> getColumnsInOrder(BlockMetaData rowGroup, boolean dropColumns) { <END> return getColumnsInOrder(rowGroup, schema, dropColumns).stream() .map(Entry::getValue) .collect(Collectors.toList()); }</code><technical_language>Converting Entry List add some cost, comparing original implementation. List<ColumnChunkMetaData> in line of 922 for original wrap List<Entry<ColumnDescriptor, ColumnChunkMetaData>> for new methods use</technical_language>

Target:
private List<ColumnChunkMetaData> getColumnsInOrder(BlockMetaData rowGroup, boolean dropColumns) { return getColumnsInOrder(rowGroup, schema, dropColumns); }
Source:
<code>public Asset updateAssetInventory(String capitalAssetNumber, String conditionCode, String buildingCode, String roomNumber) { Asset asset = businessObjectService.findBySinglePrimaryKey(Asset.class, capitalAssetNumber); <START> asset.setConditionCode(conditionCode); <END> asset.setBuildingCode(buildingCode); asset.setBuildingRoomNumber(roomNumber); Timestamp currentTimestamp = new Timestamp(System.currentTimeMillis()); asset.setLastInventoryDate(currentTimestamp); asset.setLastUpdatedTimestamp(currentTimestamp); businessObjectService.save(asset); return asset; }</code><technical_language>a check asset is non-null modifying it</technical_language>

Target:
public Asset updateAssetInventory(String capitalAssetNumber, String conditionCode, String buildingCode, String roomNumber) { Asset asset = businessObjectService.findBySinglePrimaryKey(Asset.class, capitalAssetNumber); if (ObjectUtils.isNull(asset)) { return null; } asset.setConditionCode(conditionCode); asset.setBuildingCode(buildingCode); asset.setBuildingRoomNumber(roomNumber); Timestamp currentTimestamp = dateTimeService.getCurrentTimestamp(); asset.setLastInventoryDate(currentTimestamp); asset.setLastUpdatedTimestamp(currentTimestamp); return businessObjectService.save(asset); }
Source:
<code>public boolean canEndTask(NuxeoPrincipal principal, Task task) { <START> if (task != null) { <END> return principal.isAdministrator() || principal.getName().equals(task.getInitiator()) || isTaskAssignedToUser(task, principal, true); } return false; }</code><technical_language>changing behavior of a public API, call isTaskActive checking user assignation</technical_language>

Target:
public boolean canEndTask(NuxeoPrincipal principal, Task task) { return isTaskActive(task) && checkPermissions(principal, task); }
Source:
<code>public @NonNull String getHelpText() { <START> return "End time of the segment"; END> }</code><technical_language>Externalize</technical_language>

Target:
public @NonNull String getHelpText() { return Messages.getString("SegmentEndTimeAspect.endDescription"); }
Source:
<code>protected Page computeNext() { while (!pageBuilder.isFull()) { PagePositionIterator iterator = queue.poll(); if (iterator == null) { break; } iterator.appendNextTo(pageBuilder); if (iterator.hasNext()) { queue.add(iterator); } } if (pageBuilder.isEmpty()) { return endOfData(); <START> } <END> Page page = pageBuilder.build(); pageBuilder.reset(); return page; }</code><technical_language>compositions of iterators, e.g: Iterator<Page> -> Iterator<PageWithPosition> -> merge -> Iterator<PageWithPosition> -> build page -> Iterator<Page></technical_language>

Target:
protected Page computeNext() { while (!pageBuilder.isFull() && pagePositions.hasNext()) { pagePositions.next().appendTo(pageBuilder); } if (pageBuilder.isEmpty()) { return endOfData(); } Page page = pageBuilder.build(); pageBuilder.reset(); return page; }