auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void put(T block, byte[] data, byte[] header, boolean overwrite, boolean isOldBlock) throws IOException, KeyCollisionException { byte[] routingKey = block.getRoutingKey(); ByteArrayWrapper key = new ByteArrayWrapper(routingKey); Block<T> storeBlock = new Block<T>(); storeBlock.block = block; storeBlock.data = data; storeBlock.header = header; storeBlock.overwrite = overwrite; storeBlock.isOldBlock = isOldBlock; boolean dontCacheIt = false; configLock.writeLock().lock(); try { if(!shuttingDown) { Block<T> previousBlock = blocksByRoutingKey.get(key); if(!collisionPossible || overwrite) { blocksByRoutingKey.put(key, storeBlock); if(previousBlock == null) { size += data.length+header.length+block.getFullKey().length+routingKey.length; } } else { if(previousBlock != null) { throw new KeyCollisionException(); } if(backDatastore.probablyInStore(routingKey)) { dontCacheIt = true; } else { blocksByRoutingKey.put(key, storeBlock); size += data.length+header.length+block.getFullKey().length+routingKey.length; } } if(size > maxSize) { pushAll(); } else { if(!blocksByRoutingKey.isEmpty() && !startJob) { startJob = true; this.ticker.queueTimedJob(new Runnable() { @Override public void run() { configLock.writeLock().lock(); try { pushAll(); startJob = false; } finally { configLock.writeLock().unlock(); } } }, period); } } } else { dontCacheIt = true; } } finally { configLock.writeLock().unlock(); } if(dontCacheIt) { backDatastore.put(block, data, header, overwrite, isOldBlock); return; } }

Target:
public void put(T block, byte[] data, byte[] header, boolean overwrite, boolean isOldBlock) throws IOException, KeyCollisionException { byte[] routingKey = block.getRoutingKey(); ByteArrayWrapper key = new ByteArrayWrapper(routingKey); Block<T> storeBlock = new Block<T>(); storeBlock.block = block; storeBlock.data = data; storeBlock.header = header; storeBlock.overwrite = overwrite; storeBlock.isOldBlock = isOldBlock; long sizeBlock = data.length+header.length+block.getFullKey().length+routingKey.length; boolean cacheIt = true; configLock.writeLock().lock(); try { if(!shuttingDown) { Block<T> previousBlock = blocksByRoutingKey.get(key); if(!collisionPossible || overwrite) { blocksByRoutingKey.put(key, storeBlock); if(previousBlock == null) { size += sizeBlock; } } else { if(previousBlock != null) { throw new KeyCollisionException(); } if(backDatastore.probablyInStore(routingKey)) { cacheIt = false; } else { blocksByRoutingKey.put(key, storeBlock); size += sizeBlock; } } if(size > maxSize) { pushAll(); } else { if(!blocksByRoutingKey.isEmpty() && !startJob) { startJob = true; this.ticker.queueTimedJob(new Runnable() { @Override public void run() { configLock.writeLock().lock(); try { pushAll(); startJob = false; } finally { configLock.writeLock().unlock(); } } }, period); } } } else { cacheIt = false; } } finally { configLock.writeLock().unlock(); } if(!cacheIt) { backDatastore.put(block, data, header, overwrite, isOldBlock); return; } }
Source:
protected ServerOAuth2AuthorizedClientExchangeFilterFunction(ServerOAuth2AuthorizedClientRepository authorizedClientRepository, OAuth2AuthorizedClientResolver authorizedClientResolver) { this.authorizedClientRepository = authorizedClientRepository; this.authorizedClientResolver = authorizedClientResolver; }

Target:
ServerOAuth2AuthorizedClientExchangeFilterFunction(ServerOAuth2AuthorizedClientRepository authorizedClientRepository, OAuth2AuthorizedClientResolver authorizedClientResolver) { this.authorizedClientRepository = authorizedClientRepository; this.authorizedClientResolver = authorizedClientResolver; }
Source:
public void testOneDimensionalEncoding() throws Exception { String path = "wfs?request=GetFeature&typename=gsmlbh:Borehole&outputFormat=json"; JSON json = getAsJSON(path); print(json); JSONObject properties = getFeaturePropertiesById(json, "borehole.GA.17322"); assertThat(properties, is(notNullValue())); JSONObject samplingLocation = getNestedObject( properties, "relatedSamplingFeature", "relatedSamplingFeature", "geometry"); JSONArray coordinates = samplingLocation.getJSONArray("coordinates"); assertThat(coordinates.size(), is(2)); JSONArray c1 = coordinates.getJSONArray(0); assertThat(c1.size(), is(1)); assertEquals(57.9, c1.getDouble(0), 0.1); JSONArray c2 = coordinates.getJSONArray(1); assertThat(c2.size(), is(1)); assertEquals(66.5, c2.getDouble(0), 0.1); }

Target:
public void testOneDimensionalEncoding() throws Exception { String path = "wfs?request=GetFeature&typename=gsmlbh:Borehole&outputFormat=json"; JSON json = getAsJSON(path); JSONObject properties = getFeaturePropertiesById(json, "borehole.GA.17322"); assertThat(properties, is(notNullValue())); JSONObject samplingLocation = getNestedObject( properties, "relatedSamplingFeature", "relatedSamplingFeature", "geometry"); JSONArray coordinates = samplingLocation.getJSONArray("coordinates"); assertThat(coordinates.size(), is(2)); JSONArray c1 = coordinates.getJSONArray(0); assertThat(c1.size(), is(1)); assertEquals(57.9, c1.getDouble(0), 0.1); JSONArray c2 = coordinates.getJSONArray(1); assertThat(c2.size(), is(1)); assertEquals(66.5, c2.getDouble(0), 0.1); }
Source:
public void apply(OnlineCommandContext ctx) throws Exception { if (usernameLoad != null) { ctx.client.serverVersion().assertAtLeast(ManagementVersion.VERSION_2_0_0, "Option username-load is available since WildFly 8"); } Operations ops = new Operations(ctx.client); Address securityRealmLdapAuthnAddress = securityRealmAddress.and("authentication", "ldap"); if (replaceExisting) { try { ops.removeIfExists(securityRealmLdapAuthnAddress); new Administration(ctx.client).reloadIfRequired(); } catch (OperationException e) { throw new IOException("Failed to remove ldap authentication from security realm.", e); } } ops.add(securityRealmLdapAuthnAddress, Values.empty() .andOptional("username-attribute", usernameAttribute) .andOptional("advanced-filter", advancedFilter) .andOptional("connection", connection) .andOptional("base-dn", baseDn) .andOptional("user-dn", userDn) .andOptional("username-load", usernameLoad) .andOptional("allow-empty-passwords", allowEmptyPasswords) .andOptional("recursive", recursive)); if (cache != null) { String cacheType = null; if (cache.getByAccessTime()) { cacheType = "by-access-time"; } if (cache.getBySearchTime()) { cacheType = "by-search-time"; } ops.add(securityRealmLdapAuthnAddress.and("cache", cacheType), Values.empty() .andOptional("cache-failures", cache.getCacheFailures()) .andOptional("eviction-time", cache.getEvictionTime()) .andOptional("max-cache-size", cache.getMaxCacheSize())); } }

