auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ApiKey newKey(final PlayerName playerName, final InetAddress ip) { Preconditions.checkArgument(playerName != null); <START> Preconditions.checkArgument(ip != null); <END> final ApiKey key = keyMaker.get(); userJdbiDao .lookupUserRoleByName(playerName.getValue()) .ifPresentOrElse( userRoleLookup -> { insertKey( userRoleLookup.getUserId(), playerName.getValue(), key, ip, userRoleLookup.getUserRoleId()); }, () -> { final int anonymousUserRoleId = userRoleDao.lookupAnonymousRoleId(); insertKey(null, playerName.getValue(), key, ip, anonymousUserRoleId); }); return key; }</code><technical_language>in this class direct null check</technical_language>

Target:
public ApiKey newKey(final PlayerName playerName, final InetAddress ip) { Preconditions.checkNotNull(playerName); Preconditions.checkNotNull(ip); final ApiKey key = keyMaker.get(); userJdbiDao .lookupUserRoleByName(playerName.getValue()) .ifPresentOrElse( userRoleLookup -> { insertKey( userRoleLookup.getUserId(), playerName.getValue(), key, ip, userRoleLookup.getUserRoleId()); }, () -> { final int anonymousUserRoleId = userRoleDao.lookupAnonymousRoleId(); insertKey(null, playerName.getValue(), key, ip, anonymousUserRoleId); }); return key; }
Source:
<code>public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { try { return method.invoke(mDelegate, args); } catch (InvocationTargetException delegateException) { try { LOG.info("Couldn't invoke method {}", method.toGenericString()); if (mCompat != null && delegateException.getCause().getClass() .isAssignableFrom(TApplicationException.class)) { <START> LOG.info("Attempting to invoke with {}", mCompat.getClass().getName()); <END> return invokeCompatibility(method, args); } } catch (InvocationTargetException compatibilityException) { if (compatibilityException.getCause().getClass() .isAssignableFrom(TApplicationException.class)) { LOG.warn("Invocation of compatibility for metastore client method failed.", method.getName(), compatibilityException); } else { throw compatibilityException.getCause(); } } catch (Throwable t) { LOG.warn( "Unable to invoke compatibility for metastore client method {}.", method.getName(), t); } throw delegateException.getCause(); } }</code><technical_language>info logs spammy, log for invocation of calls. cache this info proactively compat method decision change time. Then, log cache method decision</technical_language>

Target:
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { try { return method.invoke(mDelegate, args); } catch (InvocationTargetException delegateException) { try { if (mCompat != null && delegateException.getCause().getClass() .isAssignableFrom(TApplicationException.class)) { LOG.debug("Attempting to call hive metastore with compatibility class {}", mCompat.getClass().getName()); return invokeCompatibility(method, args); } } catch (InvocationTargetException compatibilityException) { if (compatibilityException.getCause().getClass() .isAssignableFrom(TApplicationException.class)) { LOG.warn("Invocation of compatibility for metastore client method failed.", method.getName(), compatibilityException); } else { throw compatibilityException.getCause(); } } catch (Throwable t) { LOG.warn( "Unable to invoke compatibility for metastore client method {}.", method.getName(), t); } throw delegateException.getCause(); } }
Source:
<code>private boolean isManagementToken(String lockToken) { <START> logger.verbose("!!!! This token is management token ? ", managementNodeLocks.contains(lockToken)); <END> return managementNodeLocks.contains(lockToken); }</code><technical_language>Remove log message</technical_language>

Target:
private boolean isManagementToken(String lockToken) { return managementNodeLocks.contains(lockToken); }
Source:
<code>public void before() { <START> eventCache = createEventCache(3); <END> part = 1; }</code><technical_language>want eventCache = createEventCache(5); here, tests want retention happen</technical_language>

Target:
public void before() { eventCache = createEventCache(5); part = 1; }
Source:
<code>CastResolver(DataType type, String name) { <START> super(FuncParams.builder().withIndependentVarArgs(Param.ANY).build()); <END> this.type = type; this.name = name; }</code><technical_language>1 2 arguments</technical_language>

Target:
CastResolver(DataType type, String name) { super(FuncParams.builder(Param.ANY) .withVarArgs(Param.ANY) .limitVarArgOccurrences(1) .build()); this.type = type; this.name = name; }
Source:
<code>public void testApikeyValidate() throws BugzillaRestException { RepositoryLocation location = new RepositoryLocation(); location.setUrl(actualFixture.getRepositoryUrl()); location.setProxy(null); location.setCredentialsStore(new InMemoryCredentialsStore()); location.setCredentials(AuthenticationType.REPOSITORY, new UserCredentials("tests@mylyn.eclipse.org", "")); location.setProperty(IBugzillaRestConstants.REPOSITORY_USE_API_KEY, Boolean.toString(true)); location.setProperty(IBugzillaRestConstants.REPOSITORY_API_KEY, "wvkz2SoBMBQEKv6ishp1j7NY1R9l711g5w2afXc6"); BugzillaRestClient client; client = new BugzillaRestClient(location, connector); assertNotNull(client.getClient()); <START> if (!Boolean.parseBoolean(actualFixture.getProperty("api_key_enabled"))) { <END> thrown.expect(BugzillaRestException.class); thrown.expectMessage("The API key you specified is invalid"); client.validate(new NullOperationMonitor()); } else { assertEquals(true, client.validate(new NullOperationMonitor())); } }</code><technical_language>api_key_enabled true due conditional ignore rule, this if else removed</technical_language>

Target:
public void testApikeyValidate() throws BugzillaRestException { RepositoryLocation location = new RepositoryLocation(); location.setUrl(actualFixture.getRepositoryUrl()); location.setProxy(null); location.setCredentialsStore(new InMemoryCredentialsStore()); location.setCredentials(AuthenticationType.REPOSITORY, new UserCredentials("tests@mylyn.eclipse.org", "")); location.setProperty(IBugzillaRestConstants.REPOSITORY_USE_API_KEY, Boolean.toString(true)); location.setProperty(IBugzillaRestConstants.REPOSITORY_API_KEY, "wvkz2SoBMBQEKv6ishp1j7NY1R9l711g5w2afXc6"); BugzillaRestClient client; client = new BugzillaRestClient(location, connector); assertNotNull(client.getClient()); if (!Boolean.parseBoolean(actualFixture.getProperty(IBugzillaRestConstants.API_KEY_ENABLED_PROPERTY))) { thrown.expect(BugzillaRestException.class); thrown.expectMessage("The API key you specified is invalid"); client.validate(new NullOperationMonitor()); } else { assertEquals(true, client.validate(new NullOperationMonitor())); } }
Source:
<code>public void delete(Iterable<SystemStreamPartition> systemStreamPartitions) { for (SystemStreamPartition systemStreamPartition : systemStreamPartitions) { LOG.info("Deleting the partition: from store.", systemStreamPartition); String sspKey = getKey(systemStreamPartition); <START> metadataStore.delete(sspKey); <END> } }</code><technical_language>nit. a suggestion, metadata store api method for deleting multiple keys? more efficient for some types of storage</technical_language>

