auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private synchronized boolean onTransactions(List<Transaction> txs) { if (txs.isEmpty()) return false; long[] gasPrices = new long[txs.size()]; for (int i = 0; i < txs.size(); ++i) { gasPrices[i] = ByteUtil.byteArrayToLong(txs.get(i).getGasPrice()); } <START> while (blockGasPrices.size() >= getMinBlocks() && <END> (calcGasPricesSize() - blockGasPrices.get(0).length + gasPrices.length) >= getMinTransactions()) { blockGasPrices.remove(blockGasPrices.get(0)); } blockGasPrices.add(gasPrices); return true; }</code><technical_language>If gasPrices added loop rid of extra + gasPrices.length argument in loop condition. this work if intrusive CircularFifoQueue replaced</technical_language>

Target:
private synchronized boolean onTransactions(List<Transaction> txs) { if (txs.isEmpty()) return false; long[] gasPrices = new long[txs.size()]; for (int i = 0; i < txs.size(); ++i) { gasPrices[i] = ByteUtil.byteArrayToLong(txs.get(i).getGasPrice()); } blockGasPrices.add(gasPrices); while (blockGasPrices.size() > getMinBlocks() && (calcGasPricesSize() - blockGasPrices.getFirst().length) >= getMinTransactions()) { blockGasPrices.removeFirst(); } return true; }
Source:
<code>public HttpEntity<PassThroughHeadersResource> getPassThroughHeaders() { Require.that(yonaProperties.isTestServer(), <START> () -> InvalidDataException.onlyAllowedOnTestServers("Endpoint /passThrougHeaders is not available")); <END> passBarrier(); PassThroughHeadersDto passThroughHeaders = PassThroughHeadersDto.createInstance(headersHolder.export()); return createOkResponse(passThroughHeaders, createPassThroughHeadersResourceAssembler()); }</code><technical_language>passTrougHeaders -> passThroughHeaders</technical_language>

Target:
public HttpEntity<PassThroughHeadersResource> getPassThroughHeaders() { Require.that(yonaProperties.isTestServer(), () -> InvalidDataException.onlyAllowedOnTestServers("Endpoint /passThroughHeaders is not available")); passBarrier(); PassThroughHeadersDto passThroughHeaders = PassThroughHeadersDto.createInstance(headersHolder.export()); return createOkResponse(passThroughHeaders, createPassThroughHeadersResourceAssembler()); }
Source:
<code>AbstractInternalQueryCache(String cacheId, String cacheName, QueryCacheConfig queryCacheConfig, IMap delegate, QueryCacheContext context) { this.cacheId = cacheId; this.cacheName = cacheName; this.queryCacheConfig = queryCacheConfig; this.mapName = delegate.getName(); this.delegate = delegate; this.context = context; this.serializationService = context.getSerializationService(); this.indexes = Indexes.newBuilder(serializationService, COPY_ON_READ).build(); this.includeValue = isIncludeValue(); this.partitioningStrategy = getPartitioningStrategy(); this.extractors = Extractors.newBuilder(serializationService).build(); this.recordStore = new DefaultQueryCacheRecordStore(serializationService, indexes, queryCacheConfig, getEvictionListener(), extractors); <START> StoreAdapter recordStoreAdapter = indexes.isGlobal() ? null : new QueryCacheRecordStoreAdapter(recordStore); <END> for (MapIndexConfig indexConfig : queryCacheConfig.getIndexConfigs()) { indexes.addOrGetIndex(indexConfig.getAttribute(), indexConfig.isOrdered(), recordStoreAdapter); } }</code><technical_language>Currently, query cache indexes on-heap (global), a good idea replace assert, remove QueryCacheRecordStoreAdapter complexity a bit</technical_language>

Target:
AbstractInternalQueryCache(String cacheId, String cacheName, QueryCacheConfig queryCacheConfig, IMap delegate, QueryCacheContext context) { this.cacheId = cacheId; this.cacheName = cacheName; this.queryCacheConfig = queryCacheConfig; this.mapName = delegate.getName(); this.delegate = delegate; this.context = context; this.serializationService = context.getSerializationService(); this.indexes = Indexes.newBuilder(serializationService, COPY_ON_READ).build(); this.includeValue = isIncludeValue(); this.partitioningStrategy = getPartitioningStrategy(); this.extractors = Extractors.newBuilder(serializationService).build(); this.recordStore = new DefaultQueryCacheRecordStore(serializationService, indexes, queryCacheConfig, getEvictionListener(), extractors); assert indexes.isGlobal(); for (MapIndexConfig indexConfig : queryCacheConfig.getIndexConfigs()) { indexes.addOrGetIndex(indexConfig.getAttribute(), indexConfig.isOrdered(), null); } }
Source:
<code>protected void childCommandsExecutionEnded(CommandBase<?> command, boolean anyFailed, List<Guid> childCmdIds, CommandExecutionStatus status, int completedChildren) { Guid cmdId = command.getCommandId(); if (status == CommandExecutionStatus.EXECUTED) { SerialChildExecutingCommand serialChildExecutingCommand = (SerialChildExecutingCommand) command; if (!anyFailed || serialChildExecutingCommand.ignoreChildCommandFailure()) { try { boolean endCommand = !serialChildExecutingCommand.performNextOperation(completedChildren); if (!endCommand) { return; } } catch (Exception e) { log.error("Command '{}' id: '{}' children failed when attempting to perform the next operation, marking as <START> FAILED '{}'", <END> command.getActionType(), cmdId, childCmdIds, command.getCommandStatus()); log.error(e.getMessage(), e); serialChildExecutingCommand.handleFailure(); anyFailed = true; } } else { serialChildExecutingCommand.handleFailure(); } } else { log.info("Command '{}' id: '{}' execution didn't complete, not proceeding to perform the next operation", command.getActionType(), cmdId); } setCommandEndStatus(command, anyFailed, status, childCmdIds); }</code><technical_language>pass status in arguments. remove hard-coded FAILED here</technical_language>

