auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void checkAuth(SentinelServersConfig cfg) { boolean connected = false; for (String address : cfg.getSentinelAddresses()) { RedisURI addr = new RedisURI(address); scheme = addr.getScheme(); addr = applyNatMap(addr); RedisClient client = createClient(NodeType.SENTINEL, addr, this.config.getConnectTimeout(), this.config.getTimeout(), null); try { RedisConnection c = client.connect(); connected = true; c.sync(RedisCommands.PING); break; } catch (RedisAuthRequiredException e) { usePassword = true; } catch (RedisConnectionException e) { log.warn("Can't connect to sentinel server. {}", e.getMessage()); } catch (Exception e) { } finally { client.shutdown(); } } if (!connected) { stopThreads(); StringBuilder list = new StringBuilder(); for (String address : cfg.getSentinelAddresses()) { list.append(address).append(", "); } throw new RedisConnectionException("Unable to connect to Redis sentinel servers: " + list); } }

Target:
private void checkAuth(SentinelServersConfig cfg) { boolean connected = checkConnection(cfg); if (!connected) { stopThreads(); StringBuilder list = new StringBuilder(); for (String address : cfg.getSentinelAddresses()) { list.append(address).append(", "); } throw new RedisConnectionException("Unable to connect to Redis sentinel servers: " + list); } }
Source:
public void locksAndUnlocks() throws Exception { final MkStorage storage = new MkStorage.InFile(); final ExecutorService executor = Executors.newSingleThreadExecutor(); final Runnable secondThread = new Runnable() { @Override public void run() { try { storage.lock(); } catch (IOException ex) { throw new IllegalStateException(ex); } } }; storage.lock(); Future<?> future = executor.submit(secondThread); try { future.get(1, TimeUnit.SECONDS); MatcherAssert.assertThat("timeout should happen", false); } catch (TimeoutException ex) { future.cancel(true); } storage.unlock(); future = executor.submit(secondThread); try { future.get(1, TimeUnit.SECONDS); } catch (TimeoutException ex) { MatcherAssert.assertThat("timeout should NOT happen", false); } }

Target:
public void locksAndUnlocks() throws Exception { final MkStorage storage = new MkStorage.InFile(); final ExecutorService executor = Executors.newSingleThreadExecutor(); final Runnable second = new Runnable() { @Override public void run() { try { storage.lock(); } catch (IOException ex) { throw new IllegalStateException(ex); } } }; storage.lock(); Future<?> future = executor.submit(second); try { future.get(1, TimeUnit.SECONDS); MatcherAssert.assertThat("timeout SHOULD happen", false); } catch (TimeoutException ex) { future.cancel(true); } finally { storage.unlock(); } future = executor.submit(second); try { future.get(1, TimeUnit.SECONDS); } catch (TimeoutException ex) { MatcherAssert.assertThat("timeout SHOULD NOT happen", false); future.cancel(true); } executor.shutdown(); }
Source:
public synchronized < T > void removeSource( final Source< T > source ) { final int currentSourceIndex = this.sources.indexOf( source ); if ( this.states.get( source ).typeProperty().get() == TYPE.LABEL ) this.states.get( source ).meshManagerProperty().get().removeAllNeurons(); this.states.remove( source ); this.sources.remove( source ); this.currentSource.set( this.sources.size() == 0 ? null : this.sources.get( Math.max( currentSourceIndex - 1, 0 ) ) ); this.composites.remove( source ); this.removedSources.add( source ); }

Target:
public synchronized < T > void removeSource( final Source< T > source ) { final int currentSourceIndex = this.sources.indexOf( source ); Optional.ofNullable( this.states.get( source ).meshManagerProperty().get() ).ifPresent( MeshManager::removeAllNeurons ); this.states.remove( source ); this.sources.remove( source ); this.currentSource.set( this.sources.size() == 0 ? null : this.sources.get( Math.max( currentSourceIndex - 1, 0 ) ) ); this.composites.remove( source ); this.removedSources.add( source ); }
Source:
public BruteForce getBruteForce(ScanTarget target) { return this.bruteForceMap.get(target); }

Target:
BruteForce getBruteForce(ScanTarget target) { return this.bruteForceMap.get(target); }
Source:
public List<SlotExecutionVertexAssignment> allocateSlotsFor( final List<ExecutionVertexSchedulingRequirements> executionVertexSchedulingRequirements) { validateSchedulingRequirements(executionVertexSchedulingRequirements); validateNoCoLocationConstraint(executionVertexSchedulingRequirements); final Set<ExecutionVertexID> allExecutionVertexIds = executionVertexSchedulingRequirements.stream() .map(ExecutionVertexSchedulingRequirements::getExecutionVertexId) .collect(Collectors.toSet()); final Map<ExecutionVertexID, SlotRequestId> executionVertexSlotRequestIds = generateExecutionVertexSlotRequestIds(allExecutionVertexIds); final List<SlotExecutionVertexAssignment> slotExecutionVertexAssignments = createSlotExecutionVertexAssignments(executionVertexSchedulingRequirements, executionVertexSlotRequestIds); final List<CompletableFuture<PhysicalSlotRequest>> physicalSlotRequestFutures = createPhysicalSlotRequestFutures( executionVertexSchedulingRequirements, allExecutionVertexIds, executionVertexSlotRequestIds); allocateSlotsForAssignments( physicalSlotRequestFutures, slotExecutionVertexAssignments, executionVertexSlotRequestIds); return slotExecutionVertexAssignments; }