Target:
public void delete(Iterable<SystemStreamPartition> systemStreamPartitions) { for (SystemStreamPartition systemStreamPartition : systemStreamPartitions) { LOG.info("Deleting the partition: from store.", systemStreamPartition); String serializedSSPAsJson = serializeSSPToJson(systemStreamPartition); metadataStore.delete(serializedSSPAsJson); } }
Source:
<code>protected void index(PartialDeploy config) { if (config == null) { return; } partialBundles.putIfAbsent(config.bundle(), new HashSet<>()); <START> Set<TargetExtensions> pairs = partialBundles.get(config.bundle()); <END> Arrays.stream(config.features()).map(c -> { try { return c.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new IllegalStateException(e); } }).forEach(pairs::add); }</code><technical_language>write this: partialBundles.computeIfAbsent(config.bundle(), key ->new HashSet<>()) avoid instantiate a HashSet if exists</technical_language>

Target:
protected void index(PartialDeploy config) { if (config == null) { return; } Set<TargetExtensions> pairs = partialBundles.computeIfAbsent(config.bundle(), key -> new HashSet<>()); Arrays.stream(config.features()).map(c -> { try { return c.newInstance(); } catch (ReflectiveOperationException e) { throw new IllegalStateException(e); } }).forEach(pairs::add); }
Source:
<code>private long getColumnIndexForSort(String fieldName) { if (fieldName == null || fieldName.isEmpty()) { throw new IllegalArgumentException("Non-empty field name required."); } if (fieldName.contains(".")) { <START> throw new IllegalArgumentException("Sorting using child object fields is not supported: " + fieldName); <END> } long columnIndex = collection.getTable().getColumnIndex(fieldName); if (columnIndex < 0) { throw new IllegalArgumentException(String.format("Field '%s' does not exist.", fieldName)); } return columnIndex; }</code><technical_language>This limitation is removed in another PR right</technical_language>

Target:
private long getColumnIndexForSort(String fieldName) { if (fieldName == null || fieldName.isEmpty()) { throw new IllegalArgumentException("Non-empty field name required."); } if (fieldName.contains(".")) { throw new IllegalArgumentException("Aggregates on child object fields are not supported: " + fieldName); } long columnIndex = collection.getTable().getColumnIndex(fieldName); if (columnIndex < 0) { throw new IllegalArgumentException(String.format("Field '%s' does not exist.", fieldName)); } return columnIndex; }
Source:
<code>public Mono<AccessToken> authenticateWithPfxCertificate(String pfxCertificatePath, String pfxCertificatePassword, TokenRequestContext request) { String authorityUrl = options.getAuthorityHost().replaceAll("/+$", "") + "/" + tenantId; return Mono.fromCallable(() -> { ConfidentialClientApplication.Builder applicationBuilder = ConfidentialClientApplication.builder(clientId, ClientCredentialFactory.createFromCertificate( new FileInputStream(pfxCertificatePath), pfxCertificatePassword)) <START> .httpClient(new HttpPipelineAdapter(options.getHttpPipeline())) <END> .authority(authorityUrl); if (options.getProxyOptions() != null) { applicationBuilder.proxy(proxyOptionsToJavaNetProxy(options.getProxyOptions())); } if (options.getHttpPipeline() != null) { applicationBuilder.httpClient(new HttpPipelineAdapter(options.getHttpPipeline())); } return applicationBuilder.build(); }).flatMap(application -> Mono.fromFuture(application.acquireToken( ClientCredentialParameters.builder(new HashSet<>(request.getScopes())).build()))) .map(ar -> new AccessToken(ar.accessToken(), OffsetDateTime.ofInstant(ar.expiresOnDate().toInstant(), ZoneOffset.UTC))); }</code><technical_language>so, check if (options.getHttpPipeline() != null) setting pipeline</technical_language>

Target:
public Mono<AccessToken> authenticateWithPfxCertificate(String pfxCertificatePath, String pfxCertificatePassword, TokenRequestContext request) { String authorityUrl = options.getAuthorityHost().replaceAll("/+$", "") + "/" + tenantId; return Mono.fromCallable(() -> { ConfidentialClientApplication.Builder applicationBuilder = ConfidentialClientApplication.builder(clientId, ClientCredentialFactory.createFromCertificate( new FileInputStream(pfxCertificatePath), pfxCertificatePassword)) .authority(authorityUrl); if (options.getProxyOptions() != null) { applicationBuilder.proxy(proxyOptionsToJavaNetProxy(options.getProxyOptions())); } if (options.getHttpPipeline() != null) { applicationBuilder.httpClient(new HttpPipelineAdapter(options.getHttpPipeline())); } return applicationBuilder.build(); }).flatMap(application -> Mono.fromFuture(application.acquireToken( ClientCredentialParameters.builder(new HashSet<>(request.getScopes())).build()))) .map(ar -> new AccessToken(ar.accessToken(), OffsetDateTime.ofInstant(ar.expiresOnDate().toInstant(), ZoneOffset.UTC))); }
Source:
<code>public <T> ListGauge newListGauge(String name) { <START> return registry.newListGauge(groupName, new ListGauge(name)); <END> }</code><technical_language>do a ListGauge<T> for explicit type inference method is parameterized T already</technical_language>

