auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void saveSubscription(final Subscription subscription) throws InternalNakadiException, DuplicatedSubscriptionException { try { jdbcTemplate.update("INSERT INTO zn_data.subscription (s_id, s_subscription_object) VALUES (?, ?::jsonb)", subscription.getId(), jsonMapper.writer().writeValueAsString(subscription)); } catch (JsonProcessingException e) { throw new InternalNakadiException("Serialization problem during persistence of event type", e); } catch (DuplicateKeyException e) { throw new DuplicatedSubscriptionException("Subscription with the same key properties already exists", e); } }

Target:
public void saveSubscription(final Subscription subscription) throws InternalNakadiException, DuplicatedSubscriptionException { try { jdbcTemplate.update("INSERT INTO zn_data.subscription (s_id, s_subscription_object) VALUES (?, ?::jsonb)", subscription.getId(), jsonMapper.writer().writeValueAsString(subscription)); } catch (final JsonProcessingException e) { throw new InternalNakadiException("Serialization problem during persistence of event type", e); } catch (final DuplicateKeyException e) { throw new DuplicatedSubscriptionException("Subscription with the same key properties already exists", e); } }
Source:
public boolean isSoftLimitReached(Guid volumeId) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); if (volume != null) { GlusterVolumeSnapshotConfig config = getGlusterVolumeSnapshotConfigDao().getConfigByClusterIdAndName(volume.getClusterId(), "snap-max-soft-limit"); if (config != null) { String configValue = config.getParamValue().substring(0, config.getParamValue().length() - 1); int snapMaxSoftLimitPcnt = Integer.parseInt(configValue); int snapshotCount = volume.getSnapshotsCount(); int snapMaxLimit = volume.getSnapMaxLimit(); return snapshotCount >= (snapMaxLimit * snapMaxSoftLimitPcnt) / 100; } } return false; }

Target:
public boolean isSoftLimitReached(Guid volumeId) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); if (volume != null) { GlusterVolumeSnapshotConfig config = getGlusterVolumeSnapshotConfigDao().getConfigByClusterIdAndName(volume.getClusterId(), "snap-max-soft-limit"); if (config != null) { String configValue = config.getParamValue(); if (configValue.endsWith("%")) { configValue = configValue.substring(0, configValue.length() - 1); } int snapMaxSoftLimitPcnt = Integer.parseInt(configValue); int snapshotCount = volume.getSnapshotsCount(); int snapMaxLimit = volume.getSnapMaxLimit(); return snapshotCount >= (snapMaxLimit * snapMaxSoftLimitPcnt) / 100; } } return false; }
Source:
public void populateDAG(DAG dag, Configuration conf) { RandomGenerator generator = dag.addOperator("DataGenerator", new RandomGenerator()); KafkaOutputOperator kafkaOutput = dag.addOperator("KafkaWriter", new KafkaOutputOperator()); generator.setTuplesBlast(maxTuplesPerWindow); generator.setInitialOffset(initialOffset); kafkaOutput.setTopic(topic); Properties configProperties = new Properties(); configProperties.setProperty("metadata.broker.list",broker); kafkaOutput.setConfigProperties(configProperties); KafkaInputModule input = dag.addModule("KafkaReader", new KafkaInputModule()); Validator valid = dag.addOperator("Validation", new Validator()); valid.setMaxTuplesPerWindow(maxTuplesPerWindow); input.setTopic(topic); input.setZookeeper(zookeeper); if(offsetFilePath != null) { input.setOffsetFilePath(offsetFilePath); } input.setInitialOffset(initialOffset); input.setParallelReads(parallelReads); input.setMaxTuplesPerWindow(maxTuplesPerWindow); input.setStrategy(strategy); input.setBandwidth(bandwidth); dag.addStream("ToKafka", generator.output, kafkaOutput.inputPort); dag.addStream("ToValidator", generator.integer_data, valid.generatePort); dag.addStream("FromKafka", input.output, valid.kafkaPort); }

Target:
public void populateDAG(DAG dag, Configuration conf) { RandomGenerator generator = dag.addOperator("DataGenerator", new RandomGenerator()); KafkaOutputOperator kafkaOutput = dag.addOperator("KafkaWriter", new KafkaOutputOperator()); generator.setTuplesBlast(maxTuplesPerWindow); generator.setInitialOffset(initialOffset); generator.setDisableGenerate(disableValidation); kafkaOutput.setTopic(topic); Properties configProperties = new Properties(); configProperties.setProperty("metadata.broker.list",broker); kafkaOutput.setConfigProperties(configProperties); KafkaInputModule input = dag.addModule("KafkaReader", new KafkaInputModule()); ValidatorOperator validator = dag.addOperator("Validation", new ValidatorOperator()); validator.setMaxTuplesPerWindow(maxTuplesPerWindow); validator.setDisableValidation(disableValidation); input.setTopic(topic); input.setZookeeper(zookeeper); if(offsetFilePath != null) { input.setOffsetFilePath(offsetFilePath); } input.setInitialOffset(initialOffset); if(parallelReads != 0) { input.setParallelReads(parallelReads); } input.setMaxTuplesPerWindow(maxTuplesPerWindow); if(bandwidth != 0) { input.setBandwidth(bandwidth); } dag.addStream("ToKafka", generator.output, kafkaOutput.inputPort); dag.addStream("ToValidator", generator.integer_data, validator.randomPort); dag.addStream("FromKafka", input.output, validator.kafkaPort); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; JavadocInlineTag that = (JavadocInlineTag) o; return type == that.type && content.equals(that.content); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; JavadocInlineTag that = (JavadocInlineTag) o; if (tagName != null ? !tagName.equals(that.tagName) : that.tagName != null) return false; if (type != that.type) return false; return content != null ? content.equals(that.content) : that.content == null; }
Source:
public Scale getInventoryScaleByName(final String name) { Scale scale = new Scale(); try { StringBuilder sql = this.buildQueryForInventoryScales(); sql.append(" AND prs.name = :name"); SQLQuery query = this.getSession().createSQLQuery(sql.toString()).addScalar("id").addScalar("scalename").addScalar("methodname") .addScalar("name").addScalar("definition"); query.setParameter("name", name); List<Object[]> result = query.list(); if (result != null && !result.isEmpty()) { Object[] row = result.get(0); String displayName = row[1] + " - " + row[2]; scale = new Scale(new Term((Integer) row[0], row[3].toString(), row[4].toString())); scale.setDisplayName(displayName); return scale; } } catch (HibernateException e) { this.logAndThrowException("Error in getAllInventoryScales in CVTermDao: " + e.getMessage(), e); } return scale; }