Target:
protected void childCommandsExecutionEnded(CommandBase<?> command, boolean anyFailed, List<Guid> childCmdIds, CommandExecutionStatus status, int completedChildren) { Guid cmdId = command.getCommandId(); if (status == CommandExecutionStatus.EXECUTED) { SerialChildExecutingCommand serialChildExecutingCommand = (SerialChildExecutingCommand) command; if (!anyFailed || serialChildExecutingCommand.ignoreChildCommandFailure()) { try { boolean endCommand = !serialChildExecutingCommand.performNextOperation(completedChildren); if (!endCommand) { return; } } catch (Exception e) { log.error("Command '{}' id: '{}' with children failed when attempting to perform the next operation, marking as '{}'", command.getActionType(), cmdId, childCmdIds, command.getCommandStatus()); log.error(e.getMessage(), e); serialChildExecutingCommand.handleFailure(); anyFailed = true; } } else { serialChildExecutingCommand.handleFailure(); } } else { log.info("Command '{}' id: '{}' execution didn't complete, not proceeding to perform the next operation", command.getActionType(), cmdId); } setCommandEndStatus(command, anyFailed, status, childCmdIds); }
Source:
<code>public SomeValuesFromVisitor(RdfCloudTripleStoreConfiguration conf, InferenceEngine inferenceEngine) { super(conf, inferenceEngine); <START> include = true; <END> }</code><technical_language>A config for SomeValuesFrom inferencing added RdfCloudTripleStoreConfiguration</technical_language>

Target:
public SomeValuesFromVisitor(RdfCloudTripleStoreConfiguration conf, InferenceEngine inferenceEngine) { super(conf, inferenceEngine); include = conf.isInferSomeValuesFrom(); }
Source:
<code>public GetUsersResult(final SpectraUser user) { this.SpectraUserListResult = new SpectraUserList(); <START> List<SpectraUser> listOfOne = new ArrayList<SpectraUser>(); <END> listOfOne.add(user); this.SpectraUserListResult.setSpectraUsers(listOfOne); }</code><technical_language>Missing final</technical_language>

Target:
public GetUsersResult(final SpectraUser user) { this.spectraUserListResult = new SpectraUserList(); final ImmutableList<SpectraUser> listOfOne = ImmutableList.of(user); this.spectraUserListResult.setSpectraUsers(listOfOne); }
Source:
<code>public Mapper process(ProcessorContext context, TypeElement mapperTypeElement, Mapper mapper) { this.typeFactory = context.getTypeFactory(); String componentModel = MapperConfiguration.getInstanceOn( mapperTypeElement ).componentModel(); String effectiveComponentModel = OptionsHelper.getEffectiveComponentModel( context.getOptions(), componentModel ); if ( !getComponentModelIdentifier().equalsIgnoreCase( effectiveComponentModel ) ) { return mapper; } <START> mapper.removeDecorator(); <END> mapper.addAnnotation( getTypeAnnotation() ); ListIterator<MapperReference> iterator = mapper.getReferencedMappers().listIterator(); while ( iterator.hasNext() ) { MapperReference reference = iterator.next(); iterator.remove(); iterator.add( replacementMapperReference( reference ) ); } return mapper; }</code><technical_language>this done in CDI JSR 330 implementations</technical_language>

Target:
public Mapper process(ProcessorContext context, TypeElement mapperTypeElement, Mapper mapper) { this.typeFactory = context.getTypeFactory(); String componentModel = MapperConfiguration.getInstanceOn( mapperTypeElement ).componentModel(); String effectiveComponentModel = OptionsHelper.getEffectiveComponentModel( context.getOptions(), componentModel ); if ( !getComponentModelIdentifier().equalsIgnoreCase( effectiveComponentModel ) ) { return mapper; } if ( shouldDecoratorBeRemoved() ) { mapper.removeDecorator(); } mapper.addAnnotation( getTypeAnnotation() ); ListIterator<MapperReference> iterator = mapper.getReferencedMappers().listIterator(); while ( iterator.hasNext() ) { MapperReference reference = iterator.next(); iterator.remove(); iterator.add( replacementMapperReference( reference ) ); } return mapper; }
Source:
<code>public SweepableCells(KeyValueService kvs, WriteInfoPartitioner partitioner) { super(kvs, TargetedSweepTableFactory.of().getSweepableCellsTable(null).getTableRef(), partitioner); <START> commitTsLoader = CommitTsLoader.create(TransactionServices.createTransactionService(kvs), new TLongHashSet()); <END> }</code><technical_language>nit: prefer this.commitTsLoader here, for a nit, a minor stylistic thing</technical_language>

Target:
public SweepableCells(KeyValueService kvs, WriteInfoPartitioner partitioner) { super(kvs, TargetedSweepTableFactory.of().getSweepableCellsTable(null).getTableRef(), partitioner); this.commitTsLoader = CommitTsLoader .create(TransactionServices.createTransactionService(kvs), new TLongHashSet()); }
Source:
<code>protected void executeVmCommand() { AddCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); boolean succeeded = false; try { getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(oldIface); getVmNetworkInterfaceDao().update(getInterface()); if (macAddressChanged) { MacPoolManager.getInstance().freeMac(oldIface.getMacAddress()); } getCompensationContext().stateChanged(); return null; } }); succeeded = updateHost(); } finally { setSucceeded(succeeded); <START> if (!succeeded && macAddressChanged) { <END> MacPoolManager.getInstance().addMac(oldIface.getMacAddress()); MacPoolManager.getInstance().freeMac(getInterface()); } } }</code><technical_language>is a potential race here: free mac line 102 other Vnic do updateHost() is a long operation period freed mac address is pool i releasing mac addresses done end</technical_language>

