auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void handleException(HttpServletRequest request, HttpServletResponse response, Throwable t) throws IOException, ServletException { if (response.containsHeader("Cache-Control")) { response.setHeader("Cache-Control", "no-cache"); } Throwable unwrappedException = ExceptionHelper.unwrapException(t); if (!ExceptionHelper.isSecurityError(unwrappedException) && !response.containsHeader(SSO_INITIAL_URL_REQUEST_KEY)) { super.handleException(request, response, t); return; } Principal principal = request.getUserPrincipal(); if (principal == null) { LoginContext loginContext = (LoginContext) request.getAttribute("org.nuxeo.ecm.login.context"); principal = (Principal) loginContext.getSubject().getPrincipals().toArray()[0]; } if (principal instanceof NuxeoPrincipal) { NuxeoPrincipal nuxeoPrincipal = (NuxeoPrincipal) principal; if (nuxeoPrincipal.isAnonymous()) { response.resetBuffer(); String urlToReach = getURLToReach(request); Cookie cookieUrlToReach = new Cookie(NXAuthConstants.SSO_INITIAL_URL_REQUEST_KEY, urlToReach); cookieUrlToReach.setPath("/"); cookieUrlToReach.setMaxAge(60); response.addCookie(cookieUrlToReach); if (!response.isCommitted()) { request.getRequestDispatcher(CAS_REDIRECTION_URL).forward(request, response); } parameters.getListener().responseComplete(); return; } } super.handleException(request, response, t); }

Target:
public void handleException(HttpServletRequest request, HttpServletResponse response, Throwable t) throws IOException, ServletException { if (response.containsHeader("Cache-Control")) { response.setHeader("Cache-Control", "no-cache"); } Throwable unwrappedException = ExceptionHelper.unwrapException(t); if (!ExceptionHelper.isSecurityError(unwrappedException) && !response.containsHeader(SSO_INITIAL_URL_REQUEST_KEY)) { super.handleException(request, response, t); return; } Principal principal = request.getUserPrincipal(); if (principal == null) { LoginContext loginContext = (LoginContext) request.getAttribute(LOGINCONTEXT_KEY); Subject subject = loginContext.getSubject(); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); if (principals != null && !principals.isEmpty()) { principal = (Principal) principals.toArray()[0]; } } } if (principal instanceof NuxeoPrincipal) { NuxeoPrincipal nuxeoPrincipal = (NuxeoPrincipal) principal; if (nuxeoPrincipal.isAnonymous()) { response.resetBuffer(); String urlToReach = getURLToReach(request); Cookie cookieUrlToReach = new Cookie(NXAuthConstants.SSO_INITIAL_URL_REQUEST_KEY, urlToReach); cookieUrlToReach.setPath("/"); cookieUrlToReach.setMaxAge(60); response.addCookie(cookieUrlToReach); if (!response.isCommitted()) { request.getRequestDispatcher(CAS_REDIRECTION_URL).forward(request, response); } parameters.getListener().responseComplete(); return; } } super.handleException(request, response, t); }
Source:
public KeyWrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key) { return client.wrapKey(algorithm, key, Context.NONE).block(); }

Target:
public KeyWrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key) { return wrapKey(algorithm, key, Context.NONE); }
Source:
private ConfigRecord(ConfigurationFactory configurationFactory, ConfigurationProvider<T> configurationProvider) { requireNonNull(configurationProvider, "configurationProvider"); ConfigurationBinding<T> configurationBinding = configurationProvider.getConfigurationBinding(); key = configurationBinding.getKey(); configClass = configurationBinding.getConfigClass(); prefix = configurationBinding.getPrefix().orElse(null); ConfigurationMetadata<T> metadata = getConfigurationMetadata(configurationBinding.getConfigClass()); T defaults = configurationFactory.getDefaultConfig(configurationBinding.getKey()); T instance = null; try { instance = configurationProvider.get(); } catch (Throwable ignored) { } String prefix = configurationBinding.getPrefix() .map(value -> value + ".") .orElse(""); ImmutableSortedSet.Builder<ConfigAttribute> builder = ImmutableSortedSet.naturalOrder(); for (AttributeMetadata attribute : metadata.getAttributes().values()) { String propertyName = prefix + attribute.getInjectionPoint().getProperty(); Method getter = attribute.getGetter(); String defaultValue = getValue(getter, defaults, "-- none --"); String currentValue = getValue(getter, instance, "-- n/a --"); String description = attribute.getDescription(); if (description == null) { description = ""; } boolean secret = false; if (attribute.getInjectionPoint().getSetter().isAnnotationPresent(Config.class)) { Config config = attribute.getInjectionPoint().getSetter().getAnnotation(Config.class); secret = config.secret(); } builder.add(new ConfigAttribute(attribute.getName(), propertyName, defaultValue, currentValue, description, secret)); } attributes = builder.build(); }

Target:
private ConfigRecord(ConfigurationFactory configurationFactory, ConfigurationProvider<T> configurationProvider) { requireNonNull(configurationProvider, "configurationProvider"); ConfigurationBinding<T> configurationBinding = configurationProvider.getConfigurationBinding(); key = configurationBinding.getKey(); configClass = configurationBinding.getConfigClass(); prefix = configurationBinding.getPrefix().orElse(null); ConfigurationMetadata<T> metadata = getConfigurationMetadata(configurationBinding.getConfigClass()); T defaults = configurationFactory.getDefaultConfig(configurationBinding.getKey()); T instance = null; try { instance = configurationProvider.get(); } catch (Throwable ignored) { } String prefix = configurationBinding.getPrefix() .map(value -> value + ".") .orElse(""); ImmutableSortedSet.Builder<ConfigAttribute> builder = ImmutableSortedSet.naturalOrder(); for (AttributeMetadata attribute : metadata.getAttributes().values()) { String propertyName = prefix + attribute.getInjectionPoint().getProperty(); Method getter = attribute.getGetter(); String defaultValue = getValue(getter, defaults, "-- none --"); String currentValue = getValue(getter, instance, "-- n/a --"); String description = attribute.getDescription(); if (description == null) { description = ""; } builder.add(new ConfigAttribute(attribute.getName(), propertyName, defaultValue, currentValue, description, attribute.isRedact())); } attributes = builder.build(); }
Source:
public void setBeaconAdvertisingData(String uuid, Integer major, Integer minor, String companyCode, Integer txPower, boolean LELimited, boolean LEGeneral, boolean BR_EDRSupported, boolean LE_BRController, boolean LE_BRHost) { BluetoothConfigurationProcessListener bbl = new BluetoothConfigurationProcessListener(this.bbcl); String[] dataHex = toStringArray(BluetoothAdvertisingData.getData(uuid, major, minor, companyCode, txPower, LELimited, LEGeneral, BR_EDRSupported, LE_BRController, LE_BRHost)); String[] cmd = new String[3 + dataHex.length]; cmd[0] = "cmd"; cmd[1] = OGF_CONTROLLER_CMD; cmd[2] = OCF_ADVERTISING_DATA_CMD; for (int i = 0; i < dataHex.length; i++) { cmd[i + 3] = dataHex[i]; } logger.debug("Set Advertising Data : hcitool -i cmd {}", this.name, OGF_CONTROLLER_CMD, OCF_ADVERTISING_DATA_CMD, Arrays.toString(dataHex)); logger.info("Set Advertising Data on interface {}", this.name); try { BluetoothUtil.hcitoolCmd(this.name, cmd, bbl, this.executorService); } catch (IOException e) { logger.error("Failed to set beacon advertising data", e); } }