Target:
public Scale getInventoryScaleByName(final String name) { Scale scale = new Scale(); try { StringBuilder sql = this.buildQueryForInventoryScales(); sql.append(" AND prs.name = :name"); SQLQuery query = this.getSession().createSQLQuery(sql.toString()).addScalar("id").addScalar("scalename").addScalar("methodname") .addScalar("name").addScalar("definition"); query.setParameter("name", name); Object[] result = (Object[]) query.uniqueResult(); if (result != null) { String displayName = result[1] + " - " + result[2]; scale = new Scale(new Term((Integer) result[0], result[3].toString(), result[4].toString())); scale.setDisplayName(displayName); return scale; } } catch (HibernateException e) { this.logAndThrowException("Error in getAllInventoryScales in CVTermDao: " + e.getMessage(), e); } return scale; }
Source:
public boolean add(DocumentWriteOperation documentWriteOperation) { System.out.println(operations); return operations.add(documentWriteOperation); }

Target:
public boolean add(DocumentWriteOperation documentWriteOperation) { return operations.add(documentWriteOperation); }
Source:
private SimpleReportEntry createReportEntry(TestIdentifier testIdentifier, Optional<Throwable> throwable) { String className = getClassName(testIdentifier); StackTraceWriter traceWriter = new PojoStackTraceWriter(className, testIdentifier.getLegacyReportingName(), throwable.orElse(null)); return new SimpleReportEntry(className, testIdentifier.getDisplayName(), traceWriter, null); }

Target:
private SimpleReportEntry createReportEntry(TestIdentifier testIdentifier, Optional<Throwable> throwable) { Optional<String> className = getClassName(testIdentifier); Optional<StackTraceWriter> stackTraceWriter = throwable.flatMap( t -> className.map(name -> new PojoStackTraceWriter(name, getMethodName(testIdentifier).orElse(""), t))); String source = sourceLegacyReportingName(testIdentifier); return new SimpleReportEntry(source, testIdentifier.getLegacyReportingName(), stackTraceWriter.orElse(null), null); }
Source:
public static CommitMessageComponentState loadState(Repository repository) { IDialogSettings dialogSettings = getDialogSettings(); String[] values = dialogSettings.getArray(repository.getDirectory() .getAbsolutePath()); if (values == null || values.length < MEMBER_COUNT) return null; CommitMessageComponentState state = new CommitMessageComponentState(); state.setAmend(Boolean.parseBoolean(values[0])); state.setAuthor(values[1]); state.setCommitMessage(values[2]); state.setCaretPosition(Integer.parseInt(values[3])); state.setCommitter(values[4]); state.setHeadCommit(ObjectId.fromString(values[5])); return state; }

Target:
public static CommitMessageComponentState loadState(Repository repository) { IDialogSettings dialogSettings = getDialogSettings(); String[] values = dialogSettings.getArray(repository.getDirectory() .getAbsolutePath()); if (values == null) { return null; } CommitMessageComponentState state = new CommitMessageComponentState(); state.setAmend(Boolean.parseBoolean(values[0])); state.setAuthor(values[1]); state.setCommitMessage(values[2]); if (values.length == MEMBER_COUNT) { state.setCaretPosition(Integer.parseInt(values[3])); state.setCommitter(values[4]); state.setHeadCommit(ObjectId.fromString(values[5])); } else if (values.length == MEMBER_COUNT_WITHOUT_CARET_POSITION) { state.setCommitter(values[3]); state.setHeadCommit(ObjectId.fromString(values[4])); } else { return null; } return state; }
Source:
public static Html toValue(Field field, JsonNode value) { if (field.getDatatype().equals(Datatype.TEXT)) { return Html.apply(new MarkdownProcessor().markdown(toRawValue(field, value))); } else if (field.getDatatype().equals(Datatype.COLOUR)) { return Html.apply(new MarkdownProcessor().markdown(toColourValue(field, value))); } else { return Html.apply(toRawValue(field, value)); } }

Target:
public static Html toValue(Field field, JsonNode value) { if (field.getDatatype() == Datatype.TEXT) { return Html.apply(new MarkdownProcessor().markdown(toRawValue(field, value))); } else if (field.getDatatype() == Datatype.COLOUR) { return Html.apply(new MarkdownProcessor().markdown(toColourValue(field, value))); } else { return Html.apply(toRawValue(field, value)); } }
Source:
public boolean isDataAvailable(String keyspace, Token token) { Pair<Set<Range<Token>>, Set<Range<Token>>> availableRanges = getAvailableRanges(keyspace, token.getPartitioner()); return Streams.concat(availableRanges.left.stream(), availableRanges.right.stream()).anyMatch(range -> range.contains(token)); }