Target:
protected void executeVmCommand() { AddCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (macShouldBeChanged) { macAddedToPool = addMacToPool(getMacAddress()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(oldIface); getVmNetworkInterfaceDao().update(getInterface()); getCompensationContext().stateChanged(); return null; } }); succeeded = updateHost(); } finally { setSucceeded(succeeded); if (macAddedToPool) { if (succeeded) { MacPoolManager.getInstance().freeMac(oldIface.getMacAddress()); } else { MacPoolManager.getInstance().freeMac(getInterface().getMacAddress()); } } } }
Source:
<code>public Node visit(final Term term) { if (term.isGenerated()) { <START> return null; <END> } ComparableCharSequence token = term.getValue(); matchSeq.addLast(token); ComparableCharSequence seqForMatching = new CompoundCharSequence(TOKEN_SEPARATOR, matchSeq); State<List<ComparableCharSequence>> match = replaceRules.get( ignoreCase ? new LowerCaseCharSequence(seqForMatching) : seqForMatching).getStateForCompleteSequence(); if (!match.isKnown) { if (priorMatch.isFinal()) { hasReplacement = true; querySeq.addAll(priorMatch.value); matchSeq.clear(); } else { matchSeq.removeLast(); if (!matchSeq.isEmpty()) { querySeq.addAll(matchSeq); matchSeq.clear(); } } priorMatch = replaceRules.get(token).getStateForCompleteSequence(); if (priorMatch.isKnown) { matchSeq.addLast(token); } else { querySeq.addLast(token); } } else { priorMatch = match; } return null; }</code><technical_language>Arguably, want replace generated terms (could a configuration setting) -> nice</technical_language>

Target:
public Node visit(final Term term) { if (term.isGenerated()) { return null; } ComparableCharSequence token = term.getValue(); matchSeq.addLast(token); ComparableCharSequence seqForMatching = new CompoundCharSequence(TOKEN_SEPARATOR, matchSeq); State<List<CharSequence>> match = replaceRules.get( ignoreCase ? new LowerCaseCharSequence(seqForMatching) : seqForMatching).getStateForCompleteSequence(); if (!match.isKnown) { if (priorMatch.isFinal()) { hasReplacement = true; querySeq.addAll(priorMatch.value); matchSeq.clear(); } else { matchSeq.removeLast(); if (!matchSeq.isEmpty()) { querySeq.addAll(matchSeq); matchSeq.clear(); } } priorMatch = replaceRules.get(token).getStateForCompleteSequence(); if (priorMatch.isKnown) { matchSeq.addLast(token); } else { querySeq.addLast(token); } } else { priorMatch = match; } return null; }
Source:
<code><START> public void setClassLoader(ClassLoader externalCL) { <END> externalClassLoader = externalCL; forceExternalClassLoader = false; classLoaderChanged(); }</code><technical_language>Try avoid white space changes, easier review. apply a uniform code style a stage</technical_language>

Target:
public void setClassLoader(ClassLoader externalCL) { externalClassLoader = externalCL; classLoaderChanged(); }
Source:
<code>private RestTemplate createRestTemplate(String login, String password, String hostname, HttpClientBuilder builder, int port, String protocol) { final HttpClient client = createHttpClient(login, password, hostname, port, protocol, builder); final UriPrefixingClientHttpRequestFactory factory = new UriPrefixingClientHttpRequestFactory( new HttpComponentsClientHttpRequestFactory(client), hostname, port, protocol); final RestTemplate restTemplate = new RestTemplate(factory); restTemplate.setInterceptors(Arrays.<ClientHttpRequestInterceptor>asList( new HeaderSettingRequestInterceptor(singletonMap("Accept", getAcceptHeaderValue())))); final List<HttpMessageConverter<?>> partConverters = new ArrayList<>(); partConverters.add(new ByteArrayHttpMessageConverter()); final StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter(); stringHttpMessageConverter.setWriteAcceptCharset(false); partConverters.add(stringHttpMessageConverter); partConverters.add(new ResourceHttpMessageConverter()); <START> partConverters.add(new MappingJackson2HttpMessageConverter()); <END> final FormHttpMessageConverter formHttpMessageConverter = new FormHttpMessageConverter(); formHttpMessageConverter.setPartConverters(partConverters); final List<HttpMessageConverter<?>> messageConverters = new ArrayList<>(); messageConverters.add(new ByteArrayHttpMessageConverter()); messageConverters.add(new StringHttpMessageConverter()); messageConverters.add(new ResourceHttpMessageConverter()); messageConverters.add(formHttpMessageConverter); messageConverters.add(new MappingJackson2HttpMessageConverter()); restTemplate.setMessageConverters(messageConverters); restTemplate.setErrorHandler(new ResponseErrorHandler(messageConverters)); return restTemplate; }</code><technical_language>jackson2 throw message converters defaults</technical_language>

Target:
private RestTemplate createRestTemplate(String login, String password, String hostname, HttpClientBuilder builder, int port, String protocol) { final HttpClient client = createHttpClient(login, password, hostname, port, protocol, builder); final UriPrefixingClientHttpRequestFactory factory = new UriPrefixingClientHttpRequestFactory( new HttpComponentsClientHttpRequestFactory(client), hostname, port, protocol); final RestTemplate restTemplate = new RestTemplate(factory); restTemplate.setInterceptors(Arrays.<ClientHttpRequestInterceptor>asList( new HeaderSettingRequestInterceptor(singletonMap("Accept", getAcceptHeaderValue())))); restTemplate.setErrorHandler(new ResponseErrorHandler(restTemplate.getMessageConverters())); return restTemplate; }
Source:
<code>public void testMappingWithEmptyList() { final String deviceIdentification = "nr1"; final GprsOperationModeType gprsOperationModeType = GprsOperationModeType.ALWAYS_ON; final ConfigurationFlags configurationFlags = new ConfigurationFlagsBuilder().withEmptyList().build(); final ConfigurationObject configurationObject = new ConfigurationObject(gprsOperationModeType, configurationFlags); final SetConfigurationObjectRequestData setConfigurationObjectRequestData = new SetConfigurationObjectRequestData( configurationObject); final SetConfigurationObjectRequest setConfigurationObjectRequest = new SetConfigurationObjectRequest( deviceIdentification, setConfigurationObjectRequestData); final SetConfigurationObjectRequestDto setConfigurationObjectRequestDto = this.configurationMapper.map( setConfigurationObjectRequest, SetConfigurationObjectRequestDto.class); assertNotNull(setConfigurationObjectRequestDto); assertEquals(deviceIdentification, setConfigurationObjectRequestDto.getDeviceIdentification()); final ConfigurationObjectDto configurationObjectDto = setConfigurationObjectRequestDto .getSetConfigurationObjectRequestData().getConfigurationObject(); assertNotNull(configurationObjectDto); <START> assertEquals(configurationFlags.getConfigurationFlag().isEmpty(), configurationObjectDto <END> .getConfigurationFlags().getConfigurationFlag().isEmpty()); }</code><technical_language>if a non-empty list, assertion is true replace assertTrue(configurationObjectDto.getConfigurationFlags().getConfigurationFlag().isEmpty())</technical_language>