Target:
public void setBeaconAdvertisingData(String uuid, Integer major, Integer minor, String companyCode, Integer txPower, boolean LELimited, boolean LEGeneral, boolean BR_EDRSupported, boolean LE_BRController, boolean LE_BRHost) { BluetoothConfigurationProcessListener bbl = new BluetoothConfigurationProcessListener(this.bbcl); String[] dataHex = toStringArray(BluetoothAdvertisingData.getData(uuid, major, minor, companyCode, txPower, LELimited, LEGeneral, BR_EDRSupported, LE_BRController, LE_BRHost)); String[] cmd = new String[3 + dataHex.length]; cmd[0] = "cmd"; cmd[1] = OGF_CONTROLLER_CMD; cmd[2] = OCF_ADVERTISING_DATA_CMD; for (int i = 0; i < dataHex.length; i++) { cmd[i + 3] = dataHex[i]; } logger.debug("Set Advertising Data : hcitool -i cmd {}", this.name, OGF_CONTROLLER_CMD, OCF_ADVERTISING_DATA_CMD, Arrays.toString(dataHex)); logger.info("Set Advertising Data on interface {}", this.name); runHcitoolCmd(bbl, cmd); }
Source:
public void attachFile(EntityReference pageReference, String name, InputStream is, boolean failIfExists, UsernamePasswordCredentials credentials) throws Exception { UsernamePasswordCredentials currentCredentials = getDefaultCredentials(); EntityReference reference = new EntityReference(name, EntityType.ATTACHMENT, pageReference); try { if (credentials != null) { setDefaultCredentials(credentials); } attachFile(reference, is, failIfExists); } finally { setDefaultCredentials(currentCredentials); } }

Target:
public void attachFile(EntityReference pageReference, String name, InputStream is, boolean failIfExists, UsernamePasswordCredentials credentials) throws Exception { UsernamePasswordCredentials currentCredentials = getDefaultCredentials(); EntityReference reference = new EntityReference(name, EntityType.ATTACHMENT, pageReference); try { if (credentials != null) { setDefaultCredentials(credentials); } attachFile(reference, is, failIfExists); } finally { if (credentials != null) { setDefaultCredentials(currentCredentials); } } }
Source:
public Ehcache(CacheConfiguration<K, V> config, Store<K, V> store, final CacheLoaderWriter<? super K, V> cacheLoaderWriter, CacheEventNotificationService<K, V> eventNotifier, ScheduledExecutorService statisticsExecutor) { this.store = store; StatisticsManager.associate(store).withParent(this); System.out.println("Creating cache with " + cacheLoaderWriter); new Exception().printStackTrace(System.out); this.cacheLoaderWriter = cacheLoaderWriter; if (statisticsExecutor != null) { this.cacheStatistics = new StatisticsGateway(this, statisticsExecutor, bulkMethodEntries); } else { this.cacheStatistics = new DisabledStatistics(); } if (store instanceof RecoveryCache) { this.resilienceStrategy = new LoggingRobustResilienceStrategy<K, V>(castToRecoveryCache(store)); } else { this.resilienceStrategy = new LoggingRobustResilienceStrategy<K, V>(recoveryCache(store)); } if (eventNotifier != null) { this.eventNotificationService = eventNotifier; } else { this.eventNotificationService = new DisabledCacheEventNotificationService<K, V>(); } this.runtimeConfiguration = new RuntimeConfiguration(config); this.storeListener = new StoreListener(); this.jsr107Cache = new Jsr107CacheImpl(); }

Target:
public Ehcache(CacheConfiguration<K, V> config, Store<K, V> store, final CacheLoaderWriter<? super K, V> cacheLoaderWriter, CacheEventNotificationService<K, V> eventNotifier, ScheduledExecutorService statisticsExecutor) { this.store = store; StatisticsManager.associate(store).withParent(this); this.cacheLoaderWriter = cacheLoaderWriter; if (statisticsExecutor != null) { this.cacheStatistics = new StatisticsGateway(this, statisticsExecutor, bulkMethodEntries); } else { this.cacheStatistics = new DisabledStatistics(); } if (store instanceof RecoveryCache) { this.resilienceStrategy = new LoggingRobustResilienceStrategy<K, V>(castToRecoveryCache(store)); } else { this.resilienceStrategy = new LoggingRobustResilienceStrategy<K, V>(recoveryCache(store)); } if (eventNotifier != null) { this.eventNotificationService = eventNotifier; } else { this.eventNotificationService = new DisabledCacheEventNotificationService<K, V>(); } this.runtimeConfiguration = new RuntimeConfiguration(config); this.storeListener = new StoreListener(); this.jsr107Cache = new Jsr107CacheImpl(); }
Source:
public A next() { if (this.hasNext()) { return this.action.transform(this.iterator.next()); } else { throw new NoSuchElementException( "No more element with fits the select condition." ); } }

