auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
List<Cluster> computeClusters(List<Cluster> clusters) { Cluster current = new Cluster(); long prevSendTime = -1; long prevRecvTime = -1; for(Probe probe : probes_) { if(prevSendTime >= 0) { long sendDeltaMs = probe.sendTimeMs - prevSendTime; long recvDeltaMs = probe.recvTimeMs - prevRecvTime; if(sendDeltaMs >= 1 && recvDeltaMs >= 1) { ++current.numAboveMinDelta; } if(!IsWithinClusterBounds(sendDeltaMs,current)) { if(current.count >= kMinClusterSize) { clusters = addCluster(clusters,current); } current = new Cluster(); } current.sendMeanMs += sendDeltaMs; current.recvMeanMs += recvDeltaMs; current.meanSize += probe.payloadSize; ++current.count; } prevSendTime = probe.sendTimeMs; prevRecvTime = probe.recvTimeMs; } if(current.count >= kMinClusterSize) clusters = addCluster(clusters, current); return clusters; }

Target:
private void computeClusters(List<Cluster> clusters) { Cluster current = new Cluster(); long prevSendTime = -1; long prevRecvTime = -1; for(Probe probe : probes_) { if(prevSendTime >= 0) { long sendDeltaMs = probe.sendTimeMs - prevSendTime; long recvDeltaMs = probe.recvTimeMs - prevRecvTime; if(sendDeltaMs >= 1 && recvDeltaMs >= 1) { ++current.numAboveMinDelta; } if(!IsWithinClusterBounds(sendDeltaMs,current)) { if(current.count >= kMinClusterSize) { addCluster(clusters,current); } current = new Cluster(); } current.sendMeanMs += sendDeltaMs; current.recvMeanMs += recvDeltaMs; current.meanSize += probe.payloadSize; ++current.count; } prevSendTime = probe.sendTimeMs; prevRecvTime = probe.recvTimeMs; } if(current.count >= kMinClusterSize) addCluster(clusters, current); }
Source:
public StudentAttributes getStudentForRegistrationKey(String registrationKey) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, registrationKey); try { String originalKey = StringHelper.decrypt(registrationKey.trim()); CourseStudent courseStudent = getCourseStudentEntityForRegistrationKey(originalKey); if (courseStudent == null) { return null; } return new StudentAttributes(courseStudent); } catch (Exception e) { Assumption.fail("Exception thrown trying to retrieve CourseStudent \n" + TeammatesException.toStringWithStackTrace(e)); return null; } }

Target:
public StudentAttributes getStudentForRegistrationKey(String registrationKey) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, registrationKey); try { String originalKey = StringHelper.decrypt(registrationKey.trim()); CourseStudent courseStudent = getCourseStudentEntityForRegistrationKey(originalKey); if (courseStudent == null) { return null; } return new StudentAttributes(courseStudent); } catch (Exception e) { log.severe("Exception thrown trying to retrieve CourseStudent \n" + TeammatesException.toStringWithStackTrace(e)); return null; } }
Source:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), (getVmTemplateName() == null) ? "" : getVmTemplateName()); } return jobProperties; }

Target:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), (getVmTemplateName() == null) ? "" : getVmTemplateName()); } return jobProperties; }
Source:
Mono<Response<KeyVaultKey>> createEcKeyWithResponse(CreateEcKeyOptions createEcKeyOptions, Context context) { Objects.requireNonNull(createEcKeyOptions, "The Ec key options options cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() .setKty(createEcKeyOptions.getKeyType()) .setCurve(createEcKeyOptions.getCurve()) .setKeyOps(createEcKeyOptions.getKeyOperations()) .setKeyAttributes(new KeyRequestAttributes(createEcKeyOptions)); return service.createKey(endpoint, createEcKeyOptions.getName(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE, context) .doOnRequest(ignored -> logger.info("Creating Ec key - {}", createEcKeyOptions.getName())) .doOnSuccess(response -> logger.info("Created Ec key - {}", response.getValue().getName())) .doOnError(error -> logger.warning("Failed to create Ec key - {}", createEcKeyOptions.getName(), error)); }

Target:
Mono<Response<KeyVaultKey>> createEcKeyWithResponse(CreateEcKeyOptions createEcKeyOptions, Context context) { Objects.requireNonNull(createEcKeyOptions, "The Ec key options cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() .setKty(createEcKeyOptions.getKeyType()) .setCurve(createEcKeyOptions.getCurveName()) .setKeyOps(createEcKeyOptions.getKeyOperations()) .setKeyAttributes(new KeyRequestAttributes(createEcKeyOptions)); return service.createKey(vaultUrl, createEcKeyOptions.getName(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE, context) .doOnRequest(ignored -> logger.info("Creating Ec key - {}", createEcKeyOptions.getName())) .doOnSuccess(response -> logger.info("Created Ec key - {}", response.getValue().getName())) .doOnError(error -> logger.warning("Failed to create Ec key - {}", createEcKeyOptions.getName(), error)); }
Source:
private void createReviewedPanel(){ reviewedPanel = new FlowPanel(); reviewedCheckBox = new CheckBox(PatchUtil.C.reviewed() + " "); reviewedCheckBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { setReviewedByCurrentUser(event.getValue()); } }); Anchor reviewedAnchor = new Anchor(PatchUtil.C.andContinue()); reviewedAnchor.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { setReviewedByCurrentUser(true); } }); final PatchValidator unreviewedValidator = new PatchValidator() { public boolean isValid(Patch patch) { return !patch.isReviewedByCurrentUser(); } }; int nextUnreviewedPatchIndex = patchSetDetail.getNextPatch(patchIndex, true, unreviewedValidator, fileList.PREFERENCE_VALIDATOR); if (nextUnreviewedPatchIndex > -1) { final PatchLink reviewedLink = fileList.createLink(nextUnreviewedPatchIndex, getPatchScreenType(), null, null); reviewedLink.setText(""); reviewedAnchor.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { reviewedLink.go(); } }); } else { final ChangeLink upLink = new ChangeLink("", patchKey.getParentKey()); reviewedAnchor.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { upLink.go(); } }); } reviewedPanel.add(reviewedCheckBox); reviewedPanel.add(reviewedAnchor); }