Target:
public List<SlotExecutionVertexAssignment> allocateSlotsFor( final List<ExecutionVertexSchedulingRequirements> executionVertexSchedulingRequirements) { validateSchedulingRequirements(executionVertexSchedulingRequirements); validateNoCoLocationConstraint(executionVertexSchedulingRequirements); final LinkedHashMap<SlotRequestId, SlotExecutionVertexAssignment> slotExecutionVertexAssignments = createSlotExecutionVertexAssignments(executionVertexSchedulingRequirements); final Map<ExecutionVertexID, SlotRequestId> executionVertexSlotRequestIds = slotExecutionVertexAssignments .entrySet() .stream() .collect(Collectors.toMap(e -> e.getValue().getExecutionVertexId(), Map.Entry::getKey)); final List<CompletableFuture<PhysicalSlotRequest>> physicalSlotRequestFutures = createPhysicalSlotRequestFutures( executionVertexSchedulingRequirements, executionVertexSlotRequestIds); allocateSlotsForAssignments( physicalSlotRequestFutures, slotExecutionVertexAssignments); return Collections.unmodifiableList(new ArrayList<>(slotExecutionVertexAssignments.values())); }
Source:
public void setReviewPattern(String reviewPattern) throws PatternSyntaxException { if (!reviewPattern.matches(".*\\([^\\)]*\\).*")) { throw new PatternSyntaxException("The pattern must contain at least one group.", reviewPattern, 0); } this.reviewPattern = Pattern.compile(reviewPattern).toString(); }

Target:
public void setReviewPattern(String reviewPattern) throws PatternSyntaxException { if (!reviewPattern.matches(PATTERN_SINGLE_GROUP)) { throw new PatternSyntaxException(PATTERN_MUST_CONTAIN_GROUP, reviewPattern, 0); } this.reviewPattern = Pattern.compile(reviewPattern).toString(); }
Source:
private void updateGradleSyncState() { if (!myUsingCachedProjectData) { GradleProjectSyncData.save(myProject); GradleSyncState.getInstance(myProject).syncEnded(); } else { long lastSyncTimestamp = myLastSyncTimestamp; if (lastSyncTimestamp < 0) { lastSyncTimestamp = System.currentTimeMillis(); } GradleSyncState.getInstance(myProject).syncSkipped(lastSyncTimestamp); } myUsingCachedProjectData = DEFAULT_USING_CACHED_PROJECT_DATA; myLastSyncTimestamp = DEFAULT_LAST_SYNC_TIMESTAMP; }

Target:
private void updateGradleSyncState() { if (!myUsingCachedProjectData) { GradleProjectSyncData.save(myProject); GradleSyncState.getInstance(myProject).syncEnded(); } else { long lastSyncTimestamp = myLastSyncTimestamp; if (lastSyncTimestamp == DEFAULT_LAST_SYNC_TIMESTAMP) { lastSyncTimestamp = System.currentTimeMillis(); } GradleSyncState.getInstance(myProject).syncSkipped(lastSyncTimestamp); } myUsingCachedProjectData = DEFAULT_USING_CACHED_PROJECT_DATA; myLastSyncTimestamp = DEFAULT_LAST_SYNC_TIMESTAMP; }
Source:
public LogUnitServerCache(LogUnitServerConfig config, StreamLog streamLog) { this.streamLog = streamLog; this.dataCache = Caffeine.newBuilder() .<Long, ILogData>weigher((addr, logData) -> logData.getSizeEstimate() + (int)(sizeOf.deepSizeOf(logData.getMetadataMap()))) .maximumWeight(config.getMaxCacheSize()) .removalListener(this::handleEviction) .build(this::handleRetrieval); }

Target:
public LogUnitServerCache(LogUnitServerConfig config, StreamLog streamLog) { this.streamLog = streamLog; this.dataCache = Caffeine.newBuilder() .<Long, ILogData>weigher((addr, logData) -> getLogDataTotalSize(logData)) .maximumWeight(config.getMaxCacheSize()) .removalListener(this::handleEviction) .build(this::handleRetrieval); }
Source:
public boolean isSelected() { return getRoot().getAttribute("class").contains("cellTableSelectedRow"); }

Target:
public boolean isSelected() { return getRoot().getAttribute("class").contains(ROW_SELECTED_CLASS); }
Source:
public void loadSystems(ModuleEnvironment environment, NetworkMode netMode) { DisplayDevice displayDevice = CoreRegistry.get(DisplayDevice.class); boolean isHeadless = displayDevice.isHeadless(); ListMultimap<Name, Class<?>> systemsByModule = ArrayListMultimap.create(); for (Class<?> type : environment.getTypesAnnotatedWith(RegisterSystem.class)) { if (!ComponentSystem.class.isAssignableFrom(type)) { logger.error("Cannot load {}, must be a subclass of ComponentSystem", type.getSimpleName()); continue; } Name moduleId = environment.getModuleProviding(type); RegisterSystem registerInfo = type.getAnnotation(RegisterSystem.class); if (registerInfo.value().isValidFor(netMode, isHeadless)) { systemsByModule.put(moduleId, type); } } for (Module module : environment.getModulesOrderedByDependencies()) { for (Class<?> system : systemsByModule.get(module.getId())) { String id = module.getId() + ":" + system.getSimpleName(); logger.debug("Registering system {}", id); try { ComponentSystem newSystem = (ComponentSystem) system.newInstance(); InjectionHelper.share(newSystem); register(newSystem, id); logger.debug("Loaded system {}", id); } catch (Throwable t) { logger.error("Failed to load system {}", id, t); } } } }

Target:
public void loadSystems(ModuleEnvironment environment, NetworkMode netMode) { DisplayDevice displayDevice = CoreRegistry.get(DisplayDevice.class); boolean isHeadless = displayDevice.isHeadless(); ListMultimap<Name, Class<?>> systemsByModule = ArrayListMultimap.create(); for (Class<?> type : environment.getTypesAnnotatedWith(RegisterSystem.class)) { if (!ComponentSystem.class.isAssignableFrom(type)) { logger.error("Cannot load {}, must be a subclass of ComponentSystem", type.getSimpleName()); continue; } Name moduleId = environment.getModuleProviding(type); RegisterSystem registerInfo = type.getAnnotation(RegisterSystem.class); if (registerInfo.value().isValidFor(netMode, isHeadless)) { systemsByModule.put(moduleId, type); } } for (Module module : environment.getModulesOrderedByDependencies()) { for (Class<?> system : systemsByModule.get(module.getId())) { String id = module.getId() + ":" + system.getSimpleName(); logger.debug("Registering system {}", id); try { ComponentSystem newSystem = (ComponentSystem) system.newInstance(); InjectionHelper.share(newSystem); register(newSystem, id); logger.debug("Loaded system {}", id); } catch (RuntimeException | IllegalAccessException | InstantiationException e) { logger.error("Failed to load system {}", id, e); } } } }
Source:
private void initUnregisteredVM() { OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmFromConfiguration = ovfHelper.readVmFromOvf(ovfEntityData.getOvfData()); vmFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); getParameters().setVm(vmFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskMap() != null) { vmFromConfiguration.setDiskMap(getParameters().getDiskMap()); vmFromConfiguration.setImages(getDiskImageListFromDiskMap(getParameters().getDiskMap())); } } catch (OvfReaderException e) { log.error("failed to parse a given ovf configuration: \n{}", ovfEntityData.getOvfData()); log.error("Exception", e); } } }