Target:
public void apply(OnlineCommandContext ctx) throws Exception { if (usernameLoad != null) { ctx.version.assertAtLeast(ServerVersion.VERSION_2_0_0, "Option username-load is available since WildFly 8"); } Operations ops = new Operations(ctx.client); Address securityRealmLdapAuthnAddress = securityRealmAddress.and("authentication", "ldap"); if (replaceExisting) { ops.removeIfExists(securityRealmLdapAuthnAddress); new Administration(ctx.client).reloadIfRequired(); } ops.add(securityRealmLdapAuthnAddress, Values.empty() .andOptional("username-attribute", usernameAttribute) .andOptional("advanced-filter", advancedFilter) .andOptional("connection", connection) .andOptional("base-dn", baseDn) .andOptional("user-dn", userDn) .andOptional("username-load", usernameLoad) .andOptional("allow-empty-passwords", allowEmptyPasswords) .andOptional("recursive", recursive)); if (cache != null) { String cacheType = null; if (cache.getByAccessTime()) { cacheType = "by-access-time"; } if (cache.getBySearchTime()) { cacheType = "by-search-time"; } ops.add(securityRealmLdapAuthnAddress.and("cache", cacheType), Values.empty() .andOptional("cache-failures", cache.getCacheFailures()) .andOptional("eviction-time", cache.getEvictionTime()) .andOptional("max-cache-size", cache.getMaxCacheSize())); } }
Source:
public void testPersistWriter() throws Exception { HbasePersistWriter testPersistWriter = new HbasePersistWriter(testConfiguration); testPersistWriter.prepare(testConfiguration); InputStream testActivityFolderStream = HbasePersistWriterIT.class.getClassLoader() .getResourceAsStream("activities"); List<String> files = IOUtils.readLines(testActivityFolderStream, Charsets.UTF_8); for( String file : files) { LOGGER.info("File: " + file ); InputStream testActivityFileStream = HbasePersistWriterIT.class.getClassLoader() .getResourceAsStream("activities/" + file); Activity activity = MAPPER.readValue(testActivityFileStream, Activity.class); StreamsDatum datum = new StreamsDatum(activity, activity.getVerb()); testPersistWriter.write( datum ); LOGGER.info("Wrote: " + activity.getVerb() ); } testPersistWriter.cleanUp(); }

Target:
public void testPersistWriter() throws Exception { HbasePersistWriter testPersistWriter = new HbasePersistWriter(testConfiguration); testPersistWriter.prepare(testConfiguration); InputStream testActivityFolderStream = HbasePersistWriterIT.class.getClassLoader() .getResourceAsStream("activities"); List<String> files = IOUtils.readLines(testActivityFolderStream, StandardCharsets.UTF_8); for( String file : files) { LOGGER.info("File: " + file ); InputStream testActivityFileStream = HbasePersistWriterIT.class.getClassLoader() .getResourceAsStream("activities/" + file); Activity activity = MAPPER.readValue(testActivityFileStream, Activity.class); StreamsDatum datum = new StreamsDatum(activity, activity.getVerb()); testPersistWriter.write( datum ); LOGGER.info("Wrote: " + activity.getVerb() ); } testPersistWriter.cleanUp(); }
Source:
private Request addRateLimitIdTag(Request request) { return request.newBuilder() .tag(ConcurrencyLimiterListener.class, ConcurrencyLimiterListener.of(concurrencyLimiters.acquireLimiter(request).acquire())) .build(); }

Target:
private Request addRateLimitIdTag(Request request) { return request.newBuilder() .tag(ConcurrencyLimiterListener.class, ConcurrencyLimiterListener.of(SettableFuture.create())) .build(); }
Source:
public void start() { LOGGER.info("Load plugins"); for (File file : listJarFiles(fs.getInstalledPluginsDir())) { PluginInfo info = PluginInfo.create(file); pluginInfosByKeys.put(info.getKey(), info); LOGGER.info("Loaded plugin [{}]", info.getName(), info.getKey()); } pluginInstancesByKeys.putAll(loader.load(pluginInfosByKeys)); started.set(true); }

Target:
public void start() { LOGGER.info("Load plugins"); for (File file : listJarFiles(fs.getInstalledPluginsDir())) { PluginInfo info = PluginInfo.create(file); pluginInfosByKeys.put(info.getKey(), info); } pluginInstancesByKeys.putAll(loader.load(pluginInfosByKeys)); pluginInfosByKeys.values().forEach(p -> LOGGER.info("Loaded plugin [{}]", p.getName(), p.getKey())); started.set(true); }
Source:
public WorkerAllocatedResource allocateQueryMaster(QueryInProgress queryInProgress) { WorkerResourceAllocationRequest qmResourceRequest = createQMResourceRequest(queryInProgress.getQueryId()); SimpleExchange<WorkerResourceAllocationResponse> callFuture = new SimpleExchange<WorkerResourceAllocationResponse>() { @Override protected void cancel(WorkerResourceAllocationResponse canceled) { if (canceled != null && !canceled.getWorkerAllocatedResourceList().isEmpty()) { LOG.info("Canceling resources allocated"); WorkerAllocatedResource resource = canceled.getWorkerAllocatedResource(0); releaseWorkerResource(resource.getContainerId()); } } }; allocateWorkerResources(qmResourceRequest, callFuture); WorkerResourceAllocationResponse response = null; try { response = callFuture.get(3, TimeUnit.SECONDS); } catch (Throwable t) { response = callFuture.cancel(); if (response == null) { LOG.warn("Got exception " + t); LOG.error(t, t); return null; } } if (response == null || response.getWorkerAllocatedResourceList().size() == 0) { return null; } WorkerAllocatedResource resource = response.getWorkerAllocatedResource(0); registerQueryMaster(queryInProgress.getQueryId(), resource.getContainerId()); return resource; }