Target:
private void createReviewedPanel(){ reviewedPanel = new FlowPanel(); reviewedCheckBox = new CheckBox(PatchUtil.C.reviewed() + " & "); reviewedCheckBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { setReviewedByCurrentUser(event.getValue()); } }); reviewedPanel.add(reviewedCheckBox); reviewedPanel.add(getReviewedAnchor()); }
Source:
public Mono<CosmosDatabaseResponse> createDatabase(CosmosDatabaseProperties databaseProperties, CosmosDatabaseRequestOptions options) { if (options == null) { options = new CosmosDatabaseRequestOptions(); } Database wrappedDatabase = new Database(); wrappedDatabase.setId(databaseProperties.getId()); final CosmosDatabaseRequestOptions requestOptions = options; return withContext(context -> createDatabaseInternal(wrappedDatabase, requestOptions, context)); }

Target:
public Mono<CosmosDatabaseResponse> createDatabase(CosmosDatabaseProperties databaseProperties, CosmosDatabaseRequestOptions options) { final CosmosDatabaseRequestOptions requestOptions = options == null ? new CosmosDatabaseRequestOptions() : options; Database wrappedDatabase = new Database(); wrappedDatabase.setId(databaseProperties.getId()); return withContext(context -> createDatabaseInternal(wrappedDatabase, requestOptions, context)); }
Source:
public int hashCode() { int bits = 1; bits = 31 * bits + this.minx; bits = 31 * bits + this.miny; bits = 31 * bits + this.minz; bits = 31 * bits + this.maxx; bits = 31 * bits + this.maxy; bits = 31 * bits + this.maxz; return bits; }

Target:
public int hashCode() { int bits = 1; bits = 31 * bits + this.minx; bits = 31 * bits + this.miny; bits = 31 * bits + this.minz; bits = 31 * bits + this.maxx; bits = 31 * bits + this.maxy; bits = 31 * bits + this.maxz; return bits ^ (bits >> 31); }
Source:
public void forEachTuple(ModelConsumer consumer, TupleTypeContext tupleTypeContext, EntityKeyMetadata entityKeyMetadata) { MongoDatabase db = provider.getDatabase(); MongoCollection<Document> collection = db.getCollection( entityKeyMetadata.getTable() ); consumer.consume( new MongoDBTuplesSupplier( collection, entityKeyMetadata ) ); }

Target:
public void forEachTuple(ModelConsumer consumer, TupleTypeContext tupleTypeContext, EntityKeyMetadata entityKeyMetadata) { MongoCollection<Document> collection = getCollection( entityKeyMetadata.getTable(), tupleTypeContext.getOptionsContext() ); consumer.consume( new MongoDBTuplesSupplier( collection, entityKeyMetadata ) ); }
Source:
String displayableValue(MarshallingMessage message) { if (StringUtils.nonEmpty(message.getMessageKey())) { final List<?> arguments = Optional.ofNullable(message.getMessageArguments()).orElse(Collections.emptyList()); String translation = translationService.getValue(message.getMessageKey(), arguments.stream().toArray(Object[]::new)); if (!erraiDefaultValue(message.getMessageKey()).equals(translation)) { return translation; } } return message.getMessage(); }

Target:
String displayableValue(MarshallingMessage message) { if (StringUtils.nonEmpty(message.getMessageKey())) { final List<?> arguments = Optional.ofNullable(message.getMessageArguments()).orElse(Collections.emptyList()); String translation = translationService.getValue(message.getMessageKey(), arguments.toArray(new Object[0])); if (!erraiDefaultValue(message.getMessageKey()).equals(translation)) { return translation; } } return message.getMessage(); }
Source:
public void testMean() throws Exception { Byte byte10 = 10; Byte byte20 = 20; Byte byte30 = 30; Short short10 = 10; Short short20 = 20; Short short30 = 30; Long long10 = (long) 100000000; Long long20 = (long) 200000000; Long long30 = (long) 300000000; String string10 = "-10"; String string20 = "-20"; String string30 = "-30.00"; KnoxShellTable TABLE = new KnoxShellTable(); TABLE.header("Column Integer").header("Column Double").header("Column Float").header("Column Byte").header("Column Short").header("Column Long").header("Column String"); TABLE.row().value(10).value(20d).value(20.9999).value(byte10).value(short10).value(long10).value(string10); TABLE.row().value(30).value(40d).value(40.9999).value(byte20).value(short20).value(long20).value(string20); TABLE.row().value(27).value(60d).value(60.9999).value(byte30).value(short30).value(long30).value(string30); assertEquals(22.3, TABLE.mean("Column Integer"), 0.1); assertEquals(40, TABLE.mean("Column Double"), 0.1); assertEquals(22.3, TABLE.mean(0), 0.1); assertEquals(40, TABLE.mean(1), 0.1); assertEquals(40.9999, TABLE.mean("Column Float"), 0.1); assertEquals(40.9999, TABLE.mean(2), 0.1); assertEquals(20, TABLE.mean("Column Byte"), 0.1); assertEquals(20, TABLE.mean("Column Short"), 0.1); assertEquals(2.0E8, TABLE.mean("Column Long"), 0.1); assertEquals(-20, TABLE.mean("Column String"), 0.1); }