Target:
public A next() { return this.action.transform(this.iterator.next()); }
Source:
private void sendMetrics(final WorkerMetrics workerMetrics) { LOG.log(Level.FINE, "Sending WorkerMetrics {0}", new Object[]{workerMetrics}); metricsMsgSender.send(workerMetrics); }

Target:
private void sendMetrics(final WorkerMetrics workerMetrics) { LOG.log(Level.FINE, "Sending WorkerMetrics {0}", workerMetrics); metricsMsgSender.send(workerMetrics); }
Source:
protected void onHangup(Hangup message, ActorRef self, ActorRef sender) throws URISyntaxException, ParseException { requestee = sender; callDetailRecord = getCallDetailRecord(); if(callDetailRecord == null){ logger.error("could not retrieve conferenceDetailRecord"); } else { try { URI uri = new URI("/restcomm"+callDetailRecord.getUri()); uri = UriUtils.resolve(uri); if (logger.isInfoEnabled()) logger.info("call api uri is: "+uri); Header[] headers = { new BasicHeader(HttpHeaders.AUTHORIZATION, getSuperAdminAuthenticationHeader()) ,new BasicHeader("Content-type", "application/x-www-form-urlencoded") ,new BasicHeader("Accept", "application/json") }; ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>(); postParameters.add(new BasicNameValuePair("Status", "Completed")); httpAsycClientHelper = httpAsycClientHelper(); HttpRequestDescriptor httpRequestDescriptor =new HttpRequestDescriptor(uri, "POST", postParameters, -1, headers); httpAsycClientHelper.tell(httpRequestDescriptor, self); } catch (Exception e) { logger.error("Exception while trying to terminate call via api: ", e); } } }

Target:
protected void onHangup(Hangup message, ActorRef self, ActorRef sender) throws URISyntaxException, ParseException { requestee = sender; callDetailRecord = message.getCallDetailRecord() == null ? getCallDetailRecord() : message.getCallDetailRecord(); if(callDetailRecord == null){ logger.error("could not retrieve cdr by provided Sid"); onDownloaderResponse(new DownloaderResponse(new IllegalArgumentException("could not retrieve cdr by provided Sid")), self, sender); } else { try { URI uri = new URI("/restcomm"+callDetailRecord.getUri()); uri = UriUtils.resolve(uri); if (logger.isInfoEnabled()) logger.info("call api uri is: "+uri); Header[] headers = RestcommApiClientUtil.getBasicHeaders(message.getRequestingAccountSid(), storage); ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>(); postParameters.add(new BasicNameValuePair("Status", "Completed")); httpAsycClientHelper = httpAsycClientHelper(); HttpRequestDescriptor httpRequestDescriptor =new HttpRequestDescriptor(uri, "POST", postParameters, -1, headers); httpAsycClientHelper.tell(httpRequestDescriptor, self); } catch (Exception e) { logger.error("Exception while trying to terminate call via api ", e); onDownloaderResponse(new DownloaderResponse(e), self, sender); } } }
Source:
public void testHotCacheDataBatching() throws Exception { ReadServerResource readServerResource = bootstrapReadServer(); EurekaInterestClient eurekaClient = connectEurekaClient(readServerResource.getDiscoveryResolver()).getEurekaClient(); fillUpRegistry(writeServer.getEurekaServerRegistry(), REGISTRY_INITIAL_SIZE); ExtTestSubscriber<ChangeNotification<InstanceInfo>> testSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()).filter(dataOnlyFilter()).subscribe(testSubscriber); testSubscriber.takeNextOrWait(REGISTRY_INITIAL_SIZE + 2); eurekaClient.shutdown(); eurekaClient = connectEurekaClient(readServerResource.getDiscoveryResolver()).getEurekaClient(); testSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()).subscribe(testSubscriber); for (int i = 0; i < REGISTRY_INITIAL_SIZE + 2; i++) { testSubscriber.takeNextOrWait(); } ExtTestSubscriber<Set<InstanceInfo>> snapshotSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()) .compose(ChangeNotificationFunctions.<InstanceInfo>buffers()) .compose(ChangeNotificationFunctions.<InstanceInfo>snapshots()) .subscribe(snapshotSubscriber); Set<InstanceInfo> initialSet = snapshotSubscriber.takeNextOrWait(); assertThat(initialSet.size(), is(greaterThan(REGISTRY_INITIAL_SIZE))); }

Target:
public void testHotCacheDataBatching() throws Exception { ReadServerResource readServerResource = bootstrapReadServer(); EurekaInterestClient eurekaClient = connectEurekaClient(readServerResource.getDiscoveryResolver()).getEurekaClient(); fillUpRegistry(writeServer.getEurekaServerRegistry(), REGISTRY_INITIAL_SIZE); ExtTestSubscriber<ChangeNotification<InstanceInfo>> testSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()).filter(dataOnlyFilter()).subscribe(testSubscriber); testSubscriber.takeNextOrWait(REGISTRY_INITIAL_SIZE + 2); eurekaClient.shutdown(); eurekaClient = connectEurekaClient(readServerResource.getDiscoveryResolver()).getEurekaClient(); testSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()).subscribe(testSubscriber); for (int i = 0; i < REGISTRY_INITIAL_SIZE + 2; i++) { testSubscriber.takeNextOrWait(); } ExtTestSubscriber<Set<InstanceInfo>> snapshotSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()) .compose(ChangeNotificationFunctions.<InstanceInfo>buffers()) .compose(ChangeNotificationFunctions.<InstanceInfo>snapshots()) .subscribe(snapshotSubscriber); Set<InstanceInfo> initialSet = snapshotSubscriber.takeNextOrWait(); assertThat(initialSet.size(), is(equalTo(REGISTRY_INITIAL_SIZE + 2))); }
Source:
public String parseEventSubject(String eventSubject, Map<String, Object> eventParameters) { String configName = (String) eventParameters.get("configName"); if (eventSubject.equals(FORMS_EVENT)) { String xmlns = (String) ((Map) eventParameters.get(ATTRIBUTES)).get("xmlns"); String appId = (String) ((Map) eventParameters.get(ATTRIBUTES)).get("app_id"); if (appId != null) { return eventSubject.concat(".").concat(configName).concat(".").concat(xmlns).concat(appId); } else { return eventSubject.concat(".").concat(configName).concat(".").concat(xmlns); } } return eventSubject.concat(".").concat(configName); }