Target:
public WorkerAllocatedResource allocateQueryMaster(QueryInProgress queryInProgress) { long timeout = masterContext.getConf().getTimeVar( TajoConf.ConfVars.TAJO_QUERYMASTER_ALLOCATION_TIMEOUT, TimeUnit.MILLISECONDS); WorkerResourceAllocationRequest qmResourceRequest = createQMResourceRequest(queryInProgress.getQueryId()); final CancelableRpcCallback<WorkerResourceAllocationResponse> callFuture = new CancelableRpcCallback<WorkerResourceAllocationResponse>() { @Override protected void cancel(WorkerResourceAllocationResponse canceled) { if (canceled != null && !canceled.getWorkerAllocatedResourceList().isEmpty()) { LOG.info("Canceling resources allocated"); WorkerAllocatedResource resource = canceled.getWorkerAllocatedResource(0); releaseWorkerResource(resource.getContainerId()); } } }; allocateWorkerResources(qmResourceRequest, callFuture); WorkerResourceAllocationResponse response = null; try { response = callFuture.get(timeout, TimeUnit.MILLISECONDS); } catch (Throwable t) { response = callFuture.cancel(); if (response == null) { LOG.warn("Got exception waiting resources for query master " + queryInProgress.getQueryId(), t); return null; } } if (response == null || response.getWorkerAllocatedResourceList().size() == 0) { return null; } WorkerAllocatedResource resource = response.getWorkerAllocatedResource(0); registerQueryMaster(queryInProgress.getQueryId(), resource.getContainerId()); return resource; }
Source:
void should_create_error_message() { String message = shouldBeValidBase64("string").create(new TestDescription("TEST"), STANDARD_REPRESENTATION); then(message).isEqualTo(format("[TEST] %nExpecting <\"string\"> to be a valid Base64 encoded string")); }

Target:
void should_create_error_message() { String message = shouldBeValidBase64("string %s").create(new TestDescription("TEST"), STANDARD_REPRESENTATION); then(message).isEqualTo(format("[TEST] %nExpecting <\"string %%s\"> to be a valid Base64 encoded string")); }
Source:
public Intent getIntentForBrokerActivity(final AuthenticationRequest request) { Intent intent = null; AccountManagerFuture<Bundle> result; try { Bundle addAccountOptions = getBrokerOptions(request); result = mAcctManager.addAccount(AuthenticationConstants.Broker.BROKER_ACCOUNT_TYPE, AuthenticationConstants.Broker.AUTHTOKEN_TYPE, null, addAccountOptions, null, null, mHandler); Bundle bundleResult = result.getResult(); intent = bundleResult.getParcelable(AccountManager.KEY_INTENT); if (intent != null) { intent.putExtra(AuthenticationConstants.Broker.BROKER_REQUEST, AuthenticationConstants.Broker.BROKER_REQUEST); if (!isBrokerWithPRTSupport(intent) && PromptBehavior.FORCE_PROMPT == request.getPrompt()) { Logger.v(TAG, "FORCE_PROMPT is set for broker auth via old version of broker app, reset to ALWAYS."); intent.putExtra(AuthenticationConstants.Broker.ACCOUNT_PROMPT, PromptBehavior.Always.name()); } } } catch (OperationCanceledException e) { Logger.e(TAG, "Authenticator cancels the request", "", ADALError.AUTH_FAILED_CANCELLED, e); } catch (AuthenticatorException e) { Logger.e(TAG, "Authenticator cancels the request", "", ADALError.BROKER_AUTHENTICATOR_NOT_RESPONDING, e); } catch (IOException e) { Logger.e(TAG, "Authenticator cancels the request", "", ADALError.BROKER_AUTHENTICATOR_IO_EXCEPTION, e); } return intent; }

Target:
public Intent getIntentForBrokerActivity(final AuthenticationRequest request) { Intent intent = null; try { Bundle addAccountOptions = getBrokerOptions(request); final AccountManagerFuture<Bundle> result = mAcctManager.addAccount( AuthenticationConstants.Broker.BROKER_ACCOUNT_TYPE, AuthenticationConstants.Broker.AUTHTOKEN_TYPE, null, addAccountOptions, null, null, mHandler); Bundle bundleResult = result.getResult(); intent = bundleResult.getParcelable(AccountManager.KEY_INTENT); if (intent != null) { intent.putExtra(AuthenticationConstants.Broker.BROKER_REQUEST, AuthenticationConstants.Broker.BROKER_REQUEST); if (!isBrokerWithPRTSupport(intent) && PromptBehavior.FORCE_PROMPT == request.getPrompt()) { Logger.v(TAG, "FORCE_PROMPT is set for broker auth via old version of broker app, reset to ALWAYS."); intent.putExtra(AuthenticationConstants.Broker.ACCOUNT_PROMPT, PromptBehavior.Always.name()); } } } catch (OperationCanceledException e) { Logger.e(TAG, "Authenticator cancels the request", "", ADALError.AUTH_FAILED_CANCELLED, e); } catch (AuthenticatorException e) { Logger.e(TAG, "Authenticator cancels the request", "", ADALError.BROKER_AUTHENTICATOR_NOT_RESPONDING, e); } catch (IOException e) { Logger.e(TAG, "Authenticator cancels the request", "", ADALError.BROKER_AUTHENTICATOR_IO_EXCEPTION, e); } return intent; }
Source:
public void updateTimelime(final Timeline timeline) { try { jdbcTemplate.update( "UPDATE zn_data.timeline SET " + " et_name=?, " + " tl_order=?, " + " st_id=?, " + " tl_topic=?, " + " tl_created_at=?, " + " tl_switched_at=?, " + " tl_cleanup_at=?, " + " tl_latest_position=?::jsonb " + " WHERE tl_id=?", timeline.getEventType(), timeline.getOrder(), timeline.getStorage().getId(), timeline.getTopic(), timeline.getCreatedAt(), timeline.getSwitchedAt(), timeline.getCleanupAt(), timeline.getLatestPosition() == null ? null : jsonMapper.writer().writeValueAsString(timeline.getLatestPosition()), timeline.getId()); } catch (final JsonProcessingException ex) { throw new IllegalArgumentException("Can not serialize latest position to json", ex); } }