Target:
private void initUnregisteredVM() { OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmFromConfiguration = ovfHelper.readVmFromOvf(ovfEntityData.getOvfData()); vmFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); getParameters().setVm(vmFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskMap() != null) { vmFromConfiguration.setDiskMap(getParameters().getDiskMap()); vmFromConfiguration.setImages(getDiskImageListFromDiskMap(getParameters().getDiskMap())); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration:\n{}", ovfEntityData.getOvfData()); log.error("Exception", e); } } }
Source:
public static boolean setUseEureka2(boolean useEureka2) { boolean lastValue = Eureka2Clients.useEureka2; Eureka2Clients.useEureka2 = useEureka2; return lastValue; }

Target:
public static boolean setUseEureka2(boolean useEureka2) { return Eureka2Clients.useEureka2.getAndSet(useEureka2); }
Source:
public StatusListener(String intf, int port, String publicIntf) { m_resolvedIntf = resolveInterface(intf, ""); m_publicIntf = resolveInterface(publicIntf, m_resolvedIntf); initServer(m_resolvedIntf, port); }

Target:
public StatusListener(String intf, int port, String publicIntf) throws InitException { m_resolvedIntf = resolveInterface(intf, ""); m_publicIntf = resolveInterface(publicIntf, m_resolvedIntf); initServer(m_resolvedIntf, port); }
Source:
protected void doTest(Location loc) throws Exception { final MongoDBShardedDeployment deployment = app.createAndManageChild(EntitySpec.create(MongoDBShardedDeployment.class) .configure(MongoDBShardedDeployment.INITIAL_ROUTER_CLUSTER_SIZE, ROUTER_CLUSTER_SIZE) .configure(MongoDBShardedDeployment.SHARD_REPLICASET_SIZE,REPLICASET_SIZE) .configure(MongoDBShardedDeployment.INITIAL_SHARD_CLUSTER_SIZE, SHARD_CLUSTER_SIZE)); app.start(ImmutableList.of(loc)); Entities.dumpInfo(app); Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Callable<Boolean>() { @Override public Boolean call() throws Exception { Assert.assertEquals(deployment.getRouterCluster().getCurrentSize(), ROUTER_CLUSTER_SIZE); Assert.assertEquals(deployment.getShardCluster().getCurrentSize(), SHARD_CLUSTER_SIZE); Assert.assertEquals(deployment.getConfigCluster().getCurrentSize(), MongoDBShardedDeployment.CONFIG_CLUSTER_SIZE.getDefaultValue()); for (Entity entity : deployment.getShardCluster().getMembers()) { Assert.assertEquals(((MongoDBReplicaSet)entity).getCurrentSize(), REPLICASET_SIZE); } return true; } }); }

Target:
protected void doTest(Location loc) throws Exception { final MongoDBShardedDeployment deployment = app.createAndManageChild(EntitySpec.create(MongoDBShardedDeployment.class) .configure(MongoDBShardedDeployment.INITIAL_ROUTER_CLUSTER_SIZE, ROUTER_CLUSTER_SIZE) .configure(MongoDBShardedDeployment.SHARD_REPLICASET_SIZE,REPLICASET_SIZE) .configure(MongoDBShardedDeployment.INITIAL_SHARD_CLUSTER_SIZE, SHARD_CLUSTER_SIZE)); app.start(ImmutableList.of(loc)); Entities.dumpInfo(app); Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Runnable() { public void run() { Assert.assertEquals(deployment.getRouterCluster().getCurrentSize(), ROUTER_CLUSTER_SIZE); Assert.assertEquals(deployment.getShardCluster().getCurrentSize(), SHARD_CLUSTER_SIZE); Assert.assertEquals(deployment.getConfigCluster().getCurrentSize(), MongoDBShardedDeployment.CONFIG_CLUSTER_SIZE.getDefaultValue()); for (Entity entity : deployment.getShardCluster().getMembers()) { Assert.assertEquals(((MongoDBReplicaSet) entity).getCurrentSize(), REPLICASET_SIZE); } } }); }
Source:
public ImmutableValue<Boolean> exactTeleport() { return new ImmutableSpongeValue<>(Keys.EXACT_TELEPORT, false, this.exactTeleport); }

Target:
public ImmutableValue<Boolean> exactTeleport() { return this.exactTeleportValue; }
Source:
private static Uri getFileUriFromMediaStoreUri(@NonNull Context context, @NonNull Uri photoUri) { final Cursor cursor = context.getContentResolver().query(photoUri, new String[]{MediaStore.Images.ImageColumns.DATA}, null, null, null); if (null == cursor) { return null; } try { cursor.moveToFirst(); if (cursor.getCount() <= 0 || cursor.getColumnCount() <= 0) { return null; } final String data = cursor.getString(0); if (TextUtils.isEmpty(data)) { return null; } return Uri.fromFile(new File(data)); } finally { cursor.close(); } }