Target:
public String parseEventSubject(String eventSubject, Map<String, Object> eventParameters) { String configName = (String) eventParameters.get("configName"); if (eventSubject.equals(FORMS_EVENT)) { String xmlns = (String) ((Map) eventParameters.get(ATTRIBUTES)).get("xmlns"); String appId = (String) ((Map) eventParameters.get(ATTRIBUTES)).get("app_id"); if (appId == null) { appId = ""; LOGGER.warn("AppId for form is null. XMLNS: {}", xmlns); } return eventSubject.concat(".").concat(configName).concat(".").concat(xmlns).concat(appId); } return eventSubject.concat(".").concat(configName); }
Source:
public String toString() { return toStringHelper(this) .add("cpu", cpuCost) .add("memory", peakMemoryCost) .add("network", networkCost) .toString(); }

Target:
public String toString() { return toStringHelper(this) .add("cpu", cpuCost) .add("memory", memoryCost) .add("network", networkCost) .toString(); }
Source:
protected void initChannel(SocketChannel ch) throws Exception { final ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast(TIMEOUT, new IdleStateHandler(0, 0, Configuration.configuration.getTIMEOUTCON(), TimeUnit.MILLISECONDS)); pipeline.addLast(LIMITGLOBAL, Configuration.configuration.getGlobalTrafficShapingHandler()); pipeline.addLast(LIMITCHANNEL, new ChannelTrafficShapingHandler( Configuration.configuration.getServerChannelWriteLimit(), Configuration.configuration.getServerChannelReadLimit(), Configuration.configuration.getDelayLimit())); pipeline.addLast("codec", new NetworkPacketCodec()); pipeline.addLast(Configuration.configuration.getHandlerGroup(), "handler", new NetworkServerHandler(this.server)); }

Target:
protected void initChannel(SocketChannel ch) throws Exception { final ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast(TIMEOUT, new IdleStateHandler(0, 0, Configuration.configuration.getTIMEOUTCON(), TimeUnit.MILLISECONDS)); GlobalTrafficShapingHandler handler = Configuration.configuration.getGlobalTrafficShapingHandler(); if (handler == null) { throw new OpenR66ProtocolNetworkException( "Error at pipeline initialization," + " GlobalTrafficShapingHandler configured."); } pipeline.addLast(LIMITGLOBAL, handler); pipeline.addLast(LIMITCHANNEL, new ChannelTrafficShapingHandler( Configuration.configuration.getServerChannelWriteLimit(), Configuration.configuration.getServerChannelReadLimit(), Configuration.configuration.getDelayLimit())); pipeline.addLast("codec", new NetworkPacketCodec()); pipeline.addLast(Configuration.configuration.getHandlerGroup(), "handler", new NetworkServerHandler(this.server)); }
Source:
public WiresCanvas.View addShape( final ShapeView<?> shapeView ) { if ( org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresUtils.isWiresShape( shapeView ) ) { WiresShape wiresShape = ( WiresShape ) shapeView; wiresManager.register( wiresShape ); wiresManager.getMagnetManager().createMagnets( wiresShape ); wiresShape.getContainer().setUserData( WiresCanvas.WIRES_CANVAS_GROUP_ID ); } else if ( org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresUtils.isWiresConnector( shapeView ) ) { WiresConnector wiresConnector = ( WiresConnector ) shapeView; final WiresConnectorControl connectorControl = wiresManager.register( wiresConnector ); if ( shapeView instanceof AbstractConnectorView ) { ( ( AbstractConnectorView ) shapeView ).setControl( connectorControl ); } wiresConnector.getGroup().setUserData( WiresCanvas.WIRES_CANVAS_GROUP_ID ); } else { super.addShape( shapeView ); } return this; }

Target:
public WiresCanvas.View addShape( final ShapeView<?> shapeView ) { if ( WiresUtils.isWiresShape( shapeView ) ) { WiresShape wiresShape = ( WiresShape ) shapeView; wiresManager.register( wiresShape ); wiresManager.getMagnetManager().createMagnets( wiresShape ); wiresShape.getContainer().setUserData( WiresCanvas.WIRES_CANVAS_GROUP_ID ); } else if ( WiresUtils.isWiresConnector( shapeView ) ) { WiresConnector wiresConnector = ( WiresConnector ) shapeView; final WiresConnectorControl connectorControl = wiresManager.register( wiresConnector ); if ( shapeView instanceof AbstractConnectorView ) { ( ( AbstractConnectorView ) shapeView ).setControl( connectorControl ); } wiresConnector.getGroup().setUserData( WiresCanvas.WIRES_CANVAS_GROUP_ID ); } else { super.addShape( shapeView ); } return this; }
Source:
private void init() { ThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT); timer = new HashedWheelTimer(new NamedThreadFactory("PG-JDBC Timer")); Executor bossExecutorService = Executors.newCachedThreadPool(new NamedThreadFactory("PG-JDBC Boss")); Executor workerExecutorService = Executors.newCachedThreadPool(new NamedThreadFactory("PG-JDBC Worker")); int workerCount = Math.max(10, getRuntime().availableProcessors()); ChannelFactory channelFactory = new NioClientSocketChannelFactory(bossExecutorService, 1, new NioWorkerPool(workerExecutorService, workerCount), timer); bootstrap = new ClientBootstrap(channelFactory); bootstrap.setPipelineFactory(new ChannelPipelineFactory() { @Override public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline(new MessageDecoder(), new MessageHandler()); } }); }

Target:
private void init() { ThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT); timer = new HashedWheelTimer(new NamedThreadFactory("PG-JDBC Timer")); Executor bossExecutorService = Executors.newCachedThreadPool(new NamedThreadFactory("PG-JDBC Boss")); Executor workerExecutorService = Executors.newCachedThreadPool(new NamedThreadFactory("PG-JDBC Worker")); int workerCount = getRuntime().availableProcessors(); ChannelFactory channelFactory = new NioClientSocketChannelFactory(bossExecutorService, 1, new NioWorkerPool(workerExecutorService, workerCount), timer); bootstrap = new ClientBootstrap(channelFactory); bootstrap.setPipelineFactory(new ChannelPipelineFactory() { @Override public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline(new MessageDecoder(), new MessageHandler()); } }); }
Source:
public void run() { if (resource.get() == DisposableHelper.DISPOSED) { long r = get(); if (r != 0L) { actual.onNext(count++); if (r != Long.MAX_VALUE) { decrementAndGet(); } } else { try { actual.onError(new MissingBackpressureException("Can't deliver value " + count + " due to lack of requests")); } finally { DisposableHelper.dispose(resource); } } } }