Target:
public void updateTimelime(final Timeline timeline) { if (null == timeline.getId()) { throw new IllegalArgumentException("Timeline id can not be null on update (" + timeline + ")"); } try { jdbcTemplate.update( "UPDATE zn_data.timeline SET " + " et_name=?, " + " tl_order=?, " + " st_id=?, " + " tl_topic=?, " + " tl_created_at=?, " + " tl_switched_at=?, " + " tl_cleanup_at=?, " + " tl_latest_position=?::jsonb " + " WHERE tl_id=?", timeline.getEventType(), timeline.getOrder(), timeline.getStorage().getId(), timeline.getTopic(), timeline.getCreatedAt(), timeline.getSwitchedAt(), timeline.getCleanupAt(), timeline.getLatestPosition() == null ? null : jsonMapper.writer().writeValueAsString(timeline.getLatestPosition()), timeline.getId()); } catch (final JsonProcessingException ex) { throw new IllegalArgumentException("Can not serialize latest position to json", ex); } }
Source:
public void clickOnHightlightThreadButton(boolean highlight) { waitForElementByElement(hightlightThreadButton); waitForElementClickableByElement(hightlightThreadButton); scrollAndClick(hightlightThreadButton); if (highlight) { waitForElementByCss(".removed"); } else { waitForElementNotVisibleByBy(By.cssSelector(".removed")); } PageObjectLogging.log("clickOnHightlightThreadButton", "click on '" + (highlight ? "highlight": "unhighlight") + " thread' button on a message", true); }

Target:
private void clickOnHightlightThreadButton(boolean highlight) { waitForElementByElement(hightlightThreadButton); waitForElementClickableByElement(hightlightThreadButton); scrollAndClick(hightlightThreadButton); if (highlight) { waitForElementByElement(highlightLabel); } else { waitForElementNotVisibleByElement(highlightLabel); } PageObjectLogging.log("clickOnHightlightThreadButton", "click on '" + (highlight ? "highlight": "unhighlight") + " thread' button on a message", true); }
Source:
protected void writeInfo() { _writer.writeStartElement("Info"); _writer.writeRaw(String.format("%1$s CPU, %2$s Memeory", vmBase.getNumOfCpus(), vmBase.getMemSizeMb())); _writer.writeEndElement(); }

Target:
protected void writeInfo() { _writer.writeStartElement("Info"); _writer.writeRaw(String.format("%1$s CPU, %2$s Memory", vmBase.getNumOfCpus(), vmBase.getMemSizeMb())); _writer.writeEndElement(); }
Source:
public GroupedPropertyList getPropertyList() throws Exception { if (propertyList == null) { propertyList = new GroupedPropertyList(individual, vreq, editing); } return propertyList; }

Target:
public GroupedPropertyList getPropertyList() { if (propertyList == null) { propertyList = new GroupedPropertyList(individual, vreq, editing); } return propertyList; }
Source:
public BlobChangefeedAsyncClient buildAsyncClient() { BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest(); return new BlobChangefeedAsyncClient(pipeline, accountUrl, serviceVersion); }

Target:
public BlobChangefeedAsyncClient buildAsyncClient() { BlobContainerAsyncClient client = new BlobContainerClientBuilder() .endpoint(accountUrl) .containerName(CHANGEFEED_CONTAINER_NAME) .pipeline(pipeline) .serviceVersion(version) .buildAsyncClient(); AvroReaderFactory avroReaderFactory = new AvroReaderFactory(); BlobChunkedDownloaderFactory blobChunkedDownloaderFactory = new BlobChunkedDownloaderFactory(client); ChunkFactory chunkFactory = new ChunkFactory(avroReaderFactory, blobChunkedDownloaderFactory); ShardFactory shardFactory = new ShardFactory(chunkFactory, client); SegmentFactory segmentFactory = new SegmentFactory(shardFactory, client); ChangefeedFactory changefeedFactory = new ChangefeedFactory(segmentFactory, client); return new BlobChangefeedAsyncClient(changefeedFactory); }
Source:
private Organisation stubOrgObject() { Organisation organisation = new Organisation(); organisation.setName("testname"); organisation.setLocation("testlocation"); organisation.setLocation("testlink"); organisation.setEmail("test@email.com"); organisation.setDescription("This is the test description."); return organisation; }

Target:
private Organisation stubOrgObject() { String markdownDescription = "An h1 header ============ Paragraphs are separated by a blank line. 2nd paragraph. *Italic*, **bold**, and `monospace`. Itemized lists look like: * this one * that one * the other one Note that --- not considering the asterisk --- the actual text content starts at 4-columns in. > Block quotes are > written like so. > > They can span multiple paragraphs, > if you like. Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., \"it's all in chapters 12--14\"). Three dots ... will be converted to an ellipsis. Unicode is supported. ☺ "; Organisation organisation = new Organisation(); organisation.setName("testname"); organisation.setLocation("testlocation"); organisation.setLink("testlink"); organisation.setEmail("test@email.com"); organisation.setDescription(markdownDescription); return organisation; }
Source:
public byte[] toBytesFull(boolean withHeader) { int size = getFullStorageSize(numBuckets); if (withHeader) { size += Byte.BYTES + Byte.BYTES; } ByteBuffer buf = ByteBuffer.allocate(size); toBytesFullHelper(buf, withHeader); return buf.array(); }

Target:
public byte[] toBytesFull(boolean withHeader) { int size = getFullStorageSize(numBuckets); if (withHeader) { size += SERDE_HEADER_SIZE; } ByteBuffer buf = ByteBuffer.allocate(size); writeByteBufferFull(buf, withHeader); return buf.array(); }
Source:
public void testNotStats() { assertExpression("NOT(x < 0e0)") .outputRowsCount(625) .symbolStats(new Symbol("x"), symbolAssert -> symbolAssert.averageRowSize(4.0) .lowValue(-10.0) .highValue(10.0) .distinctValuesCount(40.0) .nullsFraction(0.4)) .symbolStats(new Symbol("y"), symbolAssert -> symbolAssert.distinctValuesCount(20.0)); assertExpression("NOT(json_array_contains(JSON '[]', x))") .outputRowsCount(900) .symbolStats(new Symbol("x"), symbolAssert -> symbolAssert.averageRowSize(4.0) .lowValue(-10.0) .highValue(10.0) .distinctValuesCount(40.0) .nullsFraction(0.25)); assertExpression("NOT(x IS NULL)") .outputRowsCount(750) .symbolStats(new Symbol("x"), symbolAssert -> symbolAssert.averageRowSize(4.0) .lowValue(-10.0) .highValue(10.0) .distinctValuesCount(40.0) .nullsFraction(0)); }

