auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static AmazonS3 getAmazonS3Client(String accessKey, String secretKey, Map<String, String> options) { AmazonS3 client = s3Clients.get(key(accessKey, secretKey, options)); if (null == client) { Region region = null; URL endpoint = null; String signer = null; if (options != null) { if (options.get(OPTS.S3_ENDPOINT.name()) != null) { try { endpoint = new URL(options.get(OPTS.S3_ENDPOINT.name())); } catch (MalformedURLException e) { String err = "The provided S3 Endpoint URL is invalid: " + e.getMessage(); throw new StorageException(err, e); } if (options.get(OPTS.S3_SIGNER_TYPE.name()) != null) { signer = options.get(OPTS.S3_SIGNER_TYPE.name()); } } else if (options.get(OPTS.AWS_REGION.name()) != null) { region = com.amazonaws.services.s3.model.Region.fromValue( options.get(OPTS.AWS_REGION.name())).toAWSRegion(); } } client = newS3Client(accessKey, secretKey, region, endpoint, signer); s3Clients.put(key(accessKey, secretKey, options), client); } return client; }

Target:
public static AmazonS3 getAmazonS3Client(String accessKey, String secretKey, Map<String, String> options) { AmazonS3 client = s3Clients.get(key(accessKey, secretKey, options)); if (null == client) { Region region = null; URL endpoint = null; String signer = null; if (options != null) { if (options.get(OPTS.SWIFT_S3_ENDPOINT.name()) != null) { try { endpoint = new URL(options.get(OPTS.SWIFT_S3_ENDPOINT.name())); } catch (MalformedURLException e) { String err = "The provided Swift S3 Endpoint URL is invalid: " + e.getMessage(); throw new StorageException(err, e); } if (options.get(OPTS.SWIFT_S3_SIGNER_TYPE.name()) != null) { signer = options.get(OPTS.SWIFT_S3_SIGNER_TYPE.name()); } } else if (options.get(OPTS.AWS_REGION.name()) != null) { region = com.amazonaws.services.s3.model.Region.fromValue( options.get(OPTS.AWS_REGION.name())).toAWSRegion(); } } client = newS3Client(accessKey, secretKey, region, endpoint, signer); s3Clients.put(key(accessKey, secretKey, options), client); } return client; }
Source:
public Serializable getClassificationByMaxProb(AttributesMap attributes) { PredictionMap predictionMap = predict(attributes); double maxProb = 0; Serializable classification = null; for (Serializable prediction : predictionMap.keySet()) { double prob = predictionMap.get(prediction); if (prob > maxProb) { maxProb = prob; classification = prediction; } } assert (classification != null); return classification; }

Target:
public Serializable getClassificationByMaxProb(AttributesMap attributes) { PredictionMap predictionMap = predict(attributes); double maxProb = 0; Serializable classification = null; for (Serializable prediction : predictionMap.keySet()) { double prob = predictionMap.get(prediction); if (prob > maxProb) { maxProb = prob; classification = prediction; } } if (classification == null) throw new RuntimeException("unable to make a classification"); return classification; }
Source:
public void verifyNoDomainForMemoryWhenDomainIsNotActive() { for (StorageDomainStatus storageDomainStatus : StorageDomainStatus.values()) { if (storageDomainStatus != StorageDomainStatus.Active) { validStorageDomain.setStatus(storageDomainStatus); verifyNoDomainForMemory(Arrays.asList(validStorageDomain)); } } }

Target:
public void verifyNoDomainForMemoryWhenDomainIsNotActive() { for (StorageDomainStatus storageDomainStatus : StorageDomainStatus.values()) { if (storageDomainStatus != StorageDomainStatus.Active) { validStorageDomain.setStatus(storageDomainStatus); verifyNoDomainForMemory(Collections.singletonList(validStorageDomain)); } } }
Source:
public DataSource as(@NonNull String alias) { if(alias == null) { throw new IllegalArgumentException("alias is null"); } super.alias = alias; return this; }

Target:
public DataSource as(@NonNull String alias) { if (alias == null) { throw new IllegalArgumentException("alias is null."); } super.alias = alias; return this; }
Source:
public AbstractCookieConfig(ConfigReader configReader) { Assert.notNull(configReader); this.name = configReader.getString(configKeyFor(NAME)); Assert.hasText(this.name, NAME + " cannot be null or empty."); this.comment = configReader.getString(configKeyFor(COMMENT)); this.domain = configReader.getString(configKeyFor(DOMAIN)); this.path = configReader.getString(configKeyFor(PATH)); this.secure = configReader.getBoolean(configKeyFor(SECURE)); this.httpOnly = configReader.getBoolean(configKeyFor(HTTP_ONLY)); this.maxAge = 1; }

Target:
public AbstractCookieConfig(ConfigReader configReader) { Assert.notNull(configReader); this.name = configReader.getString(configKeyFor(NAME)); Assert.hasText(this.name, NAME + " cannot be null or empty."); this.comment = configReader.getString(configKeyFor(COMMENT)); this.domain = configReader.getString(configKeyFor(DOMAIN)); this.path = configReader.getString(configKeyFor(PATH)); this.secure = configReader.getBoolean(configKeyFor(SECURE)); this.httpOnly = configReader.getBoolean(configKeyFor(HTTP_ONLY)); }
Source:
protected String createBody() { StringBuilder sb = new StringBuilder("<?xml version=\"1.0\"?>\n"); sb.append("<orders xmlns=\"http:acme.com\">\n"); sb.append(" <order id=\"1\" xmlns=\"http:acme.com\">Camel in Action</order>\n"); sb.append(" <order id=\"2\">ActiveMQ in Action</order>\n"); sb.append(" <order id=\"3\">DSL in Action</order>\n"); sb.append("</orders>"); return sb.toString(); }

Target:
protected String createBody() { StringBuilder sb = new StringBuilder("<?xml version=\"1.0\"?>\n"); sb.append("<orders xmlns=\"http:acme.com\">\n"); sb.append(" <order id=\"1\">Camel in Action</order>\n"); sb.append(" <order id=\"2\">ActiveMQ in Action</order>\n"); sb.append(" <order id=\"3\">DSL in Action</order>\n"); sb.append("</orders>"); return sb.toString(); }
Source:
public void addListener(Object listener) { ListenerHolder listenerHolder = new ListenerHolder(listener, encoder, wrapper); Cache unwrapped = super.unwrapCache(this.cache); if(unwrapped instanceof CacheImpl) { ((CacheImpl)unwrapped).addListener(listenerHolder); } else { super.addListener(listener); } }