Target:
public void testMappingWithEmptyList() { final String deviceIdentification = "nr1"; final GprsOperationModeType gprsOperationModeType = GprsOperationModeType.ALWAYS_ON; final ConfigurationFlags configurationFlags = new ConfigurationFlags(new ArrayList<ConfigurationFlag>()); final ConfigurationObject configurationObject = new ConfigurationObject(gprsOperationModeType, configurationFlags); final SetConfigurationObjectRequestData setConfigurationObjectRequestData = new SetConfigurationObjectRequestData( configurationObject); final SetConfigurationObjectRequest setConfigurationObjectRequest = new SetConfigurationObjectRequest( deviceIdentification, setConfigurationObjectRequestData); final SetConfigurationObjectRequestDto setConfigurationObjectRequestDto = this.configurationMapper.map( setConfigurationObjectRequest, SetConfigurationObjectRequestDto.class); assertNotNull(setConfigurationObjectRequestDto); assertEquals(deviceIdentification, setConfigurationObjectRequestDto.getDeviceIdentification()); final ConfigurationObjectDto configurationObjectDto = setConfigurationObjectRequestDto .getSetConfigurationObjectRequestData().getConfigurationObject(); assertNotNull(configurationObjectDto); assertTrue(configurationObjectDto.getConfigurationFlags().getConfigurationFlag().isEmpty()); }
Source:
<code>public synchronized void startRecordingCounters() { requireNotDisposed(); if (_monitorThread != null && _monitorThread.isAlive()) { _logger.info("Request to start system monitoring aborted as it is already running."); } else { _logger.info("Starting system monitor thread."); _checkAlertExistence(true); _monitorThread = new MonitorThread("system-monitor"); _monitorThread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { @Override public void uncaughtException(Thread t, Throwable e) { _logger.error("Uncaught exception occurred while pushing monitor counters for {}. Reason: {}", HOSTNAME, e.getMessage()); t.interrupt(); } }); _monitorThread.start(); _logger.info("System monitor thread started."); if (Boolean.valueOf(_sysConfig.getValue(com.salesforce.dva.argus.system.SystemConfiguration.Property.DATA_LAG_MONITOR_ENABLED))) { _dataLagMonitorThread = new DataLagMonitor(_sysConfig, _metricService, _mailService); <START> _dataLagMonitorThread.start(); <END> } } }</code><technical_language>Do plan stop data lag monitor thread started ? similar monitor thread stopRecordingCounters</technical_language>

Target:
public synchronized void startRecordingCounters() { requireNotDisposed(); if (_monitorThread != null && _monitorThread.isAlive()) { _logger.info("Request to start system monitoring aborted as it is already running."); } else { _logger.info("Starting system monitor thread."); _checkAlertExistence(true); _monitorThread = new MonitorThread("system-monitor"); _monitorThread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { @Override public void uncaughtException(Thread t, Throwable e) { _logger.error("Uncaught exception occurred while pushing monitor counters for {}. Reason: {}", HOSTNAME, e.getMessage()); t.interrupt(); } }); _monitorThread.start(); _logger.info("System monitor thread started."); if (Boolean.valueOf(_sysConfig.getValue(com.salesforce.dva.argus.system.SystemConfiguration.Property.DATA_LAG_MONITOR_ENABLED))) { _logger.info("Starting data lag monitor thread."); _dataLagMonitorThread = new DataLagMonitor(_sysConfig, _metricService, _mailService); _dataLagMonitorThread.start(); _logger.info("Data lag monitor thread started."); } } }
Source:
<code>public boolean validate() { getGeoRepSession().validateSelectedItem(new IValidation[] { new NotEmptyValidation() }); getFrequency().validateSelectedItem(new IValidation[] { new NotEmptyValidation() }); getHour().validateSelectedItem( new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, <START> 24) } <END> ); getMins().validateSelectedItem( new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, 60) } ); boolean ret = getGeoRepSession().getIsValid() && getFrequency().getIsValid(); if (!getFrequency().getSelectedItem().equals(Frequency.NONE)) { return ret && getHour().getIsValid() && getMins().getIsValid(); } return ret; }</code><technical_language>extract constant</technical_language>

Target:
public boolean validate() { getGeoRepSession().validateSelectedItem(new IValidation[] { new NotEmptyValidation() }); getFrequency().validateSelectedItem(new IValidation[] { new NotEmptyValidation() }); getHour().validateSelectedItem( new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, MAX_HOUR) } ); getMins().validateSelectedItem( new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, MAX_MINUTE) } ); boolean ret = getGeoRepSession().getIsValid() && getFrequency().getIsValid(); if (!getFrequency().getSelectedItem().equals(Frequency.NONE)) { return ret && getHour().getIsValid() && getMins().getIsValid(); } return ret; }
Source:
<code>public void shiftingInstanceSerialization() throws ClassNotFoundException { Serializer<Serializable> s = new CompactJavaSerializer(null); System.out.println(Arrays.toString(Foo_W.class.getDeclaredClasses())); <START> System.out.println(Foo_W.c.getClass().getEnclosingClass()); <END> ClassLoader wLoader = createClassNameRewritingLoader(Foo_W.class); ClassLoader rLoader = createClassNameRewritingLoader(Foo_R.class); Class<?> wClass = wLoader.loadClass(newClassName(Foo_W.class)); Class<?> rClass = rLoader.loadClass(newClassName(Foo_R.class)); Object[] wInstances = wClass.getEnumConstants(); Object[] rInstances = rClass.getEnumConstants(); pushTccl(rLoader); try { for (int i = 0; i < wInstances.length; i++) { Assert.assertThat(s.read(s.serialize((Serializable) wInstances[i])), IsSame.sameInstance(rInstances[i])); } } finally { popTccl(); } }</code><technical_language>sysouts??</technical_language>