Target:
public void testNotStats() { assertExpression("NOT(x < 0e0)") .outputRowsCount(625) .symbolStats(new Symbol("x"), symbolAssert -> symbolAssert.averageRowSize(4.0) .lowValue(0.0) .highValue(10.0) .distinctValuesCount(20.0) .nullsFraction(0.4)) .symbolStats(new Symbol("y"), symbolAssert -> symbolAssert.isEqualTo(yStats)); assertExpression("NOT(json_array_contains(JSON '[]', x))") .outputRowsCount(900) .symbolStats(new Symbol("x"), symbolAssert -> symbolAssert.averageRowSize(4.0) .lowValue(-10.0) .highValue(10.0) .distinctValuesCount(40.0) .nullsFraction(0.25)) .symbolStats(new Symbol("y"), symbolAssert -> symbolAssert.isEqualTo(yStats)); assertExpression("NOT(x IS NULL)") .outputRowsCount(750) .symbolStats(new Symbol("x"), symbolAssert -> symbolAssert.averageRowSize(4.0) .lowValue(-10.0) .highValue(10.0) .distinctValuesCount(40.0) .nullsFraction(0)) .symbolStats(new Symbol("y"), symbolAssert -> symbolAssert.isEqualTo(yStats)); }
Source:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { setProperlyConfigured(false); if (config != null) { String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } String ip = (String) config.get("ip"); if (StringUtils.isBlank(ip)) { return; } this.ip = ip; String username = (String) config.get("username"); if (StringUtils.isBlank(username)) { return; } this.username = username; String password = (String) config.get("password"); if (StringUtils.isBlank(password)) { return; } this.password = password; setProperlyConfigured(true); } }

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { setProperlyConfigured(false); if (config != null) { String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } String ip = (String) config.get("ip"); if (StringUtils.isBlank(ip)) { throw new ConfigurationException("ip", "The ip address must not be empty."); } this.ip = ip; String username = (String) config.get("username"); if (StringUtils.isBlank(username)) { throw new ConfigurationException("username", "The username must not be empty."); } this.username = username; String password = (String) config.get("password"); if (StringUtils.isBlank(password)) { throw new ConfigurationException("password", "The password must not be empty."); } this.password = password; setProperlyConfigured(true); } }
Source:
public void shouldGenerateTwoDifferentSuccessiveDates(){ final LocalDateTime end = LocalDateTime.now().minusDays(2); final LocalDateTime start = LocalDateTime.now().minusDays(3); final Arbitrary<LocalDateTime> dates = Arbitrary.localDateTime(); final LocalDateTime firstDate = dates.apply(100).apply(RANDOM); final LocalDateTime secondDate = dates.apply(100).apply(RANDOM); assertThat(firstDate).isNotEqualTo(secondDate); }

Target:
public void shouldGenerateTwoDifferentSuccessiveDates(){ final Arbitrary<LocalDateTime> dates = Arbitrary.localDateTime(); final LocalDateTime firstDate = dates.apply(100).apply(RANDOM); final LocalDateTime secondDate = dates.apply(100).apply(RANDOM); assertThat(firstDate).isNotEqualTo(secondDate); }
Source:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_REMOVE) .setDescription("Remove a notification for the authenticated user.<br>" + "Requires one of the following permissions:" + "<ul>" + " <li>Authentication if no login is provided</li>" + " <li>System administration if a login is provided</li>" + "</ul>") .setSince("6.3") .setPost(true) .setHandler(this); action.createParam(PARAM_PROJECT) .setDescription("Project key") .setExampleValue(KeyExamples.KEY_PROJECT_EXAMPLE_001); List<NotificationChannel> channels = notificationCenter.getChannels(); action.createParam(PARAM_CHANNEL) .setDescription("Channel through which the notification is sent. For example, notifications can be sent by email.") .setPossibleValues(channels) .setDefaultValue(EmailNotificationChannel.class.getSimpleName()); action.createParam(PARAM_TYPE) .setDescription("Notification type. Possible values are for:" + "<ul>" + " <li>Global notifications: %s</li>" + " <li>Per project notifications: %s</li>" + "</ul>", dispatchers.getSortedGlobalDispatchers().stream().sorted().collect(Collectors.joining(", ")), dispatchers.getSortedProjectDispatchers().stream().sorted().collect(Collectors.joining(", "))) .setRequired(true) .setExampleValue(MyNewIssuesNotificationDispatcher.KEY); action.createParam(PARAM_LOGIN) .setDescription("User login") .setSince("6.4"); }

Target:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_REMOVE) .setDescription("Remove a notification for the authenticated user.<br>" + "Requires one of the following permissions:" + "<ul>" + " <li>Authentication if no login is provided</li>" + " <li>System administration if a login is provided</li>" + "</ul>") .setSince("6.3") .setPost(true) .setHandler(this); action.createParam(PARAM_PROJECT) .setDescription("Project key") .setExampleValue(KeyExamples.KEY_PROJECT_EXAMPLE_001); List<NotificationChannel> channels = notificationCenter.getChannels(); action.createParam(PARAM_CHANNEL) .setDescription("Channel through which the notification is sent. For example, notifications can be sent by email.") .setPossibleValues(channels) .setDefaultValue(EmailNotificationChannel.class.getSimpleName()); action.createParam(PARAM_TYPE) .setDescription("Notification type. Possible values are for:" + "<ul>" + " <li>Global notifications: %s</li>" + " <li>Per project notifications: %s</li>" + "</ul>", dispatchers.getGlobalDispatchers().stream().sorted().collect(Collectors.joining(", ")), dispatchers.getProjectDispatchers().stream().sorted().collect(Collectors.joining(", "))) .setRequired(true) .setExampleValue(MyNewIssuesNotificationDispatcher.KEY); action.createParam(PARAM_LOGIN) .setDescription("User login") .setSince("6.4"); }
Source:
public void onAdd(IForgeRegistryInternal<Block> owner, RegistryManager stage, int id, Block block, @Nullable Block oldBlock) { @SuppressWarnings("unchecked") ClearableObjectIntIdentityMap<IBlockState> blockstateMap = owner.getSlaveMap(BLOCKSTATE_TO_ID, ClearableObjectIntIdentityMap.class); if (oldBlock != null) { for (IBlockState state : oldBlock.getBlockState().getValidStates()) blockstateMap.remove(state); } if ("minecraft:tripwire".equals(block.getRegistryName().toString())) { for (int meta = 0; meta < 15; meta++) blockstateMap.put(block.getStateFromMeta(meta), id << 4 | meta); } final boolean[] usedMeta = new boolean[16]; for (IBlockState state : block.getBlockState().getValidStates()) { final int meta = block.getMetaFromState(state); blockstateMap.put(state, id << 4 | meta); usedMeta[meta] = true; } for (int meta = 0; meta < 16; meta++) { if (block.getClass() == BlockObserver.class) continue; if (usedMeta[meta]) blockstateMap.put(block.getStateFromMeta(meta), id << 4 | meta); } if (oldBlock != null) { @SuppressWarnings("unchecked") BiMap<Block, Item> blockToItem = owner.getSlaveMap(BLOCK_TO_ITEM, BiMap.class); Item item = blockToItem.get(oldBlock); if (item != null) blockToItem.forcePut(block, item); } }