Target:
public boolean isDataAvailable(String keyspace, Token token) { SystemKeyspace.AvailableRanges availableRanges = getAvailableRanges(keyspace, token.getPartitioner()); return Streams.concat(availableRanges.full.stream(), availableRanges.trans.stream()) .anyMatch(range -> range.contains(token)); }
Source:
public static void main(String[] args) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException, InvalidKeySpecException { Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); try { String publicKey = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqTxd43gyp8IOEto2LdIfjRQrIbsd4SXZkLW6jDutdhXSJCWHw8REntlo7aNDthvj+y7GjUuFDb/R1NGe1OPzpA=="; String payload = "[{\"email\":\"example@test.com\",\"timestamp\":1583532164,\"smtp-id\":\"<14c5d75ce93.dfd.64b469@ismtpd-555>\",\"event\":\"processed\",\"category\":\"cat facts\",\"sg_event_id\":\"sg_event_id\",\"sg_message_id\":\"sg_message_id\"}]"; String signature = "MEUCIB3PweCEFCNC0kCi6XFmlDSeFV9INyue8XmKejxu6OrKAiEAguMqCpe/5HpuK21G/+QxcZSKQm3lzM4YAblVHAhoXeU="; String timestamp = "1587162961"; boolean valid = EventWebhook.VerifySignature(publicKey, payload, signature, timestamp); System.out.println("Valid Signature: " + valid); } catch (Exception exception) { Logger.getLogger(Example.class.getName()).log(Level.SEVERE, "something went wrong", exception); } }

Target:
public static void main(String[] args) { Security.addProvider(new BouncyCastleProvider()); try { String publicKey = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEDr2LjtURuePQzplybdC+u4CwrqDqBaWjcMMsTbhdbcwHBcepxo7yAQGhHPTnlvFYPAZFceEu/1FwCM/QmGUhA=="; String payload = "{\"category\":\"example_payload\",\"event\":\"test_event\",\"message_id\":\"message_id\"}"; String signature = "MEUCIQCtIHJeH93Y+qpYeWrySphQgpNGNr/U+UyUlBkU6n7RAwIgJTz2C+8a8xonZGi6BpSzoQsbVRamr2nlxFDWYNH2j/0="; String timestamp = "1588788367"; EventWebhook ew = new EventWebhook(); ECPublicKey ellipticCurvePublicKey = ew.ConvertPublicKeyToECDSA(publicKey); boolean valid = ew.VerifySignature(ellipticCurvePublicKey, payload, signature, timestamp); System.out.println("Valid Signature: " + valid); } catch (Exception exception) { Logger.getLogger(Example.class.getName()).log(Level.SEVERE, "something went wrong", exception); } }
Source:
public String getComponent(String digitalTwinId, String componentPath) { return digitalTwinsAsyncClient.getComponent(digitalTwinId, componentPath).block(); }

Target:
public String getComponent(String digitalTwinId, String componentPath) { return getComponentWithResponse(digitalTwinId, componentPath, Context.NONE).getValue(); }
Source:
public Solution_ call() { synchronized (this) { if (solverStatus != SolverStatus.SOLVING_SCHEDULED) { return problemFinder.apply(problemId); } solverStatus = SolverStatus.SOLVING_ACTIVE; } try { Solution_ problem = problemFinder.apply(problemId); final Solution_ finalBestSolution = solver.solve(problem); if (finalBestSolutionConsumer != null) { finalBestSolutionConsumer.accept(finalBestSolution); } return finalBestSolution; } catch (Exception e) { exceptionHandler.accept(problemId, e); throw new IllegalStateException("Solving failed for problemId (" + problemId + ").", e); } finally { solvingTerminated(); } }

Target:
public Solution_ call() { SolverStatus solverStatus = solverStatusReference.getAndSet(SolverStatus.SOLVING_ACTIVE); if (solverStatus != SolverStatus.SOLVING_SCHEDULED) { return problemFinder.apply(problemId); } try { Solution_ problem = problemFinder.apply(problemId); final Solution_ finalBestSolution = solver.solve(problem); if (finalBestSolutionConsumer != null) { finalBestSolutionConsumer.accept(finalBestSolution); } return finalBestSolution; } catch (Exception e) { exceptionHandler.accept(problemId, e); throw new IllegalStateException("Solving failed for problemId (" + problemId + ").", e); } finally { solvingTerminated(); } }
Source:
private void runFirehoseV2(FirehoseV2 firehose) { final Period intermediatePersistPeriod = config.getIntermediatePersistPeriod(); try { firehose.start(); } catch (Exception e) { log.error(e, "Failed to start firehoseV2"); return; } long nextFlush = new DateTime().plus(intermediatePersistPeriod).getMillis(); boolean haveRow = true; while (haveRow) { InputRow inputRow = null; int numRows = 0; try { inputRow = firehose.currRow(); if (inputRow != null) { try { numRows = plumber.add(inputRow); } catch (IndexSizeExceededException e) { log.info("Index limit exceeded: %s", e.getMessage()); nextFlush = doIncrementalPersist(firehose.makeCommitter(), intermediatePersistPeriod); continue; } if (numRows < 0) { metrics.incrementThrownAway(); log.debug("Throwing away event[%s]", inputRow); } else { metrics.incrementProcessed(); } } } catch (Exception e) { log.makeAlert(e, "Some exception got thrown while processing rows. Ignoring and continuing.") .addData("inputRow", inputRow); } try { haveRow = firehose.advance(); } catch (Exception e) { log.debug(e, "thrown away line due to exception, considering unparseable"); metrics.incrementUnparseable(); continue; } try { if (numRows > config.getMaxRowsInMemory() || System.currentTimeMillis() > nextFlush) { nextFlush = doIncrementalPersist(firehose.makeCommitter(), intermediatePersistPeriod); } } catch (Exception e) { log.makeAlert(e, "An exception happened while queue to persist!? We hope it is transient. Ignore and continue."); } } }

Target:
private void runFirehoseV2(FirehoseV2 firehose) { final Period intermediatePersistPeriod = config.getIntermediatePersistPeriod(); try { firehose.start(); } catch (Exception e) { log.error(e, "Failed to start firehoseV2"); return; } long nextFlush = new DateTime().plus(intermediatePersistPeriod).getMillis(); log.info("FirehoseV2 started with nextFlush [%s]", nextFlush); boolean haveRow = true; while (haveRow) { InputRow inputRow = null; int numRows = 0; try { inputRow = firehose.currRow(); if (inputRow != null) { try { numRows = plumber.add(inputRow); } catch (IndexSizeExceededException e) { log.info("Index limit exceeded: %s", e.getMessage()); nextFlush = doIncrementalPersist(firehose.makeCommitter(), intermediatePersistPeriod); continue; } if (numRows < 0) { metrics.incrementThrownAway(); log.debug("Throwing away event[%s]", inputRow); } else { metrics.incrementProcessed(); } } } catch (Exception e) { log.makeAlert(e, "Some exception got thrown while processing rows. Ignoring and continuing.") .addData("inputRow", inputRow); } try { haveRow = firehose.advance(); } catch (Exception e) { log.debug(e, "thrown away line due to exception, considering unparseable"); metrics.incrementUnparseable(); continue; } try { final Sink sink = plumber.getSink(inputRow.getTimestampFromEpoch()); if ((sink != null && !sink.canAppendRow()) || System.currentTimeMillis() > nextFlush) { nextFlush = doIncrementalPersist(firehose.makeCommitter(), intermediatePersistPeriod); } } catch (Exception e) { log.makeAlert(e, "An exception happened while queue to persist!? We hope it is transient. Ignore and continue."); } } }
Source:
public int getToolTipTimeDisplayed(Object object_p) { return 2000; }

Target:
public int getToolTipTimeDisplayed(Object object_p) { return TOOLTIP_TIME_DISPLAYED; }
Source:
private MultipartInfoInitiateResponse initiateMultiPartUpload( MultipartInfoInitiateRequest request) throws IOException { MultipartInfoInitiateResponse.Builder resp = MultipartInfoInitiateResponse .newBuilder(); KeyArgs keyArgs = request.getKeyArgs(); OmKeyArgs omKeyArgs = new OmKeyArgs.Builder() .setVolumeName(keyArgs.getVolumeName()) .setBucketName(keyArgs.getBucketName()) .setKeyName(keyArgs.getKeyName()) .setType(keyArgs.getType()) .setFactor(keyArgs.getFactor()) .setAcls(keyArgs.getAclsList().stream().map(a -> OzoneAcl.fromProtobuf(a)).collect(Collectors.toList())) .setFactor(keyArgs.getFactor()) .build(); OmMultipartInfo multipartInfo = impl.initiateMultipartUpload(omKeyArgs); resp.setVolumeName(multipartInfo.getVolumeName()); resp.setBucketName(multipartInfo.getBucketName()); resp.setKeyName(multipartInfo.getKeyName()); resp.setMultipartUploadID(multipartInfo.getUploadID()); return resp.build(); }

Target:
private MultipartInfoInitiateResponse initiateMultiPartUpload( MultipartInfoInitiateRequest request) throws IOException { MultipartInfoInitiateResponse.Builder resp = MultipartInfoInitiateResponse .newBuilder(); KeyArgs keyArgs = request.getKeyArgs(); OmKeyArgs omKeyArgs = new OmKeyArgs.Builder() .setVolumeName(keyArgs.getVolumeName()) .setBucketName(keyArgs.getBucketName()) .setKeyName(keyArgs.getKeyName()) .setType(keyArgs.getType()) .setFactor(keyArgs.getFactor()) .setAcls(keyArgs.getAclsList().stream().map(a -> OzoneAcl.fromProtobuf(a)).collect(Collectors.toList())) .build(); OmMultipartInfo multipartInfo = impl.initiateMultipartUpload(omKeyArgs); resp.setVolumeName(multipartInfo.getVolumeName()); resp.setBucketName(multipartInfo.getBucketName()); resp.setKeyName(multipartInfo.getKeyName()); resp.setMultipartUploadID(multipartInfo.getUploadID()); return resp.build(); }
Source:
public void testBlobDataReader() throws Exception { String clientId = this.getConfiguration().get(TestConfigurationKeys.FS_AZURE_BLOB_DATA_READER_CLIENT_ID); Assume.assumeTrue("Reader client id not provided", clientId != null); String secret = this.getConfiguration().get(TestConfigurationKeys.FS_AZURE_BLOB_DATA_READER_CLIENT_SECRET); Assume.assumeTrue("Reader client secret not provided", secret != null); prepareFiles(); final AzureBlobFileSystem fs = getBlobReader(); AzureBlobFileSystemStore abfsStore = fs.getAbfsStore(); Map<String, String> properties = abfsStore.getFilesystemProperties(); assertTrue(fs.exists(EXISTED_FOLDER_PATH)); try { abfsStore.delete(EXISTED_FOLDER_PATH, true); } catch (AbfsRestOperationException e) { assertEquals(AzureServiceErrorCode.AUTHORIZATION_PERMISSION_MISS_MATCH, e.getErrorCode()); } try (InputStream inputStream = abfsStore.openFileForRead(EXISTED_FILE_PATH, null)) { assertTrue(inputStream.read() != 0); } try { abfsStore.openFileForWrite(EXISTED_FILE_PATH, fs.getFsStatistics(),true); } catch (AbfsRestOperationException e) { assertEquals(AzureServiceErrorCode.AUTHORIZATION_PERMISSION_MISS_MATCH, e.getErrorCode()); } }

Target:
public void testBlobDataReader() throws Exception { String clientId = this.getConfiguration().get(TestConfigurationKeys.FS_AZURE_BLOB_DATA_READER_CLIENT_ID); Assume.assumeTrue("Reader client id not provided", clientId != null); String secret = this.getConfiguration().get(TestConfigurationKeys.FS_AZURE_BLOB_DATA_READER_CLIENT_SECRET); Assume.assumeTrue("Reader client secret not provided", secret != null); prepareFiles(); final AzureBlobFileSystem fs = getBlobReader(); AzureBlobFileSystemStore abfsStore = fs.getAbfsStore(); Map<String, String> properties = abfsStore.getFilesystemProperties(); assertTrue(fs.exists(EXISTED_FOLDER_PATH)); try { abfsStore.delete(EXISTED_FOLDER_PATH, true); } catch (AbfsRestOperationException e) { assertEquals(AzureServiceErrorCode.AUTHORIZATION_PERMISSION_MISS_MATCH, e.getErrorCode()); } try (InputStream inputStream = abfsStore.openFileForRead(EXISTED_FILE_PATH, null)) { assertTrue(inputStream.read() != 0); } try { abfsStore.openFileForWrite(EXISTED_FILE_PATH, fs.getFsStatistics(), true); } catch (AbfsRestOperationException e) { assertEquals(AzureServiceErrorCode.AUTHORIZATION_PERMISSION_MISS_MATCH, e.getErrorCode()); } finally { IOUtils.cleanupWithLogger(LOG, abfsStore); } }
Source:
public void createWithPrimaryKeyField_string() { realmSchema.createWithPrimaryKeyField("FooNonNull", "pkField", String.class, FieldAttribute.REQUIRED); RealmObjectSchema objectSchema = realmSchema.getSchemaForClass("FooNonNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.STRING, objectSchema.getFieldType("pkField")); assertFalse(objectSchema.isNullable("pkField")); realmSchema.createWithPrimaryKeyField("FooNull", "pkField", String.class); objectSchema = realmSchema.getSchemaForClass("FooNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.STRING, objectSchema.getFieldType("pkField")); assertTrue(objectSchema.isNullable("pkField")); }

Target:
public void createWithPrimaryKeyField_string() { realmSchema.createWithPrimaryKeyField("FooNonNull", "pkField", String.class, FieldAttribute.REQUIRED); RealmObjectSchema objectSchema = realmSchema.getSchemaForClass("FooNonNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.STRING, objectSchema.getFieldType("pkField")); assertFalse(objectSchema.isNullable("pkField")); assertTrue(objectSchema.hasIndex("pkField")); realmSchema.createWithPrimaryKeyField("FooNull", "pkField", String.class); objectSchema = realmSchema.getSchemaForClass("FooNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.STRING, objectSchema.getFieldType("pkField")); assertTrue(objectSchema.isNullable("pkField")); assertTrue(objectSchema.hasIndex("pkField")); }
Source:
void setProcessStateNotifier(ProcessStateNotifier notifier) { assert this.processStateNotifier == null; this.processStateNotifier = notifier; if (notifier != null) { this.propertyChangeListener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (ControlledProcessState.State.RUNNING == evt.getNewValue()) { synchronized (this) { if (scanEnabled) { undeployScanTask = scheduledExecutor.submit(new UndeployScanRunnable()); } } } else if (ControlledProcessState.State.STOPPING == evt.getNewValue()) { scanEnabled = false; if(undeployScanTask != null) { undeployScanTask.cancel(true); undeployScanTask = null; } processStateNotifier.removePropertyChangeListener(this); } } }; this.processStateNotifier.addPropertyChangeListener(propertyChangeListener); } else { this.propertyChangeListener = null; } }