Target:
public <T> ListGauge<T> newListGauge(String name) { return registry.newListGauge(groupName, new ListGauge(name)); }
Source:
<code>public void stop() { log.info("Stopping announcer"); synchronized (toAnnounce) { if (!started) { return; } started = false; Closer closer = Closer.create(); for (NodeCache cache : listeners.values()) { closer.register(cache); } CloseQuietly.close(closer); for (String announcementPath : announcements.keySet()) { unannounce(announcementPath); } if (!parentsIBuilt.isEmpty()) { CuratorTransaction transaction = curator.inTransaction(); for (String parent : parentsIBuilt) { try { transaction = transaction.delete().forPath(parent).and(); } catch (Exception e) { <START> log.info(e, "Unable to delete parent[%s], boooo.", parent); <END> } } try { ((CuratorTransactionFinal) transaction).commit(); } catch (Exception e) { log.info(e, "Unable to commit transaction. Please feed the hamsters"); } } } }</code><technical_language>log.error</technical_language>

Target:
public void stop() { log.info("Stopping announcer"); synchronized (toAnnounce) { if (!started) { return; } started = false; Closer closer = Closer.create(); for (NodeCache cache : listeners.values()) { closer.register(cache); } CloseQuietly.close(closer); for (String announcementPath : announcedPaths.keySet()) { unannounce(announcementPath); } if (!parentsIBuilt.isEmpty()) { CuratorTransaction transaction = curator.inTransaction(); for (String parent : parentsIBuilt) { try { transaction = transaction.delete().forPath(parent).and(); } catch (Exception e) { log.error(e, "Unable to delete parent[%s].", parent); } } try { ((CuratorTransactionFinal) transaction).commit(); } catch (Exception e) { log.error(e, "Unable to commit transaction."); } } } }
Source:
<code>public void commit(final Xid xid, final boolean onePhase) throws XAException { try { if (commitToEnlistment()) lookup(xid).commit(onePhase); } catch (XAException | RuntimeException exception) { <START> if (!onePhase && resourceRegistry != null) <END> resourceRegistry.resourceInDoubt(this); throw exception; } if (resourceRegistry != null) resourceRegistry.removeResource(this); }</code><technical_language>@ochaloup I remember I added this onePhase check here. line of thought is that, if resource fails commit preparing, committing, need track it. Now, need track resource in doubt for two-phase well, I if correct is wrote it, if is if (resourceRegistry != null) Wdyt correct here? Do a reason for needing add resource resource registry exception is thrown phase is true</technical_language>

Target:
public void commit(final Xid xid, final boolean onePhase) throws XAException { try { if (commitToEnlistment()) lookup(xid).commit(onePhase); } catch (XAException | RuntimeException exception) { if (resourceRegistry != null) resourceRegistry.resourceInDoubt(this); throw exception; } if (resourceRegistry != null) resourceRegistry.removeResource(this); }
Source:
<code>public KscDashlet(String name, DashletSpec dashletSpec, NodeDao nodeDao, ResourceDao resourceDao, TransactionOperations transactionOperations, final TimeformatService timeformatService) { super(name, dashletSpec); m_nodeDao = nodeDao; m_resourceDao = resourceDao; m_transactionOperations = transactionOperations; <START> this.timeformatService = timeformatService; <END> this.userTimezoneId = TimeformatHelper.extractUserTimeZoneId().orElse(null); }</code><technical_language>mix m_ this.</technical_language>

Target:
public KscDashlet(String name, DashletSpec dashletSpec, NodeDao nodeDao, ResourceDao resourceDao, TransactionOperations transactionOperations, final TimeformatService timeformatService) { super(name, dashletSpec); m_nodeDao = nodeDao; m_resourceDao = resourceDao; m_transactionOperations = transactionOperations; m_timeformatService = timeformatService; m_userTimezoneId = UserTimeZoneExtractor.extractUserTimeZoneIdOrNull(); }
Source:
<code>public void testGetMasterStorageDomainIdForPool() { <START> Guid result = dao.getMasterStorageDomainIdForPool(Guid.createGuidFromString("6d849ebf-755f-4552-ad09-9a090cda105d")); <END> assertNotNull(result); assertEquals(EXISTING_DOMAIN_ID, result); }</code><technical_language>new Guid(String) - this literal null</technical_language>

Target:
public void testGetMasterStorageDomainIdForPool() { Guid result = dao.getMasterStorageDomainIdForPool(new Guid("6d849ebf-755f-4552-ad09-9a090cda105d")); assertNotNull(result); assertEquals(EXISTING_DOMAIN_ID, result); }
Source:
<code>private FormValidation doCheckCpus(@QueryParameter String value) { boolean valid = true; String errorMessage = "Invalid CPUs value, it should be a positive decimal."; if (StringUtils.isBlank(value)) { valid = false; } else { try { <START> if (Double.parseDouble(value.trim()) < 0) { <END> valid = false; } } catch (NumberFormatException e) { valid = false; } } return valid ? FormValidation.ok() : FormValidation.error(errorMessage); }</code><technical_language>trim validate trim assigning variables above. do trim trim here</technical_language>

Target:
private FormValidation doCheckCpus(@QueryParameter String value) { boolean valid = true; String errorMessage = "Invalid CPUs value, it should be a positive decimal."; if (StringUtils.isBlank(value)) { valid = false; } else { try { if (Double.parseDouble(value) < 0) { valid = false; } } catch (NumberFormatException e) { valid = false; } } return valid ? FormValidation.ok() : FormValidation.error(errorMessage); }
Source:
<code>public void processPacket(final Stanza packet) { if (packet instanceof org.jivesoftware.smack.packet.Message) { org.jivesoftware.smack.packet.Message xmppMessage = (org.jivesoftware.smack.packet.Message) packet; Map<String, ?> mappedHeaders = headerMapper.toHeadersFromRequest(xmppMessage); Object messageBody = xmppMessage.getBody(); if (ChatMessageListeningEndpoint.this.payloadExpression != null) { messageBody = ChatMessageListeningEndpoint.this.payloadExpression .getValue(ChatMessageListeningEndpoint.this.evaluationContext, xmppMessage); } if (messageBody != null) { sendMessage(getMessageBuilderFactory() .withPayload(messageBody) .copyHeaders(mappedHeaders).build()); } <START> } <END> }</code><technical_language>DEBUG log for null ?</technical_language>