Target:
public void addListener(Object listener) { ListenerHolder listenerHolder = new ListenerHolder(listener, keyEncoderClass, valueEncoderClass, keyWrapperClass, valueWrapperClass); Cache unwrapped = super.unwrapCache(this.cache); if (unwrapped instanceof CacheImpl) { ((CacheImpl) unwrapped).addListener(listenerHolder); } else { super.addListener(listener); } }
Source:
public DockerOkHttpClientSupplier(SSLContextWithKeysSupplier sslContextWithKeysSupplier) { this.sslContextWithKeysSupplier = sslContextWithKeysSupplier; }

Target:
DockerOkHttpClientSupplier(SSLContextWithKeysSupplier sslContextWithKeysSupplier) { this.sslContextWithKeysSupplier = sslContextWithKeysSupplier; }
Source:
public void showInvalidURLSnackbar(String message) { String action = "EDIT"; final int length = Snackbar.LENGTH_LONG; View.OnClickListener clickEvent = view -> { mUrl.requestFocus(); mUrl.selectAll(); }; createSnackbar(message, action, length, clickEvent).show(); }

Target:
public void showInvalidURLSnackbar(String message) { createSnackbar(message) .setAction(getResources().getString(R.string.snackbar_edit), view -> { mUrl.requestFocus(); mUrl.selectAll(); }) .show(); }
Source:
public Notification createNotification(Intent inboundIntent) { final NotificationData data = readInboundIntent(inboundIntent); if (null == data) { return null; } MPLog.d(LOGTAG, "MP FCM notification received: " + data.message); final PendingIntent contentIntent = PendingIntent.getActivity( context, 0, data.intent, PendingIntent.FLAG_UPDATE_CURRENT ); builder. setDefaults(MPConfig.getInstance(context).getNotificationDefaults()). setWhen(now). setContentTitle(data.title). setContentText(data.message). setTicker(data.message). setContentIntent(contentIntent); maybeSetNotificationBarIcon(data); maybeSetLargeIcon(data); maybeSetExpandableNotification(data); maybeSetCustomIconColor(data); maybeSetChannel(); final Notification n = buildNotification(); n.flags |= Notification.FLAG_AUTO_CANCEL; return n; }

Target:
Notification createNotification(Intent inboundIntent) { parseIntent(inboundIntent); if (this.mData == null) { return null; } if (this.mData.isSilent()) { MPLog.d(LOGTAG, "Notification will not be shown because \'mp_silent = true\'"); return null; } if (this.mData.getMessage() == null) { MPLog.d(LOGTAG, "Notification will not be shown because 'mp_message' was null"); return null; } if (this.mData.getMessage().equals("")) { MPLog.d(LOGTAG, "Notification will not be shown because 'mp_message' was empty"); return null; } buildNotificationFromData(); Notification n; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { n = mBuilder.build(); } else { n = mBuilder.getNotification(); } if (!mData.isSticky()) { n.flags |= Notification.FLAG_AUTO_CANCEL; } return n; }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Attribute other = (Attribute) obj; if (key == null) { if (other.key != null) return false; } else if (!key.equals(other.key)) return false; if (state != other.state) return false; if (value == null) { if (other.value != null) return false; } else if (!value.equals(other.value)) return false; return true; }

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof Attribute)) return false; Attribute other = (Attribute) obj; if (!key.equals(other.key)) return false; if (state != other.state) return false; if (value == null) { if (other.value != null) return false; } else if (!value.equals(other.value)) return false; return true; }
Source:
public void testToString() { String expectedOutput = "/usr/bin/local:10:1: error: errMsg"; assertEquals(expectedOutput, this.violationMessage.toString()); ViolationMessage emptyViolationMessage = ViolationMessage.EMPTY; assertThat(emptyViolationMessage.toString(), IsEmptyString.isEmptyString()); }

Target:
public void testToString() { String expectedOutput = "/usr/bin/local:10:1: error: errMsg"; assertEquals(expectedOutput, this.violationMessage.toString()); }
Source:
public void start() throws IOException { if (pluginEndpoint != null) { pluginEndpoint.start(); } writeLock.lock(); try { scheduledLoggingExecutor.scheduleAtFixedRate(new Runnable() { @Override public void run() { readLock.lock(); try { if (dagRunning) { LOG.info("Stats for current dag: {}", dagStats); } } finally { readLock.unlock(); } } }, 0, 10000L, TimeUnit.MILLISECONDS); llapMetricsCollector.start(); nodeEnablerFuture = nodeEnabledExecutor.submit(nodeEnablerCallable); Futures.addCallback(nodeEnablerFuture, new LoggingFutureCallback("NodeEnablerThread", LOG)); delayedTaskSchedulerFuture = delayedTaskSchedulerExecutor.submit(delayedTaskSchedulerCallable); Futures.addCallback(delayedTaskSchedulerFuture, new LoggingFutureCallback("DelayedTaskSchedulerThread", LOG)); schedulerFuture = schedulerExecutor.submit(schedulerCallable); Futures.addCallback(schedulerFuture, new LoggingFutureCallback("SchedulerThread", LOG)); registry.start(); registry.registerStateChangeListener(new NodeStateChangeListener()); registry.registerStateChangeListener(llapMetricsCollector); activeInstances = registry.getInstances(); for (LlapServiceInstance inst : activeInstances.getAll()) { registerAndAddNode(new NodeInfo(inst, nodeBlacklistConf, clock, numSchedulableTasksPerNode, metrics), inst); } if (amRegistry != null) { amRegistry.start(); int pluginPort = pluginEndpoint != null ? pluginEndpoint.getActualPort() : -1; amRegistry.register(amPort, pluginPort, HiveConf.getVar(conf, ConfVars.HIVESESSIONID), serializedToken, jobIdForToken, 0); } } finally { writeLock.unlock(); } }