Target:
private static Uri getFileUriFromMediaStoreUri(@NonNull Context context, @NonNull Uri photoUri) { final Cursor cursor = context.getContentResolver().query(photoUri, new String[]{MediaStore.Images.ImageColumns.DATA}, null, null, null); if (null == cursor) { return null; } try { if (cursor.moveToFirst() && cursor.getColumnCount() > 0) { final String data = cursor.getString(0); if (TextUtils.isEmpty(data)) { return null; } return Uri.fromFile(new File(data)); } } finally { cursor.close(); } return null; }
Source:
public JavaFileObject toJavaFileObject() { TypeSpec firstTypeSpec = typeSpecs.get(0); URI uri = URI.create((packageName.isEmpty() ? firstTypeSpec.name : packageName.replace('.', '/') + '/' + firstTypeSpec.name) + Kind.SOURCE.extension); return new SimpleJavaFileObject(uri, Kind.SOURCE) { private final long lastModified = System.currentTimeMillis(); @Override public String getCharContent(boolean ignoreEncodingErrors) { return JavaFile.this.toString(); } @Override public InputStream openInputStream() throws IOException { return new ByteArrayInputStream(getCharContent(true).getBytes(UTF_8)); } @Override public long getLastModified() { return lastModified; } }; }

Target:
public JavaFileObject toJavaFileObject() { URI uri = URI.create((packageName.isEmpty() ? typeSpec.name : packageName.replace('.', '/') + '/' + typeSpec.name) + Kind.SOURCE.extension); return new SimpleJavaFileObject(uri, Kind.SOURCE) { private final long lastModified = System.currentTimeMillis(); @Override public String getCharContent(boolean ignoreEncodingErrors) { return JavaFile.this.toString(); } @Override public InputStream openInputStream() throws IOException { return new ByteArrayInputStream(getCharContent(true).getBytes(UTF_8)); } @Override public long getLastModified() { return lastModified; } }; }
Source:
public QueryBuilder make(EsHint hint, String fieldName, Object value) { MatchPhraseQueryBuilder matchPhraseQuery = QueryBuilders.matchPhraseQuery(fieldName, value); if (hint.analyzer != null) { matchPhraseQuery.analyzer(hint.analyzer); } return matchPhraseQuery; }

Target:
public QueryBuilder make(EsHint hint, String fieldName, Object value) { return QueryBuilders.matchPhraseQuery(fieldName, value).analyzer(hint.analyzer); }
Source:
public void onConstruction(CallbackInfo ci) { final Optional<net.minecraft.world.DimensionType> optDimensionType = DimensionManager.getDimensionType((Class<? extends WorldProvider>) (Object) getClass()); if (!optDimensionType.isPresent()) { throw new RuntimeException("Attempt was made to create an instance of a WorldProvider who has no registered type!"); } this.dimensionType = optDimensionType.get(); }

Target:
public void onConstruction(CallbackInfo ci) { this.dimensionType = DimensionManager.getDimensionType((Class<? extends WorldProvider>) (Object) getClass()).orElseThrow(() -> new RuntimeException("Attempt was made to create an instance of a WorldProvider who has no " + "registered type!")); }
Source:
private MultiKeyOperation(final List keys, final OpName o) { Object firstKey = (keys != null) ? keys.get(0) : null; if(firstKey != null) { if (firstKey instanceof String) { this.keys = keys; this.binaryKeys = null; } else if (firstKey instanceof byte[]) { this.keys = null; this.binaryKeys = keys; } else { this.keys = null; this.binaryKeys = null; } } else { this.keys = null; this.binaryKeys = null; } this.op = o; }

Target:
private MultiKeyOperation(final List keys, final OpName o) { Object firstKey = (keys != null && keys.size() > 0) ? keys.get(0) : null; if(firstKey != null) { if (firstKey instanceof String) { this.keys = keys; this.binaryKeys = null; } else if (firstKey instanceof byte[]) { this.keys = null; this.binaryKeys = keys; } else { this.keys = null; this.binaryKeys = null; } } else { this.keys = null; this.binaryKeys = null; } this.op = o; }
Source:
public void testCloseNoInterrupt() throws Exception { byte[] cf1 = Bytes.toBytes("CF1"); byte[][] families = { cf1 }; Configuration conf = HBaseConfiguration.create(); conf.setBoolean(HRegion.CLOSE_WAIT_ABORT, false); region = initHRegion(tableName, method, conf, families); final CountDownLatch latch = new CountDownLatch(1); final AtomicBoolean holderInterrupted = new AtomicBoolean(); Thread holder = new Thread(new Runnable() { @Override public void run() { try { LOG.info("Starting region operation holder"); region.startRegionOperation(Operation.SCAN); latch.countDown(); try { Thread.sleep(10*1000); } catch (InterruptedException e) { LOG.info("Interrupted"); holderInterrupted.set(true); } } catch (Exception e) { throw new RuntimeException(e); } finally { try { region.closeRegionOperation(); } catch (IOException e) { } LOG.info("Stopped region operation holder"); } } }); holder.start(); latch.await(); region.close(); region = null; assertFalse("Region lock holder should not have been interrupted", holderInterrupted.get()); }

Target:
public void testCloseNoInterrupt() throws Exception { byte[] cf1 = Bytes.toBytes("CF1"); byte[][] families = { cf1 }; final int SLEEP_TIME = 10 * 1000; Configuration conf = new Configuration(CONF); conf.setBoolean(HRegion.CLOSE_WAIT_ABORT, false); conf.setInt(HRegion.CLOSE_WAIT_INTERVAL, 1000); region = initHRegion(tableName, method, conf, families); final CountDownLatch latch = new CountDownLatch(1); final AtomicBoolean holderInterrupted = new AtomicBoolean(); Thread holder = new Thread(new Runnable() { @Override public void run() { try { LOG.info("Starting region operation holder"); region.startRegionOperation(Operation.SCAN); latch.countDown(); try { Thread.sleep(SLEEP_TIME); } catch (InterruptedException e) { LOG.info("Interrupted"); holderInterrupted.set(true); } } catch (Exception e) { throw new RuntimeException(e); } finally { try { region.closeRegionOperation(); } catch (IOException e) { } LOG.info("Stopped region operation holder"); } } }); holder.start(); latch.await(); region.close(); region = null; holder.join(); assertFalse("Region lock holder should not have been interrupted", holderInterrupted.get()); }
Source:
public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()) .setCancelable(false) .setTitle(getString(R.string.storage_permission_required)); if (getArguments().getBoolean("shouldShowRationale")) { builder.setIcon(R.mipmap.ic_launcher) .setMessage(getString(R.string.permission_must_be_granted)) .setNeutralButton(getString(R.string.ok), null); } else { builder.setIcon(R.drawable.ic_error_outline_24dp) .setMessage(getString(R.string.approve_permission)) .setNegativeButton(getString(R.string.no), null) .setPositiveButton(getString(R.string.yes), (dialogInterface, i) -> { final Intent intent = new Intent(); intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.setData(Uri.parse("package:" + getContext().getPackageName())); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); getContext().startActivity(intent); }); } return builder.create(); }