Target:
public void processPacket(final Stanza packet) { if (packet instanceof org.jivesoftware.smack.packet.Message) { org.jivesoftware.smack.packet.Message xmppMessage = (org.jivesoftware.smack.packet.Message) packet; Map<String, ?> mappedHeaders = headerMapper.toHeadersFromRequest(xmppMessage); Object messageBody = xmppMessage.getBody(); if (ChatMessageListeningEndpoint.this.payloadExpression != null) { EvaluationContext evaluationContext = ChatMessageListeningEndpoint.this.evaluationContext; List<ExtensionElement> extensions = xmppMessage.getExtensions(); if (extensions.size() == 1) { ExtensionElement extension = extensions.get(0); evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); evaluationContext.setVariable("extension", extension); } messageBody = ChatMessageListeningEndpoint.this.payloadExpression .getValue(evaluationContext, xmppMessage); } if (messageBody != null) { sendMessage(getMessageBuilderFactory() .withPayload(messageBody) .copyHeaders(mappedHeaders).build()); } else if (logger.isInfoEnabled()) { if (ChatMessageListeningEndpoint.this.payloadExpression != null) { logger.info("The 'payloadExpression' [" + ChatMessageListeningEndpoint.this.payloadExpression.getExpressionString() + "] has been evaluated to 'null'. The XMPP Message [" + xmppMessage + "] is ignored."); } else { logger.info("The XMPP Message [" + xmppMessage + "] with empty body is ignored."); } } } }
Source:
<code>private RecordWriter createWriter(int index) throws Exception { <START> File file = temp.newFile(String.valueOf(index) + ".parquet"); <END> file.delete(); RecordWriter writer = parquetOutputFormat.getRecordWriter( conf, new Path(file.toString()), CompressionCodecName.UNCOMPRESSED); return writer; }</code><technical_language>deleting this file used? Mabye a file.deleteOnExit() avoid leaving temporary files tests</technical_language>

Target:
private RecordWriter createWriter(int index) throws Exception { File file = temp.newFile(String.valueOf(index) + ".parquet"); if (!file.delete()) { throw new RuntimeException("Could not delete file: " + file); } RecordWriter writer = parquetOutputFormat.getRecordWriter( conf, new Path(file.toString()), CompressionCodecName.UNCOMPRESSED); return writer; }
Source:
<code>public static String description(int[] hashes) { assert(hashes != null); assert(hashes.length >= 3); StringBuilder sb = new StringBuilder(); sb.append("Full Hash ").append(hashes[0]); sb.append(", Catalog Version ").append(hashes[1]); sb.append(", Statement Count ").append(hashes[2]); int includedStmts = Math.min(hashes[2], MAX_STATEMENTS_WITH_DETAIL); <START> for (int i = 0; i < includedStmts; ++i) { <END> sb.append("\n Ran Statement ").append(hashes[i * 2 + HEADER_OFFSET]); sb.append(" with Parameters ").append(hashes[i * 2 + HEADER_OFFSET + 1]); } if (hashes[2] > MAX_STATEMENTS_WITH_DETAIL) { sb.append("\n Additional SQL statements truncated"); } return sb.toString(); }</code><technical_language>i=HEADER_OFFSET;;i+=2</technical_language>

Target:
public static String description(int[] hashes) { assert(hashes != null); assert(hashes.length >= 3); StringBuilder sb = new StringBuilder(); sb.append("Full Hash ").append(hashes[0]); sb.append(", Catalog Version ").append(hashes[1]); sb.append(", Statement Count ").append(hashes[2] / 2); int includedHashes = Math.min(hashes[2], MAX_HASHES_COUNT); for (int i = HEADER_OFFSET; i < HEADER_OFFSET + includedHashes; i += 2) { sb.append("\n Ran Statement ").append(hashes[i]); sb.append(" with Parameters ").append(hashes[i + 1]); } if (hashes[2] > MAX_HASHES_COUNT) { sb.append("\n Additional SQL statements truncated"); } return sb.toString(); }
Source:
<code>if (PlatformDependent.javaVersion() >= 11) { Object maybeException = AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { try { return Deflater.class.getDeclaredMethod("setInput", ByteBuffer.class); } catch (NoSuchMethodException e) { return e; } catch (SecurityException e) { return e; } } }); if (maybeException instanceof Method) { logger.debug("Deflater.setInput(ByteBuffer): available"); deflaterSetInput = (Method) maybeException; } else { <START> logger.debug("Deflater.setInput(ByteBuffer): unavailable"); <END> } maybeException = AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { try { return Deflater.class.getDeclaredMethod("deflate", ByteBuffer.class, int.class); } catch (NoSuchMethodException e) { return e; } catch (SecurityException e) { return e; } } }); if (maybeException instanceof Method) { logger.debug("Deflater.deflate(ByteBuffer, int): available"); deflaterDeflate = (Method) maybeException; } else { logger.debug("Deflater.deflate(ByteBuffer, int): unavailable"); } maybeException = AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { try { return CRC32.class.getDeclaredMethod("update", ByteBuffer.class); } catch (NoSuchMethodException e) { return e; } catch (SecurityException e) { return e; } } }); if (maybeException instanceof Method) { logger.debug("CRC32.update(ByteBuffer): available"); crc32Update = (Method) maybeException; } else { logger.debug("CRC32.update(ByteBuffer): unavailable"); } }</code><technical_language>nit: include exception</technical_language>

Target:
if (PlatformDependent.javaVersion() >= 11) { Object maybeException = AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { try { return Deflater.class.getDeclaredMethod("setInput", ByteBuffer.class); } catch (NoSuchMethodException e) { return e; } catch (SecurityException e) { return e; } } }); if (maybeException instanceof Method) { logger.debug("Deflater.setInput(ByteBuffer): available"); deflaterSetInput = (Method) maybeException; } else { logger.debug("Deflater.setInput(ByteBuffer): unavailable", maybeException); } maybeException = AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { try { return Deflater.class.getDeclaredMethod("deflate", ByteBuffer.class, int.class); } catch (NoSuchMethodException e) { return e; } catch (SecurityException e) { return e; } } }); if (maybeException instanceof Method) { logger.debug("Deflater.deflate(ByteBuffer, int): available"); deflaterDeflate = (Method) maybeException; } else { logger.debug("Deflater.deflate(ByteBuffer, int): unavailable", maybeException); } }
Source:
<code>public void testGetChildrenFromEmptyDB() { <START> spanService.getChildren(null, "id"); <END> }</code><technical_language>assertions</technical_language>