Target:
public void start() throws IOException { if (pluginEndpoint != null) { pluginEndpoint.start(); } writeLock.lock(); try { scheduledLoggingExecutor.scheduleAtFixedRate(new Runnable() { @Override public void run() { readLock.lock(); try { if (dagRunning) { LOG.info("Stats for current dag: {}", dagStats); } } finally { readLock.unlock(); } } }, 0, 10000L, TimeUnit.MILLISECONDS); nodeEnablerFuture = nodeEnabledExecutor.submit(nodeEnablerCallable); Futures.addCallback(nodeEnablerFuture, new LoggingFutureCallback("NodeEnablerThread", LOG)); delayedTaskSchedulerFuture = delayedTaskSchedulerExecutor.submit(delayedTaskSchedulerCallable); Futures.addCallback(delayedTaskSchedulerFuture, new LoggingFutureCallback("DelayedTaskSchedulerThread", LOG)); schedulerFuture = schedulerExecutor.submit(schedulerCallable); Futures.addCallback(schedulerFuture, new LoggingFutureCallback("SchedulerThread", LOG)); registry.start(); registry.registerStateChangeListener(new NodeStateChangeListener()); activeInstances = registry.getInstances(); for (LlapServiceInstance inst : activeInstances.getAll()) { registerAndAddNode(new NodeInfo(inst, nodeBlacklistConf, clock, numSchedulableTasksPerNode, metrics), inst); } if (amRegistry != null) { amRegistry.start(); int pluginPort = pluginEndpoint != null ? pluginEndpoint.getActualPort() : -1; amRegistry.register(amPort, pluginPort, HiveConf.getVar(conf, ConfVars.HIVESESSIONID), serializedToken, jobIdForToken, 0); } } finally { writeLock.unlock(); } }
Source:
public final void onMessage(final ByteBuffer buffer) { final Request req = AbstractServerWebSocketHandler.Decoder.parseRequest(buffer); LOG.info("Got a response from the submission server!"); LOG.info(req.getSessionInfo()); final String[] sessionInfo = req.getSessionInfo().split("\\+"); LOG.info(sessionInfo[1]); final MultiConnectionState state = getStateFromId(sessionInfo[1]); LOG.info("State {}", state); if (req.getRequestType() == MessageType.DATA_REQUEST) { final DataResult.Builder result2 = DataResult.newBuilder(); try { final DataResult result = DataResult.parseFrom(req.getOtherData()); result2.clearResults(); for (ItemResult item : result.getResultsList()) { if (item.hasAdvanceQuery() && item.getQuery() == ItemQuery.EXPERIMENT) { final ExperimentReview rev = ExperimentReview.parseFrom(item.getAdvanceQuery()); if (rev.getShowUserNames()) { LOG.error("Attempting to change out usernames!"); result2.addResults(item); } else { result2.addResults(item); } } else { result2.addResults(item); } } } catch (InvalidProtocolBufferException e) { LOG.info("Exception {}", e); } final Request.Builder builder = Request.newBuilder(req); builder.setSessionInfo(sessionInfo[0]); final SocketSession connection = getConnectionFromState(state); builder.setOtherData(result2.build().toByteString()); if (connection == null) { LOG.error("SOCKET IS NULL"); } this.getParentServer().send(getConnectionFromState(state), builder.build()); } }

Target:
public final void onMessage(final ByteBuffer buffer) { final Request req = AbstractServerWebSocketHandler.Decoder.parseRequest(buffer); LOG.info("Got a response from the submission server!"); LOG.info(req.getSessionInfo()); final String[] sessionInfo = req.getSessionInfo().split("\\+"); LOG.info(sessionInfo[1]); final MultiConnectionState state = getStateFromId(sessionInfo[1]); LOG.info("State {}", state); if (req.getRequestType() == MessageType.DATA_REQUEST) { final DataResult.Builder result2 = DataResult.newBuilder(); try { final DataResult result = DataResult.parseFrom(req.getOtherData()); result2.clearResults(); for (ItemResult item : result.getResultsList()) { if (item.hasAdvanceQuery() && item.getQuery() == ItemQuery.EXPERIMENT) { final ExperimentReview rev = ExperimentReview.parseFrom(item.getAdvanceQuery()); if (rev.getShowUserNames()) { LOG.info("Attempting to change out usernames!"); result2.addResults(item); } else { result2.addResults(item); } } else { result2.addResults(item); } } } catch (InvalidProtocolBufferException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } final Request.Builder builder = Request.newBuilder(req); builder.setSessionInfo(sessionInfo[0]); final SocketSession connection = getConnectionFromState(state); builder.setOtherData(result2.build().toByteString()); if (connection == null) { LOG.error("SOCKET IS NULL"); } this.getParentServer().send(getConnectionFromState(state), builder.build()); } }
Source:
public Result doWork() { final boolean[] result = new boolean[1]; String patientIdTobeUpdated = getInputData().getString(PatientTable.Column.ID); PatientDAO patientDAO = new PatientDAO(); Patient patientTobeUpdated = patientDAO.findPatientByID(patientIdTobeUpdated); updatePatient(patientTobeUpdated, new DefaultResponseCallbackListener() { @Override public void onResponse() { result[0] = true; handler.post(new Runnable() { @Override public void run() { ToastUtil.success("Patient " + patientTobeUpdated.getPerson().getName().getNameString() + " updated"); } }); } @Override public void onErrorResponse(String errorMessage) { result[0] = false; handler.post(new Runnable() { @Override public void run() { ToastUtil.error("Patient " + patientTobeUpdated.getPerson().getName().getNameString() + " cannot be updated due to server error will retry sync "); } }); } }); return result[0] == true ? Result.success() : Result.retry(); }

Target:
public Result doWork() { final boolean[] result = new boolean[1]; String patientIdTobeUpdated = getInputData().getString(PatientTable.Column.ID); PatientDAO patientDAO = new PatientDAO(); Patient patientTobeUpdated = patientDAO.findPatientByID(patientIdTobeUpdated); updatePatient(patientTobeUpdated, new DefaultResponseCallbackListener() { @Override public void onResponse() { result[0] = true; Message msg = new Message(); msg.obj = patientTobeUpdated.getPerson().getName().getNameString(); msg.what = ON_SUCCESS; mHandler.sendMessage(msg); } @Override public void onErrorResponse(String errorMessage) { result[0] = false; Message msg = new Message(); msg.obj = patientTobeUpdated.getPerson().getName().getNameString(); msg.what = ON_FAILURE; mHandler.sendMessage(msg); } }); return result[0] ? Result.success() : Result.retry(); }
Source:
public Optional<Argument> find(String name) { if (name.startsWith(prefix)) { String propertyName = name.substring(prefix.length()); for (PropertyDescriptor descriptor : info.getPropertyDescriptors()) { if (propertyName.equals(descriptor.getName())) { try { return ctx.findArgumentFor( descriptor.getReadMethod().getGenericReturnType(), descriptor.getReadMethod().invoke(bean)); } catch (IllegalAccessException e) { throw new UnableToCreateStatementException(String.format("Access exception invoking getter for " + "bean property [%s] on [%s]", propertyName, bean), e, ctx); } catch (InvocationTargetException e) { throw new UnableToCreateStatementException(String.format("Invocation target exception invoking " + "getter for bean property [%s] on [%s]", propertyName, bean), e, ctx); } } } } return Optional.empty(); }