Target:
public void shiftingInstanceSerialization() throws ClassNotFoundException { Serializer<Serializable> s = new CompactJavaSerializer(null); ClassLoader wLoader = createClassNameRewritingLoader(Foo_W.class); ClassLoader rLoader = createClassNameRewritingLoader(Foo_R.class); Class<?> wClass = wLoader.loadClass(newClassName(Foo_W.class)); Class<?> rClass = rLoader.loadClass(newClassName(Foo_R.class)); Object[] wInstances = wClass.getEnumConstants(); Object[] rInstances = rClass.getEnumConstants(); pushTccl(rLoader); try { for (int i = 0; i < wInstances.length; i++) { Assert.assertThat(s.read(s.serialize((Serializable) wInstances[i])), IsSame.sameInstance(rInstances[i])); } } finally { popTccl(); } }
Source:
<code>public int decompress(byte[] b, int off, int len) throws IOException { <START> ByteBuffer encodedBuffer = ByteBuffer.allocate(len - off); <END> while (partialOutputByteBuffer != null && partialOutputByteBuffer.hasRemaining() && encodedBuffer.hasRemaining()) { encodedBuffer.put(partialOutputByteBuffer.get()); } encodeCharBufferIntoByteBuffer(encodedBuffer); if (decodedCharBuffer.remaining() > 0 && encodedBuffer.remaining() > 0) { encodePartialCharacter(encodedBuffer); } encodedBuffer.flip(); encodedBuffer.get(b, off, Math.min(encodedBuffer.remaining(), len)); return encodedBuffer.position(); }</code><technical_language>do ByteBuffer.wrap(b, off, len) save more copy</technical_language>

Target:
public int decompress(byte[] b, int off, int len) throws IOException { ByteBuffer encodedBuffer = ByteBuffer.wrap(b, off, len); while (partialOutputByteBuffer != null && partialOutputByteBuffer.hasRemaining() && encodedBuffer.hasRemaining()) { encodedBuffer.put(partialOutputByteBuffer.get()); } encodeCharBufferIntoByteBuffer(encodedBuffer); if (decodedCharBuffer.remaining() > 0 && encodedBuffer.remaining() > 0 && encodedBuffer.position() - off == 0) { encodePartialCharIntoByteBuffer(encodedBuffer); } return encodedBuffer.position() - off; }
Source:
<code>private void checkDoesNotReinit(ClientConfiguration ccfg) { ReliableChannel rc = new ReliableChannel(chFactory, ccfg, null); rc.initConnection(); List<ReliableChannel.ClientChannelHolder> originalChannels = rc.getChannelHolders(); rc.initChannelHolders(true); List<ReliableChannel.ClientChannelHolder> newChannels = rc.getChannelHolders(); assertSame(originalChannels, newChannels); <START> IntStream.range(0, 3).forEach(i -> { <END> assertSame(originalChannels.get(i), newChannels.get(i)); assertFalse(originalChannels.get(i).isClosed()); }); assertEquals(3, newChannels.size()); }</code><technical_language>IMO more readable for loop</technical_language>

Target:
private void checkDoesNotReinit(ClientConfiguration ccfg) { ReliableChannel rc = new ReliableChannel(chFactory, ccfg, null); rc.channelsInit(); List<ReliableChannel.ClientChannelHolder> originalChannels = rc.getChannelHolders(); List<ReliableChannel.ClientChannelHolder> copyOriginalChannels = new ArrayList<>(originalChannels); rc.initChannelHolders(); List<ReliableChannel.ClientChannelHolder> newChannels = rc.getChannelHolders(); assertSame(originalChannels, newChannels); for (int i = 0; i < 3; ++i) { assertSame(copyOriginalChannels.get(i), newChannels.get(i)); assertFalse(copyOriginalChannels.get(i).isClosed()); } assertEquals(3, newChannels.size()); }
Source:
<code>private void configureManagementNetwork(HostSetupNetworksParameters parameters) { ActionReturnValue retVal = getBackend().runInternalAction(ActionType.HostSetupNetworks, parameters, cloneContextAndDetachFromParent()); boolean skipCommit = parameters.isCommitOnSuccess() && isSkipCommitNetworkChangesSupported(host); if (retVal.getSucceeded() && !skipCommit) { retVal = getBackend().runInternalAction(ActionType.CommitNetworkChanges, new VdsActionParameters(parameters.getVdsId()), cloneContextAndDetachFromParent()); if (!retVal.getSucceeded()) { auditLogDirector.log(createEvent(), AuditLogType.PERSIST_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK); throw new NetworkConfiguratorException(MANAGEMENT_NETWORK_CONFIG_ERR); } } else { auditLogDirector.log(createEvent(), AuditLogType.SETUP_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK_CONFIGURATION); <START> throw new NetworkConfiguratorException(MANAGEMENT_NETWORK_CONFIG_ERR); <END> } }</code><technical_language>NetworkConfiguratorException is thrown, if skipCommit is true</technical_language>

Target:
private void configureManagementNetwork(HostSetupNetworksParameters parameters) { ActionReturnValue retVal = getBackend().runInternalAction(ActionType.HostSetupNetworks, parameters, cloneContextAndDetachFromParent()); boolean skipCommit = parameters.isCommitOnSuccess() && isSkipCommitNetworkChangesSupported(host); if (retVal.getSucceeded() && !skipCommit) { retVal = getBackend().runInternalAction(ActionType.CommitNetworkChanges, new VdsActionParameters(parameters.getVdsId()), cloneContextAndDetachFromParent()); if (!retVal.getSucceeded()) { auditLogDirector.log(createEvent(), AuditLogType.PERSIST_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK); throw new NetworkConfiguratorException(MANAGEMENT_NETWORK_CONFIG_ERR); } } else if (!retVal.getSucceeded()) { auditLogDirector.log(createEvent(), AuditLogType.SETUP_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK_CONFIGURATION); throw new NetworkConfiguratorException(MANAGEMENT_NETWORK_CONFIG_ERR); } }
Source:
<code>public void test_startActionSingleSyncWithIUnderstandShouldStartService() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity.getApplicationContext()); <START> prefs.edit().putBoolean("i_understand", true).commit(); <END> ShadowActivity shadowActivity = Robolectric.shadowOf(activity); SyncingService.startActionSingleSync(activity.getApplicationContext(), 2); Intent syncingService = shadowActivity.getNextStartedService(); assertThat(ShadowToast.shownToastCount(), is(0)); assertThat(syncingService.getAction(), is("com.nightscout.android.dexcom.action.SYNC")); assertThat(syncingService.getExtras().getInt("com.nightscout.android.dexcom.extra.SYNC_PERIOD"), is(2)); }</code><technical_language>apply work here</technical_language>