Target:
void setProcessStateNotifier(ProcessStateNotifier notifier) { assert this.processStateNotifier == null; this.processStateNotifier = notifier; if (notifier != null) { this.propertyChangeListener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (ControlledProcessState.State.RUNNING == evt.getNewValue()) { synchronized (FileSystemDeploymentService.this) { if (scanEnabled) { undeployScanTask = scheduledExecutor.submit(new UndeployScanRunnable()); } } } else if (ControlledProcessState.State.STOPPING == evt.getNewValue()) { synchronized (FileSystemDeploymentService.this) { scanEnabled = false; if (undeployScanTask != null) { undeployScanTask.cancel(true); undeployScanTask = null; } } processStateNotifier.removePropertyChangeListener(this); } } }; this.processStateNotifier.addPropertyChangeListener(propertyChangeListener); } else { this.propertyChangeListener = null; } }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((this.logEntry == null) ? 0 : this.logEntry.hashCode()); return result; }

Target:
public int hashCode() { return this.logEntry.hashCode(); }
Source:
public void access(final Path path, final FsAction mode) throws IOException { LOG.debug("AzureBlobFileSystem.access path : {}, mode : {}", path, mode); Path qualifiedPath = path == null ? null : makeQualified(path); try { this.abfsStore.access(qualifiedPath, mode); } catch (AzureBlobFileSystemException ex) { checkCheckAccessException(path, ex); } }