Target:
public void run() { if (resource.get() != DisposableHelper.DISPOSED) { long r = get(); if (r != 0L) { actual.onNext(count++); if (r != Long.MAX_VALUE) { decrementAndGet(); } } else { try { actual.onError(new MissingBackpressureException("Can't deliver value " + count + " due to lack of requests")); } finally { DisposableHelper.dispose(resource); } } } }
Source:
public void cwlNoInput() throws IOException{ File file = new File(ResourceHelpers.resourceFilePath("noInput.cwl")); File json = new File(ResourceHelpers.resourceFilePath("1st-workflow-job.json")); ArrayList<String> args = new ArrayList<String>() {{ add("--entry"); add(file.getAbsolutePath()); add("--local-entry"); add("--json"); add(json.getAbsolutePath()); }}; WorkflowsApi api = mock(WorkflowsApi.class); UsersApi usersApi = mock(UsersApi.class); Client client = new Client(); client.setConfigFile(ResourceHelpers.resourceFilePath("config")); exit.expectSystemExit(); WorkflowClient workflowClient = new WorkflowClient(api, usersApi, client); workflowClient.checkEntryFile(file.getAbsolutePath(), args, null); Assert.assertTrue("output should include a successful cromwell run",systemOutRule.getLog().contains("Missing 'inputs' in CWL file.")); }

Target:
public void cwlNoInput() throws IOException{ File file = new File(ResourceHelpers.resourceFilePath("noInput.cwl")); File json = new File(ResourceHelpers.resourceFilePath("1st-workflow-job.json")); ArrayList<String> args = new ArrayList<String>() {{ add("--entry"); add(file.getAbsolutePath()); add("--local-entry"); add("--json"); add(json.getAbsolutePath()); }}; WorkflowsApi api = mock(WorkflowsApi.class); UsersApi usersApi = mock(UsersApi.class); Client client = new Client(); client.setConfigFile(ResourceHelpers.resourceFilePath("config")); exit.expectSystemExit(); WorkflowClient workflowClient = new WorkflowClient(api, usersApi, client); workflowClient.checkEntryFile(file.getAbsolutePath(), args, null); Assert.assertTrue("output should include an error message and exit",systemOutRule.getLog().contains("Required fields that are missing from CWL file : 'inputs'")); }
Source:
private List<Migration.FileMetadata> extractFileMetadataFrom(String batchId, Batch.Builder newBatchBuilder) { Cursor downloadsCursor = database.rawQuery(DOWNLOADS_QUERY, batchId); List<Migration.FileMetadata> fileMetadataList = new ArrayList<>(); while (downloadsCursor.moveToNext()) { String originalNetworkAddress = downloadsCursor.getString(NETWORK_ADDRESS_COLUMN); String originalFileLocation = downloadsCursor.getString(FILE_LOCATION_COLUMN); newBatchBuilder.addFile(originalNetworkAddress); long rawFileSize = downloadsCursor.getLong(FILE_SIZE_COLUMN); FileSize fileSize = new LiteFileSize(rawFileSize, rawFileSize); Migration.FileMetadata fileMetadata = new Migration.FileMetadata(originalFileLocation, fileSize, originalNetworkAddress); fileMetadataList.add(fileMetadata); } downloadsCursor.close(); return fileMetadataList; }

Target:
private List<Migration.FileMetadata> extractFileMetadataFrom(String batchId, Batch.Builder newBatchBuilder) { Cursor downloadsCursor = database.rawQuery(DOWNLOADS_QUERY, batchId); if (downloadsCursor == null) { return Collections.emptyList(); } try { List<Migration.FileMetadata> fileMetadataList = new ArrayList<>(); while (downloadsCursor.moveToNext()) { String originalNetworkAddress = downloadsCursor.getString(NETWORK_ADDRESS_COLUMN); String originalFileLocation = downloadsCursor.getString(FILE_LOCATION_COLUMN); newBatchBuilder.addFile(originalNetworkAddress); long rawFileSize = downloadsCursor.getLong(FILE_SIZE_COLUMN); FileSize fileSize = new LiteFileSize(rawFileSize, rawFileSize); Migration.FileMetadata fileMetadata = new Migration.FileMetadata(originalFileLocation, fileSize, originalNetworkAddress); fileMetadataList.add(fileMetadata); } return fileMetadataList; } finally { downloadsCursor.close(); } }
Source:
private ValidationResult validateForMacsInUse(List<VmNetworkInterface> vnics, MacPool macPool) { final Optional<String> macInUse = vnics .stream() .map(VmNetworkInterface::getMacAddress) .filter(Objects::nonNull) .filter(macPool::isMacInUse) .findFirst(); return macInUse.isPresent() ? new ValidationResult( EngineMessage.NETWORK_MAC_ADDRESS_IN_USE, ReplacementUtils.createSetVariableString("MAC", macInUse.get())) : ValidationResult.VALID; }

Target:
private ValidationResult validateForMacsInUse(List<VmNetworkInterface> vnics, MacPool macPool) { final List<String> macsInUse = vnics .stream() .map(VmNetworkInterface::getMacAddress) .filter(Objects::nonNull) .filter(macPool::isMacInUse) .collect(Collectors.toList()); final EngineMessage msg = EngineMessage.NETWORK_MAC_ADDRESS_IN_USE; return ValidationResult .failWith(msg, ReplacementUtils.getListVariableAssignmentString(msg, macsInUse)) .unless(macsInUse.isEmpty()); }
Source:
public boolean isMyType(final Document document) { return rootElementMatches(document); }