Target:
public void testGetChildrenFromEmptyDB() throws StoreException, InterruptedException { List<Span> spans = spanService.getChildren(null, "id"); Assert.assertTrue(spans.isEmpty()); }
Source:
<code>private void initializeSSLContext(SSLChannelMode preferredChannelMode) throws NoSuchAlgorithmException, KeyManagementException { switch (preferredChannelMode) { case Default: if (!openSSLProviderRegistered) { OpenSSLProvider.register(); openSSLProviderRegistered = true; } try { java.util.logging.Logger logger = java.util.logging.Logger.getLogger( SSL.class.getName()); logger.setLevel(Level.WARNING); ctx = SSLContext.getInstance("openssl.TLS"); ctx.init(null, null, null); logger.setLevel(Level.INFO); channelMode = SSLChannelMode.OpenSSL; } catch (NoSuchAlgorithmException e) { <START> LOG.warn("Failed to load OpenSSL. Falling back to the JSSE default."); <END> ctx = SSLContext.getDefault(); channelMode = SSLChannelMode.Default_JSSE; } break; case OpenSSL: if (!openSSLProviderRegistered) { OpenSSLProvider.register(); openSSLProviderRegistered = true; } ctx = SSLContext.getInstance("openssl.TLS"); ctx.init(null, null, null); channelMode = SSLChannelMode.OpenSSL; break; case Default_JSSE: ctx = SSLContext.getDefault(); channelMode = SSLChannelMode.Default_JSSE; break; case Default_JSSE_with_GCM: ctx = SSLContext.getDefault(); channelMode = SSLChannelMode.Default_JSSE_with_GCM; break; default: throw new AssertionError("Unknown channel mode: " + preferredChannelMode); } }</code><technical_language>i dont want a warning in default mode. log debug openssl explicitly asked for</technical_language>

Target:
private void initializeSSLContext(SSLChannelMode preferredChannelMode) throws NoSuchAlgorithmException, KeyManagementException { switch (preferredChannelMode) { case Default: if (!openSSLProviderRegistered) { OpenSSLProvider.register(); openSSLProviderRegistered = true; } try { java.util.logging.Logger logger = java.util.logging.Logger.getLogger( SSL.class.getName()); logger.setLevel(Level.WARNING); ctx = SSLContext.getInstance("openssl.TLS"); ctx.init(null, null, null); logger.setLevel(Level.INFO); channelMode = SSLChannelMode.OpenSSL; } catch (NoSuchAlgorithmException e) { LOG.debug("Failed to load OpenSSL. Falling back to the JSSE default."); ctx = SSLContext.getDefault(); channelMode = SSLChannelMode.Default_JSSE; } break; case OpenSSL: if (!openSSLProviderRegistered) { OpenSSLProvider.register(); openSSLProviderRegistered = true; } ctx = SSLContext.getInstance("openssl.TLS"); ctx.init(null, null, null); channelMode = SSLChannelMode.OpenSSL; break; case Default_JSSE: ctx = SSLContext.getDefault(); channelMode = SSLChannelMode.Default_JSSE; break; case Default_JSSE_with_GCM: ctx = SSLContext.getDefault(); channelMode = SSLChannelMode.Default_JSSE_with_GCM; break; default: throw new NoSuchAlgorithmException("Unknown channel mode: " + preferredChannelMode); } }
Source:
<code>private void startMachine(String name, DockerContainerConfig containerConfig) throws InfrastructureException, InterruptedException { InternalMachineConfig machineCfg = getContext().getMachineConfigs().get(name); DockerMachine machine = containerStarter.startContainer(getContext().getDockerEnvironment().getNetwork(), name, containerConfig, getContext().getIdentity(), getContext().getDevMachineName().equals(name), new AbnormalMachineStopHandlerImpl()); try { checkInterruption(); startSynchronizer.addMachine(name, machine); } catch (InfrastructureException e) { <START> destroyMachineQuietly(name, machine); <END> throw e; } if (!machineCfg.getInstallers().isEmpty()) { bootstrapperFactory.create(name, getContext().getIdentity(), machineCfg.getInstallers(), machine) .bootstrap(); } checkInterruption(); ServersReadinessChecker readinessChecker = new ServersReadinessChecker(name, machine.getServers(), serverCheckerFactory); readinessChecker.startAsync(new ServerReadinessHandler(name)); readinessChecker.await(); }</code><technical_language>I interruption check needed</technical_language>

Target:
private void startMachine(String name, DockerContainerConfig containerConfig) throws InfrastructureException, InterruptedException { InternalMachineConfig machineCfg = getContext().getMachineConfigs().get(name); DockerMachine machine = containerStarter.startContainer(getContext().getDockerEnvironment().getNetwork(), name, containerConfig, getContext().getIdentity(), getContext().getDevMachineName().equals(name), new AbnormalMachineStopHandlerImpl()); try { startSynchronizer.addMachine(name, machine); } catch (InfrastructureException e) { destroyMachineQuietly(name, machine); throw e; } if (!machineCfg.getInstallers().isEmpty()) { bootstrapperFactory.create(name, getContext().getIdentity(), machineCfg.getInstallers(), machine) .bootstrap(); } checkInterruption(); ServersReadinessChecker readinessChecker = new ServersReadinessChecker(name, machine.getServers(), serverCheckerFactory); readinessChecker.startAsync(new ServerReadinessHandler(name)); readinessChecker.await(); }
Source:
<code>protected ConnectionFactory getConnectionFactory() { logger.debug("connectionFactoryBuilder connectionFactoryClass properties {}", "" + connectionFactoryBuilder, connectionFactoryClass, connectionFactoryProperties); ConnectionFactory cf; try { if (connectionFactoryBuilder != null) { cf = connectionFactoryBuilder.buildConnectionFactory(); <START> } else if (connectionFactoryClass != null) { <END> @SuppressWarnings("unchecked") Class<ConnectionFactory> clazz = (Class<ConnectionFactory>)Class.forName(connectionFactoryClass); cf = clazz.newInstance(); } else { cf = new org.apache.activemq.ActiveMQConnectionFactory(); } BeanUtils.populate(cf, connectionFactoryProperties); logger.debug("creation successful."); return cf; } catch (Exception e) { throw new RuntimeException("Failed to create connection factory.", e); } }</code><technical_language>Instead of multiple mechanisms encapsulate factory class instanatiation a default factory builder</technical_language>