Target:
public void access(final Path path, final FsAction mode) throws IOException { LOG.debug("AzureBlobFileSystem.access path : {}, mode : {}", path, mode); Path qualifiedPath = makeQualified(path); try { this.abfsStore.access(qualifiedPath, mode); } catch (AzureBlobFileSystemException ex) { checkCheckAccessException(path, ex); } }
Source:
public void copyRightToLeft(Diff target, Monitor monitor) { if (target.getState() != DifferenceState.UNRESOLVED) { return; } long start = System.currentTimeMillis(); target.setState(DifferenceState.MERGED); final Set<Diff> dependencies = getDirectMergeDependencies(target, true); boolean requiresMerging = requiresMerging(target, true); for (Diff mergeMe : dependencies) { mergeDiff(mergeMe, true, monitor); } for (Diff transitiveMerge : getDirectResultingMerges(target, true)) { transitiveMerge.setState(DifferenceState.MERGED); } if (requiresMerging) { if (target.getSource() == DifferenceSource.LEFT) { reject(target, true); } else { accept(target, true); } } if (isHandleSubDiffs()) { Set<Diff> subDiffs = Sets.newLinkedHashSet(ComparisonUtil.getDirectSubDiffs(false).apply(target)); for (Diff subDiff : subDiffs) { mergeDiff(subDiff, true, monitor); } } if (LOGGER.isDebugEnabled()) { long duration = System.currentTimeMillis() - start; LOGGER.debug("copyLeftToRight(Diff, Monitor) - diff " + target.hashCode() + " merged in " + duration + "s"); } }

Target:
public void copyRightToLeft(Diff target, Monitor monitor) { if (target.getState() != DifferenceState.UNRESOLVED) { return; } long start = System.currentTimeMillis(); target.setState(DifferenceState.MERGED); final Set<Diff> dependencies = getDirectMergeDependencies(target, true); boolean requiresMerging = requiresMerging(target, true); for (Diff mergeMe : dependencies) { mergeDiff(mergeMe, true, monitor); } for (Diff transitiveMerge : getDirectResultingMerges(target, true)) { transitiveMerge.setState(DifferenceState.MERGED); } if (requiresMerging) { if (target.getSource() == DifferenceSource.LEFT) { reject(target, true); } else { accept(target, true); } } if (isHandleSubDiffs()) { Set<Diff> subDiffs = Sets.newLinkedHashSet(ComparisonUtil.getDirectSubDiffs(false).apply(target)); for (Diff subDiff : subDiffs) { mergeDiff(subDiff, true, monitor); } } if (LOGGER.isDebugEnabled()) { long duration = System.currentTimeMillis() - start; LOGGER.debug("copyLeftToRight(Diff, Monitor) - diff " + target.hashCode() + " merged in " + duration + "ms"); } }
Source:
private void computeWidgetX() { GC gc= new GC(fTextWidget); Font font= fTextWidget.getFont(); fFontForCachedWidgetX= font; gc.setFont(font); StringBuilder sb= new StringBuilder(fMarginWidth); String sampleText= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; while (sb.length() < fMarginWidth) { sb.append(sampleText, 0, Math.min(sampleText.length(), fMarginWidth - sb.length())); } fCachedWidgetX= gc.textExtent(sb.toString()).x; gc.dispose(); }