Target:
public boolean isMyType(final Document document) { return rootElementMatches(document) && (versionMatches(document) || versionAbsent(document)); }
Source:
public static XRYFileParser get(String reportType) { if (reportType == null) { throw new IllegalArgumentException("Report type cannot be null"); } switch (reportType.toLowerCase()) { case "calls": return new XRYCallsFileParser(); case "contacts/contacts": return new XRYContactsFileParser(); case "device/general information": return new XRYDeviceGenInfoFileParser(); case "messages/sms": return new XRYMessagesFileParser(); case "web/bookmarks": return new XRYWebBookmarksFileParser(); default: throw new IllegalArgumentException(reportType + " not recognized."); } }

Target:
static XRYFileParser get(String reportType) { if (reportType == null) { throw new IllegalArgumentException("Report type cannot be null"); } switch (reportType.trim().toLowerCase()) { case "calls": return new XRYCallsFileParser(); case "contacts/contacts": return new XRYContactsFileParser(); case "device/general information": return new XRYDeviceGenInfoFileParser(); case "messages/sms": return new XRYMessagesFileParser(); case "web/bookmarks": return new XRYWebBookmarksFileParser(); default: throw new IllegalArgumentException(reportType + " not recognized."); } }
Source:
public static <T> T parse(final Path path, final Class<T> tClass) { try(final InputStream inputStream = Files.newInputStream(path)) { return parse(inputStream, tClass); }catch (Exception e){ throw new DotRuntimeException(e); } }

Target:
public static <T> T parse(final Path path, final Class<T> tClass) { try(final InputStream inputStream = Files.newInputStream(path)) { return parse(inputStream, tClass); }catch (Exception e){ Logger.error(YamlUtil.class,e.getMessage(),e); throw new DotRuntimeException(e); } }
Source:
private static Map<String, Object> readStackFrame(JsonReader reader) throws IOException { Map<String, Object> map = new HashMap<>(); reader.beginObject(); while (reader.hasNext()) { String key = reader.nextName(); Object val = null; switch (reader.peek()) { case STRING: val = reader.nextString(); break; case NUMBER: val = reader.nextInt(); break; default: reader.skipValue(); break; } if (val != null) { map.put(key, val); } } reader.endObject(); return map; }

Target:
private static Map<String, Object> readStackFrame(JsonReader reader) throws IOException { Map<String, Object> map = new HashMap<>(); reader.beginObject(); try { while (reader.hasNext()) { String key = reader.nextName(); switch (reader.peek()) { case STRING: map.put(key, reader.nextString()); break; case NUMBER: map.put(key, reader.nextLong()); break; default: reader.skipValue(); break; } } } catch (IllegalStateException exc) { Logger.warn("Failed to read stackframe", exc); } reader.endObject(); return map; }
Source:
public int toBytes(Object object, byte[] bytes, int offset) { return 0; }

Target:
public int toBytes(Object object, byte[] bytes, int offset) { if(byteSize == null) { return 0; } return byteSize; }
Source:
void addReferencesToBlobs(PortAndAssignment pna, BlobChangingCallback cb) throws IOException, KeyNotFoundException, AuthorizationException { List<LocalResource> localResourceList = getLocalResources(pna); if (!localResourceList.isEmpty()) { getBlobs(localResourceList, pna, cb); } pna.complete(); }

Target:
void addReferencesToBlobs(PortAndAssignment pna, BlobChangingCallback cb) throws IOException, KeyNotFoundException, AuthorizationException { List<LocalResource> localResourceList = getLocalResources(pna); if (!localResourceList.isEmpty()) { getBlobs(localResourceList, pna, cb); } }
Source:
protected TreeItem getRootItem(DiskImage disk) { HorizontalPanel panel = new HorizontalPanel(); panel.setSpacing(1); panel.setWidth("100%"); addItemToPanel(panel, new Image(resources.diskImage()), "25px"); addTextBoxToPanel(panel, new TextBoxLabel(), disk.getDiskAlias(), ""); addItemToPanel(panel, disk.getReadOnly() ? new Image(resources.readOnlyDiskIcon()) :new Image(), "60px"); addValueLabelToPanel(panel, new DiskSizeLabel<Long>(), disk.getSizeInGigabytes(), "120px"); addValueLabelToPanel(panel, new DiskSizeLabel<Long>(SizeConverter.SizeUnit.BYTES), disk.getActualSizeInBytes(), "120px"); addValueLabelToPanel(panel, new EnumLabel<ImageStatus>(), disk.getImageStatus(), "120px"); addValueLabelToPanel(panel, new EnumLabel<VolumeType>(), disk.getVolumeType(), "120px"); addValueLabelToPanel(panel, new EnumLabel<DiskInterface>(), disk.getDiskInterface(), "120px"); addValueLabelToPanel(panel, new DateLabel(), disk.getCreationDate(), "90px"); TreeItem treeItem = new TreeItem(panel); treeItem.setUserObject(disk.getId()); return treeItem; }

Target:
protected TreeItem getRootItem(DiskImage disk) { HorizontalPanel panel = new HorizontalPanel(); panel.setSpacing(1); panel.setWidth("100%"); addItemToPanel(panel, new Image(resources.diskImage()), "25px"); addTextBoxToPanel(panel, new TextBoxLabel(), disk.getDiskAlias(), ""); addItemToPanel(panel, disk.getReadOnly() ? new Image(resources.readOnlyDiskIcon()) : new Image(), "60px"); addValueLabelToPanel(panel, new DiskSizeLabel<Long>(), disk.getSizeInGigabytes(), "120px"); addValueLabelToPanel(panel, new DiskSizeLabel<Long>(SizeConverter.SizeUnit.BYTES), disk.getActualSizeInBytes(), "120px"); addValueLabelToPanel(panel, new EnumLabel<ImageStatus>(), disk.getImageStatus(), "120px"); addValueLabelToPanel(panel, new EnumLabel<VolumeType>(), disk.getVolumeType(), "120px"); addValueLabelToPanel(panel, new EnumLabel<DiskInterface>(), disk.getDiskInterface(), "120px"); addValueLabelToPanel(panel, new DateLabel(), disk.getCreationDate(), "90px"); TreeItem treeItem = new TreeItem(panel); treeItem.setUserObject(disk.getId()); return treeItem;llls }
Source:
public void createContentStructure(DocumentModel eventDoc) { initSession(eventDoc); boolean initRootAcl = true; for (TemplateItemDescriptor item : template) { if (!shouldCreateDocument(eventDoc.getId(), item.getId(), item.getTypeName())) { initRootAcl = false; continue; } String itemPath = eventDoc.getPathAsString(); if (item.getPath() != null) { itemPath += "/" + item.getPath(); } DocumentModel newChild = session.createDocumentModel(itemPath, item.getId(), item.getTypeName()); newChild.setProperty("dublincore", "title", item.getTitle()); newChild.setProperty("dublincore", "description", item.getDescription()); setProperties(item.getProperties(), newChild); newChild = session.createDocument(newChild); setAcl(item.getAcl(), newChild.getRef()); session.save(); } if (initRootAcl) { setAcl(acl, eventDoc.getRef()); } }