Target:
public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()) .setCancelable(false) .setTitle(getString(R.string.storage_permission_required)); if (getArguments().getBoolean("shouldShowRationale")) { builder.setIcon(R.mipmap.ic_launcher) .setMessage(getString(R.string.permission_must_be_granted)) .setPositiveButton(getString(R.string.ok), null); } else { builder.setIcon(R.drawable.ic_error_outline_24dp) .setMessage(getString(R.string.approve_permission)) .setNegativeButton(getString(R.string.no), null) .setPositiveButton(getString(R.string.yes), (dialogInterface, i) -> { final Intent intent = new Intent(); intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.setData(Uri.parse("package:" + getContext().getPackageName())); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); getContext().startActivity(intent); }); } return builder.create(); }
Source:
public Optional<ByteSource> streamTaskReports(final String taskId) { final ZkWorker zkWorker = findWorkerRunningTask(taskId); if (zkWorker == null) { return Optional.absent(); } else { Worker worker = runningTasks.get(taskId).getWorker(); TaskLocation taskLocation = runningTasks.get(taskId).getLocation(); final URL url = TaskRunnerUtils.makeTaskLocationURL( taskLocation, "/druid/worker/v1/chat/%s/liveReports", taskId ); return Optional.of( new ByteSource() { @Override public InputStream openStream() throws IOException { try { return httpClient.go( new Request(HttpMethod.GET, url), new InputStreamResponseHandler() ).get(); } catch (InterruptedException e) { throw new RuntimeException(e); } catch (ExecutionException e) { Throwables.propagateIfPossible(e.getCause(), IOException.class); throw new RuntimeException(e); } } } ); } }

Target:
public Optional<ByteSource> streamTaskReports(final String taskId) { final ZkWorker zkWorker = findWorkerRunningTask(taskId); if (zkWorker == null) { return Optional.absent(); } else { TaskLocation taskLocation = runningTasks.get(taskId).getLocation(); final URL url = TaskRunnerUtils.makeTaskLocationURL( taskLocation, "/druid/worker/v1/chat/%s/liveReports", taskId ); return Optional.of( new ByteSource() { @Override public InputStream openStream() throws IOException { try { return httpClient.go( new Request(HttpMethod.GET, url), new InputStreamResponseHandler() ).get(); } catch (InterruptedException e) { throw new RuntimeException(e); } catch (ExecutionException e) { Throwables.propagateIfPossible(e.getCause(), IOException.class); throw new RuntimeException(e); } } } ); } }
Source:
public void run() { List<ReplicationMetric> metrics = collector.getMetrics(); Retry<Void> retriable = new Retry<Void>(Exception.class) { @Override public Void execute() throws Exception { ReplicationMetricList metricList = new ReplicationMetricList(); List<ReplicationMetrics> replicationMetricsList = new ArrayList<>(); for (ReplicationMetric metric : metrics) { ReplicationMetrics persistentMetric = new ReplicationMetrics(); persistentMetric.setDumpExecutionId(metric.getDumpExecutionId()); persistentMetric.setScheduledExecutionId(metric.getScheduledExecutionId()); persistentMetric.setPolicy(metric.getPolicy()); ObjectMapper mapper = new ObjectMapper(); persistentMetric.setProgress(mapper.writeValueAsString(metric.getProgress())); persistentMetric.setMetadata(mapper.writeValueAsString(metric.getMetadata())); replicationMetricsList.add(persistentMetric); } metricList.setReplicationMetricList(replicationMetricsList); Hive.get(conf).getMSC().addReplicationMetrics(metricList); return null; } }; try { retriable.run(); } catch (Exception e) { throw new RuntimeException("Metrics are not getting persisted"); } }

Target:
public void run() { ReplicationMetricList metricList = new ReplicationMetricList(); try { LinkedList<ReplicationMetric> metrics = collector.getMetrics(); if (metrics.size() > 0) { int totalMetricsSize = metrics.size(); List<ReplicationMetrics> replicationMetricsList = new ArrayList<>(totalMetricsSize); for (int index = 0; index < totalMetricsSize; index++) { ReplicationMetric metric = metrics.removeFirst(); ReplicationMetrics persistentMetric = new ReplicationMetrics(); persistentMetric.setDumpExecutionId(metric.getDumpExecutionId()); persistentMetric.setScheduledExecutionId(metric.getScheduledExecutionId()); persistentMetric.setPolicy(metric.getPolicy()); ObjectMapper mapper = new ObjectMapper(); persistentMetric.setProgress(mapper.writeValueAsString(metric.getProgress())); persistentMetric.setMetadata(mapper.writeValueAsString(metric.getMetadata())); replicationMetricsList.add(persistentMetric); } metricList.setReplicationMetricList(replicationMetricsList); } } catch (Exception e) { throw new RuntimeException("Metrics are not getting persisted", e); } Retry<Void> retriable = new Retry<Void>(Exception.class) { @Override public Void execute() throws Exception { if (metricList.getReplicationMetricListSize() > 0) { Hive.get(conf).getMSC().addReplicationMetrics(metricList); } return null; } }; try { retriable.run(); } catch (Exception e) { throw new RuntimeException("Metrics are not getting persisted to HMS", e); } }
Source:
public Object getEditHelperContext() { Object result; IClientContext context = getClientContext(); Element excludee = getElementToExclude(); if (context == null) { result = excludee; } else { Element owner = (excludee == null) ? null : excludee; result = new EditHelperContext(owner, context); } return result; }