Target:
private void computeWidgetX() { GC gc= new GC(fTextWidget); fFontForCachedWidgetX= fTextWidget.getFont(); double pixels= gc.getFontMetrics().getAverageCharacterWidth(); gc.dispose(); fCachedWidgetX= (int) (pixels * fMarginWidth + 0.5); }
Source:
public void testEncryption() throws Throwable { super.testEncryption(); }

Target:
public void testEncryption() throws Throwable { }
Source:
public void update(float delta) { if (metricsLabel != null) { if (metricsModes.isEmpty()) { metricsLabel.setText("No metric modes are available!"); return; } metricsLabel.setText(metricsModes.get(currentMode).getMetrics()); } }

Target:
public void update(float delta) { metricsLabel.setText(debugMetricsSystem.getCurrentMode().getMetrics()); }
Source:
public ResponseEntity<Object> uploadDicom(String accessToken, MultipartFile dicomFile, String participantId, String accessionId, String targetPath) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.MULTIPART_FORM_DATA); headers.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); MultiValueMap<String, Object> requestBody = new LinkedMultiValueMap<>(); try { Path tempDicomFile = Files.createTempFile("dicomFile" + System.nanoTime(), ".zip"); Files.write(tempDicomFile, dicomFile.getBytes()); File dicomFileToUpload = tempDicomFile.toFile(); requestBody.add(DICOM_FILE_PARAM, new FileSystemResource(dicomFileToUpload)); } catch (IOException e) { logger.error("Unable to read the zip file", e); return ResponseEntity.badRequest() .body(ErrorConstants.ERR_UNABLE_TO_READ_FILE); } requestBody.add(PARTICIPANT_ID_PARAM, participantId); requestBody.add(ACCESSION_ID_PARAM, accessionId); requestBody.add(TARGET_PATH_PARAM, targetPath); HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(requestBody, headers); RestTemplate restTemplate = new RestTemplate(); String uploadDicomUrl = DICOM_SERVICE_URL + "/dicom"; try { logger.debug("Calling dicom-service to upload dicom file"); restTemplate.postForEntity(uploadDicomUrl, requestEntity, Object.class); return ResponseEntity.ok().build(); } catch (HttpClientErrorException e) { logger.error("Failed to upload dicom file to dicom-service", e); return ResponseEntity .status(e.getRawStatusCode()) .body(e.getResponseBodyAsString()); } }

Target:
public ResponseEntity<String> uploadDicom(String accessToken, MultipartFile dicomFile, String participantId, String accessionId, String targetPath) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.MULTIPART_FORM_DATA); headers.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); MultiValueMap<String, Object> requestBody = new LinkedMultiValueMap<>(); try { Path tempDicomFile = Files.createTempFile("dicomFile" + System.nanoTime(), ".zip"); Files.write(tempDicomFile, dicomFile.getBytes()); File dicomFileToUpload = tempDicomFile.toFile(); requestBody.add(DICOM_FILE_PARAM, new FileSystemResource(dicomFileToUpload)); } catch (IOException e) { logger.error("Unable to read the zip file", e); return ResponseEntity.badRequest() .body(ErrorConstants.ERR_UNABLE_TO_READ_FILE); } requestBody.add(PARTICIPANT_ID_PARAM, participantId); requestBody.add(ACCESSION_ID_PARAM, accessionId); requestBody.add(TARGET_PATH_PARAM, targetPath); HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(requestBody, headers); RestTemplate restTemplate = new RestTemplate(); String uploadDicomUrl = DICOM_SERVICE_URL + DICOM_PATH; try { logger.debug("Calling dicom-service to upload dicom file"); restTemplate.postForEntity(uploadDicomUrl, requestEntity, Object.class); return ResponseEntity.ok().build(); } catch (HttpClientErrorException e) { logger.error("Failed to upload dicom file to dicom-service", e); return ResponseEntity .status(e.getRawStatusCode()) .body(e.getResponseBodyAsString()); } }
Source:
public List<NakadiCursor> convert(final List<SubscriptionCursorWithoutToken> cursors) throws InternalNakadiException, NoSuchEventTypeException, ServiceUnavailableException, InvalidCursorException { for (final SubscriptionCursorWithoutToken cursor: cursors) { if (null == cursor.getPartition()) { throw new InvalidCursorException(CursorError.NULL_PARTITION, cursor); } else if (null == cursor.getOffset()) { throw new InvalidCursorException(CursorError.NULL_OFFSET, cursor); } } final LinkedHashMap<SubscriptionCursorWithoutToken, AtomicReference<NakadiCursor>> orderingMap = new LinkedHashMap<>(); cursors.forEach(item -> orderingMap.put(item, new AtomicReference<>(null))); final Map<Version, List<SubscriptionCursorWithoutToken>> mappedByVersions = cursors.stream() .collect(Collectors.groupingBy(c -> guessVersion(c.getOffset()))); for (final Map.Entry<Version, List<SubscriptionCursorWithoutToken>> entry: mappedByVersions.entrySet()) { final List<NakadiCursor> result = converters.get(entry.getKey()).convertBatched(entry.getValue()); IntStream.range(0, entry.getValue().size()) .forEach(idx -> orderingMap.get(entry.getValue().get(idx)).set(result.get(idx))); } return orderingMap.values().stream().map(AtomicReference::get).collect(Collectors.toList()); }