Target:
public void onAdd(IForgeRegistryInternal<Block> owner, RegistryManager stage, int id, Block block, @Nullable Block oldBlock) { @SuppressWarnings("unchecked") ClearableObjectIntIdentityMap<IBlockState> blockstateMap = owner.getSlaveMap(BLOCKSTATE_TO_ID, ClearableObjectIntIdentityMap.class); if (oldBlock != null) { for (IBlockState state : oldBlock.getBlockState().getValidStates()) { blockstateMap.remove(state); } } if ("minecraft:tripwire".equals(block.getRegistryName().toString())) { for (int meta = 0; meta < 15; meta++) blockstateMap.put(block.getStateFromMeta(meta), id << 4 | meta); } final boolean[] usedMeta = new boolean[16]; for (IBlockState state : block.getBlockState().getValidStates()) { final int meta = block.getMetaFromState(state); blockstateMap.put(state, id << 4 | meta); usedMeta[meta] = true; } for (int meta = 0; meta < 16; meta++) { if (block.getClass() == BlockObserver.class) continue; if (usedMeta[meta]) blockstateMap.put(block.getStateFromMeta(meta), id << 4 | meta); } if (oldBlock != null) { @SuppressWarnings("unchecked") BiMap<Block, Item> blockToItem = owner.getSlaveMap(BLOCK_TO_ITEM, BiMap.class); Item item = blockToItem.get(oldBlock); if (item != null) blockToItem.forcePut(block, item); } }
Source:
private void configureRatingTooltip() { playerInfoBean.chatOnlyProperty().addListener((observable1, oldValue1, newValue1) -> { if (!newValue1) { Tooltip userRatingTooltip = new Tooltip(playerInfoBean.getCountry()); String globalRating = i18n.get("playerRatingFormat.global", RatingUtil.getGlobalRating(playerInfoBean)); String ladderRating = i18n.get("playerRatingFormat.ladder", RatingUtil.getLadderRating(playerInfoBean)); userRatingTooltip.setText(String.format("%s \n %s", globalRating, ladderRating)); playerInfoBean.globalRatingMeanProperty().addListener((observable, oldValue, newValue) -> { String updatedGlobalRating = i18n.get("playerRatingFormat.global", RatingUtil.getGlobalRating(playerInfoBean)); String oldLadderRating = i18n.get("playerRatingFormat.ladder", RatingUtil.getLadderRating(playerInfoBean)); userRatingTooltip.setText(String.format("%s \n %s", updatedGlobalRating, oldLadderRating)); }); playerInfoBean.ladderRatingMeanProperty().addListener((observable, oldValue, newValue) -> { String oldGlobalRating = i18n.get("playerRatingFormat.global", RatingUtil.getGlobalRating(playerInfoBean)); String updatedLadderRating = i18n.get("playerRatingFormat.ladder", RatingUtil.getLadderRating(playerInfoBean)); userRatingTooltip.setText(String.format("%s \n %s", oldGlobalRating, updatedLadderRating)); }); Tooltip.install(clanLabel, userRatingTooltip); Tooltip.install(usernameLabel, userRatingTooltip); } }); }

Target:
private void configureRatingTooltip() { if (!playerInfoBean.getChatOnly()) { Tooltip userRatingTooltip = new Tooltip(); String rating = i18n.get("userInfo.ratingFormat", RatingUtil.getRoundedGlobalRating(playerInfoBean), RatingUtil.getLeaderboardRating(playerInfoBean)); userRatingTooltip.setText(rating); addRatingListenerToTooltip(playerInfoBean.leaderboardRatingMeanProperty(), userRatingTooltip); addRatingListenerToTooltip(playerInfoBean.globalRatingMeanProperty(), userRatingTooltip); Tooltip.install(clanLabel, userRatingTooltip); Tooltip.install(usernameLabel, userRatingTooltip); } }
Source:
protected Map<String,String> parseAttributes(final String attributesString) throws UnsupportedEncodingException { final Map<String, String> attributes = new LinkedHashMap<>(); final String[] splitLine = attributesString.split(ATTRIBUTE_DELIMITER); for(String attribute : splitLine) { final String[] key_value = attribute.split(KEY_VALUE_SEPARATOR); if (key_value.length<2) { continue; } attributes.put(URLDecoder.decode(key_value[0].trim(), "UTF-8"), URLDecoder.decode(key_value[1].trim(), "UTF-8")); } return attributes; }

Target:
static private Map<String,String> parseAttributes(final String attributesString) throws UnsupportedEncodingException { final Map<String, String> attributes = new LinkedHashMap<>(); final List<String> splitLine = ParsingUtils.split(attributesString,ATTRIBUTE_DELIMITER); for(String attribute : splitLine) { final List<String> key_value = ParsingUtils.split(attribute,KEY_VALUE_SEPARATOR); if (key_value.size()<2) { continue; } attributes.put(URLDecoder.decode(key_value.get(0).trim(), "UTF-8"), URLDecoder.decode(key_value.get(1).trim(), "UTF-8")); } return attributes; }
Source:
private void loadProviders() { ProviderType providerType = getProviderType(); if (providerType == null) { return; } AsyncDataProvider.getInstance().getAllProvidersByType(new AsyncQuery(new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { List<Provider<?>> providers = new ArrayList<Provider<?>>(); for (Provider provider : (List<Provider>) returnValue) { VmwareVmProviderProperties properties = (VmwareVmProviderProperties) provider.getAdditionalProperties(); if (getDataCenters().getSelectedItem().getId().equals(properties.getStoragePoolId())) { providers.add(provider); } } providers.add(0, null); getProviders().setItems(providers); } }), providerType); }

Target:
private void loadProviders() { switch(importSources.getSelectedItem()) { case VMWARE: loadVmwareProviders(); break; default: } }
Source:
public ProjectMergeStrategies call() throws Exception { pc = open(); ProjectConfig config; MetaDataUpdate md = metaDataUpdateFactory.create(projectName); try { config = ProjectConfig.read(md); if (config.getRevision() != null && !config.getRevision().equals( pc.getProjectState().getConfig().getRevision())) { projectCache.evict(config.getProject()); pc = open(); } } finally { md.close(); } List<MergeStrategySection> local = new ArrayList<MergeStrategySection>(); Set<String> ownerOf = new HashSet<String>(); for (MergeStrategySection section : config.getMergeStrategySections()) { RefControl rc = pc.controlForRef(section.getName()); if (rc.isOwner()) { local.add(section); ownerOf.add(section.getName()); } else if (rc.isVisible()) { local.add(section); } } final ProjectMergeStrategies detail = new ProjectMergeStrategies(); detail.setRevision(config.getRevision().name()); detail.setLocal(local); detail.setOwnerOf(ownerOf); if (projectName.equals(allProjectsName)) { detail.setInheritsFrom(null); } else if (config.getProject().getParent() != null) { detail.setInheritsFrom(config.getProject().getParent()); } else { detail.setInheritsFrom(allProjectsName); } return detail; }