Target:
public void createContentStructure(DocumentModel eventDoc) { initSession(eventDoc); boolean initRootAcl = shouldInitAcl(eventDoc); for (TemplateItemDescriptor item : template) { if (!shouldCreateDocument(eventDoc.getId(), item.getId(), item.getTypeName())) { continue; } String itemPath = eventDoc.getPathAsString(); if (item.getPath() != null) { itemPath += "/" + item.getPath(); } DocumentModel newChild = session.createDocumentModel(itemPath, item.getId(), item.getTypeName()); newChild.setProperty("dublincore", "title", item.getTitle()); newChild.setProperty("dublincore", "description", item.getDescription()); setProperties(item.getProperties(), newChild); newChild = session.createDocument(newChild); setAcl(item.getAcl(), newChild.getRef()); session.save(); } if (initRootAcl) { setAcl(acl, eventDoc.getRef()); } }
Source:
public String generateHtml(FormEntryContext context) { if (mss == null) { mss = Context.getMessageSourceService(); } initializeExistingCondition(context); StringBuilder ret = new StringBuilder(); ret.append("<div id=\"htmlformentry-condition\">"); ret.append(htmlForConditionSearchWidget(context)); ret.append(htmlForConditionStatusesWidgets(context)); ret.append(htmlForConditionDatesWidget(context)); ret.append("</div>"); return ret.toString(); }

Target:
public String generateHtml(FormEntryContext context) { wrapperDivId = "htmlformentry-condition-" + formFieldName; endDatePickerWrapperId = "condition-end-date-" + formFieldName; if (mss == null) { mss = Context.getMessageSourceService(); } initializeExistingCondition(context); StringBuilder ret = new StringBuilder(); ret.append("<div id=\"" + wrapperDivId + "\">"); ret.append(htmlForConditionSearchWidget(context)); ret.append(htmlForConditionStatusesWidgets(context)); ret.append(htmlForConditionDatesWidget(context)); ret.append("</div>"); return ret.toString(); }
Source:
private void applyConnectionParams(final HttpMethod method) throws IOException { int timeout = 0; Object param = method.getParams().getParameter(HttpMethodParams.SO_TIMEOUT); if (param == null) { param = this.conn.getParams().getParameter(HttpConnectionParams.SO_TIMEOUT); } if (param != null) { timeout = (Integer) param; } this.conn.setSocketTimeout(timeout); }

Target:
private void applyConnectionParams(final HttpMethod method) throws IOException { int timeout = 0; Object param = method.getParams().getParameter(HttpMethodParams.SO_TIMEOUT); if (param == null) { param = this.conn.getParams().getParameter(HttpConnectionParams.SO_TIMEOUT); } if (param != null) { timeout = ((Integer)param).intValue(); } this.conn.setSocketTimeout(timeout); }
Source:
public void onPositiveAction() { ReadingListSyncAdapter.setSyncEnabledWithSetup(); maybeShowOnboarding(); }

Target:
public void onPositiveAction() { Prefs.shouldShowReadingListSyncMergePrompt(true); ReadingListSyncAdapter.setSyncEnabledWithSetup(); maybeShowOnboarding(); }
Source:
public List<GlusterVolumeEntity> getVolumesSupportedAsStorageDomain() { List<GlusterVolumeEntity> volumes = getCallsHandler().executeReadList("GetGlusterVolumesSupportedAsStorageDomain", volumeRowMapper, getCustomMapSqlParameterSource() .addValue("replica_count", 3)); fetchRelatedEntities(volumes); return volumes; }

Target:
public List<GlusterVolumeEntity> getVolumesSupportedAsStorageDomain() { List<GlusterVolumeEntity> volumes = getCallsHandler().executeReadList("GetGlusterVolumesSupportedAsStorageDomain", volumeRowMapper, null); fetchRelatedEntities(volumes); return volumes; }
Source:
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { return new ViewHolder(LayoutInflater.from(parent.getContext()) .inflate(R.layout.list_item_customer, parent, false)); }

Target:
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View itemView = layoutInflater.inflate(R.layout.list_item_customer, parent, false); return new ViewHolder(itemView); }
Source:
public synchronized void flush() throws IOException { if (!somethingWritten.get()) { return; } somethingWritten.set(false); flushOrCheckpoint(false); }

Target:
public synchronized void flush() throws IOException { if (!somethingWritten.compareAndSet(true, false)) { return; } flushOrCheckpoint(false); }
Source:
public void shouldStartInstallationJob() throws Exception { String componentCode = "test_widget"; ResultActions result = createAuthRequest(get(BASE_URL + "/{exchange}/install/{component}", DE_1_ID, componentCode)).execute(); result.andExpect(jsonPath("$.errors").isEmpty()) .andExpect(jsonPath("$.metaData").isEmpty()) .andExpect(jsonPath("$.payload").isString()); String jsonResponse = result.andReturn().getResponse().getContentAsString(); SimpleRestResponse<String> response = new ObjectMapper() .readValue(jsonResponse, new TypeReference<SimpleRestResponse<String>>() { }); String jobId = response.getPayload(); assertThat(jobId).hasSize(20); InstallationStatus status = InstallationStatus.CREATED; int attempts = 0; while (status != InstallationStatus.COMPLETED && attempts < 10) { status = checkJobStatus(jobId); assertThat(status).isNotEqualTo(InstallationStatus.ERROR); attempts++; try { Thread.sleep(500); } catch (InterruptedException ex) { } } assertThat(status).isEqualTo(InstallationStatus.COMPLETED); SystemInstallationReport report = initializerManager.getCurrentReport(); assertThat(report.getComponentReport(componentCode, false)) .isNotNull() .matches(cr -> cr.getStatus() == SystemInstallationReport.Status.OK); assertThat(widgetService.getWidget(componentCode)) .isNotNull(); widgetService.removeWidget(componentCode); }