Target:
public List<NakadiCursor> convert(final List<SubscriptionCursorWithoutToken> cursors) throws InternalNakadiException, NoSuchEventTypeException, ServiceUnavailableException, InvalidCursorException { final LinkedHashMap<SubscriptionCursorWithoutToken, AtomicReference<NakadiCursor>> orderingMap = new LinkedHashMap<>(); cursors.forEach(item -> orderingMap.put(item, new AtomicReference<>(null))); final Map<Version, List<SubscriptionCursorWithoutToken>> mappedByVersions = cursors.stream() .collect(Collectors.groupingBy(c -> guessVersion(c.getOffset()))); for (final Map.Entry<Version, List<SubscriptionCursorWithoutToken>> entry: mappedByVersions.entrySet()) { final List<NakadiCursor> result = converters.get(entry.getKey()).convertBatched(entry.getValue()); IntStream.range(0, entry.getValue().size()) .forEach(idx -> orderingMap.get(entry.getValue().get(idx)).set(result.get(idx))); } return orderingMap.values().stream().map(AtomicReference::get).collect(Collectors.toList()); }
Source:
private <T extends AbstractDashboardViewPortlet> T getPortlet(List<AbstractDashboardViewPortlet> portlets, Class<T> portletClass) { for (AbstractDashboardViewPortlet p : portlets) { if (portletClass.isInstance(p)) { return portletClass.cast(p); } } throw new java.util.NoSuchElementException(); }

Target:
private <T extends AbstractDashboardViewPortlet> T getPortlet(List<AbstractDashboardViewPortlet> portlets, Class<T> portletClass) { for (AbstractDashboardViewPortlet p : portlets) { if (portletClass.isInstance(p)) { return portletClass.cast(p); } } throw new java.util.NoSuchElementException(portletClass.getSimpleName()); }
Source:
public boolean equals(Object obj) { if (obj == null) return false; if (!(obj instanceof DeployDestination)) return false; DeployDestination that = (DeployDestination)obj; if (_dc == null || that._dc == null) { return false; } if (_dc.getId() != that._dc.getId()) { return false; } if (_pod == null || that._pod == null) { return false; } if (_pod.getId() != that._pod.getId()) { return false; } if (_cluster == null || that._cluster == null) { return false; } if (_cluster.getId() != that._cluster.getId()) { return false; } if (_host == null || that._host == null) { return false; } return _host.getId() == that._host.getId(); }

Target:
public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof DeployDestination)) { return false; } DeployDestination that = (DeployDestination)obj; if (this._dc == null || that._dc == null) { return false; } if (this._dc.getId() != that._dc.getId()) { return false; } if (this._pod == null || that._pod == null) { return false; } if (this._pod.getId() != that._pod.getId()) { return false; } if (this._cluster == null || that._cluster == null) { return false; } if (this._cluster.getId() != that._cluster.getId()) { return false; } if (this._host == null || that._host == null) { return false; } return this._host.getId() == that._host.getId(); }
Source:
private void onSaveVm() { UnitVmModel model = (UnitVmModel) getWindow(); String name = model.getName().getEntity(); setcurrentVm(new VM()); validateVM(model, name); }

Target:
private void onSaveVm() { UnitVmModel model = (UnitVmModel) getWindow(); String name = model.getName().getEntity(); setcurrentVm(new VM()); validateVm(model, name); }
Source:
public Span apply(@Nullable Span span) { if (span == null) return null; long startNanos = ruleMetrics.ruleStart(); List<Annotation> annotations = span.getAnnotations().stream(). filter(x -> { if (!whitelistedKeys.containsKey(x.getKey())) return false; Pattern pattern = whitelistedKeys.get(x.getKey()); return pattern == null || pattern.matcher(x.getValue()).matches(); }).collect(Collectors.toList()); if (annotations.size() < span.getAnnotations().size()) { span.setAnnotations(annotations); ruleMetrics.incrementRuleAppliedCounter(); } ruleMetrics.ruleEnd(startNanos); return span; }

Target:
public Span apply(@Nullable Span span) { if (span == null) return null; long startNanos = ruleMetrics.ruleStart(); List<Annotation> annotations = span.getAnnotations().stream(). filter(x -> whitelistedKeys.containsKey(x.getKey())). filter(x -> isPatternNullOrMatches(whitelistedKeys.get(x.getKey()), x.getValue())). collect(Collectors.toList()); if (annotations.size() < span.getAnnotations().size()) { span.setAnnotations(annotations); ruleMetrics.incrementRuleAppliedCounter(); } ruleMetrics.ruleEnd(startNanos); return span; }
Source:
public Language[] predictLanguages(CharSequence content) { double[] eval = model.getMaxentModel().eval(mContextGenerator.getContext(content.toString())); Language[] arr = new Language[eval.length]; for (int i = 0; i < eval.length; i++) { arr[i] = new Language(model.getMaxentModel().getOutcome(i), eval[i]); } Arrays.sort(arr, new Comparator<Language>() { @Override public int compare(Language o1, Language o2) { return Double.compare(o2.getConfidence(), o1.getConfidence()); } }); return arr; }

Target:
public Language[] predictLanguages(CharSequence content) { double[] eval = model.getMaxentModel().eval(mContextGenerator.getContext(content.toString())); Language[] arr = new Language[eval.length]; for (int i = 0; i < eval.length; i++) { arr[i] = new Language(model.getMaxentModel().getOutcome(i), eval[i]); } Arrays.sort(arr, (o1, o2) -> Double.compare(o2.getConfidence(), o1.getConfidence())); return arr; }
Source:
@Override protected void onEntityAdded(Entity member) { try { ((MongoDBReplicaSetImpl) entity).serverAdded((MongoDBServer) member); } catch (Exception e) { ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator((EntityLocal)member, "Failed to update replicaset", e); } }

Target:
@Override protected void onEntityAdded(Entity member) { ((MongoDBReplicaSetImpl) entity).serverAdded((MongoDBServer) member); }
Source:
public static String calcSHA1(String content) { String sha1 = null; try { MessageDigest messageDigest = MessageDigest.getInstance("SHA-1"); messageDigest.update(content.getBytes("UTF-8"), 0, content.length()); sha1 = DatatypeConverter.printHexBinary(messageDigest.digest()); sha1.toLowerCase(); } catch (UnsupportedOperationException | NoSuchAlgorithmException | UnsupportedEncodingException ex) { LOG.error("Unable to calculate sha1", ex); } return sha1; }