Target:
public void testMean() throws Exception { Byte byte10 = 10; Byte byte20 = 20; Byte byte30 = 30; Short short10 = 10; Short short20 = 20; Short short30 = 30; Long long10 = (long) 100000000; Long long20 = (long) 200000000; Long long30 = (long) 300000000; String string10 = "1023.98000000000"; String string20 = "2089743.6"; String string30 = "-3"; KnoxShellTable TABLE = new KnoxShellTable(); TABLE.header("Column Integer").header("Column Double").header("Column Float").header("Column Byte").header("Column Short").header("Column Long").header("Column String"); TABLE.row().value(10).value(20d).value(20.9999).value(byte10).value(short10).value(long10).value(string10); TABLE.row().value(30).value(40d).value(40.9999).value(byte20).value(short20).value(long20).value(string20); TABLE.row().value(27).value(60d).value(60.9999).value(byte30).value(short30).value(long30).value(string30); assertEquals(22.3, TABLE.mean("Column Integer"), 0.1); assertEquals(40, TABLE.mean("Column Double"), 0.1); assertEquals(22.3, TABLE.mean(0), 0.1); assertEquals(40, TABLE.mean(1), 0.1); assertEquals(40.9999, TABLE.mean("Column Float"), 0.1); assertEquals(40.9999, TABLE.mean(2), 0.1); assertEquals(20, TABLE.mean("Column Byte"), 0.1); assertEquals(20, TABLE.mean("Column Short"), 0.1); assertEquals(2.0E8, TABLE.mean("Column Long"), 0.1); assertEquals(696921.52666666, TABLE.mean("Column String"), 0.1); }
Source:
private Session createSession() { Cluster.Builder clusterBuilder = new Cluster.Builder(); clusterBuilder.addContactPoints(cassandraNodes.toArray(new String[]{})); if (useSSL) { SSLOptions sslOptions; try { String[] defaultCipherSuites = {"TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_256_CBC_SHA"}; sslOptions = JdkSSLOptions.builder().withSSLContext(SSLContext.getDefault()) .withCipherSuites(defaultCipherSuites).build(); clusterBuilder.withSSL(sslOptions); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("SSL support is required but is not available in the JVM.", e); } } clusterBuilder.withoutJMXReporting(); Cluster cluster = clusterBuilder.build(); cluster.init(); Session createdSession = null; try { createdSession = cluster.connect("system"); return createdSession; } finally { if (createdSession == null) { cluster.close(); } } }