Target:
public ProjectMergeStrategies call() throws Exception { ProjectConfig config = null; boolean cacheNeedsRefreshing = false; MetaDataUpdate md = metaDataUpdateFactory.create(projectName); try { config = ProjectConfig.read(md); if (config.getRevision() != null && projectCache.get(projectName).isRevisionOutOfDate(config)) { cacheNeedsRefreshing = true; } } finally { md.close(); if (config != null) { pc = projectControlFactory.validateFor(config.getProject(), ProjectControl.OWNER | ProjectControl.VISIBLE, cacheNeedsRefreshing); } else { pc = projectControlFactory.validateFor(projectName, ProjectControl.OWNER | ProjectControl.VISIBLE); } } List<MergeStrategySection> local = new ArrayList<MergeStrategySection>(); Set<String> ownerOf = new HashSet<String>(); for (MergeStrategySection section : config.getMergeStrategySections()) { RefControl rc = pc.controlForRef(section.getName()); if (rc.isOwner()) { local.add(section); ownerOf.add(section.getName()); } else if (rc.isVisible()) { local.add(section); } } final ProjectMergeStrategies strategies = new ProjectMergeStrategies(); strategies.setRevision(config.getRevision().name()); strategies.setMergeStrategies(local); strategies.setOwnerOf(ownerOf); if (projectName.equals(allProjectsName)) { strategies.setInheritsFrom(null); } else if (config.getProject().getParent() != null) { strategies.setInheritsFrom(config.getProject().getParent()); } else { strategies.setInheritsFrom(allProjectsName); } return strategies; }
Source:
private Object buildFromResultSet(java.sql.Array array, StatementContext ctx) throws SQLException { final ColumnMapper<?> mapper = ctx.findColumnMapperFor(componentType) .orElseThrow(() -> new IllegalArgumentException("Unable to find column mapper for " + componentType)); List<Object> list = new ArrayList<>(); try (ResultSet rs = array.getResultSet()) { while (rs.next()) { list.add(mapper.map(rs, 2, ctx)); } } Object ary = Array.newInstance(componentType, list.size()); if (componentType.isPrimitive()) { for (int i = 0; i < list.size(); i++) { Array.set(ary, i, list.get(i)); } return ary; } return list.toArray((Object[]) ary); }

Target:
private Object buildFromResultSet(java.sql.Array array, StatementContext ctx) throws SQLException { List<Object> list = new ArrayList<>(); try (ResultSet rs = array.getResultSet()) { while (rs.next()) { list.add(elementMapper.map(rs, 2, ctx)); } } Object ary = Array.newInstance(componentType, list.size()); if (componentType.isPrimitive()) { for (int i = 0; i < list.size(); i++) { Array.set(ary, i, list.get(i)); } return ary; } return list.toArray((Object[]) ary); }
Source:
public void putBulkObjectWithPipeAndSync() throws Exception { assumeThat(Util.getBlackPearlVersion(client), greaterThan(3.0)); final String bucketName = "test_put_bulk_pipe_object"; try { Util.createBucket(client, bucketName); final Arguments args = new Arguments(new String[]{"--http", "-c", "put_bulk", "-b", bucketName, "--sync"}); final String file; if (Utils.isWindows) { file = ".\\src\\test\\resources\\books\\beowulf.txt\n.\\src\\test\\resources\\books\\ulysses.txt"; } else { file = "./src/test/resources/books/beowulf.txt\n./src/test/resources/books/ulysses.txt"; } final InputStream testFile = new ByteArrayInputStream(file.getBytes("UTF-8")); System.setIn(testFile); final CommandResponse response = Util.command(client, args); assertThat(response.getMessage(), is(String.format("SUCCESS: Wrote all piped files to bucket %s", bucketName))); testFile.reset(); final CommandResponse response2 = Util.command(client, args); assertThat(response2.getMessage(), is("SUCCESS: All files are up to date")); } finally { Util.deleteBucket(client, bucketName); } }

Target:
public void putBulkObjectWithPipeAndSync() throws Exception { assumeThat(Util.getBlackPearlVersion(client), greaterThan(1.2)); final String bucketName = "test_put_bulk_pipe_object"; try { Util.createBucket(client, bucketName); final Arguments args = new Arguments(new String[]{"--http", "-c", "put_bulk", "-b", bucketName, "--sync"}); final String file; if (Utils.isWindows) { file = ".\\src\\test\\resources\\books\\beowulf.txt\n.\\src\\test\\resources\\books\\ulysses.txt"; } else { file = "./src/test/resources/books/beowulf.txt\n./src/test/resources/books/ulysses.txt"; } final InputStream testFile = new ByteArrayInputStream(file.getBytes("UTF-8")); System.setIn(testFile); final CommandResponse response = Util.command(client, args); assertThat(response.getMessage(), is(String.format("SUCCESS: Wrote all piped files to bucket %s", bucketName))); testFile.reset(); final CommandResponse response2 = Util.command(client, args); assertThat(response2.getMessage(), is("SUCCESS: All files are up to date")); } finally { Util.deleteBucket(client, bucketName); } }
Source:
public Sheet getByName(String sheetName) { if (nameToSheet.containsKey(sheetName)) { return nameToSheet.get(sheetName); } return null; }

Target:
public Sheet getByName(String sheetName) { return nameToSheet.get(sheetName); }
Source:
public void visitTryStatement(TryStatementTree tree) { insideTryStatement = true; tree.resourceList().stream() .map(resource -> ((VariableTreeImpl) resource).simpleName().name()) .forEach(resourceResolversInTryWithResources::add); super.visitTryStatement(tree); resourceResolversInTryWithResources.clear(); insideTryStatement = false; }

Target:
public void visitTryStatement(TryStatementTree tree) { insideTryStatement = true; tree.resourceList().stream() .filter(resource -> resource instanceof VariableTree) .map(VariableTree.class::cast) .map(resource -> resource.simpleName().name()) .forEach(resourceResolversInTryWithResources::add); super.visitTryStatement(tree); resourceResolversInTryWithResources.clear(); insideTryStatement = false; }
Source:
public void setAllTasksFinal(Iterable<TaskInfo> finalTaskInfos) { checkState(stageState.get().isDone()); StageInfo stageInfo = getStageInfo(() -> finalTaskInfos); checkArgument(stageInfo.isCompleteInfo(), "finalTaskInfos are not final"); finalStageInfo.compareAndSet(Optional.empty(), Optional.of(stageInfo)); }