Target:
public void test_startActionSingleSyncWithIUnderstandShouldStartService() { prefs.setIUnderstand(true); SyncingService.startActionSingleSync(activity.getApplicationContext(), 2); Intent syncingService = shadowActivity.getNextStartedService(); assertThat(ShadowToast.shownToastCount(), is(0)); assertThat(syncingService.getAction(), is("com.nightscout.android.dexcom.action.SYNC")); assertThat(syncingService.getExtras() .getInt("com.nightscout.android.dexcom.extra.SYNC_PERIOD"), is(2)); }
Source:
<code>public static String createFunctionJsonString(CharSequence functionName, Object... args) { <START> return "{\"" + <END> "func\":" + wrapAndEscape(functionName) + "," + "\"args\":[" + Arrays.stream(args) .map(RemoteFunctionCallUtils::wrapAndEscape) .collect(Collectors.joining(",")) + "]" + "}"; }</code><technical_language>I change this be: return new JSONObject().put("func", functionName).put("args", new JSONArray().put(..........).toString(); IMO code cleaner WDYT</technical_language>

Target:
public static String createFunctionJsonString(CharSequence functionName, Object... args) { return new JSONObject().put("func", functionName).put("args", new JSONArray(args)).toString(); }
Source:
<code>public ContainerContext(ServletContext context, WeldManager manager) { <START> if (context == null) { <END> throw WeldServletLogger.LOG.nullServletContext(); } this.servletContext = context; if (manager == null) { manager = (WeldManager) context.getAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME); } this.manager = manager; }</code><technical_language>This replaced Preconditions.checkNotNull(context, "servlet context") nullServletContext() removed</technical_language>

Target:
public ContainerContext(ServletContext context, WeldManager manager) { Preconditions.checkArgumentNotNull(context, "servlet context"); this.servletContext = context; if (manager == null) { manager = (WeldManager) context.getAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME); } this.manager = manager; }
Source:
<code>protected void doAsyncAddEntry(final PendingAddOp op, final ByteBuf data, final AddCallback cb, final Object ctx) { <START> if (op.entryId < 0 ) { <END> super.doAsyncAddEntry(op, data, cb, ctx); return; } if (throttler != null) { throttler.acquire(); } final long currentLength; boolean wasClosed = false; synchronized (this) { if (metadata.isClosed()) { wasClosed = true; currentLength = 0; } else { currentLength = addToLength(length); pendingAddOps.add(op); } } if (wasClosed) { try { bk.mainWorkerPool.submit(new SafeRunnable() { @Override public void safeRun() { LOG.warn("Attempt to add to closed ledger: {}", ledgerId); cb.addComplete(BKException.Code.LedgerClosedException, LedgerHandleAdv.this, op.getEntryId(), ctx); } @Override public String toString() { return String.format("AsyncAddEntryToClosedLedger(lid=%d)", ledgerId); } }); } catch (RejectedExecutionException e) { cb.addComplete(bk.getReturnRc(BKException.Code.InterruptedException), LedgerHandleAdv.this, op.getEntryId(), ctx); } return; } try { bk.mainWorkerPool.submit(new SafeRunnable() { @Override public void safeRun() { ByteBuf toSend = macManager.computeDigestAndPackageForSending(op.getEntryId(), lastAddConfirmed, currentLength, data); try { op.initiate(toSend, toSend.readableBytes()); } finally { toSend.release(); } } }); } catch (RejectedExecutionException e) { cb.addComplete(bk.getReturnRc(BKException.Code.InterruptedException), LedgerHandleAdv.this, op.getEntryId(), ctx); } }</code><technical_language>this happen? I this change volatiles semantic of LedgerHandleAdv#asyncAddEntry. if entry id is negative, reject this add illegal arguments</technical_language>

Target:
protected void doAsyncAddEntry(final PendingAddOp op, final ByteBuf data, final AddCallback cb, final Object ctx) { if (throttler != null) { throttler.acquire(); } final long currentLength; boolean wasClosed = false; synchronized (this) { if (metadata.isClosed()) { wasClosed = true; currentLength = 0; } else { currentLength = addToLength(length); pendingAddOps.add(op); } } if (wasClosed) { try { bk.mainWorkerPool.submit(new SafeRunnable() { @Override public void safeRun() { LOG.warn("Attempt to add to closed ledger: {}", ledgerId); cb.addComplete(BKException.Code.LedgerClosedException, LedgerHandleAdv.this, op.getEntryId(), ctx); } @Override public String toString() { return String.format("AsyncAddEntryToClosedLedger(lid=%d)", ledgerId); } }); } catch (RejectedExecutionException e) { cb.addComplete(bk.getReturnRc(BKException.Code.InterruptedException), LedgerHandleAdv.this, op.getEntryId(), ctx); } return; } try { bk.mainWorkerPool.submit(new SafeRunnable() { @Override public void safeRun() { ByteBuf toSend = macManager.computeDigestAndPackageForSending(op.getEntryId(), lastAddConfirmed, currentLength, data); try { op.initiate(toSend, toSend.readableBytes()); } finally { toSend.release(); } } }); } catch (RejectedExecutionException e) { cb.addComplete(bk.getReturnRc(BKException.Code.InterruptedException), LedgerHandleAdv.this, op.getEntryId(), ctx); } }
Source:
<code><START> public FirmwareBuilder(ThingTypeUID thingTypeUID, String firmwareVersion) { <END> Objects.requireNonNull(thingTypeUID, "Thing type UID must not be null."); if (firmwareVersion == null || firmwareVersion.isEmpty()) { throw new IllegalArgumentException("Firmware version must not be null or empty."); } this.version = firmwareVersion; this.thingTypeUID = thingTypeUID; }</code><technical_language>a detail, (almost) other builders a public static ... create(....) method instead of a constructor. advantage more flexible wrt future evolution. I sense do too</technical_language>