Target:
private void createSession() { Cluster.Builder clusterBuilder = new Cluster.Builder(); clusterBuilder.addContactPoints(cassandraNodes.toArray(new String[]{})); if (useSSL) { SSLOptions sslOptions; try { String[] defaultCipherSuites = {"TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_256_CBC_SHA"}; sslOptions = JdkSSLOptions.builder().withSSLContext(SSLContext.getDefault()) .withCipherSuites(defaultCipherSuites).build(); clusterBuilder.withSSL(sslOptions); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("SSL support is required but is not available in the JVM.", e); } } clusterBuilder.withoutJMXReporting(); this.cluster = clusterBuilder.build(); this.cluster.init(); session = null; try { session = cluster.connect(this.keyspace); } finally { if (session == null) { cluster.close(); } } }
Source:
public void testBlobNotFoundWithTwoBlobDeleted() throws Exception { ifServerRespond = true; initialize("9"); ServerErrorCode[] serverErrorCodes = {ServerErrorCode.Blob_Not_Found, ServerErrorCode.Blob_Not_Found, ServerErrorCode.Blob_Not_Found, ServerErrorCode.Blob_Not_Found, ServerErrorCode.Blob_Not_Found, ServerErrorCode.Blob_Deleted, ServerErrorCode.Blob_Not_Found, ServerErrorCode.Blob_Not_Found, ServerErrorCode.Blob_Deleted}; writeBlobRecordToServers(serverErrorCodes); future = router.deleteBlob(blobIdString, new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Error is expected."); } catch (Exception e) { assertEquals("RouterErrorCode should be BlobDeleted", RouterErrorCode.BlobDeleted, ((RouterException) e.getCause()).getErrorCode()); } assertCloseCleanup(); }

Target:
public void testBlobNotFoundWithTwoBlobDeleted() throws Exception { ServerErrorCode[] serverErrorCodes = new ServerErrorCode[9]; Arrays.fill(serverErrorCodes, ServerErrorCode.IO_Error); serverErrorCodes[5] = ServerErrorCode.Blob_Deleted; serverErrorCodes[8] = ServerErrorCode.Blob_Deleted; presetServerErrorCode(serverErrorCodes); future = router.deleteBlob(blobIdString, new ClientCallback()); future.get(); }
Source:
protected void send(String line) { Message<?> message = this.getMessageBuilderFactory().withPayload(line) .setHeader(FileHeaders.FILENAME, this.file.getName()) .setHeader(FileHeaders.ORIGINAL_FILE, this.file) .build(); super.sendMessage(message); this.updateLastReceive(); }

Target:
protected void send(String line) { Message<?> message = this.getMessageBuilderFactory().withPayload(line) .setHeader(FileHeaders.FILENAME, this.file.getName()) .setHeader(FileHeaders.ORIGINAL_FILE, this.file) .build(); super.sendMessage(message); updateLastProduce(); }
Source:
public void tearDown() throws Exception { store.clear(); }

Target:
void tearDown() { store.clear(); }
Source:
private List<InlineHyperlink> getLinks() { if (contentTable instanceof SideBySideTable) { InlineHyperlink toUnifiedDiffLink = new InlineHyperlink(); toUnifiedDiffLink.setHTML(new ImageResourceRenderer().render(Gerrit.RESOURCES.unifiedDiff())); toUnifiedDiffLink.setTargetHistoryToken(getUnifiedDiffUrl()); toUnifiedDiffLink.setTitle(PatchUtil.C.unifiedDiff()); return Collections.singletonList(toUnifiedDiffLink); } else if (contentTable instanceof UnifiedDiffTable) { InlineHyperlink toSideBySideDiffLink = new InlineHyperlink(); toSideBySideDiffLink.setHTML(new ImageResourceRenderer().render(Gerrit.RESOURCES.sideBySideDiff())); toSideBySideDiffLink.setTargetHistoryToken(getSideBySideDiffUrl()); toSideBySideDiffLink.setTitle(PatchUtil.C.sideBySideDiff()); return Collections.singletonList(toSideBySideDiffLink); } else { return Collections.emptyList(); } }

Target:
private List<InlineHyperlink> getLinks() { if (contentTable instanceof SideBySideTable) { InlineHyperlink toUnifiedDiffLink = new InlineHyperlink(); toUnifiedDiffLink.setHTML(new ImageResourceRenderer().render(Gerrit.RESOURCES.unifiedDiff())); toUnifiedDiffLink.setTargetHistoryToken(getUnifiedDiffUrl()); toUnifiedDiffLink.setTitle(PatchUtil.C.unifiedDiff()); return Collections.singletonList(toUnifiedDiffLink); } else if (contentTable instanceof UnifiedDiffTable) { InlineHyperlink toSideBySideDiffLink = new InlineHyperlink(); toSideBySideDiffLink.setHTML(new ImageResourceRenderer().render(Gerrit.RESOURCES.sideBySideDiff())); toSideBySideDiffLink.setTargetHistoryToken(getSideBySideDiffUrl()); toSideBySideDiffLink.setTitle(PatchUtil.C.sideBySideDiff()); return Collections.singletonList(toSideBySideDiffLink); } else { throw new IllegalStateException("unknown table type: " + contentTable.getClass().getSimpleName()); } }
Source:
public void releaseStore(Store<?, ?> resource) { SoftLockValueCombinedSerializerLifecycleHelper helper = createdStores.remove(resource); if (helper == null) { throw new IllegalArgumentException("Given store is not managed by this provider : " + resource); } if (resource instanceof XAStore) { XAStore<?, ?> xaStore = (XAStore<?, ?>) resource; xaStore.transactionManagerWrapper.unregisterXAResource(xaStore.uniqueXAResourceId, xaStore.recoveryXaResource); underlyingStoreProvider.releaseStore(xaStore.underlyingStore); try { Serializer<?> serializer = helper.softLockSerializerRef.getAndSet(null); if(serializer instanceof CompactJavaSerializer) { ((CompactJavaSerializer)serializer).close(); } else if(serializer instanceof CompactPersistentJavaSerializer) { ((CompactPersistentJavaSerializer)serializer).close(); } xaStore.journal.close(); } catch (IOException ioe) { throw new RuntimeException(ioe); } } else { underlyingStoreProvider.releaseStore(resource); } }

Target:
public void releaseStore(Store<?, ?> resource) { SoftLockValueCombinedSerializerLifecycleHelper helper = createdStores.remove(resource); if (helper == null) { throw new IllegalArgumentException("Given store is not managed by this provider : " + resource); } if (resource instanceof XAStore) { XAStore<?, ?> xaStore = (XAStore<?, ?>) resource; xaStore.transactionManagerWrapper.unregisterXAResource(xaStore.uniqueXAResourceId, xaStore.recoveryXaResource); underlyingStoreProvider.releaseStore(xaStore.underlyingStore); helper.softLockSerializerRef.set(null); try { xaStore.journal.close(); } catch (IOException ioe) { throw new RuntimeException(ioe); } } else { underlyingStoreProvider.releaseStore(resource); } }
Source:
public boolean readFullyOnRequest() { return false; }

Target:
public boolean readFullyOnRequest() { throw new AssertionError("not implemented"); }
Source:
private void updateLoop() { long lastRead = systemTicker.read(); while (true) { try { Thread.sleep(loopSleepMillis); long currentRead = systemTicker.read(); update(currentRead - lastRead); lastRead = currentRead; } catch (RuntimeException | Error e) { log.error("Exception while monitoring VM runtime", e); } catch (InterruptedException e) { return; } } }

Target:
private void updateLoop() { long lastRead = systemTicker.read(); while (true) { try { Thread.sleep(loopSleepMillis); sleepObjectAllocation = lastRead; long currentRead = systemTicker.read(); long sleepDuration = currentRead - lastRead; lastRead = currentRead; if (sleepDuration < 0) { if (badSystemNanoTime.compareAndSet(false, true)) { log.warn("Possible kernel or JVM bug: system nano time moved backwards"); } continue; } long sleepDelta = sleepDuration - loopSleepMillis; if (sleepDelta < 0) { continue; } update(sleepDuration); } catch (InterruptedException e) { return; } catch (RuntimeException | Error e) { log.error("Exception while monitoring VM runtime", e); } } }
Source:
public Object fetch(Object value) throws IllegalStateException { checkConfig(); if (value != null && value instanceof String) { REF ref = REF.fromValue((String) value); if (ref != null) { try (CloseableCoreSession session = CoreInstance.openCoreSession(ref.repo)) { try { DocumentModel doc; DocumentRef documentRef; switch (mode) { case ID_REF: documentRef = new IdRef(ref.ref); break; case PATH_REF: documentRef = new PathRef(ref.ref); break; default: throw new UnsupportedOperationException(); } if (!session.exists(documentRef)) { return null; } doc = session.getDocument(documentRef); doc.detach(true); return doc; } catch (DocumentNotFoundException e) { return null; } } catch (LocalException le) { return null; } } } return null; }

Target:
public Object fetch(Object value) throws IllegalStateException { checkConfig(); if (value != null && value instanceof String) { REF ref = REF.fromValue((String) value); if (ref != null) { try (CloseableCoreSession session = CoreInstance.openCoreSession(ref.repo)) { DocumentModel doc; DocumentRef docRef; switch (mode) { case ID_REF: docRef = new IdRef(ref.ref); break; case PATH_REF: docRef = new PathRef(ref.ref); break; default: throw new UnsupportedOperationException(); } if (!session.exists(docRef)) { return null; } doc = session.getDocument(docRef); doc.detach(true); return doc; } catch (LocalException le) { return null; } } } return null; }
Source:
private static boolean isVCF(final Path outPath) { return outPath != null && outPath.toString().endsWith(IOUtil.VCF_FILE_EXTENSION); }

Target:
private static boolean isVCF(final Path outPath) { return outPath != null && outPath.getFileName().toString().endsWith(IOUtil.VCF_FILE_EXTENSION); }
Source:
boolean send(final String message) { if (!shutdown) { if (qSize.get() < qCapacity) { messages.offer(message); qSize.incrementAndGet(); return true; } } return false; }

Target:
boolean send(final String message) { if (!shutdown) { if (qsize.get() < qcapacity) { messages.offer(message); qsize.incrementAndGet(); return true; } } return false; }
Source:
public static TailsResponse getAllTails(Layout layout, CorfuRuntime runtime) { Set<TailsResponse> luResponses = new HashSet<>(); Layout.LayoutSegment segment = layout.getLatestSegment(); if (segment.getReplicationMode().equals(Layout.ReplicationMode.CHAIN_REPLICATION)) { for (Layout.LayoutStripe stripe : segment.getStripes()) { TailsResponse res = CFUtils.getUninterruptibly( runtime.getLayoutView().getRuntimeLayout(layout) .getLogUnitClient(stripe.getLogServers().get(0)) .getTails()); luResponses.add(res); } } else if (segment.getReplicationMode() .equals(Layout.ReplicationMode.QUORUM_REPLICATION)) { throw new UnsupportedOperationException(); } return aggregateLogUnitTails(luResponses); }

Target:
public static TailsResponse getAllTails(Layout layout, CorfuRuntime runtime) { Set<TailsResponse> luResponses = new HashSet<>(); Layout.LayoutSegment segment = layout.getLatestSegment(); if (segment.getReplicationMode() == Layout.ReplicationMode.CHAIN_REPLICATION) { for (Layout.LayoutStripe stripe : segment.getStripes()) { TailsResponse res = CFUtils.getUninterruptibly( runtime.getLayoutView().getRuntimeLayout(layout) .getLogUnitClient(stripe.getLogServers().get(DEFAULT_LOGUNIT)) .getAllTails()); luResponses.add(res); } } else if (segment.getReplicationMode() == Layout.ReplicationMode.QUORUM_REPLICATION) { throw new UnsupportedOperationException(); } return aggregateLogUnitTails(luResponses); }
Source:
public UnsupportedMetadataVersionException(String message) { super(StatusCode.UNSUPPORTED_METADATA_VERSION, message); }

Target:
public UnsupportedMetadataVersionException(String message) { super(StatusCode.UNSUPPORTED_METADATA_VERSION, String.format(message)); }
Source:
private int getInstancePriority(WorkflowInstance instance) { return instance.priority != null ? instance.priority.intValue() : 0; }

Target:
private short getInstancePriority(WorkflowInstance instance) { return instance.priority != null ? instance.priority.shortValue() : 0; }
Source:
public static void saveKeyValueToFluo(JavaPairRDD<Key, Value> data, JavaSparkContext ctx, Connector conn, FluoConfiguration fluoConfig, Path fluoTempDir, Path failuresDir) throws Exception { Job job = Job.getInstance(ctx.hadoopConfiguration()); FileSystem hdfs = FileSystem.get(ctx.hadoopConfiguration()); if (hdfs.exists(fluoTempDir)) { hdfs.delete(fluoTempDir, true); } if (!hdfs.exists(failuresDir)) { hdfs.mkdirs(failuresDir); } AccumuloFileOutputFormat.setOutputPath(job, fluoTempDir); data.saveAsNewAPIHadoopFile(fluoTempDir.toString(), Key.class, Value.class, AccumuloFileOutputFormat.class, job.getConfiguration()); conn.tableOperations().importDirectory(fluoConfig.getAccumuloTable(), fluoTempDir.toString(), failuresDir.toString(), false); log.info("Imported data at into Fluo app {}", fluoTempDir, fluoConfig.getApplicationName()); }

Target:
public static void saveKeyValueToFluo(JavaPairRDD<Key, Value> data, JavaSparkContext ctx, Connector conn, FluoConfiguration fluoConfig, Path fluoTempDir, Path failuresDir) throws Exception { Job job = Job.getInstance(ctx.hadoopConfiguration()); FileSystem hdfs = FileSystem.get(ctx.hadoopConfiguration()); if (hdfs.exists(fluoTempDir)) { hdfs.delete(fluoTempDir, true); } if (!hdfs.exists(failuresDir)) { hdfs.mkdirs(failuresDir); } AccumuloFileOutputFormat.setOutputPath(job, fluoTempDir); data.saveAsNewAPIHadoopFile(fluoTempDir.toString(), Key.class, Value.class, AccumuloFileOutputFormat.class, job.getConfiguration()); conn.tableOperations().importDirectory(fluoConfig.getAccumuloTable(), fluoTempDir.toString(), failuresDir.toString(), false); log.info("Imported data at into Fluo table {}", fluoTempDir, fluoConfig.getApplicationName()); }
Source:
private ItunesEpfFileUpdater( String username, String password, String feedPath, String localFilesPath, S3Client s3Client ) { this.username = checkNotNull(username); this.password = checkNotNull(password); this.feedPath = checkNotNull(feedPath); this.localFilesPath = checkNotNull(localFilesPath); this.s3client = s3Client; }

Target:
private ItunesEpfFileUpdater( String username, String password, String feedPath, String localFilesPath, S3Client s3Client ) { this.username = checkNotNull(username); this.password = checkNotNull(password); this.feedPath = checkNotNull(feedPath); this.localFilesPath = checkNotNull(localFilesPath); this.s3client = checkNotNull(s3Client); }
Source:
public RestSessionCollection getSessions( @QueryParam("last_id") Long lastId, @QueryParam("page_size") Integer pageSize, @QueryParam("page_number") Integer pageNumber) { int validPageSize = QueryParamValidator.validatePageSize(Optional.fromNullable(pageSize), MAX_SESSIONS_PAGE_SIZE, DEFAULT_SESSIONS_PAGE_SIZE); return tm.begin(() -> { ProjectStore rs = rm.getProjectStore(getSiteId()); SessionStore ss = sm.getSessionStore(getSiteId()); Integer sessionRecordsNumber = ss.getTotalSessionsCount(Optional.fromNullable(lastId)); Integer page = Optional.fromNullable(pageNumber).or(1); List<StoredSessionWithLastAttempt> sessions = ss.getSessions(validPageSize, Optional.fromNullable(lastId), page); return RestModels.sessionCollection(rs, sessions, sessionRecordsNumber); }); }

Target:
public RestSessionCollection getSessions( @QueryParam("last_id") Long lastId, @QueryParam("page_size") Integer pageSize, @QueryParam("page_number") Integer pageNumber) { int validPageSize = QueryParamValidator.validatePageSize(Optional.fromNullable(pageSize), MAX_SESSIONS_PAGE_SIZE, DEFAULT_SESSIONS_PAGE_SIZE); int validPageNumber = QueryParamValidator.validatePageNumber(Optional.fromNullable(pageNumber), DEFAULT_PAGE_NUMBER); return tm.begin(() -> { ProjectStore rs = rm.getProjectStore(getSiteId()); SessionStore ss = sm.getSessionStore(getSiteId()); Integer sessionRecordsNumber = ss.getSessionsCount(Optional.fromNullable(lastId)); List<StoredSessionWithLastAttempt> sessions = ss.getSessions(validPageSize, validPageNumber, Optional.fromNullable(lastId)); return RestModels.sessionCollection(rs, sessions, sessionRecordsNumber); }); }
Source:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateErrorEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertErrorEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }

Target:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateErrorEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertErrorEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
private boolean nextBatch(VectorizedRowBatch columnarBatch) throws IOException { initRowBatch(); columnarBatch.reset(); if (rowsReturned >= totalRowCount) { return false; } checkEndOfRowGroup(); int num = (int) Math.min(VectorizedRowBatch.DEFAULT_SIZE, totalCountLoadedSoFar - rowsReturned); for (int i = 0; i < columnReaders.length; ++i) { if (columnReaders[i] == null) { continue; } columnarBatch.cols[colsToInclude.get(i)].isRepeating = true; columnReaders[i].readBatch(num, columnarBatch.cols[colsToInclude.get(i)], columnTypesList.get(colsToInclude.get(i))); } rowsReturned += num; columnarBatch.size = num; return true; }

Target:
private boolean nextBatch(VectorizedRowBatch columnarBatch) throws IOException { columnarBatch.reset(); if (rowsReturned >= totalRowCount) { return false; } checkEndOfRowGroup(); int num = (int) Math.min(VectorizedRowBatch.DEFAULT_SIZE, totalCountLoadedSoFar - rowsReturned); for (int i = 0; i < columnReaders.length; ++i) { if (columnReaders[i] == null) { continue; } columnarBatch.cols[colsToInclude.get(i)].isRepeating = true; columnReaders[i].readBatch(num, columnarBatch.cols[colsToInclude.get(i)], columnTypesList.get(colsToInclude.get(i))); } rowsReturned += num; columnarBatch.size = num; return true; }
Source:
private String retrieveParameterValueFromServletContextConfiguration(final FilterConfig filterConfig, final String propertyName) { final String value2 = filterConfig.getServletContext().getInitParameter(propertyName); if (CommonUtils.isNotBlank(value2)) { logger.info("Property loaded from ServletContext.getInitParameter with value [{}]", propertyName, value2); return value2; } return null; }

Target:
private String retrieveParameterValueFromServletContextConfiguration(final FilterConfig filterConfig, final String propertyName) { final String value = filterConfig.getServletContext().getInitParameter(propertyName); if (CommonUtils.isNotBlank(value)) { logger.info("Property loaded from ServletContext.getInitParameter with value [{}]", propertyName, value); return value; } return null; }
Source:
DataType discardDataTypeProperties() { return dataTypeManager .withDataType(getDataType()) .withName(getOldName()) .withType(getOldType()) .withConstraint(getOldConstraint()) .withConstraintType(getConstraintType()) .asList(getOldIsList()) .get(); }

Target:
DataType discardDataTypeProperties() { return dataTypeManager .withDataType(getDataType()) .withName(getOldName()) .withType(getOldType()) .withConstraint(getOldConstraint()) .withConstraintType(getOldConstraintType()) .asList(getOldIsList()) .get(); }
Source:
public List<HasMetadata> createProjectAndRoleBindings(String name, String description, String displayName, String adminUser, String requestingUser) { List<HasMetadata> result = new ArrayList<>(); Project project = getProject(name, description, displayName, requestingUser); List<HasMetadata> projectRoleBindings = getNewProjectRoleBindings(name, adminUser); ProjectOperationsImpl projectOperations = new ProjectOperationsImpl(client, OpenShiftConfig.wrap(config)); result.add(projectOperations.create(project)); NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl listOp = new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(client, config, getNamespace(), null, false, false, new ArrayList<>(), projectRoleBindings, null, DeletionPropagation.BACKGROUND, true) {}; result.addAll(listOp.createOrReplace()); return result; }

Target:
public List<HasMetadata> createProjectAndRoleBindings(String name, String description, String displayName, String adminUser, String requestingUser) { List<HasMetadata> result = new ArrayList<>(); Project project = initProject(name, description, displayName, requestingUser); List<HasMetadata> projectRoleBindings = initRoleBindings(name, adminUser); result.add(create(project)); NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl listOp = new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(client, config, getNamespace(), null, false, false, new ArrayList<>(), projectRoleBindings, null, DeletionPropagation.BACKGROUND, true) {}; result.addAll(listOp.createOrReplace()); return result; }
Source:
protected void upgradeSystemTables() throws StandardException { ConglomerateController heapCC = null; try { TabInfoImpl tII = sdd.getNonCoreTIByNumber(DataDictionary.SYSTRIGGERS_CATALOG_NUM); TableDescriptor td = sdd.getTableDescriptor( tII.getCatalogRowFactory().getCatalogName(), sdd.getSystemSchemaDescriptor(), tc ); long conglomID = td.getHeapConglomerateId(); heapCC=tc.openConglomerate(conglomID, false,0, TransactionController.MODE_RECORD, TransactionController.ISOLATION_REPEATABLE_READ); if (heapCC instanceof HBaseController) { HBaseController hCC = (HBaseController)heapCC; if (hCC.getConglomerate().getFormat_ids().length >= SYSTRIGGERSRowFactory.SYSTRIGGERS_COLUMN_COUNT) { return; } } heapCC.close(); heapCC = null; sdd.upgrade_addColumns(tII.getCatalogRowFactory(), new int[]{19,20}, tc); SpliceLogUtils.info(LOG, "Catalog upgraded: updated system table sys.systriggers"); } catch (Exception e) { SpliceLogUtils.info(LOG, "Attempt to upgrade sys.systriggers failed. Please check if it has already been upgraded and contains the correct number of columns: 18."); } finally { if (heapCC != null) heapCC.close(); } }

Target:
protected void upgradeSystemTables() throws StandardException { ConglomerateController heapCC = null; try { TabInfoImpl tII = sdd.getNonCoreTIByNumber(DataDictionary.SYSTRIGGERS_CATALOG_NUM); TableDescriptor td = sdd.getTableDescriptor( tII.getCatalogRowFactory().getCatalogName(), sdd.getSystemSchemaDescriptor(), tc ); long conglomID = td.getHeapConglomerateId(); heapCC=tc.openConglomerate(conglomID, false,0, TransactionController.MODE_RECORD, TransactionController.ISOLATION_REPEATABLE_READ); if (heapCC instanceof HBaseController) { HBaseController hCC = (HBaseController)heapCC; if (hCC.getConglomerate().getFormat_ids().length >= 20) { return; } } heapCC.close(); heapCC = null; sdd.upgrade_addColumns(tII.getCatalogRowFactory(), new int[]{19,20}, tc); SpliceLogUtils.info(LOG, "Catalog upgraded: updated system table sys.systriggers"); } catch (Exception e) { SpliceLogUtils.info(LOG, "Attempt to upgrade sys.systriggers failed. Please check if it has already been upgraded and contains the correct number of columns: 20."); } finally { if (heapCC != null) heapCC.close(); } }
Source:
for (int i = 0; i < NB_BOND; ++i) { LocalDate endDate = START_DATE[i].plus(BOND_TENOR[i]); PeriodicSchedule periodSchedule = PeriodicSchedule.of( START_DATE[i], endDate, Frequency.P6M, BUSINESS_ADJUST, StubConvention.SHORT_INITIAL, false); FixedCouponBond product = FixedCouponBond.builder() .dayCount(DAY_COUNT) .fixedRate(RATE[i]) .legalEntityId(ISSUER_ID) .currency(USD) .notional(NOTIONAL) .periodicSchedule(periodSchedule) .settlementDateOffset(SETTLEMENT_DAYS) .yieldConvention(YIELD_CONVENTION) .exCouponPeriod(EX_COUPON) .build(); BOND_PRODUCT[i] = product; Security<FixedCouponBond> bondSecurity = UnitSecurity.builder(product).standardId(BOND_SECURITY_ID).build(); BOND_SECURITY_LINK[i] = SecurityLink.resolved(bondSecurity); }

Target:
for (int i = 0; i < NB_BOND; ++i) { LocalDate endDate = START_DATE[i].plus(BOND_TENOR[i]); PeriodicSchedule periodSchedule = PeriodicSchedule.of( START_DATE[i], endDate, Frequency.P6M, BUSINESS_ADJUST, StubConvention.SHORT_INITIAL, false); FixedCouponBond product = FixedCouponBond.builder() .dayCount(DAY_COUNT) .fixedRate(RATE[i]) .legalEntityId(ISSUER_ID) .currency(USD) .notional(NOTIONAL) .periodicSchedule(periodSchedule) .settlementDateOffset(SETTLEMENT_DAYS) .yieldConvention(YIELD_CONVENTION) .exCouponPeriod(EX_COUPON) .build(); BOND_PRODUCT[i] = product; Security<FixedCouponBond> bondSecurity = UnitSecurity.builder(product).standardId(BOND_SECURITY_ID[i]).build(); BOND_SECURITY_LINK[i] = SecurityLink.resolved(bondSecurity); }
Source:
protected Notification createNotification(Intent inboundIntent) { this.parseIntent(inboundIntent); if (this.data == null || this.data.silent) { return null; } this.buildNotificationFromData(); final Notification n = builderToNotification(); if (!data.sticky) { n.flags |= Notification.FLAG_AUTO_CANCEL; } return n; }

Target:
protected Notification createNotification(Intent inboundIntent) { this.parseIntent(inboundIntent); if (this.data.silent) { MPLog.i(LOGTAG, "Notification will not be shown because \'mp_silent = true\'"); return null; } if (null == this.data) { return null; } this.buildNotificationFromData(); final Notification n = builderToNotification(); if (!data.sticky) { n.flags |= Notification.FLAG_AUTO_CANCEL; } return n; }
Source:
public void updateNotification(Notification notification) { Notification cachedNotification = getUserNotificationByType(notification.getUserId(), notification.getType()); if (cachedNotification != null) { if (cachedNotification.getWeb() != notification.getWeb() || cachedNotification.getMail() != notification.getMail() || !cachedNotification.getAttributes().equals(notification.getAttributes())) { if (!notification.getWeb() && !notification.getMail() && notification.getAttributes().isEmpty()) { try { dataManager.removeNotification(cachedNotification); } catch (SQLException error) { Log.warning(error); } notificationsLock.writeLock().lock(); try { getUserNotificationsUnsafe(notification.getUserId()).remove(cachedNotification); } finally { notificationsLock.writeLock().unlock(); } } else { notificationsLock.writeLock().lock(); try { cachedNotification.setWeb(notification.getWeb()); cachedNotification.setMail(notification.getMail()); cachedNotification.setAttributes(notification.getAttributes()); } finally { notificationsLock.writeLock().unlock(); } try { dataManager.updateNotification(cachedNotification); } catch (SQLException error) { Log.warning(error); } } } else { notification.setId(cachedNotification.getId()); } } else if (notification.getWeb() || notification.getMail() || !notification.getAttributes().isEmpty()) { try { dataManager.addNotification(notification); } catch (SQLException error) { Log.warning(error); } notificationsLock.writeLock().lock(); try { getUserNotificationsUnsafe(notification.getUserId()).add(notification); } finally { notificationsLock.writeLock().unlock(); } } }

Target:
public void updateNotification(Notification notification) { Notification cachedNotification = getUserNotificationByType(notification.getUserId(), notification.getType()); if (cachedNotification != null) { if (cachedNotification.getWeb() != notification.getWeb() || cachedNotification.getMail() != notification.getMail()) { if (!notification.getWeb() && !notification.getMail()) { try { dataManager.removeNotification(cachedNotification); } catch (SQLException error) { Log.warning(error); } notificationsLock.writeLock().lock(); try { getUserNotificationsUnsafe(notification.getUserId()).remove(cachedNotification); } finally { notificationsLock.writeLock().unlock(); } } else { notificationsLock.writeLock().lock(); try { cachedNotification.setWeb(notification.getWeb()); cachedNotification.setMail(notification.getMail()); cachedNotification.setAttributes(notification.getAttributes()); } finally { notificationsLock.writeLock().unlock(); } try { dataManager.updateNotification(cachedNotification); } catch (SQLException error) { Log.warning(error); } } } else { notification.setId(cachedNotification.getId()); } } else if (notification.getWeb() || notification.getMail()) { try { dataManager.addNotification(notification); } catch (SQLException error) { Log.warning(error); } notificationsLock.writeLock().lock(); try { getUserNotificationsUnsafe(notification.getUserId()).add(notification); } finally { notificationsLock.writeLock().unlock(); } } }
Source:
public void visitNode(Tree tree) { MethodTree methodTree = (MethodTree) tree; ClassJavaType clt; String name = "Object"; if (hasSemantic() && isCompareToMethod(methodTree) && Boolean.FALSE.equals(methodTree.isOverriding())) { clt = (ClassJavaType) methodTree.symbol().owner().type(); if (isComparableImplemented(clt)) { ClassJavaType comparableType = clt.superTypes().stream().filter(supertype -> supertype.is("java.lang.Comparable")).findFirst().get(); if (comparableType.isParameterized()) { ParametrizedTypeJavaType ptjt = (ParametrizedTypeJavaType) comparableType; name = ptjt.substitution(ptjt.typeParameters().get(0)).symbol().name(); } reportIssue((Tree) methodTree.parameters(), "Refactor this method so that its argument is of type '" + name + "'."); } } }

Target:
public void visitNode(Tree tree) { MethodTree methodTree = (MethodTree) tree; if (hasSemantic() && isCompareToMethod(methodTree) && Boolean.FALSE.equals(methodTree.isOverriding())) { ClassJavaType ownerType = (ClassJavaType) methodTree.symbol().owner().type(); ownerType.superTypes().stream().filter(supertype -> supertype.is("java.lang.Comparable")).findFirst().ifPresent( comparableType -> { String name = "Object"; if (comparableType.isParameterized()) { ParametrizedTypeJavaType ptjt = (ParametrizedTypeJavaType) comparableType; name = ptjt.substitution(ptjt.typeParameters().get(0)).symbol().name(); } reportIssue(methodTree.parameters().get(0), "Refactor this method so that its argument is of type '" + name + "'."); }); } }
Source:
protected void deleteCitationCollectionOrder(CitationCollectionOrder citationCollectionOrder) { String statement = "delete from " + m_collectionOrderTableName + " where (" + m_collectionTableId + " = ? AND " + "LOCATION = ? AND SECTION_TYPE = ? AND VALUE = ? )"; Object fields[] = new Object[4]; fields[0] = citationCollectionOrder.getCollectionId(); fields[1] = citationCollectionOrder.getLocation(); fields[2] = citationCollectionOrder.getSectiontype(); fields[3] = citationCollectionOrder.getValue(); boolean ok = m_sqlService.dbWrite(statement, fields); }

Target:
protected void deleteCitationCollectionOrder(CitationCollectionOrder citationCollectionOrder) { String statement = "delete from " + m_collectionOrderTableName + " where (" + m_collectionTableId + " = ? AND " + "LOCATION = ? )"; Object fields[] = new Object[2]; fields[0] = citationCollectionOrder.getCollectionId(); fields[1] = citationCollectionOrder.getLocation(); boolean ok = m_sqlService.dbWrite(statement, fields); }
Source:
public void testInterfaceExtension() { List<ClassReference> references = ASTProcessor.analyze(getLibraryPaths(), getSourcePaths(), Paths.get("src/test/resources/testclasses/simple/EventServer.java")); for (ClassReference reference : references) { System.out.println("Reference: " + reference); } Assert.assertTrue(references.contains(new ClassReference("java.rmi.Remote", TypeReferenceLocation.INHERITANCE, 6, 0, 117, "public interface EventServer extends Remote {"))); }

Target:
public void testInterfaceExtension() { List<ClassReference> references = ASTProcessor.analyze(getLibraryPaths(), getSourcePaths(), Paths.get("src/test/resources/testclasses/simple/EventServer.java")); Assert.assertTrue(references.contains(new ClassReference("java.rmi.Remote", ResolutionStatus.RESOLVED, TypeReferenceLocation.INHERITANCE, 6, 0, 117, "public interface EventServer extends Remote {"))); }
Source:
static <T> Future<T> ofCallable(Callable<? extends T> computation) { return of(DEFAULT_EXECUTOR_SERVICE, computation::call); }

Target:
static <T> Future<T> ofCallable(Callable<? extends T> computation) { Objects.requireNonNull(computation, "computation is null"); return of(DEFAULT_EXECUTOR_SERVICE, computation::call); }
Source:
public void initialize() { GatewayConfig configuration = getConfigAs(GatewayConfig.class); if (configuration.host == null || configuration.host.isEmpty()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Host must be specified in the configuration!"); return; } if (configuration.code == null || configuration.code.isEmpty()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Security code must be provided in the configuration!"); return; } this.gatewayURI = "coaps://" + configuration.host + ":" + configuration.port + " try { URI uri = new URI(gatewayURI); deviceClient = new TradfriCoapClient(uri); } catch (URISyntaxException e) { logger.debug("Illegal gateway URI `{}`: {}", gatewayURI, e.getMessage()); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); return; } DtlsConnectorConfig.Builder builder = new DtlsConnectorConfig.Builder(new InetSocketAddress(0)); builder.setPskStore(new StaticPskStore("", configuration.code.getBytes())); dtlsConnector = new DTLSConnector(builder.build()); endPoint = new CoapEndpoint(dtlsConnector, NetworkConfig.getStandard()); deviceClient.setEndpoint(endPoint); updateStatus(ThingStatus.UNKNOWN); scheduler.scheduleWithFixedDelay(() -> { startScan(); }, 0, 1, TimeUnit.MINUTES); }

Target:
public void initialize() { GatewayConfig configuration = getConfigAs(GatewayConfig.class); if (configuration.host == null || configuration.host.isEmpty()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Host must be specified in the configuration!"); return; } if (configuration.code == null || configuration.code.isEmpty()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Security code must be provided in the configuration!"); return; } this.gatewayURI = "coaps://" + configuration.host + ":" + configuration.port + " try { URI uri = new URI(gatewayURI); deviceClient = new TradfriCoapClient(uri); } catch (URISyntaxException e) { logger.debug("Illegal gateway URI `{}`: {}", gatewayURI, e.getMessage()); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); return; } DtlsConnectorConfig.Builder builder = new DtlsConnectorConfig.Builder(new InetSocketAddress(0)); builder.setPskStore(new StaticPskStore("", configuration.code.getBytes())); dtlsConnector = new DTLSConnector(builder.build()); endPoint = new CoapEndpoint(dtlsConnector, NetworkConfig.getStandard()); deviceClient.setEndpoint(endPoint); updateStatus(ThingStatus.UNKNOWN); scanJob = scheduler.scheduleWithFixedDelay(() -> { startScan(); }, 0, 1, TimeUnit.MINUTES); }