Target:
public Optional<Argument> find(String name) { if (name.startsWith(prefix)) { String propertyName = name.substring(prefix.length()); for (PropertyDescriptor descriptor : info.getPropertyDescriptors()) { if (propertyName.equals(descriptor.getName())) { Method getter = descriptor.getReadMethod(); if (getter == null) { throw new UnableToCreateStatementException(String.format("No getter method found for " + "bean property [%s] on [%s]", propertyName, bean), ctx); } try { return ctx.findArgumentFor(getter.getGenericReturnType(), getter.invoke(bean)); } catch (IllegalAccessException e) { throw new UnableToCreateStatementException(String.format("Access exception invoking getter for " + "bean property [%s] on [%s]", propertyName, bean), e, ctx); } catch (InvocationTargetException e) { throw new UnableToCreateStatementException(String.format("Invocation target exception invoking " + "getter for bean property [%s] on [%s]", propertyName, bean), e, ctx); } } } } return Optional.empty(); }
Source:
private ConnectorTableMetadata getTableMetadata(KuduTableHandle tableHandle) { KuduTable table = tableHandle.getTable(clientSession); Schema schema = table.getSchema(); List<ColumnMetadata> columnsMetaList = schema.getColumns().stream() .filter(col -> !col.isKey() || !col.getName().equals(KuduColumnHandle.ROW_ID)) .map(col -> { StringBuilder extra = new StringBuilder(); if (col.isKey()) { extra.append("key, "); } else if (col.isNullable()) { extra.append("nullable, "); } if (col.getEncoding() != null) { extra.append("encoding=").append(col.getEncoding().name()).append(", "); } if (col.getCompressionAlgorithm() != null) { extra.append("compression=").append(col.getCompressionAlgorithm().name()).append(", "); } if (extra.length() > 2) { extra.setLength(extra.length() - 2); } Type prestoType = TypeHelper.fromKuduColumn(col); return new ColumnMetadata(col.getName(), prestoType, null, extra.toString(), false); }).collect(toImmutableList()); Map<String, Object> properties = clientSession.getTableProperties(tableHandle); return new ConnectorTableMetadata(tableHandle.getSchemaTableName(), columnsMetaList, properties); }

Target:
private ConnectorTableMetadata getTableMetadata(KuduTableHandle tableHandle) { KuduTable table = tableHandle.getTable(clientSession); Schema schema = table.getSchema(); List<ColumnMetadata> columnsMetaList = schema.getColumns().stream() .filter(column -> !column.isKey() || !column.getName().equals(KuduColumnHandle.ROW_ID)) .map(this::getColumnMetadata) .collect(toImmutableList()); Map<String, Object> properties = clientSession.getTableProperties(tableHandle); return new ConnectorTableMetadata(tableHandle.getSchemaTableName(), columnsMetaList, properties); }
Source:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if (bindingConfig == null) { logger.debug("binding-configuration is currently not set for item: " + item.getName()); } String itemName = null; Matcher mItemName = Pattern.compile(REGEX_ITEM_NAME).matcher(bindingConfig); if (mItemName.find()) { itemName = mItemName.group(1); } String typeString = null; Matcher mType = Pattern.compile(REGEX_TYPE).matcher(bindingConfig); if (mType.find()) { typeString = mType.group(1); } CalDavType type = null; try { type = CalDavType.valueOf(typeString); } catch (IllegalArgumentException e) { throw new BindingConfigParseException("cannot read required parameter 'type'"); } logger.debug("adding item: {}", item.getName()); this.bindingConfigs.put(item.getName(), new CalDavNextEventConfig(item.getName(), itemName, type)); }

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if (bindingConfig == null) { logger.debug("binding-configuration is currently not set for item: " + item.getName()); } String itemName = null; Matcher mItemName = Pattern.compile(REGEX_ITEM_NAME).matcher(bindingConfig); if (mItemName.find()) { itemName = mItemName.group(1); } String typeString = null; Matcher mType = Pattern.compile(REGEX_TYPE).matcher(bindingConfig); if (mType.find()) { typeString = mType.group(1); } CalDavType type = null; try { type = CalDavType.valueOf(typeString); } catch (IllegalArgumentException e) { throw new BindingConfigParseException("cannot read required parameter 'type' for item: " + item.getName()); } logger.debug("adding item: {}", item.getName()); this.addBindingConfig(item, new CalDavNextEventConfig(item.getName(), itemName, type)); }
Source:
protected Iterable<KeyPair> getDefaultKeys(@NonNull File sshDir) { if(keyPair == null) { List<Path> defaultIdentities = this.getDefaultIdentities(sshDir); return (Iterable) this.defaultKeys.computeIfAbsent(new Tuple(defaultIdentities.toArray(new Path[0])), (t) -> { return new CachingKeyPairProvider(defaultIdentities, this.getKeyCache()); }); } else { return (Iterable) Arrays.asList(keyPair); } }

Target:
protected Iterable<KeyPair> getDefaultKeys(@NonNull File sshDir) { if(keyPair == null) { List<Path> defaultIdentities = this.getDefaultIdentities(sshDir); return this.defaultKeys.computeIfAbsent(new Tuple(defaultIdentities.toArray(new Path[0])), (t) -> new CachingKeyPairProvider(defaultIdentities, this.getKeyCache())); } else { return Collections.singletonList(keyPair); } }
Source:
private void signalIfFinished() { if (mBackupStatus.isFinished()) { mFinishedBackups.put(mBackupStatus.getBackupId(), mBackupStatus.setEntryCount(mEntryCounter.get())); } if (mBackupStatus.isCompleted()) { mCompletion.set(null); AlluxioEvent.BackupFinished.fire(mBackupStatus.getBackupId()); } else if (mBackupStatus.isFailed()) { mCompletion.setException(mBackupStatus.getError()); AlluxioEvent.BackupFailed.fire(mBackupStatus.getBackupId()); } }