Target:
private FirmwareBuilder(ThingTypeUID thingTypeUID, String firmwareVersion) { checkNotNull(thingTypeUID, "ThingTypeUID"); this.thingTypeUID = thingTypeUID; checkNotNullOrEmpty(firmwareVersion, "Firmware version"); this.version = firmwareVersion; this.properties = new HashMap<>(); }
Source:
<code><START> public static void assertWarnings(QueryRunner queryRunner, Session session, @Language("SQL") String sql, List<WarningCode> expectedWarnings) <END> { Set<WarningCode> warnings = queryRunner.execute(session, sql).getWarnings().stream() .map(PrestoWarning::getWarningCode) .collect(toImmutableSet()); for (WarningCode warningCode : expectedWarnings) { if (!warnings.contains(warningCode)) { fail("Expected warning: " + warningCode); } } }</code><technical_language>nit: this need public</technical_language>

Target:
private static void assertWarnings(QueryRunner queryRunner, Session session, @Language("SQL") String sql, List<WarningCode> expectedWarnings) { Set<WarningCode> warnings = queryRunner.execute(session, sql).getWarnings().stream() .map(PrestoWarning::getWarningCode) .collect(toImmutableSet()); for (WarningCode warningCode : expectedWarnings) { if (!warnings.contains(warningCode)) { fail("Expected warning: " + warningCode); } } }
Source:
<code>public List<GeoFence> getWithinAlerts() throws GeoLocationBasedServiceException { Registry registry = getGovernanceRegistry(); String registryPath = GeoServices.REGISTRY_PATH_FOR_ALERTS + GeoServices.ALERT_TYPE_WITHIN + "/"; Resource resource; try { resource = registry.get(registryPath); } catch (RegistryException e) { log.error("Error while reading the registry path: " + registryPath); <START> return null; <END> } try { List<GeoFence> fences = new ArrayList<>(); if (resource != null) { Object contentObj = resource.getContent(); if (contentObj instanceof String[]) { String[] content = (String[]) contentObj; for (String res : content) { Resource childRes = registry.get(res); Properties props = childRes.getProperties(); GeoFence geoFence = new GeoFence(); InputStream inputStream = childRes.getContentStream(); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "UTF-8"); geoFence.setGeoJson(writer.toString()); List queryNameObj = (List) props.get(GeoServices.QUERY_NAME); geoFence.setQueryName(queryNameObj != null ? queryNameObj.get(0).toString() : null); List areaNameObj = (List) props.get(GeoServices.AREA_NAME); geoFence.setAreaName(areaNameObj != null ? areaNameObj.get(0).toString() : null); geoFence.setCreatedTime(childRes.getCreatedTime().getTime()); fences.add(geoFence); } } } return fences; } catch (RegistryException | IOException e) { throw new GeoLocationBasedServiceException( "Error occurred while getting the geo alerts" , e); } }</code><technical_language>I is return empty collection instead of null</technical_language>

Target:
public List<GeoFence> getWithinAlerts() throws GeoLocationBasedServiceException { Registry registry = getGovernanceRegistry(); String registryPath = GeoServices.REGISTRY_PATH_FOR_ALERTS + GeoServices.ALERT_TYPE_WITHIN + "/"; Resource resource; try { resource = registry.get(registryPath); } catch (RegistryException e) { log.error("Error while reading the registry path: " + registryPath); return Collections.emptyList(); } try { List<GeoFence> fences = new ArrayList<>(); if (resource != null) { Object contentObj = resource.getContent(); if (contentObj instanceof String[]) { String[] content = (String[]) contentObj; for (String res : content) { Resource childRes = registry.get(res); Properties props = childRes.getProperties(); GeoFence geoFence = new GeoFence(); InputStream inputStream = childRes.getContentStream(); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "UTF-8"); geoFence.setGeoJson(writer.toString()); List queryNameObj = (List) props.get(GeoServices.QUERY_NAME); geoFence.setQueryName(queryNameObj != null ? queryNameObj.get(0).toString() : null); List areaNameObj = (List) props.get(GeoServices.AREA_NAME); geoFence.setAreaName(areaNameObj != null ? areaNameObj.get(0).toString() : null); geoFence.setCreatedTime(childRes.getCreatedTime().getTime()); fences.add(geoFence); } } } return fences; } catch (RegistryException | IOException e) { throw new GeoLocationBasedServiceException( "Error occurred while getting the geo alerts" , e); } }
Source:
<code>public static void removePmFromDrafts(PrivateMessage pm) { info("Start to remove PM from drafts folder"); mainPage.openPrivateMessages(); <START> info("Opening drafts folder"); <END> pmPage.clickOpenDrafts(); removePm(pm); }</code><technical_language>moved pmPage.clickOpenDrafts()</technical_language>

Target:
public static void removePmFromDrafts(PrivateMessage pm) { info("Start to remove PM from drafts folder"); mainPage.openPrivateMessages(); pmPage.clickOpenDrafts(); removePm(pm); }
Source:
<code>public KafkaProducer(Map<String, Object> configs, Serializer<K> keySerializer, Serializer<V> valueSerializer) { <START> this(new ProducerConfig(ProducerConfig.addSerializerToConfig(configs, keySerializer, valueSerializer)), <END> keySerializer, valueSerializer, null, null, null, Time.SYSTEM); }</code><technical_language>previous approach intended avoid this logic in places</technical_language>

Target:
public KafkaProducer(Map<String, Object> configs, Serializer<K> keySerializer, Serializer<V> valueSerializer) { this(configs, keySerializer, valueSerializer, null, null, null, Time.SYSTEM); }
Source:
<code>protected void onSave() { if (hasUnsavedChanges()){ super.onSave(); } else { <START> Window.alert(CommonConstants.INSTANCE.NoChangesSinceLastSave()); <END> } }</code><technical_language>Please method showError (in this class), uberfire generic popup widget - avoid of Window.alert</technical_language>