Target:
public void setAllTasksFinal(Iterable<TaskInfo> finalTaskInfos) { requireNonNull(finalTaskInfos, "finalTaskInfos is null"); checkState(stageState.get().isDone()); StageInfo stageInfo = getStageInfo(() -> finalTaskInfos); checkArgument(stageInfo.isCompleteInfo(), "finalTaskInfos are not all done"); finalStageInfo.compareAndSet(Optional.empty(), Optional.of(stageInfo)); }
Source:
public XYChartConsumer createChartConsumer() { List<XYSeriesConsumer> series = new ArrayList<>(); getData().getChartSeries().stream().forEach(s -> { IDataConsumer xConsumer; IDataConsumer yConsumer; Predicate<@Nullable Number> xPredicate; if (getModel().isXLogscale()) { xPredicate = new LogarithmicPredicate(s.getX().getResolver()); } else { xPredicate = Objects::nonNull; } if (getXDescriptorsInfo().areNumericals()) { xConsumer = new NumericalConsumer(s.getX().getResolver(), xPredicate); } else { xConsumer = new ScatterStringConsumer(s.getX().getResolver(), fXStringMap); } Predicate<@Nullable Number> yPredicate; if (getModel().isYLogscale()) { yPredicate = new LogarithmicPredicate(s.getY().getResolver()); } else { yPredicate = Objects::nonNull; } if (getYDescriptorsInfo().areNumericals()) { yConsumer = new NumericalConsumer(s.getY().getResolver(), yPredicate); } else { yConsumer = new ScatterStringConsumer(s.getY().getResolver(), fYStringMap); } series.add(new XYSeriesConsumer(s, xConsumer, yConsumer)); }); NumericalConsumerAggregator xAggregator; if (getXDescriptorsInfo().areNumericals()) { xAggregator = new NumericalConsumerAggregator(); } else { xAggregator = null; } NumericalConsumerAggregator yAggregator; if (getYDescriptorsInfo().areNumericals()) { yAggregator = new NumericalConsumerAggregator(); } else { yAggregator = null; } return new XYChartConsumer(series, xAggregator, yAggregator); }

Target:
public XYChartConsumer createChartConsumer() { List<XYSeriesConsumer> series = new ArrayList<>(); getData().getChartSeries().stream().forEach(s -> { IDataConsumer xConsumer; IDataConsumer yConsumer; IDataResolver<?, ?> xResolver = checkNotNull(s.getX().getResolver()); Predicate<@Nullable Number> xPredicate; if (getModel().isXLogscale()) { xPredicate = new LogarithmicPredicate(xResolver); } else { xPredicate = Objects::nonNull; } if (getXDescriptorsInfo().areNumericals()) { xConsumer = new NumericalConsumer(xResolver, xPredicate); } else { xConsumer = new ScatterStringConsumer(xResolver, fXStringMap); } IDataResolver<?, ?> yResolver = checkNotNull(s.getY().getResolver()); Predicate<@Nullable Number> yPredicate; if (getModel().isYLogscale()) { yPredicate = new LogarithmicPredicate(yResolver); } else { yPredicate = Objects::nonNull; } if (getYDescriptorsInfo().areNumericals()) { yConsumer = new NumericalConsumer(yResolver, yPredicate); } else { yConsumer = new ScatterStringConsumer(yResolver, fYStringMap); } series.add(new XYSeriesConsumer(s, xConsumer, yConsumer)); }); NumericalConsumerAggregator xAggregator; if (getXDescriptorsInfo().areNumericals()) { xAggregator = new NumericalConsumerAggregator(); } else { xAggregator = null; } NumericalConsumerAggregator yAggregator; if (getYDescriptorsInfo().areNumericals()) { yAggregator = new NumericalConsumerAggregator(); } else { yAggregator = null; } return new XYChartConsumer(series, xAggregator, yAggregator); }
Source:
private static boolean usesScrollbars() { if (usesScrollbars_ != null) return usesScrollbars_; if (!BrowseCap.isMacintosh()) { usesScrollbars_ = true; } else { Element parent = Document.get().createElement("div"); parent.getStyle().setWidth(100, Unit.PX); parent.getStyle().setHeight(100, Unit.PX); parent.getStyle().setOverflow(Overflow.AUTO); parent.getStyle().setVisibility(Visibility.HIDDEN); Element content = Document.get().createElement("div"); content.getStyle().setWidth(100, Unit.PX); content.getStyle().setHeight(200, Unit.PX); parent.appendChild(content); Document.get().getBody().appendChild(parent); boolean hasScrollbars = parent.getOffsetWidth() - parent.getClientWidth() > 0; parent.removeFromParent(); usesScrollbars_ = hasScrollbars; } return usesScrollbars_; }

Target:
private static boolean usesScrollbars() { if (usesScrollbars_ != null) return usesScrollbars_; if (!BrowseCap.isMacintosh()) { usesScrollbars_ = true; } else { Element parent = Document.get().createElement("div"); parent.getStyle().setWidth(100, Unit.PX); parent.getStyle().setHeight(100, Unit.PX); parent.getStyle().setOverflow(Overflow.AUTO); parent.getStyle().setVisibility(Visibility.HIDDEN); parent.getStyle().setPosition(Position.FIXED); parent.getStyle().setLeft(-300, Unit.PX); parent.getStyle().setTop(-300, Unit.PX); Element content = Document.get().createElement("div"); content.getStyle().setWidth(100, Unit.PX); content.getStyle().setHeight(200, Unit.PX); parent.appendChild(content); Document.get().getBody().appendChild(parent); boolean hasScrollbars = parent.getOffsetWidth() - parent.getClientWidth() > 0; parent.removeFromParent(); usesScrollbars_ = hasScrollbars; } return usesScrollbars_; }
Source:
public static Optional<Path> getConventionTestResultsDumpPath() { String path = System.getProperty(CONVENTION_TESTS_RESULTS_DUMP_PATH_KEY, ""); if (path.isEmpty()) { return Optional.empty(); } return Optional.of(Paths.get(path)); }

Target:
public static Optional<Path> getConventionTestResultsDumpPath() { return Optional.ofNullable(System.getProperty(CONVENTION_TESTS_RESULTS_DUMP_PATH_KEY)) .map(Paths::get); }