Target:
protected ConnectionFactory getConnectionFactory() { logger.debug("connectionFactoryBuilder {}", "" + connectionFactoryBuilder); return connectionFactoryBuilder.buildConnectionFactory(); }
Source:
<code>public Response findTechnologiesByFilter(TechnologyFilter techFilter, User user) throws InternalServerErrorException, NotFoundException, BadRequestException { validateUser(user); if (techFilter.getRecommendationIs() != null && techFilter.getRecommendationIs().equals(RecommendationEnums.UNINFORMED.message())) { techFilter.setRecommendationIs(""); } List<Technology> completeList = technologyDAO.findAllActives(); completeList = filterByLastActivityDate(techFilter, completeList); List<Technology> filteredList = new ArrayList<>(); <START> if ((techFilter.getTitleContains() == null || techFilter.getTitleContains().isEmpty()) <END> && (techFilter.getRecommendationIs() == null || techFilter.getRecommendationIs().isEmpty())) { filteredList.addAll(completeList); } else { verifyFilters(techFilter, completeList, filteredList); } if (filteredList.isEmpty()) { return new TechnologiesResponse(); } else { if (techFilter.getOrderOptionIs() != null && !techFilter.getOrderOptionIs().isEmpty()) { filteredList = sortTechnologies(filteredList, TechnologyOrderOptionEnum.fromString(techFilter.getOrderOptionIs())); } else { sortTechnologiesDefault(filteredList); } TechnologiesResponse response = new TechnologiesResponse(); response.setTechnologies(filteredList); return response; } }</code><technical_language>@felipeaziz StringUtils apache-commons-utils (something this :)</technical_language>

Target:
public Response findTechnologiesByFilter(TechnologyFilter techFilter, User user) throws InternalServerErrorException, NotFoundException, BadRequestException { validateUser(user); if (techFilter.getRecommendationIs() != null && techFilter.getRecommendationIs().equals(RecommendationEnums.UNINFORMED.message())) { techFilter.setRecommendationIs(""); } List<Technology> completeList = technologyDAO.findAllActives(); completeList = filterByLastActivityDate(techFilter, completeList); List<Technology> filteredList = new ArrayList<>(); if (StringUtils.isBlank(techFilter.getTitleContains()) && StringUtils.isBlank(techFilter.getRecommendationIs())) { filteredList.addAll(completeList); } else { verifyFilters(techFilter, completeList, filteredList); } if (filteredList.isEmpty()) { return new TechnologiesResponse(); } else { if (techFilter.getOrderOptionIs() != null && !techFilter.getOrderOptionIs().isEmpty()) { filteredList = Technology.sortTechnologies(filteredList, TechnologyOrderOptionEnum.fromString(techFilter.getOrderOptionIs())); } else { Technology.sortTechnologiesDefault(filteredList); } TechnologiesResponse response = new TechnologiesResponse(); response.setTechnologies(filteredList); return response; } }
Source:
<code>@NonNull <START> protected List<String> <END> prepareStreamedSessionCreationCommand(ISessionInfo sessionInfo) { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION); if (!sessionInfo.getName().isEmpty()) { command.add(sessionInfo.getName()); } if (sessionInfo.isSnapshotSession()) { command.add(LTTngControlServiceConstants.OPTION_SNAPSHOT); } else if (sessionInfo.isLive()) { command.add(LTTngControlServiceConstants.OPTION_LIVE); if (sessionInfo.getLiveDelay() != LTTngControlServiceConstants.UNUSED_VALUE) { command.add(String.valueOf(sessionInfo.getLiveDelay())); } } if (sessionInfo.getNetworkUrl() != null) { command.add(LTTngControlServiceConstants.OPTION_NETWORK_URL); command.add(sessionInfo.getNetworkUrl()); } else { command.add(LTTngControlServiceConstants.OPTION_CONTROL_URL); command.add(sessionInfo.getControlUrl()); command.add(LTTngControlServiceConstants.OPTION_DATA_URL); command.add(sessionInfo.getDataUrl()); } return command; }</code><technical_language>proud of order here</technical_language>

Target:
protected @NonNull List<String> prepareStreamedSessionCreationCommand(ISessionInfo sessionInfo) { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION); if (!sessionInfo.getName().isEmpty()) { command.add(sessionInfo.getName()); } if (sessionInfo.isSnapshotSession()) { command.add(LTTngControlServiceConstants.OPTION_SNAPSHOT); } else if (sessionInfo.isLive()) { command.add(LTTngControlServiceConstants.OPTION_LIVE); if (sessionInfo.getLiveDelay() != LTTngControlServiceConstants.UNUSED_VALUE) { command.add(String.valueOf(sessionInfo.getLiveDelay())); } } if (sessionInfo.getNetworkUrl() != null) { command.add(LTTngControlServiceConstants.OPTION_NETWORK_URL); command.add(sessionInfo.getNetworkUrl()); } else { command.add(LTTngControlServiceConstants.OPTION_CONTROL_URL); command.add(sessionInfo.getControlUrl()); command.add(LTTngControlServiceConstants.OPTION_DATA_URL); command.add(sessionInfo.getDataUrl()); } return command; }
Source:
<code>private void showNearbyPages(NearbyResult result) { getActivity().invalidateOptionsMenu(); if (currentLocation != null) { sortByDistance(result.getList()); } adapter.clear(); addResultsToAdapter(result.getList()); compassViews.clear(); mMarkerList.clear(); mapView.clear(); <START> nearbyListContainer.setVisibility(adapter.getCount() == 0 ? View.GONE : View.VISIBLE); <END> for (int i = 0; i < adapter.getCount(); i++) { NearbyPage item = adapter.getItem(i); Location location = item.getLocation(); Marker marker = new CustomMarker(mapView, item.getTitle(), item.getDescription(), new LatLng(location.getLatitude(), location.getLongitude())); marker.setIcon(mMarkerIconPassive); marker.setRelatedObject(item); marker.setHotspot(Marker.HotspotPlace.BOTTOM_CENTER); mMarkerList.add(marker); } mapView.addMarkers(mMarkerList); }</code><technical_language>adapter.isEmpty()</technical_language>