Target:
public void shouldStartInstallationJob() throws Exception { String componentCode = "test_widget"; ResultActions result = createAuthRequest(get(BASE_URL + "/{exchange}/install/{component}", DE_1_ID, componentCode)).execute(); result.andExpect(jsonPath("$.errors").isEmpty()) .andExpect(jsonPath("$.metaData").isEmpty()) .andExpect(jsonPath("$.payload").isString()); String jsonResponse = result.andReturn().getResponse().getContentAsString(); SimpleRestResponse<String> response = new ObjectMapper() .readValue(jsonResponse, new TypeReference<SimpleRestResponse<String>>() { }); String jobId = response.getPayload(); assertThat(jobId).hasSize(20); InstallationStatus status = InstallationStatus.CREATED; int attempts = 0; while (status != InstallationStatus.COMPLETED && attempts < 10) { status = checkJobStatus(jobId); assertThat(status).isNotEqualTo(InstallationStatus.ERROR); attempts++; try { Thread.sleep(500); } catch (InterruptedException ignored) { } } assertThat(status).isEqualTo(InstallationStatus.COMPLETED); SystemInstallationReport report = initializerManager.getCurrentReport(); assertThat(report.getComponentReport(componentCode, false)) .isNotNull() .matches(cr -> cr.getStatus() == SystemInstallationReport.Status.OK); assertThat(widgetService.getWidget(componentCode)) .isNotNull(); widgetService.removeWidget(componentCode); }
Source:
public void createReadJobWithNameOption() throws IOException, SignatureException, XmlProcessingException, URISyntaxException, InterruptedException { final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( new Ds3Object("beowulf.txt", 10)) ); final GetJobSpectraS3Response jobSpectraS3Response = client .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); assertThat(jobSpectraS3Response.getMasterObjectListResult().getName(), is("test_job")); }

Target:
public void createReadJobWithNameOption() throws IOException, SignatureException, XmlProcessingException, URISyntaxException, InterruptedException { final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create().withName("test_job")); final GetJobSpectraS3Response jobSpectraS3Response = client .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); assertThat(jobSpectraS3Response.getMasterObjectListResult().getName(), is("test_job")); }
Source:
public void testHandleTransitionValidation__AssigneesUpdate() throws OseeCoreException { AtsTestUtil.cleanupAndReset("TransitionManagerTest-E"); TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf(); List<IAtsUser> assigneesBefore = teamArt.getAssignees(); MockTransitionHelper helper = new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt), AtsTestUtil.getImplementStateDef().getName(), teamArt.getTransitionAssignees(), null, TransitionOption.None); TransitionManager transMgr = new TransitionManager(helper); TransitionResults results = new TransitionResults(); TransitionResults results01 = new TransitionResults(); transMgr.handleTransitionValidation(results); Assert.assertTrue(results.isEmpty()); results01 = transMgr.handleAll(); transMgr.getTransaction().execute(); Assert.assertTrue(results01.isEmpty()); List<IAtsUser> assigneesAfter = teamArt.getAssignees(); Assert.assertTrue(assigneesAfter.containsAll(assigneesBefore)); Assert.assertTrue(assigneesBefore.containsAll(assigneesAfter)); }

Target:
public void testHandleTransitionValidation__AssigneesUpdate() throws OseeCoreException { AtsTestUtil.cleanupAndReset("TransitionManagerTest-E"); TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf(); List<IAtsUser> assigneesBefore = teamArt.getAssignees(); Assert.assertTrue(assigneesBefore.size() > 0); MockTransitionHelper helper = new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt), AtsTestUtil.getImplementStateDef().getName(), teamArt.getAssignees(), null, TransitionOption.None); TransitionManager transMgr = new TransitionManager(helper); TransitionResults results = new TransitionResults(); TransitionResults results01 = new TransitionResults(); transMgr.handleTransitionValidation(results); Assert.assertTrue(results.isEmpty()); results01 = transMgr.handleAll(); transMgr.getTransaction().execute(); Assert.assertTrue(results01.isEmpty()); List<IAtsUser> assigneesAfter = teamArt.getAssignees(); Assert.assertTrue(assigneesAfter.containsAll(assigneesBefore)); Assert.assertTrue(assigneesBefore.containsAll(assigneesAfter)); }
Source:
public Observable<Cursor> createObservable() { try { throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return storIOContentResolver .observeChangesOfUri(query.uri()) .map(MapSomethingToExecuteAsBlocking.newInstance(this)) .startWith(Observable.create(OnSubscribeExecuteAsBlocking.newInstance(this))) .subscribeOn(Schedulers.io()); } catch (Throwable throwable) { throw new StorIOException(throwable); } }

Target:
public Observable<Cursor> createObservable() { throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return storIOContentResolver .observeChangesOfUri(query.uri()) .map(MapSomethingToExecuteAsBlocking.newInstance(this)) .startWith(Observable.create(OnSubscribeExecuteAsBlocking.newInstance(this))) .subscribeOn(Schedulers.io()); }
Source:
private DeploymentProvider getDeploymentProvider() throws DeploymentEnvironmentException { String platform = System.getenv(ENV_DEPLOYMENT_PLATFORM); if (platform == null || platform.equals("")) { throw new DeploymentEnvironmentException("Unable to identify the deployment platform."); } if (platform.equalsIgnoreCase(DEPLOYMENT_KUBERNETES)) { return new KubernetesDeploymentProvider(); } else { throw new DeploymentEnvironmentException("Unsupported deployment platform: " + platform); } }

Target:
private DeploymentProvider getDeploymentProvider() throws DeploymentEnvironmentException { String platform = System.getenv(ENV_DEPLOYMENT_PLATFORM); if (platform == null || platform.isEmpty()) { throw new DeploymentEnvironmentException("Unable to identify the deployment platform."); } if (DEPLOYMENT_KUBERNETES.equalsIgnoreCase(platform)) { return new KubernetesDeploymentProvider(); } else { throw new DeploymentEnvironmentException("Unsupported deployment platform: " + platform); } }