Target:
public Object getEditHelperContext() { Object result; IClientContext context = getClientContext(); Element owner = requireNonNull(getElementToExclude().getOwner(), "element.owner"); if (context == null) { result = owner; } else { result = new EditHelperContext(owner, context); } return result; }
Source:
RequestContext( HttpServletRequest req ) { this.outputRequireJs = this.getBooleanValue( req.getParameter( "requirejs" ), true ); this.referer = req.getHeader( "referer" ); this.serverAddress = ( 80 == req.getServerPort() || 443 == req.getServerPort() ) ? req.getScheme() + "://" + req.getServerName() : req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort(); this.useFullyQualifiedUrl = this.getBooleanValue( req.getParameter( "useFullyQualifiedUrl" ), referer != null && !referer.startsWith( this.serverAddress ) ); }

Target:
RequestContext( HttpServletRequest req ) { this.outputRequireJs = this.getBooleanValue( req.getParameter( "requirejs" ), true ); this.referer = req.getHeader( "referer" ); this.serverAddress = ( HTTP_DEFAULT_PORT == req.getServerPort() || HTTPS_DEFAULT_PORT == req.getServerPort() ) ? req.getScheme() + "://" + req.getServerName() : req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort(); this.useFullyQualifiedUrl = this.getBooleanValue( req.getParameter( "useFullyQualifiedUrl" ), referer != null && !referer.startsWith( this.serverAddress ) ); }
Source:
private void parsePdxDiskStore(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { ParsingUtils.setPropertyValue(element, builder, "pdx-disk-store", "pdxDiskStoreName"); final String pdxDiskStoreName = element.getAttribute("pdx-disk-store"); if (!StringUtils.isEmpty(pdxDiskStoreName)) { final BeanDefinitionRegistry registry = parserContext.getRegistry(); if (registry instanceof ConfigurableApplicationContext) { ((ConfigurableApplicationContext) registry).addBeanFactoryPostProcessor( new PdxDiskStoreAwareBeanFactoryPostProcessor(pdxDiskStoreName)); } } }

Target:
private void parsePdxDiskStore(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { ParsingUtils.setPropertyValue(element, builder, "pdx-disk-store", "pdxDiskStoreName"); final String pdxDiskStoreName = element.getAttribute("pdx-disk-store"); if (!StringUtils.isEmpty(pdxDiskStoreName)) { registerPdxDiskStoreAwareBeanFactoryPostProcessor(parserContext, pdxDiskStoreName); } }
Source:
public void execute(final String coords, final String goal, final Properties config) throws ValidationException { final Plugin plugin = new Plugin(); final String[] sectors = StringUtils.split(coords, ':'); plugin.setGroupId(sectors[0]); plugin.setArtifactId(sectors[1]); plugin.setVersion(sectors[2]); final MojoDescriptor descriptor = this.descriptor(plugin, goal); try { this.helper.setupPluginRealm( descriptor.getPluginDescriptor(), this.session, Thread.currentThread().getContextClassLoader(), new java.util.ArrayList<String>(), new java.util.ArrayList<String>() ); } catch (org.apache.maven.plugin.PluginResolutionException ex) { throw new IllegalStateException("Plugin resolution problem", ex); } catch (org.apache.maven.plugin.PluginContainerException ex) { throw new IllegalStateException("Can't setup realm", ex); } final Xpp3Dom xpp = Xpp3Dom.mergeXpp3Dom( this.toXppDom(config, "configuration"), this.toXppDom(descriptor.getMojoConfiguration()) ); final MojoExecution execution = new MojoExecution(descriptor, xpp); final Mojo mojo = this.mojo(execution); Logger.info(this, "Calling %s:%s...", coords, goal); try { mojo.execute(); } catch (org.apache.maven.plugin.MojoExecutionException ex) { throw new IllegalArgumentException(ex); } catch (org.apache.maven.plugin.MojoFailureException ex) { throw new ValidationException(ex); } this.manager.releaseMojo(mojo, execution); }

Target:
public void execute(final String coords, final String goal, final Properties config) throws ValidationException { final Plugin plugin = new Plugin(); final String[] sectors = StringUtils.split(coords, ':'); plugin.setGroupId(sectors[0]); plugin.setArtifactId(sectors[1]); plugin.setVersion(sectors[2]); final MojoDescriptor descriptor = this.descriptor(plugin, goal); try { this.helper.setupPluginRealm( descriptor.getPluginDescriptor(), this.session, Thread.currentThread().getContextClassLoader(), new LinkedList<String>(), new LinkedList<String>() ); } catch (org.apache.maven.plugin.PluginResolutionException ex) { throw new IllegalStateException("Plugin resolution problem", ex); } catch (org.apache.maven.plugin.PluginContainerException ex) { throw new IllegalStateException("Can't setup realm", ex); } final Xpp3Dom xpp = Xpp3Dom.mergeXpp3Dom( this.toXppDom(config, "configuration"), this.toXppDom(descriptor.getMojoConfiguration()) ); final MojoExecution execution = new MojoExecution(descriptor, xpp); final Mojo mojo = this.mojo(execution); Logger.info(this, "Calling %s:%s...", coords, goal); try { mojo.execute(); } catch (org.apache.maven.plugin.MojoExecutionException ex) { throw new IllegalArgumentException(ex); } catch (org.apache.maven.plugin.MojoFailureException ex) { throw new ValidationException(ex); } this.manager.releaseMojo(mojo, execution); }
Source:
public void deleteUnauthorized() throws Exception { context.turnOffAuthorisationSystem(); MetadataField metadataField = MetadataFieldBuilder.createMetadataField(context, ELEMENT, QUALIFIER, SCOPE_NOTE) .build(); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); getClient() .perform(delete("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isUnauthorized()); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); }

Target:
public void deleteUnauthorized() throws Exception { context.turnOffAuthorisationSystem(); MetadataField metadataField = MetadataFieldBuilder.createMetadataField(context, ELEMENT, QUALIFIER, SCOPE_NOTE) .build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); getClient() .perform(delete("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isUnauthorized()); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); }
Source:
public MessagePacker packString(String s) throws IOException { if(s.length() > 0) { CharBuffer in = CharBuffer.wrap(s); prepareEncoder(); ByteBuffer preservedEncodeBuffer = encodeBuffer; encodeBuffer.clear(); encoder.reset(); try { while(in.hasRemaining()) { try { CoderResult cr = encoder.encode(in, encodeBuffer, true); if(cr.isUnderflow()) { cr = encoder.flush(encodeBuffer); } if(cr.isOverflow()) { int estimatedRemainingSize = Math.max(1, (int) (in.remaining() * encoder.averageBytesPerChar())); encodeBuffer.flip(); ByteBuffer newBuffer = ByteBuffer.allocate(encodeBuffer.remaining() + estimatedRemainingSize); newBuffer.put(encodeBuffer); encodeBuffer = newBuffer; continue; } if(cr.isError()) { if(cr.isMalformed() && config.getActionOnMalFormedInput() == CodingErrorAction.REPORT) { cr.throwException(); } else if(cr.isUnderflow() && config.getActionOnUnmappableCharacter() == CodingErrorAction.REPORT) { cr.throwException(); } } } catch(CharacterCodingException e) { throw new MessageStringCodingException(e); } } encodeBuffer.flip(); packRawStringHeader(encodeBuffer.remaining()); writePayload(encodeBuffer); } finally { encodeBuffer = preservedEncodeBuffer; } } else { packRawStringHeader(0); } return this; }

Target:
public MessagePacker packString(String s) throws IOException { if(s.length() > 0) { CharBuffer in = CharBuffer.wrap(s); prepareEncoder(); ByteBuffer preservedEncodeBuffer = encodeBuffer; encodeBuffer.clear(); encoder.reset(); try { while(in.hasRemaining()) { try { CoderResult cr = encoder.encode(in, encodeBuffer, true); if(cr.isUnderflow()) { cr = encoder.flush(encodeBuffer); } if(cr.isOverflow()) { int estimatedRemainingSize = Math.max(1, (int) (in.remaining() * encoder.averageBytesPerChar())); encodeBuffer.flip(); ByteBuffer newBuffer = ByteBuffer.allocate(Math.max((int) (encodeBuffer.capacity() * 1.5), encodeBuffer.remaining() + estimatedRemainingSize)); newBuffer.put(encodeBuffer); encodeBuffer = newBuffer; encoder.reset(); continue; } if(cr.isError()) { if((cr.isMalformed() && config.getActionOnMalFormedInput() == CodingErrorAction.REPORT) || (cr.isUnmappable() && config.getActionOnUnmappableCharacter() == CodingErrorAction.REPORT)) { cr.throwException(); } } } catch(CharacterCodingException e) { throw new MessageStringCodingException(e); } } encodeBuffer.flip(); packRawStringHeader(encodeBuffer.remaining()); writePayload(encodeBuffer); } finally { encodeBuffer = preservedEncodeBuffer; } } else { packRawStringHeader(0); } return this; }
Source:
private AbstractEndpoint createEndpoint(MessageHandler handler, Method method, List<Annotation> annotations) { String inputChannelName = null; String[] names = AnnotationUtils.getAnnotation(method, Bean.class).name(); if (!ObjectUtils.isEmpty(names)) { inputChannelName = names[0]; } if (!StringUtils.hasText(inputChannelName)) { inputChannelName = method.getName(); } MessageChannel inputChannel = this.beanFactory.getBean(inputChannelName, MessageChannel.class); if (inputChannel instanceof PollableChannel) { PollingConsumer pollingConsumer = new PollingConsumer((PollableChannel) inputChannel, handler); configurePollingEndpoint(pollingConsumer, annotations); return pollingConsumer; } else { Poller[] pollers = MessagingAnnotationUtils.resolveAttribute(annotations, "poller", Poller[].class); Assert.state(ObjectUtils.isEmpty(pollers), "A '@Poller' should not be specified for Annotation-based " + "endpoint, since '" + inputChannel + "' is a SubscribableChannel (not pollable)."); return new EventDrivenConsumer((SubscribableChannel) inputChannel, handler); } }

Target:
protected AbstractEndpoint createEndpoint(MessageHandler handler, Method method, List<Annotation> annotations) { String inputChannelName = null; String[] names = AnnotationUtils.getAnnotation(method, Bean.class).name(); if (!ObjectUtils.isEmpty(names)) { inputChannelName = names[0]; } if (!StringUtils.hasText(inputChannelName)) { inputChannelName = method.getName(); } MessageChannel inputChannel = this.beanFactory.getBean(inputChannelName, MessageChannel.class); return doCreateEndpoint(handler, inputChannel, annotations); }
Source:
public void checkRead(String file) { if (file != null) { this.nGrinderHomeReadAllowed(file); } }

Target:
public void checkRead(String file) { if (file != null && file.contains("database.conf")) { throw new SecurityException("File Read access on database.conf is not allowed."); } }
Source:
public void remove() { if (lastLen == 0) { throw new IllegalStateException(); } System.arraycopy( baf.getBuffer(), nextOff, baf.getBuffer(), nextOff - lastLen, remainingLen); baf.setLength(remainingLen - lastLen); lastLen = 0; }

Target:
public void remove() { if (lastLen == 0) { throw new IllegalStateException(); } System.arraycopy( baf.getBuffer(), nextOff, baf.getBuffer(), nextOff - lastLen, remainingLen); nextOff -= lastLen; baf.setLength(baf.getLength() - lastLen); lastLen = 0; }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); previouslyStarted = prefs.getBoolean(getString(R.string.pref_previously_started), false); ImageButton new_user = (ImageButton) findViewById(R.id.newUserButtonFirstPage); new_user.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent myIntent = new Intent(StartActivity.this, AvatarRoomActivity.class); startActivityForResult(myIntent, 0); } }); ImageButton start = (ImageButton) findViewById(R.id.startButtonMain); start.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!previouslyStarted) { startActivity(new Intent(StartActivity.this, AvatarRoomActivity.class)); } else { startActivity(new Intent(StartActivity.this, MapActivity.class)); } } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); preferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); haspreviouslyStarted = preferences.getBoolean(getString(R.string.preferences_has_previously_started), false); ImageButton new_user = (ImageButton) findViewById(R.id.newUserButtonFirstPage); new_user.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent myIntent = new Intent(StartActivity.this, AvatarRoomActivity.class); startActivityForResult(myIntent, 0); } }); ImageButton start = (ImageButton) findViewById(R.id.startButtonMain); start.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (haspreviouslyStarted) { startActivity(new Intent(StartActivity.this, MapActivity.class)); } else { startActivity(new Intent(StartActivity.this, AvatarRoomActivity.class)); } } }); }
Source:
public Iterator<Chain> iterator() throws TimeoutException { Iterator<Chain> iterator = onStoreProxy(serverStoreProxy -> serverStoreProxy.iterator()); return new Iterator<Chain>() { @Override public boolean hasNext() { return iterator.hasNext(); } @Override public Chain next() { return iterator.next(); } }; }