Target:
private void signalIfFinished() { if (mBackupStatus.isFinished()) { mFinishedBackups.put(mBackupStatus.getBackupId(), mBackupStatus.setEntryCount(mEntryCounter.get())); } if (mBackupStatus.isCompleted()) { mCompletion.set(null); AlluxioEvent.BackupFinished.fire(new Pair<>("BackupId", mBackupStatus.getBackupId())); } else if (mBackupStatus.isFailed()) { mCompletion.setException(mBackupStatus.getError()); AlluxioEvent.BackupFailed.fire(new Pair<>("BackupId", mBackupStatus.getBackupId())); } }
Source:
protected String getRequestTokenParams(final Request request, final Configuration c) { return Constants.CONSUMER_KEY + "=" + c.getString(SettingKeys.CONSUMER_KEY) + "&" + getRedirectUriKey() + "=" + getRedirectUrl(request); }

Target:
protected List<NameValuePair> getRequestTokenParams(final Request request, final Configuration c) { final List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair(PocketConstants.CONSUMER_KEY, c.getString(SettingKeys.CONSUMER_KEY))); params.add(new BasicNameValuePair(getRedirectUriKey(), getRedirectUrl(request))); return params; }
Source:
private synchronized void shrinkWriteOperationQueue() throws IOException { outputStreamStatistics.queueShrinked(); try { while (writeOperations.peek() != null && writeOperations.peek().task.isDone()) { writeOperations.peek().task.get(); lastTotalAppendOffset += writeOperations.peek().length; writeOperations.remove(); } } catch (Exception e) { if (e.getCause() instanceof AzureBlobFileSystemException) { lastError = (AzureBlobFileSystemException) e.getCause(); } else { lastError = new IOException(e); } throw lastError; } }

Target:
private synchronized void shrinkWriteOperationQueue() throws IOException { try { while (writeOperations.peek() != null && writeOperations.peek().task.isDone()) { writeOperations.peek().task.get(); lastTotalAppendOffset += writeOperations.peek().length; writeOperations.remove(); outputStreamStatistics.queueShrunk(); } } catch (Exception e) { if (e.getCause() instanceof AzureBlobFileSystemException) { lastError = (AzureBlobFileSystemException) e.getCause(); } else { lastError = new IOException(e); } throw lastError; } }
Source:
getIndex(String indexName, FieldDescriptor fieldDescriptor) { return new Index<>( () -> indexName, (CorfuTable.IndexFunction<Message, CorfuRecord<Message, Message>, T>) (key, val) -> (T) val.getPayload().getField(fieldDescriptor)); }

Target:
getIndex(String indexName, FieldDescriptor fieldDescriptor) { return new Index<>( () -> indexName, (CorfuTable.IndexFunction<Message, CorfuRecord<Message, Message>, T>) (key, val) -> ClassUtils.cast(val.getPayload().getField(fieldDescriptor))); }
Source:
public void showList() throws Exception { final ProjectMigrationPresenter.View view = mock(ProjectMigrationPresenter.View.class); doReturn(view).when(projectListAssetsPresenter).getView(); final HTMLElement element = mock(HTMLElement.class); doReturn(element).when(view).getElement(); final WorkspaceProject project = new WorkspaceProject(mock(OrganizationalUnit.class), mock(Repository.class), mock(Branch.class), mock(KieModule.class)); doReturn(project).when(projectContext).getActiveWorkspaceProject(); doReturn(true).when(libraryService).hasAssets(project); screen.onStartup(); verify(projectDetailEvent).fire(projectDetailEventArgumentCaptor.capture()); assertEquals(project, projectDetailEventArgumentCaptor.getValue().getProject()); verify(projectListAssetsPresenter).show(project); verify(this.view).setContent(element); }

Target:
public void showList() throws Exception { final ProjectMigrationPresenter.View view = mock(ProjectMigrationPresenter.View.class); doReturn(view).when(workspaceProjectListAssetsPresenter).getView(); final HTMLElement element = mock(HTMLElement.class); doReturn(element).when(view).getElement(); final WorkspaceProject project = new WorkspaceProject(mock(OrganizationalUnit.class), mock(Repository.class), mock(Branch.class), mock(KieModule.class)); doReturn(project).when(projectContext).getActiveWorkspaceProject(); doReturn(true).when(libraryService).hasAssets(project); screen.onStartup(); verify(projectDetailEvent).fire(projectDetailEventArgumentCaptor.capture()); assertEquals(project, projectDetailEventArgumentCaptor.getValue().getProject()); verify(workspaceProjectListAssetsPresenter).show(project); verify(this.view).setContent(element); }
Source:
static public OutputStream openOutputFileEx(String filename) throws FileNotFoundException,IOException { if ( filename == null || filename.equals("-") ) return System.out ; if ( filename.startsWith("file:") ) { filename = filename.substring("file:".length()) ; filename = IRILib.decode(filename) ; } OutputStream out = new FileOutputStream(filename) ; String ext = FileOps.extension(filename); switch ( ext ) { case "": return out; case "gz": return new GZIPOutputStream(out) ; case "bz2": return new BZip2CompressorOutputStream(out); case "sz": throw new UnsupportedOperationException("Snappy output"); } return out ; }

Target:
static public OutputStream openOutputFileEx(String filename) throws FileNotFoundException,IOException { if ( filename == null || filename.equals("-") ) return System.out ; if ( filename.startsWith("file:") ) { filename = filename.substring("file:".length()) ; filename = IRILib.decode(filename) ; } OutputStream out = new FileOutputStream(filename) ; String ext = FilenameUtils.getExtension(filename); switch ( ext ) { case "": return out; case "gz": return new GZIPOutputStream(out) ; case "bz2": return new BZip2CompressorOutputStream(out); case "sz": throw new UnsupportedOperationException("Snappy output"); } return out ; }
Source:
public static int runTasksOnce(List<VirtualFSInterface> vfss) { log.debug("Starting DiskUsageService runTasksOnce ..."); ExecutorService executor = Executors.newSingleThreadExecutor(); vfss.forEach(vfs -> { DiskUsageTask task = new DiskUsageTask(vfs); log.debug("Run task {}", task); executor.submit(task); }); log.debug("Submitted tasks", vfss.size()); executor.shutdown(); return vfss.size(); }