Target:
private void showNearbyPages(NearbyResult result) { getActivity().invalidateOptionsMenu(); if (currentLocation != null) { sortByDistance(result.getList()); } adapter.clear(); addResultsToAdapter(result.getList()); compassViews.clear(); mMarkerList.clear(); mapView.clear(); nearbyListContainer.setVisibility(adapter.isEmpty() ? View.GONE : View.VISIBLE); for (int i = 0; i < adapter.getCount(); i++) { NearbyPage item = adapter.getItem(i); Location location = item.getLocation(); Marker marker = new Marker(mapView, item.getTitle(), item.getDescription(), new LatLng(location.getLatitude(), location.getLongitude())); marker.setIcon(mMarkerIconPassive); marker.setRelatedObject(item); marker.setHotspot(Marker.HotspotPlace.BOTTOM_CENTER); mMarkerList.add(marker); } mapView.addMarkers(mMarkerList); }
Source:
<code>public void storeMobilePolicyForOrg(UserAccount account, int timeout, int passLen) { if (account == null) { return; } final Context context = SalesforceSDKManager.getInstance().getAppContext(); final SharedPreferences sp = context.getSharedPreferences(MOBILE_POLICY_PREF + account.getOrgLevelFilenameSuffix(), Context.MODE_PRIVATE); final Editor e = sp.edit(); e.putInt(KEY_TIMEOUT, timeout); e.putInt(KEY_PASSCODE_LENGTH, passLen); <START> e.commit(); <END> }</code><technical_language><table data-meta="generated_by_SalesforceSDK"> <tbody> <tr> <td>:warning:</td> <td width="100%" data-sticky="false"><span data-href="<LINK_0>"></span>Consider <code>apply()</code> instead; <code>commit</code> writes data persistent storage immediately, <code>apply</code> handle in background</td> </tr> </tbody> </table></technical_language>

Target:
public void storeMobilePolicyForOrg(UserAccount account, int timeout, int passLen) { storeMobilePolicyForOrg(account, timeout, passLen, true); }
Source:
<code><START> public JobStatus permanentlyDeleteTicket(Ticket ticket) { <END> checkHasId(ticket); deleteTicket(ticket.getId()); return permanentlyDeleteTicket(ticket.getId()); }</code><technical_language>want signature compatible</technical_language>

Target:
public JobStatus permanentlyDeleteTicket(Ticket ticket) { checkHasId(ticket); return permanentlyDeleteTicket(ticket.getId()); }
Source:
<code>public void testManagementDescription() throws Exception { final ModelNode address = new ModelNode(); address.add(ModelDescriptionConstants.DEPLOYMENT, "ws-example.war"); address.add(ModelDescriptionConstants.SUBSYSTEM, WSExtension.SUBSYSTEM_NAME); address.add("endpoint", "*"); final ModelNode operation = new ModelNode(); operation.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.READ_RESOURCE_OPERATION); operation.get(ModelDescriptionConstants.OP_ADDR).set(address); operation.get(ModelDescriptionConstants.INCLUDE_RUNTIME).set(true); operation.get(ModelDescriptionConstants.RECURSIVE).set(true); final ModelNode result = managementClient.getControllerClient().execute(operation); <START> assertThat(result.get(ModelDescriptionConstants.OUTCOME).asString(), is(ModelDescriptionConstants.SUCCESS)); <END> List<ModelNode> endpoints = result.get("result").asList(); assertThat(endpoints.size() > 0, is(true)); for (final ModelNode endpointResult : result.get("result").asList()) { final ModelNode endpoint = endpointResult.get("result"); assertThat(endpoint.hasDefined("class"), is(true)); assertThat(endpoint.hasDefined("name"), is(true)); assertThat(endpoint.hasDefined("wsdl-url"), is(true)); assertThat(endpoint.get("wsdl-url").asString().endsWith("?wsdl"), is(true)); assertThat(endpoint.hasDefined("request-count"), is(true)); assertThat(endpoint.get("request-count").asString(), containsString("No metrics available")); } }</code><technical_language>@ehsavoie replacements of Assert.assertEquals() assertThat() pointless, hard changed. If 'must' do this replacement, please do a separate commit</technical_language>

Target:
public void testManagementDescription() throws Exception { final ModelNode address = new ModelNode(); address.add(ModelDescriptionConstants.DEPLOYMENT, "ws-example.war"); address.add(ModelDescriptionConstants.SUBSYSTEM, WSExtension.SUBSYSTEM_NAME); address.add("endpoint", "*"); final ModelNode operation = new ModelNode(); operation.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.READ_RESOURCE_OPERATION); operation.get(ModelDescriptionConstants.OP_ADDR).set(address); operation.get(ModelDescriptionConstants.INCLUDE_RUNTIME).set(true); operation.get(ModelDescriptionConstants.RECURSIVE).set(true); final ModelNode result = managementClient.getControllerClient().execute(operation); List<ModelNode> endpoints = DomainTestSupport.validateResponse(result).asList(); assertThat(endpoints.size() > 0, is(true)); for (final ModelNode endpointResult : result.get("result").asList()) { final ModelNode endpoint = endpointResult.get("result"); assertThat(endpoint.hasDefined("class"), is(true)); assertThat(endpoint.hasDefined("name"), is(true)); assertThat(endpoint.hasDefined("wsdl-url"), is(true)); assertThat(endpoint.get("wsdl-url").asString().endsWith("?wsdl"), is(true)); assertThat(endpoint.hasDefined("request-count"), is(true)); assertThat(endpoint.get("request-count").asString(), containsString("No metrics available")); } }
Source:
<code>public String getHealthStatus(){ return GSON.toJson(ImmutableMap.of( "Solr", healthCheckService.isSolrUp(Arrays.asList("analytics", "bioentities")) ? "UP" : "DOWN", <START> "DB", healthCheckService.isDatabaseUp(experimentDao) ? "UP" : "DOWN" <END> )); }</code><technical_language>lenient check web prod is... split endpoints in case</technical_language>

Target:
public String getHealthStatus(){ return GSON.toJson(ImmutableMap.of( "solr", healthCheckService.isSolrUp(Arrays.asList("analytics", "bioentities")) ? "UP" : "DOWN", "db", healthCheckService.isDatabaseUp(experimentDao) ? "UP" : "DOWN" )); }
Source:
<code>public void listChanged(final IDockerConnection connection, final List<IDockerContainer> list) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { final <START> ITreeSelection selection <END> = getCommonViewer() .getStructuredSelection(); getCommonViewer().refresh(); if (selection != null) { getCommonViewer().setSelection(selection, false); } } }); }</code><technical_language>describe reproduce issue this fixes</technical_language>