Target:
public Iterator<Chain> iterator() throws TimeoutException { return onStoreProxy(LockingServerStoreProxy::iterator); }
Source:
public Object getValue() { Focus f = (Focus) super.getValue(); if (f == null) return null; Focus res = new Focus(); res.setStringValue(f.getStringValue()); return res; }

Target:
public Object getValue() { return ImOption.apply((Focus) super.getValue()).map(f -> f.copy()).getOrNull(); }
Source:
public PutResult performPut(@NonNull StorIOSQLite storIOSQLite, @NonNull Person person) { final PutResults<Object> putResults = storIOSQLite .put() .objects(asList(person, person.getCars())) .prepare() .executeAsBlocking(); final Set<String> affectedTables = new HashSet<String>(2); affectedTables.add(PersonsTable.TABLE); affectedTables.add(CarsTable.TABLE); return PutResult.newUpdateResult(putResults.numberOfUpdates(), affectedTables); }

Target:
public PutResult performPut(@NonNull StorIOSQLite storIOSQLite, @NonNull Person person) { storIOSQLite.internal().beginTransaction(); try { final ContentValues contentValues = new ContentValues(2); contentValues.put(PersonsTable.COLUMN_UUID, person.uuid()); contentValues.put(PersonsTable.COLUMN_NAME, person.name()); final Set<String> affectedTables = new HashSet<>(2); affectedTables.add(PersonsTable.TABLE_NAME); storIOSQLite .put() .object(person) .prepare() .executeAsBlocking(); List<Car> cars = person.cars(); int count = cars.size(); for (int i=0; i<count; i++) { storIOSQLite .put() .object(new Car.Builder(cars.get(i).model()).personUuid(person.uuid()).build()) .prepare() .executeAsBlocking(); } if (0<count) { affectedTables.add(CarsTable.TABLE_NAME); } storIOSQLite.internal().setTransactionSuccessful(); return person.id() != null ? PutResult.newUpdateResult(1, affectedTables) : PutResult.newInsertResult(personId, affectedTables); } finally { storIOSQLite.internal().endTransaction(); } }
Source:
public void testIncr_whenWrongType_shouldReturnError() { String key = "key"; String nonIntegerValue = "I am not a number! I am a free man!"; assertThat(jedis.set(key, nonIntegerValue)).isEqualTo("OK"); try { jedis.incr(key); } catch (JedisDataException e) { assertThat(e.getMessage()).contains("out of range"); } assertThat(jedis.get(key)).isEqualTo(nonIntegerValue); }