Target:
public static synchronized int runTasksOnce(List<VirtualFSInterface> vfss) { log.debug("Starting DiskUsageService runTasksOnce ..."); ExecutorService executor = Executors.newSingleThreadExecutor(); vfss.forEach(vfs -> { DiskUsageTask task = new DiskUsageTask(vfs); log.debug("Run task {}", task); executor.submit(task); }); log.debug("Submitted tasks", vfss.size()); executor.shutdown(); return vfss.size(); }
Source:
public void scheduleTimeout(Channel channel) { assert timeoutFuture == null; this.timeoutFuture = channel.eventLoop().schedule(new TimeoutRunnable(channel), channelFactory.socketTimeout(), TimeUnit.MILLISECONDS); }

Target:
public void scheduleTimeout(Channel channel) { assert timeoutFuture == null; this.channel = channel; this.timeoutFuture = channel.eventLoop().schedule(this, channelFactory.socketTimeout(), TimeUnit.MILLISECONDS); }
Source:
public WorldRendererImpl(Context context, GLBufferPool bufferPool) { this.context = context; this.worldProvider = context.get(WorldProvider.class); this.backdropProvider = context.get(BackdropProvider.class); this.renderingConfig = context.get(Config.class).getRendering(); this.shaderManager = context.get(ShaderManager.class); vrProvider = OpenVRProvider.getInstance(); if (renderingConfig.isVrSupport()) { context.put(OpenVRProvider.class, vrProvider); if (vrProvider.init()) { playerCamera = new OpenVRStereoCamera(vrProvider, worldProvider, renderingConfig); vrProvider.getState().setGroundPlaneYOffset( GROUND_PLANE_HEIGHT_DISPARITY - context.get(Config.class).getPlayer().getEyeHeight()); currentRenderingStage = RenderingStage.LEFT_EYE; } else { playerCamera = new PerspectiveCamera(worldProvider, renderingConfig, context.get(DisplayDevice.class)); currentRenderingStage = RenderingStage.MONO; } } else { playerCamera = new PerspectiveCamera(worldProvider, renderingConfig, context.get(DisplayDevice.class)); currentRenderingStage = RenderingStage.MONO; } LocalPlayerSystem localPlayerSystem = context.get(LocalPlayerSystem.class); localPlayerSystem.setPlayerCamera(playerCamera); renderableWorld = new RenderableWorldImpl(worldProvider, context.get(ChunkProvider.class), bufferPool, playerCamera); renderQueues = renderableWorld.getRenderQueues(); initRenderingSupport(); MethodCommand.registerAvailable(this, context.get(Console.class), context); }

Target:
public WorldRendererImpl(Context context, GLBufferPool bufferPool) { this.context = context; this.worldProvider = context.get(WorldProvider.class); this.backdropProvider = context.get(BackdropProvider.class); this.renderingConfig = context.get(Config.class).getRendering(); this.shaderManager = context.get(ShaderManager.class); vrProvider = OpenVRProvider.getInstance(); if (renderingConfig.isVrSupport()) { context.put(OpenVRProvider.class, vrProvider); if (vrProvider.init()) { playerCamera = new OpenVRStereoCamera(vrProvider, worldProvider, renderingConfig); vrProvider.getState().setGroundPlaneYOffset( GROUND_PLANE_HEIGHT_DISPARITY - context.get(Config.class).getPlayer().getEyeHeight()); currentRenderingStage = RenderingStage.LEFT_EYE; } else { playerCamera = new PerspectiveCamera(worldProvider, renderingConfig, context.get(DisplayDevice.class)); currentRenderingStage = RenderingStage.MONO; } } else { playerCamera = new PerspectiveCamera(worldProvider, renderingConfig, context.get(DisplayDevice.class)); currentRenderingStage = RenderingStage.MONO; } LocalPlayerSystem localPlayerSystem = context.get(LocalPlayerSystem.class); localPlayerSystem.setPlayerCamera(playerCamera); renderableWorld = new RenderableWorldImpl(worldProvider, context.get(ChunkProvider.class), bufferPool, playerCamera); renderQueues = renderableWorld.getRenderQueues(); initRenderingSupport(); console = context.get(Console.class); MethodCommand.registerAvailable(this, console, context); }
Source:
private void writeDevelopers(IndentingWriter writer, MavenBuildSettings settings) { writeElement(writer, "developers", () -> { if (settings.getDevelopers() == null) { writer.println("<developer />"); } }); }

Target:
private void writeDevelopers(IndentingWriter writer, MavenBuildSettings settings) { if (settings.getDevelopers().isEmpty()) { return; } writeElement(writer, "developers", () -> writeCollection(writer, settings.getDevelopers(), this::writeDeveloper)); }
Source:
protected Control renderControl(SWTGridCell cell, Composite parent) throws NoPropertyDescriptorFoundExeption, NoRendererFoundException { if (rendererGridDescription.getColumns() == 1) { return renderMultiAttributeControl(cell, parent); } if (cell.getColumn() == 0 && rendererGridDescription.getColumns() > 1) { validationIcon = createValidationIcon(parent); GridDataFactory.fillDefaults().hint(16, 17).grab(false, false).applyTo(validationIcon); return validationIcon; } final Composite composite = new Composite(parent, SWT.NONE); composite.setBackground(parent.getBackground()); try { final IObservableList list = getEMFFormsDatabinding().getObservableList( getVElement().getDomainModelReference(), getViewModelContext().getDomainModel()); GridLayoutFactory.fillDefaults().numColumns(2).applyTo(composite); final Control multiAttributeComposite = renderMultiAttributeControl(cell, composite); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(multiAttributeComposite); buttonComposite = createButtonComposite(composite, list); GridDataFactory.fillDefaults().align(SWT.END, SWT.BEGINNING).grab(false, false).applyTo(buttonComposite); initButtons(list); applyEnable(); applyReadOnly(); } catch (final DatabindingFailedException ex) { getReportService().report(new RenderingFailedReport(ex)); return createErrorLabel(composite, ex); } return composite; }