Target:
public void listChanged(final IDockerConnection connection, final List<IDockerContainer> list) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { final ISelection selection = getCommonViewer() .getSelection(); if (selection != null) { getCommonViewer().setSelection(selection, false); } getCommonViewer().refresh(); } }); }
Source:
<code>public void refresh() { <START> new SwingWorker<Void, Void>() { <END> @Override protected Void doInBackground() throws Exception { attributeValues.displayDelayedMetadata(); setChildren(Children.create(new CommonAttributeValueNodeFactory(attributeValues.getMetadataList()), false)); return null; } @Override protected void done() { super.done(); try { get(); } catch (InterruptedException | ExecutionException ex) { logger.log(Level.SEVERE, "Unexpected exception while loading common search result instances", ex); } } }.execute(); }</code><technical_language>a SwingWorker get opposed passing "true" Children.create() call (which key creation happen a separate thread)</technical_language>

Target:
public void refresh() { attributeValues.displayDelayedMetadata(); setChildren(Children.create(new CommonAttributeValueNodeFactory(attributeValues.getMetadataList()), true)); }
Source:
<code>private MapBlockBuilder( boolean useNewMapBlock, Type keyType, MethodHandle keyBlockNativeEquals, MethodHandle keyNativeHashCode, MethodHandle keyBlockHashCode, @Nullable BlockBuilderStatus blockBuilderStatus, BlockBuilder keyBlockBuilder, BlockBuilder valueBlockBuilder, int[] offsets, boolean[] mapIsNull, int[] hashTables) { super(keyType, keyNativeHashCode, keyBlockNativeEquals); this.useNewMapBlock = useNewMapBlock; if (useNewMapBlock) { requireNonNull(keyBlockHashCode, "keyBlockHashCode is null"); <START> } <END> this.keyBlockHashCode = keyBlockHashCode; this.blockBuilderStatus = blockBuilderStatus; this.positionCount = 0; this.offsets = requireNonNull(offsets, "offsets is null"); this.mapIsNull = requireNonNull(mapIsNull, "mapIsNull is null"); this.keyBlockBuilder = requireNonNull(keyBlockBuilder, "keyBlockBuilder is null"); this.valueBlockBuilder = requireNonNull(valueBlockBuilder, "valueBlockBuilder is null"); this.hashTables = requireNonNull(hashTables, "hashTables is null"); }</code><technical_language>enforce in other case</technical_language>

Target:
private MapBlockBuilder( boolean useNewMapBlock, Type keyType, MethodHandle keyBlockNativeEquals, MethodHandle keyNativeHashCode, MethodHandle keyBlockHashCode, @Nullable BlockBuilderStatus blockBuilderStatus, BlockBuilder keyBlockBuilder, BlockBuilder valueBlockBuilder, int[] offsets, boolean[] mapIsNull, int[] hashTables) { super(keyType, keyNativeHashCode, keyBlockNativeEquals); this.useNewMapBlock = useNewMapBlock; if (useNewMapBlock) { requireNonNull(keyBlockHashCode, "keyBlockHashCode is null"); } else { if (keyBlockHashCode != null) { throw new IllegalArgumentException("When useNewMapBlock is false, keyBlockHashCode should be null."); } } this.keyBlockHashCode = keyBlockHashCode; this.blockBuilderStatus = blockBuilderStatus; this.positionCount = 0; this.offsets = requireNonNull(offsets, "offsets is null"); this.mapIsNull = requireNonNull(mapIsNull, "mapIsNull is null"); this.keyBlockBuilder = requireNonNull(keyBlockBuilder, "keyBlockBuilder is null"); this.valueBlockBuilder = requireNonNull(valueBlockBuilder, "valueBlockBuilder is null"); this.hashTables = requireNonNull(hashTables, "hashTables is null"); }
Source:
<code>if (PKCS11_PROVIDER != null) { <START> LOGGER.debug("PKCS11 NSS provider was loaded - native crypto support enabled"); <END> }</code><technical_language>In light of ranked preference, this message *enabled*</technical_language>

Target:
if (PKCS11_PROVIDER != null) { LOGGER.debug("PKCS11 NSS provider was loaded - native crypto support available"); }
Source:
<code>public Block provideFromDirectStream(OrcDataSourceId dataSourceId, int batchSize, BooleanInputStream presentStream, LongInputStream dataStream) throws IOException { if (presentStream == null) { if (dataStream == null) { throw new OrcCorruptionException(dataSourceId, "Value is not null but data stream is not present"); } return populateNonNullBlock(batchSize, dataStream); } <START> else { <END> boolean[] isNull = new boolean[batchSize]; int nullCount = presentStream.getUnsetBits(batchSize, isNull); if (nullCount == 0) { verify(dataStream != null); return populateNonNullBlock(batchSize, dataStream); } if (nullCount != batchSize) { verify(dataStream != null); return populateBlockWithNull(batchSize, dataStream, isNull); } else { return new RunLengthEncodedBlock( new IntArrayBlock(1, Optional.of(new boolean[] {true}), new int[] {0}), batchSize); } } }</code><technical_language>generally avoid a "redundant else" (where "if" block returns throws unconditionally). IntelliJ inspection for this (under *Java | Control flow issues*)</technical_language>

Target:
public Block provideFromDirectStream(OrcDataSourceId dataSourceId, int batchSize, BooleanInputStream presentStream, LongInputStream dataStream) throws IOException { if (presentStream == null) { if (dataStream == null) { throw new OrcCorruptionException(dataSourceId, "Value is not null but data stream is not present"); } return populateNonNullBlock(batchSize, dataStream); } boolean[] isNull = new boolean[batchSize]; int nullCount = presentStream.getUnsetBits(batchSize, isNull); if (nullCount == 0) { verify(dataStream != null); return populateNonNullBlock(batchSize, dataStream); } if (nullCount != batchSize) { verify(dataStream != null); return populateBlockWithNull(batchSize, dataStream, isNull); } return new RunLengthEncodedBlock( new IntArrayBlock(1, Optional.of(new boolean[] {true}), new int[] {0}), batchSize); }