Target:
public void testIncr_whenWrongType_shouldReturnError() { String key = "key"; String nonIntegerValue = "I am not a number! I am a free man!"; assertThat(jedis.set(key, nonIntegerValue)).isEqualTo("OK"); assertThatThrownBy(() -> jedis.incr(key)).hasMessageContaining(ERROR_NOT_INTEGER); assertThat(jedis.get(key)).isEqualTo(nonIntegerValue); }
Source:
public TestElasticsearchIntegrationSmokeTest(EmbeddedElasticsearchNode embeddedElasticsearchNode) throws Exception { super(() -> createElasticsearchQueryRunner(embeddedElasticsearchNode, TpchTable.getTables())); this.embeddedElasticsearchNode = embeddedElasticsearchNode; }

Target:
public TestElasticsearchIntegrationSmokeTest(EmbeddedElasticsearchNode embeddedElasticsearchNode) { super(() -> createElasticsearchQueryRunner(embeddedElasticsearchNode, TpchTable.getTables())); this.embeddedElasticsearchNode = embeddedElasticsearchNode; }
Source:
public void onResume() { super.onResume(); if (pageViewCallback != null && pageViewCallback.multiLingualPageView != null) { pageViewCallback.multiLingualPageView.refresh(); } }

Target:
public void onResume() { super.onResume(); if (pageViewCallback != null && pageViewCallback.getOnboardingPageView() != null) { pageViewCallback.getOnboardingPageView().refresh(); } }
Source:
public Observable<Void> release(PooledConnection<I, O> connection) { if (null == connection) { return Observable.error(new IllegalArgumentException("Returned a null connection to the pool.")); } try { stateChangeListener.onReleaseAttempted(); if (isShutdown.get()) { discardConnection(connection); stateChangeListener.onReleaseSucceeded(); return Observable.empty(); } else if (connection.isUsable()) { idleConnections.add(connection); stateChangeListener.onReleaseSucceeded(); return Observable.empty(); } else { discardConnection(connection); stateChangeListener.onReleaseSucceeded(); return Observable.empty(); } } catch (Throwable throwable) { stateChangeListener.onReleaseFailed(); return Observable.error(throwable); } }

Target:
public Observable<Void> release(PooledConnection<I, O> connection) { if (null == connection) { return Observable.error(new IllegalArgumentException("Returned a null connection to the pool.")); } try { stateChangeObservable.onNext(PoolStateChangeEvent.onReleaseAttempted); if (isShutdown.get() || !connection.isUsable()) { discardConnection(connection); stateChangeObservable.onNext(PoolStateChangeEvent.onReleaseSucceeded); return Observable.empty(); } else { idleConnections.add(connection); stateChangeObservable.onNext(PoolStateChangeEvent.onReleaseSucceeded); return Observable.empty(); } } catch (Throwable throwable) { stateChangeObservable.onNext(PoolStateChangeEvent.onReleaseFailed); return Observable.error(throwable); } }