Target:
public static Optional<String> calcSHA1(String content) { if (content != null) { try { MessageDigest messageDigest = MessageDigest.getInstance("SHA-1"); final byte[] bytes = content.getBytes(StandardCharsets.UTF_8); messageDigest.update(bytes, 0, bytes.length); String sha1 = DatatypeConverter.printHexBinary(messageDigest.digest()).toLowerCase(); return Optional.of(sha1); } catch (UnsupportedOperationException | NoSuchAlgorithmException ex) { LOG.error("Unable to calculate SHA-1", ex); } } else { LOG.error("File descriptor content is null"); } return Optional.empty(); }
Source:
public LocalDateTime getScheduled() { return (task != null) ? task.getSchedule() : null; }

Target:
public Long getScheduled() { return (task != null) ? task.getScheduleAsLong() : null; }
Source:
public int compactPartition(String partitionPath) throws CloudStorageException { if (isShuttingDown()) { logger.info("Skipping compaction of due to shut down.", partitionPath); return 0; } Map<String, Long> checkpoints; try { checkpoints = getCompactionProgress(partitionPath); } catch (BlobStorageException | UncheckedIOException e) { throw new CloudStorageException("Compaction of " + partitionPath + " failed reading checkpoint", e); } long now = System.currentTimeMillis(); long compactionStartTime = now; long timeToQuit = now + compactionTimeLimitMs; long queryEndTime = now - retentionPeriodMs; long queryStartTime = now - TimeUnit.DAYS.toMillis(lookbackDays); Date queryEndDate = new Date(queryEndTime); int totalBlobsPurged = 0; try { long deletionStartTime = Math.max(queryStartTime, checkpoints.get(CloudBlobMetadata.FIELD_DELETION_TIME)); int numPurged = compactPartition(partitionPath, CloudBlobMetadata.FIELD_DELETION_TIME, deletionStartTime, queryEndTime, timeToQuit); logger.info("Purged deleted blobs in partition up to {}", numPurged, partitionPath, queryEndDate); totalBlobsPurged += numPurged; long expirationStartTime = Math.max(queryStartTime, checkpoints.get(CloudBlobMetadata.FIELD_EXPIRATION_TIME)); numPurged = compactPartition(partitionPath, CloudBlobMetadata.FIELD_EXPIRATION_TIME, expirationStartTime, queryEndTime, timeToQuit); logger.info("Purged expired blobs in partition up to {}", numPurged, partitionPath, queryEndDate); totalBlobsPurged += numPurged; } catch (CloudStorageException ex) { logger.error("Compaction failed for partition {}", partitionPath, ex); vcrMetrics.compactionFailureCount.inc(); } if (System.currentTimeMillis() >= timeToQuit) { logger.info("Compaction terminated due to time limit exceeded."); } if (isShuttingDown()) { logger.info("Compaction terminated due to shut down."); } long compactionTime = (System.currentTimeMillis() - compactionStartTime) / 1000; return totalBlobsPurged; }

Target:
public int compactPartition(String partitionPath) throws CloudStorageException { if (isShuttingDown()) { logger.info("Skipping compaction of due to shut down.", partitionPath); return 0; } Map<String, Long> checkpoints = getCompactionProgress(partitionPath); long now = System.currentTimeMillis(); long queryEndTime = now - retentionPeriodMs; long queryStartTime = now - TimeUnit.DAYS.toMillis(lookbackDays); int totalBlobsPurged = 0; for (String fieldName : compactionFields) { try { long optimizedStartTime = Math.max(queryStartTime, checkpoints.get(fieldName)); int numPurged = compactPartition(partitionPath, fieldName, optimizedStartTime, queryEndTime); logger.info("Purged blobs in partition based on {}", numPurged, partitionPath, fieldName); totalBlobsPurged += numPurged; } catch (CloudStorageException ex) { logger.error("Compaction failed for partition based on {}", partitionPath, fieldName, ex); vcrMetrics.compactionFailureCount.inc(); } } if (isShuttingDown()) { logger.info("Compaction terminated due to shut down."); } return totalBlobsPurged; }
Source:
public void commence(ServletRequest request, ServletResponse response, AuthenticationException authException) throws IOException, ServletException { HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.addHeader("WWW-Authenticate", "Basic realm=\"" + realmName + "\""); if (hasAccept(request, "application/vnd.go.cd.v1+json")) { httpResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED); httpResponse.getOutputStream().println("{"); httpResponse.getOutputStream().println(" \"message\": \"You are not authorized to access this resource!\""); httpResponse.getOutputStream().println("}"); return; } httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage()); }

Target:
public void commence(ServletRequest request, ServletResponse response, AuthenticationException authException) throws IOException, ServletException { HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.addHeader("WWW-Authenticate", "Basic realm=\"GoCD\""); if (hasAccept(request, "application/vnd.go.cd.v1+json")) { httpResponse.setContentType("application/vnd.go.cd.v1+json"); httpResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED); httpResponse.getOutputStream().print("{\n"); httpResponse.getOutputStream().print(" \"message\": \"You are not authorized to access this resource!\"\n"); httpResponse.getOutputStream().print("}\n"); return; } httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage()); }
Source:
public synchronized void notify(List<URL> urls) { List<URL> categoryUrls = urls.stream() .filter(this::isValidCategory) .filter(this::isNotCompatibleFor26x) .collect(Collectors.toList()); this.configurators = Configurator.toConfigurators(classifyUrls(categoryUrls, UrlUtils::isConfigure)) .orElse(configurators); toRouters(classifyUrls(categoryUrls, UrlUtils::isRoute)).ifPresent(this::addRouters); refreshOverrideAndInvoker(classifyUrls(categoryUrls, UrlUtils::isProvider)); }

Target:
public synchronized void notify(List<URL> urls) { List<URL> categoryUrls = urls.stream() .filter(this::isValidCategory) .filter(this::isNotCompatibleFor26x) .collect(Collectors.toList()); this.configurators = Configurator.toConfigurators(classifyUrls(categoryUrls, UrlUtils::isConfigurator)) .orElse(configurators); toRouters(classifyUrls(categoryUrls, UrlUtils::isRoute)).ifPresent(this::addRouters); refreshOverrideAndInvoker(classifyUrls(categoryUrls, UrlUtils::isProvider)); }