Target:
protected Control renderControl(SWTGridCell cell, Composite parent) throws NoPropertyDescriptorFoundExeption, NoRendererFoundException { if (rendererGridDescription.getColumns() == 1) { return renderMultiAttributeControl(cell, parent); } if (cell.getColumn() == 0 && rendererGridDescription.getColumns() > 1) { validationIcon = createValidationIcon(parent); GridDataFactory.fillDefaults().hint(16, 17).grab(false, false).applyTo(validationIcon); return validationIcon; } final Composite composite = new Composite(parent, SWT.NONE); composite.setBackground(parent.getBackground()); try { final IObservableList list = getEMFFormsDatabinding().getObservableList( getVElement().getDomainModelReference(), getViewModelContext().getDomainModel()); GridLayoutFactory.fillDefaults().numColumns(2).applyTo(composite); final Control multiAttributeComposite = renderMultiAttributeControl(cell, composite); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(multiAttributeComposite); final Composite buttonComposite = createButtonComposite(composite, list); GridDataFactory.fillDefaults().align(SWT.END, SWT.BEGINNING).grab(false, false).applyTo(buttonComposite); initButtons(list); } catch (final DatabindingFailedException ex) { getReportService().report(new RenderingFailedReport(ex)); return createErrorLabel(composite, ex); } return composite; }
Source:
public void shouldKillStreamAppWhenZooKeeperDiesBeforeLeaderReElection() throws InterruptedException { ApplicationConfig applicationConfig1 = buildStreamApplicationConfig(SYSTEM, inputKafkaTopic, outputKafkaTopic, NUM_KAFKA_EVENTS, PROCESSOR_IDS[0], testStreamAppName, testStreamAppId); ApplicationConfig applicationConfig2 = buildStreamApplicationConfig(SYSTEM, inputKafkaTopic, outputKafkaTopic, NUM_KAFKA_EVENTS, PROCESSOR_IDS[1], testStreamAppName, testStreamAppId); StreamApplication streamApp1 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, PROCESSOR_IDS[0], null, null); StreamApplication streamApp2 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, PROCESSOR_IDS[1], null, null); LocalApplicationRunner applicationRunner1 = new LocalApplicationRunner(applicationConfig1); LocalApplicationRunner applicationRunner2 = new LocalApplicationRunner(applicationConfig2); applicationRunner1.run(streamApp1); applicationRunner2.run(streamApp2); applicationRunner1.kill(streamApp1); zookeeper().shutdown(); Thread.sleep(6000); assertEquals(ApplicationStatus.UnsuccessfulFinish, applicationRunner1.status(streamApp2)); }

Target:
public void shouldKillStreamAppWhenZooKeeperDiesBeforeLeaderReElection() throws InterruptedException { StreamApplication streamApp1 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, null, null, null); StreamApplication streamApp2 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, null, null, null); applicationRunner1.run(streamApp1); applicationRunner2.run(streamApp2); applicationRunner1.kill(streamApp1); applicationRunner1.waitForFinish(); assertEquals(ApplicationStatus.SuccessfulFinish, applicationRunner1.status(streamApp2)); zookeeper().shutdown(); applicationRunner1 = new LocalApplicationRunner(applicationConfig1); applicationRunner1.run(streamApp1); applicationRunner1.waitForFinish(); }
Source:
private String extractConnectionKey(final iOSVariant iOSVariant) { final StringBuilder sb = new StringBuilder() .append(iOSVariant.getVariantID()) .append(iOSVariant.isProduction() ? "-prod" : "-dev"); return sb.toString(); }

Target:
private String extractConnectionKey(final iOSVariant iOSVariant) { return new StringBuilder() .append(iOSVariant.getVariantID()) .append(iOSVariant.isProduction() ? "-prod" : "-dev") .toString(); }
Source:
protected boolean validatePayeeAchAccountExistence(PayeeACHAccount payeeAchAccount, String routingNumber, String accountNumber) { boolean isValid = true; if (ObjectUtils.isNull(payeeAchAccount) && (StringUtils.isEmpty(routingNumber) || StringUtils.isEmpty(accountNumber))) { GlobalVariables.getMessageMap().putError("payeeAchAccount", KFSKeyConstants.ERROR_CUSTOM, "No existing Payee ACH Account, routing number and account number required"); isValid = false; } return isValid; }

Target:
protected boolean validatePayeeAchAccountExistence(PayeeACHAccount payeeAchAccount, String routingNumber, String accountNumber) { boolean valid = true; if (ObjectUtils.isNull(payeeAchAccount) && (StringUtils.isBlank(routingNumber) || StringUtils.isBlank(accountNumber))) { GlobalVariables.getMessageMap().putError("payeeAchAccount", KFSKeyConstants.ERROR_CUSTOM, "No existing Payee ACH Account, routing number and account number required"); valid = false; } return valid; }
Source:
public void setLegacycidInChangeTable(boolean legacycidInChangeTable) { this.legacycidInChangeTable = legacycidInChangeTable; public PreselectDiffAgainst getPreselectRevision() { if (preselectRevision == null) { return PreselectDiffAgainst.BASE; } return PreselectDiffAgainst.valueOf(preselectRevision); } public void setPreselectRevision(PreselectDiffAgainst preselectRevision) { this.preselectRevision = preselectRevision.name(); } public void resetToDefaults() { maximumPageSize = DEFAULT_PAGESIZE; showSiteHeader = true; useFlashClipboard = true; copySelfOnEmail = false; reversePatchSetOrder = false; showUserInReview = false; downloadUrl = null; downloadCommand = null; dateFormat = null; timeFormat = null; relativeDateInChangeTable = false; commentVisibilityStrategy = null; diffView = null; changeScreen = null; sizeBarInChangeTable = true; legacycidInChangeTable = false; preselectRevision = null; } }

Target:
public void setLegacycidInChangeTable(boolean legacycidInChangeTable) { this.legacycidInChangeTable = legacycidInChangeTable; }
Source:
protected final void stopRewriteSessionOnPartitioners(DocumentRewriteSession session) { if (fDocumentPartitioners != null) { DocumentPartitioningChangedEvent event= new DocumentPartitioningChangedEvent(this); for (Entry<String, IDocumentPartitioner> entry : fDocumentPartitioners.entrySet()) { String partitioning = entry.getKey(); IDocumentPartitioner partitioner= fDocumentPartitioners.get(partitioning); if (partitioner instanceof IDocumentPartitionerExtension3) { IDocumentPartitionerExtension3 extension= (IDocumentPartitionerExtension3) partitioner; extension.stopRewriteSession(session); event.setPartitionChange(partitioning, 0, getLength()); } } if (!event.isEmpty()) fireDocumentPartitioningChanged(event); } }