Target:
protected void onSave() { if (hasUnsavedChanges()){ super.onSave(); } else { final String message = CommonConstants.INSTANCE.NoChangesSinceLastSave(); log(Level.INFO, message); presenter.getView().showMessage(message); } }
Source:
<code>public static PsiElement searchInImports(HaxeFileModel file, String name) { HaxeImportModel importModel = file.getImportModels().stream() .filter(model -> { PsiElement exposedItem = model.exposeByName(name); return exposedItem != null; }) <START> .findFirst().orElse(null); <END> if (importModel != null) { return importModel.exposeByName(name); } return null; }</code><technical_language>Search order for resolving imports is reversed -- bottom top. So, stream().reverse()</technical_language>

Target:
public static PsiElement searchInImports(HaxeFileModel file, String name) { HaxeImportModel importModel = StreamUtil.reverse(file.getImportModels().stream()) .filter(model -> { PsiElement exposedItem = model.exposeByName(name); return exposedItem != null; }) .findFirst().orElse(null); if (importModel != null) { return importModel.exposeByName(name); } return null; }
Source:
<code>private CellProcessor[] getProcessor(List<Field> fields) { CellProcessor[] processor = new CellProcessor[fields.size()]; int fieldCount = 0; for (Field field : fields) { if (field.getType() == FieldType.DATE) { <START> String format = field.getConstraints().get(DelimitedSchema.getDateFormat()) == null ? null <END> : (String)field.getConstraints().get(DelimitedSchema.getDateFormat()); processor[fieldCount++] = new Optional(new FmtDate(format == null ? "dd/MM/yyyy" : format)); } else { processor[fieldCount++] = new Optional(); } } return processor; }</code><technical_language>This change is required</technical_language>

Target:
private CellProcessor[] getProcessor(List<Field> fields) { CellProcessor[] processor = new CellProcessor[fields.size()]; int fieldCount = 0; for (Field field : fields) { if (field.getType() == FieldType.DATE) { String format = field.getConstraints().get(DelimitedSchema.DATE_FORMAT) == null ? null : (String)field.getConstraints().get(DelimitedSchema.DATE_FORMAT); processor[fieldCount++] = new Optional(new FmtDate(format == null ? "dd/MM/yyyy" : format)); } else { processor[fieldCount++] = new Optional(); } } return processor; }
Source:
<code>public ATCommand(String command, String parameter) { this.command = command; <START> this.parameter = parameter.getBytes(); <END> }</code><technical_language>parameter string null, avoid NullPointerException, null a valid for parameter</technical_language>

Target:
public ATCommand(String command, String parameter) { if (command == null) throw new NullPointerException("Command cannot be null."); this.command = command; if (parameter != null) this.parameter = parameter.getBytes(); }
Source:
<code>public Analyzer getBean(Map<String, String> initProperties, String fullPrefix, SenseiPluginRegistry pluginRegistry) { Analyzer defaultAnalyzer = pluginRegistry.getBeanByFullPrefix(fullPrefix + ".default", Analyzer.class); if (defaultAnalyzer == null) { <START> defaultAnalyzer = new KeywordAnalyzer(); <END> } String[] fields = MapUtils.getString(initProperties, "fields", "").split(" *, *"); Map<String, Analyzer> analyzers = new HashMap<String, Analyzer>(); for (String field: fields) { String analyzerPrefix = fullPrefix + ".fields." + field; Analyzer analyzer = pluginRegistry.getBeanByFullPrefix(analyzerPrefix, Analyzer.class); analyzers.put(field, analyzer); } return new PerFieldAnalyzerWrapper(defaultAnalyzer, analyzers); }</code><technical_language>Sensei's default analyzer is StandardAnalyzer (I think), a default default choice</technical_language>

Target:
public Analyzer getBean(Map<String, String> initProperties, String fullPrefix, SenseiPluginRegistry pluginRegistry) { Analyzer defaultAnalyzer = pluginRegistry.getBeanByFullPrefix(fullPrefix + ".default", Analyzer.class); if (defaultAnalyzer == null) { defaultAnalyzer = new StandardAnalyzer(Version.LUCENE_35); } String[] fields = MapUtils.getString(initProperties, "fields", "").split("\\s*,\\s*"); Map<String, Analyzer> analyzers = new HashMap<String, Analyzer>(); for (String field: fields) { String analyzerPrefix = fullPrefix + ".fields." + field; Analyzer analyzer = pluginRegistry.getBeanByFullPrefix(analyzerPrefix, Analyzer.class); analyzers.put(field, analyzer); } return new PerFieldAnalyzerWrapper(defaultAnalyzer, analyzers); }
Source:
<code>public Page getOutput() { if (lookupSource == null) { return null; } Counter lookupPositionsConsidered = new Counter(); if (probe != null) { while (true) { <START> if (operatorContext.getDriverContext().getAbortSignal().isAborted()) { <END> break; } if (probe.getPosition() >= 0) { if (!joinCurrentPosition(lookupPositionsConsidered)) { break; } if (!currentProbePositionProducedRow) { currentProbePositionProducedRow = true; if (!outerJoinCurrentPosition()) { break; } } } currentProbePositionProducedRow = false; if (!advanceProbePosition()) { break; } statisticsCounter.recordProbe(joinSourcePositions); joinSourcePositions = 0; } } if (pageBuilder.isFull() || (finishing && !pageBuilder.isEmpty() && probe == null)) { Page page = pageBuilder.build(); pageBuilder.reset(); return page; } return null; }</code><technical_language>This loop condition</technical_language>

Target:
public Page getOutput() { if (lookupSource == null) { return null; } DriverYieldSignal yieldSignal = operatorContext.getDriverContext().getYieldSignal(); if (probe != null) { while (!yieldSignal.isSet()) { if (probe.getPosition() >= 0) { if (!joinCurrentPosition(yieldSignal)) { break; } if (!currentProbePositionProducedRow) { currentProbePositionProducedRow = true; if (!outerJoinCurrentPosition()) { break; } } } currentProbePositionProducedRow = false; if (!advanceProbePosition()) { break; } statisticsCounter.recordProbe(joinSourcePositions); joinSourcePositions = 0; } } if (pageBuilder.isFull() || (finishing && !pageBuilder.isEmpty() && probe == null)) { Page page = pageBuilder.build(); pageBuilder.reset(); return page; } return null; }