Target:
protected final void stopRewriteSessionOnPartitioners(DocumentRewriteSession session) { if (fDocumentPartitioners != null) { DocumentPartitioningChangedEvent event= new DocumentPartitioningChangedEvent(this); for (Entry<String, IDocumentPartitioner> entry : fDocumentPartitioners.entrySet()) { String partitioning = entry.getKey(); IDocumentPartitioner partitioner= entry.getValue(); if (partitioner instanceof IDocumentPartitionerExtension3) { IDocumentPartitionerExtension3 extension= (IDocumentPartitionerExtension3) partitioner; extension.stopRewriteSession(session); event.setPartitionChange(partitioning, 0, getLength()); } } if (!event.isEmpty()) fireDocumentPartitioningChanged(event); } }
Source:
public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { return builder .withValue(TaskContract.Tasks.DUE, mDue.getTimestamp()) .withValue(TaskContract.Tasks.DTSTART, null) .withValue(TaskContract.Tasks.DURATION, null) .withValue(TaskContract.Tasks.RDATE, null) .withValue(TaskContract.Tasks.RRULE, null) .withValue(TaskContract.Tasks.EXDATE, null); }

Target:
public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { return builder .withValue(TaskContract.Tasks.DUE, mDue.getTimestamp()) .withValue(TaskContract.Tasks.TZ, mDue.isAllDay() ? "UTC" : mDue.getTimeZone().getID()) .withValue(TaskContract.Tasks.IS_ALLDAY, mDue.isAllDay() ? 1 : 0) .withValue(TaskContract.Tasks.DTSTART, null) .withValue(TaskContract.Tasks.DURATION, null) .withValue(TaskContract.Tasks.RDATE, null) .withValue(TaskContract.Tasks.RRULE, null) .withValue(TaskContract.Tasks.EXDATE, null); }
Source:
public boolean fileApprovedAmountsMatchHeaderApprovedAmount(ConcurRequestExtractFile requestExtractFile) { double detailLinesApprovedAmountSum = 0; List<ConcurRequestExtractRequestDetailFileLine> requestDetailLines = requestExtractFile.getRequestDetails(); for (ConcurRequestExtractRequestDetailFileLine detailLine : requestDetailLines) { detailLinesApprovedAmountSum = detailLinesApprovedAmountSum + detailLine.getRequestAmount().doubleValue(); } KualiDecimal detailLinesAmountSumKualiDecimal = new KualiDecimal(detailLinesApprovedAmountSum); if (detailLinesAmountSumKualiDecimal.doubleValue() == requestExtractFile.getTotalApprovedAmount().doubleValue()) { return true; } else { LOG.error("Header amount validation failed. Header amount was =" +requestExtractFile.getTotalApprovedAmount().toString()+"= while file calculated amount was =" +detailLinesAmountSumKualiDecimal.toString()+ "="); return false; } }

Target:
private boolean fileApprovedAmountsMatchHeaderApprovedAmount(ConcurRequestExtractFile requestExtractFile) { KualiDecimal detailLinesAmountSumKualiDecimal = getTotalRequestFileRequestAmount(requestExtractFile); if (detailLinesAmountSumKualiDecimal.equals(requestExtractFile.getTotalApprovedAmount())) { return true; } else { LOG.error("Header amount validation failed. Header amount was =" + requestExtractFile.getTotalApprovedAmount().toString() + "= while file calculated amount was =" + detailLinesAmountSumKualiDecimal.toString() + "="); return false; } }
Source:
public StringPatternConnection openConnection(DataCleanerConfiguration configuration) { return new StringPatternConnection() { private final Pattern _pattern = Pattern.compile(_expression); @Override public boolean matches(String string) { if (string == null) { return false; } Matcher matcher = _pattern.matcher(string); if (matcher.find()) { if (_matchEntireString) { int s = matcher.start(); if (s == 0) { int e = matcher.end(); if (e == string.length()) { return true; } } return false; } return true; } return false; } @Override public void close() { } }; }

Target:
public StringPatternConnection openConnection(DataCleanerConfiguration configuration) { return new StringPatternConnection() { private final Pattern _pattern = Pattern.compile(_expression); @Override public boolean matches(String string) { if (string == null) { return false; } final Matcher matcher = _pattern.matcher(string); if (matcher.find()) { if (_matchEntireString) { int s = matcher.start(); if (s == 0) { int e = matcher.end(); if (e == string.length()) { return true; } } return false; } return true; } return false; } @Override public void close() { } }; }
Source:
protected boolean isPage200(HttpMessage msg) { if (isCustomPage(msg, CustomPage.Type.NOTFOUND_404) || isCustomPage(msg, CustomPage.Type.ERROR_500)) { return false; } return isCustomPage(msg, CustomPage.Type.OK_200) ? true : parent.getAnalyser().isFileExist(msg); }

Target:
protected boolean isPage200(HttpMessage msg) { if (isCustomPage(msg, CustomPage.Type.NOTFOUND_404) || isCustomPage(msg, CustomPage.Type.ERROR_500)) { return false; } if (isCustomPage(msg, CustomPage.Type.OK_200)) { return true; } return parent.getAnalyser().isFileExist(msg); }
Source:
public ProxyIterator( ProxyClient<S> client, PartitionId partitionId, OpenFunction<S> openFunction, NextFunction<S, T> nextFunction, CloseFunction<S> closeFunction) { this.client = client; this.partitionId = partitionId; this.nextFunction = nextFunction; this.closeFunction = closeFunction; this.openFuture = client.applyOn(partitionId, openFunction::open); this.batch = CompletableFuture.completedFuture( new IteratorBatch<T>(0, Collections.emptyList())); }

Target:
public ProxyIterator( ProxyClient<S> client, PartitionId partitionId, OpenFunction<S> openFunction, NextFunction<S, T> nextFunction, CloseFunction<S> closeFunction) { this.client = client; this.partitionId = partitionId; this.nextFunction = nextFunction; this.closeFunction = closeFunction; this.openFuture = OrderedFuture.wrap(client.applyOn(partitionId, openFunction::open)); this.batch = CompletableFuture.completedFuture( new IteratorBatch<T>(0, Collections.emptyList())); }