auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void generatesPersistenceXml() throws Exception { Path path = new PersistTestModuleBuilder().setDriver("org.h2.Driver") .addEntityClass(MyEntity1.class) .addEntityClass(MyEntity2.class) .setUrl("jdbc:h2:mem:test") .setUser("username") .setPassword("secret") .setLogLevel("FINE") .setPersistenceUnit("test-unit") .setExceptionHandler(MyExceptionHandler.class) .setProperty("custom-property", "value") .build() .savePersistenceXml(); URL url = Thread.currentThread().getContextClassLoader().getResource("org/eclipse/che/commons/test/db/test-persistence-1.xml"); assertNotNull(url); assertEquals(new String(Files.readAllBytes(path), UTF_8), Resources.toString(url, UTF_8)); }

Target:
public void generatesPersistenceXml() throws Exception { Path path = new PersistTestModuleBuilder().setDriver("org.h2.Driver") .addEntityClass(MyEntity1.class) .addEntityClass("org.eclipse.che.commons.test.db.PersistTestModuleBuilderTest$MyEntity2") .setUrl("jdbc:h2:mem:test") .setUser("username") .setPassword("secret") .setLogLevel("FINE") .setPersistenceUnit("test-unit") .setExceptionHandler(MyExceptionHandler.class) .setProperty("custom-property", "value") .savePersistenceXml(); URL url = Thread.currentThread().getContextClassLoader().getResource("org/eclipse/che/commons/test/db/test-persistence-1.xml"); assertNotNull(url); assertEquals(new String(Files.readAllBytes(path), UTF_8), Resources.toString(url, UTF_8)); }
Source:
public void run() { try { if (!CoverageUtil.getBranchFromUser(false)) { return; } IOseeBranch branch = CoverageUtil.getBranch(); CoveragePackageArtifactListDialog dialog = new CoveragePackageArtifactListDialog("Delete Package", "Select Package"); dialog.setInput(OseeCoveragePackageStore.getCoveragePackageArtifacts(branch)); if (dialog.open() == 0) { if (dialog.getResult().length == 0) { AWorkbench.popup("Must select coverage package."); return; } Artifact coveragePackageArtifact = (Artifact) dialog.getResult()[0]; CoveragePackage coveragePackage = OseeCoveragePackageStore.get(coveragePackageArtifact); MessageDialog cDialog = new MessageDialog( Displays.getActiveShell(), "Delete Package", null, String.format( "This will delete Coverage Package and all related Coverage Units and Test Units.\n\nDelete Package [%s]?", coveragePackage.getName()), MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0); if (cDialog.open() == 0) { SkynetTransaction transaction = TransactionManager.createTransaction(branch, "Delete Coverage Package - " + coveragePackage.getName()); CoveragePackageEvent coverageEvent = new CoveragePackageEvent(coveragePackage, CoverageEventType.Deleted); OseeCoveragePackageStore.get(coveragePackage, branch).delete(transaction, coverageEvent, false); transaction.execute(); CoverageEventManager.instance.sendRemoteEvent(coverageEvent); } } } catch (OseeCoreException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }

Target:
public void run() { try { if (!CoverageUtil.getBranchFromUser(false)) { return; } IOseeBranch branch = CoverageUtil.getBranch(); CoveragePackageArtifactListDialog dialog = new CoveragePackageArtifactListDialog("Delete Package", "Select Package"); dialog.setInput(OseeCoveragePackageStore.getCoveragePackageArtifacts(branch)); if (dialog.open() == Window.OK) { if (dialog.getResult().length == 0) { AWorkbench.popup("Must select coverage package."); return; } Artifact coveragePackageArtifact = (Artifact) dialog.getResult()[0]; CoveragePackage coveragePackage = OseeCoveragePackageStore.get(coveragePackageArtifact); MessageDialog cDialog = new MessageDialog( Displays.getActiveShell(), "Delete Package", null, String.format( "This will delete Coverage Package and all related Coverage Units and Test Units.\n\nDelete Package [%s]?", coveragePackage.getName()), MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0); if (cDialog.open() == Window.OK) { SkynetTransaction transaction = TransactionManager.createTransaction(branch, "Delete Coverage Package - " + coveragePackage.getName()); CoveragePackageEvent coverageEvent = new CoveragePackageEvent(coveragePackage, CoverageEventType.Deleted); OseeCoveragePackageStore.get(coveragePackage, branch).delete(transaction, coverageEvent, false); transaction.execute(); CoverageEventManager.instance.sendRemoteEvent(coverageEvent); } } } catch (OseeCoreException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }
Source:
public String toString() { StringBuilder sb = new StringBuilder("batch: ").append(batchType).append('\n'); for (Single q : queries) { sb.append(q.toString()).append('\n'); } sb.append("end batch"); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder("batch: ").append(batchType).append('\n'); for (Single q : queries) sb.append(q.toString()).append('\n'); sb.append("end batch"); return sb.toString(); }
Source:
private static String getRecipientNames(Set<String> recipients, String studentEmail, CourseRoster roster) { StringBuilder namesStringBuilder = new StringBuilder(); int i = 0; for (String recipient : recipients) { if (i == recipients.size() - 1 && recipients.size() > 1) { namesStringBuilder.append("and "); } StudentAttributes student = roster.getStudentForEmail(recipient); if (recipient.equals(studentEmail)) { namesStringBuilder.append("you, "); } else if (data.getCourseId().equals(recipient)) { namesStringBuilder.append("All Students In This Course, "); } else if(student != null){ if (recipients.size() == 1) { namesStringBuilder.append(student.name + " (" + student.team + ", " + student.email + "), "); } else { namesStringBuilder.append(student.name + ", "); } } else { namesStringBuilder.append(recipient + ", "); } i++; } String namesString = namesStringBuilder.toString(); return namesString.substring(0, namesString.length() - 2); }

Target:
private static String getRecipientNames(Set<String> recipients, String studentEmail, CourseRoster roster) { StringBuilder namesStringBuilder = new StringBuilder(); int i = 0; for (String recipient : recipients) { if (i == recipients.size() - 1 && recipients.size() > 1) { namesStringBuilder.append(" and "); } else if ( i > 0 && i < recipients.size() - 1 && recipients.size() > 2) { namesStringBuilder.append(", "); } StudentAttributes student = roster.getStudentForEmail(recipient); if (recipient.equals(studentEmail)) { namesStringBuilder.append("you"); } else if (data.getCourseId().equals(recipient)) { namesStringBuilder.append("All Students In This Course"); } else if(student != null){ if (recipients.size() == 1) { namesStringBuilder.append(student.name + " (" + student.team + ", " + student.email + ")"); } else { namesStringBuilder.append(student.name); } } else { namesStringBuilder.append(recipient); } i++; } String namesString = namesStringBuilder.toString(); return namesString; }
Source:
public List<AuditEntry> fetchAuditHistory(final String key, final String type, int limit) { final int theLimit = getLimitOrDefault(limit); return dbi.withHandle( new HandleCallback<List<AuditEntry>>() { @Override public List<AuditEntry> withHandle(Handle handle) throws Exception { return handle.createQuery( String.format( "SELECT payload FROM %s WHERE audit_key = :audit_key and type = :type ORDER BY created_date DESC", getAuditTable() ) ) .bind("type", type) .bind("audit_key", key) .setMaxRows(theLimit) .map( new ResultSetMapper<AuditEntry>() { @Override public AuditEntry map(int index, ResultSet r, StatementContext ctx) throws SQLException { try { return jsonMapper.readValue(r.getBytes("payload"), AuditEntry.class); } catch (IOException e) { throw new SQLException(e); } } } ) .list(); } } ); }

Target:
public List<AuditEntry> fetchAuditHistory(final String key, final String type, int limit) throws IllegalArgumentException { return fetchAuditHistoryLastEntries(key, type, limit); }
Source:
public List<SubscriptionCursorWithoutToken> calculate( final Subscription subscription, final TimelineService timelineService, final CursorConverter converter) { return subscription.getEventTypes() .stream() .map(et -> { try { final List<Timeline> activeTimelines = timelineService.getActiveTimelinesOrdered(et); return activeTimelines.get(activeTimelines.size() - 1); } catch (final NakadiException e) { throw new NakadiRuntimeException(e); } }) .collect(groupingBy(Timeline::getStorage)) .values() .stream() .flatMap(timelines -> { try { return timelineService.getTopicRepository(timelines.get(0)) .loadTopicStatistics(timelines).stream(); } catch (final ServiceUnavailableException e) { throw new NakadiRuntimeException(e); } }) .map(PartitionStatistics::getLast) .map(converter::convertToNoToken) .collect(Collectors.toList()); }

Target:
public List<SubscriptionCursorWithoutToken> calculate( final Subscription subscription, final TimelineService timelineService, final CursorConverter converter) { return subscription.getEventTypes() .stream() .map(et -> { try { final List<Timeline> activeTimelines = timelineService.getActiveTimelinesOrdered(et); return activeTimelines.get(activeTimelines.size() - 1); } catch (final NakadiException e) { throw new NakadiRuntimeException(e); } }) .collect(groupingBy(Timeline::getStorage)) .values() .stream() .flatMap(timelines -> { try { return timelineService.getTopicRepository(timelines.get(0)) .loadTopicEndStatistics(timelines).stream(); } catch (final ServiceUnavailableException e) { throw new NakadiRuntimeException(e); } }) .map(PartitionEndStatistics::getLast) .map(converter::convertToNoToken) .collect(Collectors.toList()); }
Source:
public void testCreateHeaderFromSession() { Map<String, String> result = sessionProperties.createHeaderFromSession( createTestSession( ImmutableMap.of( "string_session_prop", "123", "int_session_prop", 1, "double_session_prop", 100.0, "bool_session_prop", true))); Map<String, String> expected = ImmutableMap.of( "test_session_prop1", "123", "test_session_prop2", "1", "test_session_prop3", "100.0", "test_session_prop4", "true"); assertEquals(result, expected); }

Target:
public void testCreateHeaderFromSession() { Map<String, Object> sessionValues = ImmutableMap.<String, Object>builder() .put("string_session_prop", "123") .put("int_session_prop", 1) .put("long_session_prop", 13L) .put("double_session_prop", 100.0) .put("bool_session_prop", true) .build(); Map<String, String> result = sessionProperties.toHeader(createTestSession(sessionValues)); Map<String, String> expected = ImmutableMap.<String, String>builder() .put("test_session_prop1", "123") .put("test_session_prop2", "1") .put("test_session_prop3", "13") .put("test_session_prop4", "100.0") .put("test_session_prop5", "true") .build(); assertEquals(result, expected); }
Source:
public void memberRemoved(MembershipEvent membershipEvent) { SocketAddress removedMemberSocketAddress = membershipEvent.getMember().getSocketAddress(); Set<HazelcastInstance> hazelcastLocalInstanceSet = Hazelcast.getAllHazelcastInstances(); if (!hazelcastLocalInstanceSet.isEmpty()) { HazelcastInstance hazelcastInstance = hazelcastLocalInstanceSet.iterator().next(); Lock lock = hazelcastInstance .getLock(ApplicationContextStartEventHandler.HZ_INTERNAL_CONFIGURATION_MULTI_MAP_LOCK); lock.lock(); try { MultiMap<SocketAddress, SocketAddress> configMultiMap = hazelcastInstance .getMultiMap(ApplicationContextStartEventHandler.HZ_INTERNAL_CONFIGURATION_MULTI_MAP); if (configMultiMap.keySet().contains(removedMemberSocketAddress)) { SocketAddress newAdminSocketAddress = getNewAdminInstanceSocketAddress( configMultiMap, removedMemberSocketAddress); for (SocketAddress socketAddress : configMultiMap.values()) { if (!socketAddress.equals(removedMemberSocketAddress)) { configMultiMap.put(newAdminSocketAddress, socketAddress); } } configMultiMap.remove(removedMemberSocketAddress); } else { configMultiMap.remove(configMultiMap.keySet().iterator().next(), removedMemberSocketAddress); } } finally { lock.unlock(); } } }

Target:
public void memberRemoved(MembershipEvent membershipEvent) { SocketAddress removedMemberSocketAddress = membershipEvent.getMember().getSocketAddress(); Set<HazelcastInstance> hazelcastLocalInstanceSet = Hazelcast.getAllHazelcastInstances(); if (!hazelcastLocalInstanceSet.isEmpty()) { HazelcastInstance hazelcastInstance = hazelcastLocalInstanceSet.iterator().next(); Lock lock = hazelcastInstance .getLock(HazelcastLocalInstanceRegistrar.SPRING_INTEGRATION_INTERNAL_CLUSTER_LOCK); lock.lock(); try { MultiMap<SocketAddress, SocketAddress> configMultiMap = hazelcastInstance .getMultiMap(HazelcastLocalInstanceRegistrar.SPRING_INTEGRATION_INTERNAL_CLUSTER_MULTIMAP); if (configMultiMap.containsKey(removedMemberSocketAddress)) { SocketAddress newAdminSocketAddress = getNewAdminInstanceSocketAddress( configMultiMap, removedMemberSocketAddress); for (SocketAddress socketAddress : configMultiMap.values()) { if (!socketAddress.equals(removedMemberSocketAddress)) { configMultiMap.put(newAdminSocketAddress, socketAddress); } } configMultiMap.remove(removedMemberSocketAddress); } else { configMultiMap.remove(configMultiMap.keySet().iterator().next(), removedMemberSocketAddress); } } finally { lock.unlock(); } } }
Source:
public void copyFrom(ChunkletStore otherStore) { if (otherStore instanceof PrimitiveChunkStore) { AtomicIntegerArray data = ((PrimitiveChunkStore) otherStore).data; AtomicIntegerArray to = this.data = new AtomicIntegerArray(data.length()); int end = to.length(); while (end-- > 0) { to.set(end, data.get(end)); } } else { int wh = worldHeight; for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { for (int y = 0; y < wh; y++) { set(x, y, z, otherStore.isTrue(x, y, z)); } } } } }

Target:
public void copyFrom(ChunkletStore otherStore) { if (otherStore instanceof PrimitiveChunkStore) { AtomicIntegerArray from = ((PrimitiveChunkStore) otherStore).data; AtomicIntegerArray into = this.data = new AtomicIntegerArray( worldHeight * PAGE_SIZE ); int end = Math.min(from.length(), into.length()); while (end-- > 0) { into.set(end, from.get(end)); } } else { int worldHeight = this.worldHeight; for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { for (int y = 0; y < worldHeight; y++) { set(x, y, z, otherStore.isTrue(x, y, z)); } } } } }
Source:
public Tag(String name, String description, User author) { this.name = name.toLowerCase(); this.sluggedName = toSlug(name); this.description = description; this.author = author; }

Target:
public Tag(String name, String description, User author) { this.name = name.toLowerCase(); this.sluggedName = toSlug(name, true); this.description = description; this.author = author; }
Source:
public void generateReports_WithTrendsFile_GeneratesPages() { List<String> jsonReports = Arrays.asList(ReportGenerator.reportFromResourceJson(ReportGenerator.SAMPLE_JSON)); Configuration configuration = new Configuration(reportDirectory, "myProject"); ReportBuilder builder = new ReportBuilder(jsonReports, configuration, Collections.<String>emptyList()); configuration.setTrendsStatsFile(trendsFileTmp); Reportable result = builder.generateReports(); assertThat(countHtmlFiles()).hasSize(10); assertThat(result).isNotNull(); }

Target:
public void generateReports_WithTrendsFile_GeneratesPages() { List<String> jsonReports = Arrays.asList(ReportGenerator.reportFromResource(ReportGenerator.SAMPLE_JSON)); Configuration configuration = new Configuration(reportDirectory, "myProject"); ReportBuilder builder = new ReportBuilder(jsonReports, configuration); configuration.setTrendsStatsFile(trendsFileTmp); Reportable result = builder.generateReports(); assertThat(countHtmlFiles()).hasSize(10); assertThat(result).isNotNull(); }
Source:
public void testJsonDiskDescription() { String diskAlias = null; try { diskAlias = ImagesHandler.getJsonDiskDescription("DiskAlias", "DiskDescription"); } catch (IOException e) { } assertTrue("Should be map of disk alias and disk description", diskAlias.equals("{\"DiskDescription\":\"DiskDescription\",\"DiskAlias\":\"DiskAlias\"}")); }

Target:
public void testJsonDiskDescription() throws IOException { String jsonDescription = null; jsonDescription = ImagesHandler.getJsonDiskDescription("DiskAlias", "DiskDescription"); assertTrue("Should be map of disk alias and disk description", jsonDescription.equals("{\"DiskDescription\":\"DiskDescription\",\"DiskAlias\":\"DiskAlias\"}")); }
Source:
public boolean isOwnerOf(AccessSection section) { return RefUtil.isAnySuperSet(getOwnerOf(), section.getRefPattern()); }

Target:
public boolean isOwnerOf(AccessSection section) { return getOwnerOf().contains(section.getRefPattern()); }
Source:
public void write(byte[] data) { try { writeSafely(data); } catch (Exception e) { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); LogKitten.e(sw.toString()); } }

Target:
public void write(byte[] data) { try { writeSafely(data); } catch (UncleanStatusException e) { LogKitten.ex(e); } }
Source:
protected List<String> initialKnifeParameters() { MutableList<String> result = new MutableList<String>(); result.add("node"); result.add("show"); result.add("-l"); result.add(nodeName); result.add("--format"); result.add("json"); return result; }

Target:
protected List<String> initialKnifeParameters() { return ImmutableList.of("node", "show", "-l", nodeName, "--format", "json"); }
Source:
public static void writeTag(Tag tag, NdefMessage message) { if (tag != null) { try { Ndef ndefTag = Ndef.get(tag); if (ndefTag == null) { NdefFormatable nForm = NdefFormatable.get(tag); if (nForm != null) { nForm.connect(); nForm.format(message); nForm.close(); } } else { ndefTag.connect(); ndefTag.writeNdefMessage(message); ndefTag.close(); } } catch (Exception e) { Log.d(NfcHandler.class.getSimpleName(), "Couldn't create message", e); } } }

Target:
public static void writeTag(Tag tag, NdefMessage message) { if (tag != null) { try { Ndef ndefTag = Ndef.get(tag); if (ndefTag == null) { NdefFormatable nForm = NdefFormatable.get(tag); if (nForm != null) { nForm.connect(); nForm.format(message); nForm.close(); } } else { ndefTag.connect(); ndefTag.writeNdefMessage(message); ndefTag.close(); } } catch (IOException | FormatException e) { Log.d(TAG, "Couldn't create message", e); } } }
Source:
public CreateInternalVariableCommand(final BasicFBType fbType) { this.dataType = DataTypeLibrary.getInstance().getType("BOOL"); this.fbType = fbType; this.name = DEFAULT_VAR_NAME; this.index = fbType.getInternalVars().size() - 1; }

Target:
public CreateInternalVariableCommand(final BasicFBType fbType) { this(fbType, fbType.getInternalVars().size() - 1, null, null); }
Source:
public void deactivate() { View view = getView(); if (view == null) { return; } getDiagramEventBroker().removeNotificationListener(view, this); if (hostSemanticElement == null) { return; } for (EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) { getDiagramEventBroker().removeNotificationListener(stereotypeApplication, this); } getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this); hostSemanticElement = null; }

Target:
public void deactivate() { View view = getView(); if (view != null) { getDiagramEventBroker().removeNotificationListener(view, this); if (hostSemanticElement != null) { for (EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) { getDiagramEventBroker().removeNotificationListener(stereotypeApplication, this); } getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this); hostSemanticElement = null; } } }
Source:
private CompositeJobParametersValidator compositeJobParametersValidator(JobParameters jobParameters) { List<JobParametersValidator> jobParametersValidators = new ArrayList<>(); jobParametersValidators.add(new VariantLoaderStepParametersValidator()); jobParametersValidators.add(new FileLoaderStepParametersValidator()); Boolean skipAnnotation = Boolean.valueOf(jobParameters.getString(JobParametersNames.ANNOTATION_SKIP)); if (!skipAnnotation) { jobParametersValidators.add(new InputStudyIdValidator()); jobParametersValidators.add(new VepInputGeneratorStepParametersValidator()); jobParametersValidators.add(new VepAnnotationGeneratorStepParametersValidator()); jobParametersValidators.add(new AnnotationLoaderStepParametersValidator()); jobParametersValidators.add(new AnnotationMetadataStepParametersValidator()); } Boolean skipStats = Boolean.valueOf(jobParameters.getString(JobParametersNames.STATISTICS_SKIP)); if (!skipStats) { jobParametersValidators.add(new PopulationStatisticsGeneratorStepParametersValidator()); jobParametersValidators.add(new PopulationStatisticsLoaderStepParametersValidator()); } CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }

Target:
private CompositeJobParametersValidator compositeJobParametersValidator(JobParameters jobParameters) { List<JobParametersValidator> jobParametersValidators = new ArrayList<>(); jobParametersValidators.add(new VariantLoaderStepParametersValidator()); jobParametersValidators.add(new FileLoaderStepParametersValidator()); Boolean skipAnnotation = Boolean.valueOf(jobParameters.getString(JobParametersNames.ANNOTATION_SKIP)); if (!skipAnnotation) { boolean studyIdRequired = true; jobParametersValidators.add(new VepInputGeneratorStepParametersValidator()); jobParametersValidators.add(new VepAnnotationGeneratorStepParametersValidator(studyIdRequired)); jobParametersValidators.add(new AnnotationLoaderStepParametersValidator(studyIdRequired)); jobParametersValidators.add(new AnnotationMetadataStepParametersValidator()); } Boolean skipStats = Boolean.valueOf(jobParameters.getString(JobParametersNames.STATISTICS_SKIP)); if (!skipStats) { jobParametersValidators.add(new PopulationStatisticsGeneratorStepParametersValidator()); jobParametersValidators.add(new PopulationStatisticsLoaderStepParametersValidator()); } CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }
Source:
private static int calculateTypeWidth(Type wireType) { Type type = wireType.getConcrete(); int fcount = 0; while (type instanceof FunType) { fcount++; type = ((FunType)type).getResult(); } if (fcount > 0) { return 4 + 2*fcount; } int arity = 0; while (type instanceof TypeApp) { arity++; type = ((TypeApp)type).getTypeFun(); } if (type instanceof ListTypeCon) { return 5; } if (type instanceof TypeCon) { return 2 + arity; } return 3 + arity; }

Target:
private static int calculateTypeWidth(Type wireType) { Type type = wireType.getConcrete(); int fcount = 0; while (type instanceof FunType) { fcount++; type = ((FunType)type).getResult(); } if (fcount > 0) { return 4 + 2*fcount; } int arity = 0; while (type instanceof TypeApp) { arity++; type = ((TypeApp)type).getTypeFun(); } if (type instanceof ListTypeCon) { return 5; } return 3 + arity; }
Source:
public void testUserLogin() { User user2 = User.getUser(); assertThat(user2.getUsername(), is("name")); assertThat(user2.getPassword(), is("pwd")); assertThat(user2.getUserID(), is(USER_ID)); assertThat(user2.getGroupMemberships(), is(GROUPS)); }

Target:
public void testUserLogin() { User user = User.getUser(); assertThat(user.getUsername(), is("name")); assertThat(user.getPassword(), is("pwd")); assertThat(user.getUserID(), is(USER_ID)); assertThat(user.getGroupMemberships(), is(GROUPS)); }
Source:
public static Slice allocate(int capacity) { checkArgument(capacity < Integer.MAX_VALUE - 8, "cannot allocate slice larger than %d bytes", Integer.MAX_VALUE - 8); if (capacity == 0) { return EMPTY_SLICE; } return new Slice(new byte[capacity]); }

Target:
public static Slice allocate(int capacity) { if (capacity == 0) { return EMPTY_SLICE; } checkArgument(capacity <= MAX_ARRAY_SIZE, "cannot allocate slice larger than %s bytes", MAX_ARRAY_SIZE); return new Slice(new byte[capacity]); }
Source:
public Role createRole(String name, Role role, String description) { checkCallerAccess(); return Transaction.execute(new TransactionCallback<RoleVO>() { @Override public RoleVO doInTransaction(TransactionStatus status) { RoleVO newRoleVO = roleDao.persist(new RoleVO(name, role.getRoleType(), description)); if (newRoleVO == null) { throw new CloudRuntimeException("Unable to add role into DB, is DB full?"); } List<RolePermissionVO> rolePermissions = rolePermissionsDao.findAllByRoleIdSorted(role.getId()); if (rolePermissions != null && !rolePermissions.isEmpty()) { for (RolePermissionVO permission : rolePermissions) { rolePermissionsDao.persist(new RolePermissionVO(newRoleVO.getId(), permission.getRule().toString(), permission.getPermission(), permission.getDescription())); } } return newRoleVO; } }); }

Target:
public Role createRole(String name, Role role, String description) { checkCallerAccess(); return Transaction.execute(new TransactionCallback<RoleVO>() { @Override public RoleVO doInTransaction(TransactionStatus status) { RoleVO newRoleVO = roleDao.persist(new RoleVO(name, role.getRoleType(), description)); if (newRoleVO == null) { throw new CloudRuntimeException("Unable to create the role: " + name + ", failed to persist in DB"); } List<RolePermissionVO> rolePermissions = rolePermissionsDao.findAllByRoleIdSorted(role.getId()); if (rolePermissions != null && !rolePermissions.isEmpty()) { for (RolePermissionVO permission : rolePermissions) { rolePermissionsDao.persist(new RolePermissionVO(newRoleVO.getId(), permission.getRule().toString(), permission.getPermission(), permission.getDescription())); } } return newRoleVO; } }); }
Source:
public void apply() throws ConnectException { try { if (!storage.exists(logFile)) { log.debug("Storage does not exist"); return; } acquireLease(); log.debug("Lease acquired"); if (reader == null) { reader = new WALFile.Reader(conf.getHadoopConfiguration(), Reader.file(new Path(logFile))); } Map<WALEntry, WALEntry> entries = new HashMap<>(); WALEntry key = new WALEntry(); WALEntry value = new WALEntry(); while (reader.next(key, value)) { String keyName = key.getName(); if (keyName.equals(beginMarker)) { entries.clear(); } else if (keyName.equals(endMarker)) { for (Map.Entry<WALEntry, WALEntry> entry: entries.entrySet()) { String tempFile = entry.getKey().getName(); String committedFile = entry.getValue().getName(); RecoveryHelper.getInstance().addFile(committedFile); if (!storage.exists(committedFile)) { storage.commit(tempFile, committedFile); } } } else { WALEntry mapKey = new WALEntry(key.getName()); WALEntry mapValue = new WALEntry(value.getName()); entries.put(mapKey, mapValue); if (value.getName().equals(RecoveryHelper.RECOVERY_RECORD_KEY)) { RecoveryHelper.getInstance().addFile(value.getName()); } } } } catch (IOException e) { log.error("Error applying WAL file: {}, {}", logFile, e); close(); throw new DataException(e); } log.debug("Finished applying WAL"); }

Target:
public void apply() throws ConnectException { try { if (!storage.exists(logFile)) { log.debug("Storage does not exist"); return; } acquireLease(); log.debug("Lease acquired"); if (reader == null) { reader = new WALFile.Reader(conf.getHadoopConfiguration(), Reader.file(new Path(logFile))); } Map<WALEntry, WALEntry> entries = new HashMap<>(); WALEntry key = new WALEntry(); WALEntry value = new WALEntry(); while (reader.next(key, value)) { String keyName = key.getName(); if (keyName.equals(beginMarker)) { entries.clear(); } else if (keyName.equals(endMarker)) { for (Map.Entry<WALEntry, WALEntry> entry: entries.entrySet()) { String tempFile = entry.getKey().getName(); String committedFile = entry.getValue().getName(); RecoveryHelper.getInstance().addFile(committedFile); if (!storage.exists(committedFile)) { storage.commit(tempFile, committedFile); } } } else { WALEntry mapKey = new WALEntry(key.getName()); WALEntry mapValue = new WALEntry(value.getName()); entries.put(mapKey, mapValue); if (key.getName().equals(RecoveryHelper.RECOVERY_RECORD_KEY)) { RecoveryHelper.getInstance().addFile(value.getName()); } } } } catch (IOException e) { log.error("Error applying WAL file: {}, {}", logFile, e); close(); throw new DataException(e); } log.debug("Finished applying WAL"); }
Source:
public void visitIfStatement(IfStatementTree tree) { if (!tree.is(Kind.IF_STATEMENT) || checkedIfStatements.contains(tree)) { super.visitIfStatement(tree); return; } boolean hasElse = false; List<List<StatementTree>> branches = new ArrayList<>(); for (Tree clause : getClauses(tree)) { if (clause.is(Kind.IF_STATEMENT)) { IfStatementTree ifStatementTree = (IfStatementTree) clause; branches.add(ifStatementTree.statements()); } else if (clause.is(Kind.ELSEIF_CLAUSE)) { ElseifClauseTree elseifClauseTree = (ElseifClauseTree) clause; branches.add(elseifClauseTree.statements()); } else if (clause.is(Kind.ELSE_CLAUSE)) { ElseClauseTree elseClause = (ElseClauseTree) clause; if (!elseClause.statements().get(0).is(Kind.IF_STATEMENT)) { branches.add(elseClause.statements()); hasElse = true; } } } checkBranches("branch", branches, hasElse, tree.ifToken()); super.visitIfStatement(tree); }

Target:
public void visitIfStatement(IfStatementTree tree) { if (!tree.is(Kind.IF_STATEMENT) || checkedIfStatements.contains(tree)) { super.visitIfStatement(tree); return; } boolean hasElse = false; List<List<StatementTree>> branches = new ArrayList<>(); for (Tree clause : getClauses(tree)) { if (clause.is(Kind.IF_STATEMENT)) { IfStatementTree ifStatementTree = (IfStatementTree) clause; branches.add(ifStatementTree.statements()); } else if (clause.is(Kind.ELSEIF_CLAUSE)) { ElseifClauseTree elseifClauseTree = (ElseifClauseTree) clause; branches.add(elseifClauseTree.statements()); } else { branches.add(((ElseClauseTree) clause).statements()); hasElse = true; } } boolean reportAllDuplicate = hasElse; checkBranches("branch", branches, reportAllDuplicate, tree.ifToken()); super.visitIfStatement(tree); }
Source:
private void sendLoanRaisingCompleteNotification(LoanRaisingCompleteNotifyDto dto) { try { DateTime beginSendTime = new DateTime().withTimeAtStartOfDay().withHourOfDay(loanRaisingCompleteNotifyStartHour); DateTime endSendTime = new DateTime().withTimeAtStartOfDay().withHourOfDay(loanRaisingCompleteNotifyEndHour); if (beginSendTime.isBeforeNow() && endSendTime.isAfterNow()) { smsWrapperClient.sendLoanRaisingCompleteNotify(dto); } else { DateTime nextSendTime = beginSendTime.isBeforeNow() ? beginSendTime : beginSendTime.plusDays(1); DelayMessageDeliveryJobCreator.createLoanRaisingCompleteNotifyDelayJob(jobManager, nextSendTime.toDate(), JsonConverter.writeValueAsString(dto)); } } catch (JsonProcessingException e) { logger.info("can not send loan raising complete notify", e); } }

Target:
private void sendLoanRaisingCompleteNotification(LoanRaisingCompleteNotifyDto dto) { try { DateTime beginSendTime = new DateTime().withTimeAtStartOfDay().withHourOfDay(loanRaisingCompleteNotifyStartHour); DateTime endSendTime = new DateTime().withTimeAtStartOfDay().withHourOfDay(loanRaisingCompleteNotifyEndHour); if (beginSendTime.isBeforeNow() && endSendTime.isAfterNow()) { smsWrapperClient.sendLoanRaisingCompleteNotify(dto); } else { DateTime nextSendTime = beginSendTime.isAfterNow() ? beginSendTime : beginSendTime.plusDays(1); DelayMessageDeliveryJobCreator.createLoanRaisingCompleteNotifyDelayJob(jobManager, nextSendTime.toDate(), JsonConverter.writeValueAsString(dto)); } } catch (JsonProcessingException e) { logger.info("can not send loan raising complete notify", e); } }
Source:
private void processOutput() { CallContext callContext = getCallContexts().poll(); if(callContext != null) { calling:while (true){ if(!processOutput(callContext)) break calling; } } }

Target:
private void processOutput() { CallContext callContext = getCallContext(); if(callContext != null) { while (processOutput(callContext)); } }
Source:
public static void assertEquals(String pattern, String current){ boolean isAssertPassed = true; pattern = encodeSpecialChars(pattern); current = encodeSpecialChars(current); try { Assert.assertEquals(pattern, current); PageObjectLogging.log( "assertEquals", "assertion passed<br/>pattern: " + pattern + "<br/>current: " + current, true ); } catch(AssertionError ass){ isAssertPassed = false; addVerificationFailure(ass); PageObjectLogging.log( "assertEquals", "assertion failed<br/>pattern: " + pattern + "<br/>current: " + current, false ); } }

Target:
public static void assertEquals(String pattern, String current){ boolean isAssertPassed = true; String patternEncoded = encodeSpecialChars(pattern); String currentEncoded = encodeSpecialChars(current); try { Assert.assertEquals(pattern, current); } catch(AssertionError err){ isAssertPassed = false; addVerificationFailure(err); PageObjectLogging.log( "assertEquals", "assertion failed<br/>pattern: " + patternEncoded + "<br/>current: " + currentEncoded, false ); } PageObjectLogging.log( "assertEquals", "assertion passed<br/>pattern: " + patternEncoded + "<br/>current: " + currentEncoded, true ); }
Source:
public void setupSystemKeyspace() throws Exception { logger.info( "Initialize system keyspace" ); migrate(); cass.createColumnFamily( SYSTEM_KEYSPACE, createColumnFamilyDefinition( SYSTEM_KEYSPACE, APPLICATIONS_CF, ComparatorType.BYTESTYPE ) ); cass.createColumnFamily( SYSTEM_KEYSPACE, createColumnFamilyDefinition( SYSTEM_KEYSPACE, PROPERTIES_CF, ComparatorType.BYTESTYPE ) ); cass.createColumnFamily( SYSTEM_KEYSPACE, createColumnFamilyDefinition( SYSTEM_KEYSPACE, TOKENS_CF, ComparatorType.BYTESTYPE ) ); cass.createColumnFamily( SYSTEM_KEYSPACE, createColumnFamilyDefinition( SYSTEM_KEYSPACE, PRINCIPAL_TOKEN_CF, ComparatorType.UUIDTYPE ) ); logger.info( "System keyspace initialized" ); }

Target:
public void setupSystemKeyspace() throws Exception { logger.info( "Initialize system keyspace" ); migrate(); cass.createColumnFamily( getApplicationKeyspace(), createColumnFamilyDefinition( getApplicationKeyspace(), APPLICATIONS_CF, ComparatorType.BYTESTYPE ) ); cass.createColumnFamily( getApplicationKeyspace(), createColumnFamilyDefinition( getApplicationKeyspace(), PROPERTIES_CF, ComparatorType.BYTESTYPE ) ); cass.createColumnFamily( getApplicationKeyspace(), createColumnFamilyDefinition( getApplicationKeyspace(), TOKENS_CF, ComparatorType.BYTESTYPE ) ); cass.createColumnFamily( getApplicationKeyspace(), createColumnFamilyDefinition( getApplicationKeyspace(), PRINCIPAL_TOKEN_CF, ComparatorType.UUIDTYPE ) ); logger.info( "System keyspace initialized" ); }
Source:
public String toString() { return String.valueOf(value); }

Target:
public String toString() { return value; }
Source:
private static Set<List<JavaFileScannerContext.Location>> flowFromNode(ExplodedGraph.Node node, boolean conditionIsAlwaysTrue) { List<Class<? extends Constraint>> domains = Lists.newArrayList(ObjectConstraint.class, BooleanConstraint.class); Set<List<JavaFileScannerContext.Location>> flows = FlowComputation.flow(node, node.programState.peekValue(), domains); return flows.stream() .map(f -> addIssueLocation(f, node, conditionIsAlwaysTrue)) .collect(Collectors.toSet()); }

Target:
private static Set<List<JavaFileScannerContext.Location>> flowFromNode(ExplodedGraph.Node node, boolean conditionIsAlwaysTrue) { List<Class<? extends Constraint>> domains = Lists.newArrayList(ObjectConstraint.class, BooleanConstraint.class); Set<List<JavaFileScannerContext.Location>> flows = FlowComputation.flow(node.parent(), node.programState.peekValue(), domains); return flows.stream() .map(f -> addIssueLocation(f, node, conditionIsAlwaysTrue)) .collect(Collectors.toSet()); }
Source:
public Object start(IApplicationContext context) throws Exception { String[] arguments = (String[]) context.getArguments().get(IApplicationContext.APPLICATION_ARGS); List<String> asList = Arrays.asList(arguments); if (asList.contains("-help") || Arrays.asList(arguments).contains("--help")) { System.out.println(Messages.bind(Messages.CommandLineUsage)); return IApplication.EXIT_OK; } try { ResourcesPlugin.getWorkspace(); } catch (NoClassDefFoundError noClassError) { if (noClassError.getCause() instanceof ClassNotFoundException) { ClassNotFoundException classNotFoundException = (ClassNotFoundException) noClassError.getCause(); if (classNotFoundException.getException() instanceof BundleException) { BundleException bundleException = (BundleException) classNotFoundException.getException(); if (bundleException.getCause() instanceof IllegalStateException) { System.out.println(Messages.bind(Messages.WorkspaceRequired)); return IApplication.EXIT_OK; } } } throw noClassError; } return new CodeFormatterApplication().start(context); }

Target:
public Object start(IApplicationContext context) throws Exception { String[] arguments = (String[]) context.getArguments().get(IApplicationContext.APPLICATION_ARGS); List<String> asList = Arrays.asList(arguments); if (asList.contains("-help") || Arrays.asList(arguments).contains("--help")) { System.out.println(Messages.bind(Messages.CommandLineUsage)); return IApplication.EXIT_OK; } try { ResourcesPlugin.getWorkspace(); } catch (NoClassDefFoundError noClassError) { if (noClassError.getCause() instanceof ClassNotFoundException) { ClassNotFoundException classNotFoundException = (ClassNotFoundException) noClassError.getCause(); if (classNotFoundException.getException() instanceof BundleException) { BundleException bundleException = (BundleException) classNotFoundException.getException(); if (bundleException.getCause() instanceof IllegalStateException) { System.out.println(Messages.bind(Messages.WorkspaceRequired)); return 1; } } } throw noClassError; } return new CodeFormatterApplication().start(context); }
Source:
private static Optional<Long> timestampSeed(TimelockService timelockService) { try { return Optional.of(timelockService.getFreshTimestamp()); } catch (Exception e) { return Optional.empty(); } }

Target:
private static Optional<Long> timestampSeed(TimelockService timelockService) { try { return Optional.of(timelockService.getFreshTimestamp()); } catch (Exception e) { log.info("On node startup quorum not present", e); return Optional.empty(); } }
Source:
private static String getFailMessage(ProcessStatus result) { if (result instanceof ProcessStatusImpl) { ProcessStatus firstFail = getFirstFail(result.getChildren()); if (firstFail != null) return result.getMessage() + ": " + getFailMessage(firstFail); } return result.getMessage(); }

Target:
private static String getFailMessage(ProcessStatus result) { if (result instanceof ProcessStatus) { ProcessStatus firstFail = getFirstFail(result.getChildren()); if (firstFail != null) return result.getMessage() + ": " + getFailMessage(firstFail); } return result.getMessage(); }
Source:
void highlightView(View view) { super.highlightView(view); setBounds(0, 0, view.getWidth(), view.getHeight()); view.getOverlay().add(this); }

Target:
void highlightView(View view) { super.highlightView(view); setBounds(0, 0, view.getWidth(), view.getHeight()); }
Source:
public void streamAllEvents() throws IOException, InterruptedException { List<ServerSentEvent<String>> events = getServerSentEvents(ACTUATOR_STREAM_CIRCUITBREAKER_EVENTS); CircuitBreakerEventsEndpointResponse circuitBreakerEventsBefore = circuitBreakerEvents(ACTUATOR_CIRCUITBREAKEREVENTS); try { dummyService.doSomething(true); } catch (IOException ex) { } Thread.sleep(1000); dummyService.doSomething(false); CircuitBreakerEventsEndpointResponse circuitBreakerEventsAfter = circuitBreakerEvents(ACTUATOR_CIRCUITBREAKEREVENTS); assert (circuitBreakerEventsBefore.getCircuitBreakerEvents().size() < circuitBreakerEventsAfter.getCircuitBreakerEvents().size()); assert circuitBreakerEventsAfter.getCircuitBreakerEvents().size() > 0; Thread.sleep(1000); assert (events.size() == 2); }

Target:
public void streamAllEvents() throws IOException, InterruptedException { List<ServerSentEvent<String>> events = getServerSentEvents(ACTUATOR_STREAM_CIRCUITBREAKER_EVENTS); CircuitBreakerEventsEndpointResponse circuitBreakerEventsBefore = circuitBreakerEvents(ACTUATOR_CIRCUITBREAKEREVENTS); publishEvents(); CircuitBreakerEventsEndpointResponse circuitBreakerEventsAfter = circuitBreakerEvents(ACTUATOR_CIRCUITBREAKEREVENTS); assertThat(circuitBreakerEventsBefore.getCircuitBreakerEvents().size()).isLessThan(circuitBreakerEventsAfter.getCircuitBreakerEvents().size()); assertThat(circuitBreakerEventsAfter.getCircuitBreakerEvents().size()).isGreaterThan(0); Thread.sleep(1000); assertThat(events.size()).isEqualTo(2); }
Source:
public void testSingleDeletionDeletesMetacard() throws SourceUnavailableException, IngestException { cmd = new SearchFormsManageCommand(); cmd.setEndpointUtil(endpointUtil); cmd.setCatalogFramework(catalogFramework); cmd.singleDeletion = "1"; cmd.executeWithSubject(); List<String> idToDelete = Collections.singletonList("1"); DeleteRequest mockDeleteReq = new DeleteRequestImpl(idToDelete.toArray(new String[0])); verify(catalogFramework).delete(refEq(mockDeleteReq)); assertThat(this.getOutput(), containsString("[93mDeleted: \u001B[32m1\u001B[m")); }

Target:
public void testSingleDeletionDeletesMetacard() throws SourceUnavailableException, IngestException { cmd.singleDeletion = "1"; cmd.executeWithSubject(); List<String> idToDelete = Collections.singletonList("1"); DeleteRequest mockDeleteReq = new DeleteRequestImpl(idToDelete.toArray(new String[0])); verify(catalogFramework).delete(refEq(mockDeleteReq)); assertThat(this.getOutput(), containsString("[93mDeleted: \u001B[32m1\u001B[m")); }
Source:
public Optional<TextColor> getTeamColor() { return Optional.ofNullable(TextColorRegistryModule.enumChatColor.get(this.format)); }

Target:
public Optional<TextColor> criterion$getTeamColor() { return Optional.empty(); }
Source:
private boolean compareDistance(Point point) { double calculatedDistance = calculateDistance(point.getX(), point.getY(), this.queryPoint.getX(), this.queryPoint.getY(), this.distance.getMetric()); final boolean withinRange = calculatedDistance < this.distance.getValue(); return withinRange; }

Target:
private boolean compareDistance(Point point) { double calculatedDistance = calculateDistance(point.getX(), point.getY(), this.queryPoint.getX(), this.queryPoint.getY(), this.distance.getMetric()); return calculatedDistance < this.distance.getValue(); }
Source:
private void processDynamicElements(Menu menu, final MMenu menuModel) { if (!menu.isDisposed()) { menu.getDisplay().asyncExec(new Runnable() { public void run() { MMenuElement[] ml = menuModel.getChildren().toArray( new MMenuElement[menuModel.getChildren().size()]); for (int i = 0; i < ml.length; i++) { MMenuElement currentMenuElement = ml[i]; if (currentMenuElement instanceof MDynamicMenuContribution) { Object contribution = ((MDynamicMenuContribution) currentMenuElement) .getObject(); IEclipseContext dynamicMenuContext = EclipseContextFactory .create(); dynamicMenuContext.setParent(modelService .getContainingContext(currentMenuElement)); @SuppressWarnings("unchecked") ArrayList<MMenuElement> mel = (ArrayList<MMenuElement>) currentMenuElement .getTransientData() .get(MenuManagerShowProcessor.DYNAMIC_ELEMENT_STORAGE_KEY); dynamicMenuContext.set(List.class, mel); ContextInjectionFactory.invoke(contribution, AboutToHide.class, dynamicMenuContext); } } } }); } }

Target:
private void processDynamicElements(Menu menu, final MMenu menuModel) { if (!menu.isDisposed()) { menu.getDisplay().asyncExec(new Runnable() { public void run() { MMenuElement[] ml = menuModel.getChildren().toArray( new MMenuElement[menuModel.getChildren().size()]); for (int i = 0; i < ml.length; i++) { MMenuElement currentMenuElement = ml[i]; if (currentMenuElement instanceof MDynamicMenuContribution) { Object contribution = ((MDynamicMenuContribution) currentMenuElement) .getObject(); IEclipseContext dynamicMenuContext = EclipseContextFactory .create(); @SuppressWarnings("unchecked") ArrayList<MMenuElement> mel = (ArrayList<MMenuElement>) currentMenuElement .getTransientData() .get(MenuManagerShowProcessor.DYNAMIC_ELEMENT_STORAGE_KEY); dynamicMenuContext.set(List.class, mel); IEclipseContext parentContext = modelService .getContainingContext(currentMenuElement); ContextInjectionFactory.invoke(contribution, AboutToHide.class, dynamicMenuContext, parentContext, null); } } } }); } }
Source:
private Map<ByteArray, PersistableNetworkPayload> getMapForDataRequest() { Map<ByteArray, PersistableNetworkPayload> map = new HashMap<>(); appendOnlyDataStoreService.getServices() .forEach(service -> { Map<ByteArray, PersistableNetworkPayload> serviceMap; if (service instanceof HistoricalDataStoreService) { var historicalDataStoreService = (HistoricalDataStoreService<? extends PersistableNetworkPayloadStore>) service; serviceMap = historicalDataStoreService.getMapOfLiveData(); map.putAll(serviceMap); } else { serviceMap = service.getMap(); map.putAll(serviceMap); } log.info("We added entries from to the excluded key set of our request", serviceMap.size(), service.getClass().getSimpleName()); }); return map; }

Target:
private Map<ByteArray, PersistableNetworkPayload> getMapForDataRequest() { Map<ByteArray, PersistableNetworkPayload> map = new HashMap<>(); appendOnlyDataStoreService.getServices() .forEach(service -> { Map<ByteArray, PersistableNetworkPayload> serviceMap; if (service instanceof HistoricalDataStoreService) { var historicalDataStoreService = (HistoricalDataStoreService<? extends PersistableNetworkPayloadStore>) service; serviceMap = historicalDataStoreService.getMapOfLiveData(); } else { serviceMap = service.getMap(); } map.putAll(serviceMap); log.info("We added entries from to the excluded key set of our request", serviceMap.size(), service.getClass().getSimpleName()); }); return map; }
Source:
public static VibrationElement scale(VibrationElement element, float gamma, int maxAmplitude) { return new VibrationElement(element.duration, IntStream.of(element.channels) .map(a -> (int) (MathUtils.pow(a / (float) VibrationEffect.MAX_AMPLITUDE, gamma) * maxAmplitude)).toArray()); }

Target:
public static VibrationElement scale(VibrationElement element, float gamma, int maxAmplitude) { int[] scaledChannels = IntStream.of(element.channels) .map(a -> scale(a, gamma, maxAmplitude)).toArray(); return new VibrationElement(element.duration, scaledChannels); }
Source:
public void testAsSet_returnsSameObjects() { assertTrue("set objects must be cached and reused", asSet(new MetricTarget[]{MANAGEMENT_CENTER}) == asSet(new MetricTarget[]{MANAGEMENT_CENTER})); }

Target:
public void testAsSet_returnsSameObjects() { assertSame( MetricTarget.asSet(new MetricTarget[]{MANAGEMENT_CENTER}), MetricTarget.asSet(new MetricTarget[]{MANAGEMENT_CENTER}) ); }
Source:
private MergeTDigestFunction() { super(NAME, TDIGEST, StatisticalDigestStateFactory.createTDigestFactory()); }

Target:
private MergeTDigestFunction() { super(NAME, TDIGEST, createTDigestFactory(), true); }
Source:
public String register(SocketChannel channel, PortType portType) throws IOException { Socket socket = channel.socket(); String connectionId = generateConnectionId(channel); SelectionKey key = channel.register(nioSelector, SelectionKey.OP_READ); Transmission transmission = TransmissionFactory .getChannelWrapper(connectionId, channel, key, socket.getInetAddress().getHostAddress(), socket.getPort(), time, metrics, logger, portType, sslFactory, SSLFactory.Mode.SERVER); key.attach(transmission); this.keyMap.put(connectionId, key); activeConnections.set(this.keyMap.size()); return connectionId; }

Target:
public String register(SocketChannel channel, PortType portType) throws IOException { Socket socket = channel.socket(); String connectionId = generateConnectionId(channel); SelectionKey key = channel.register(nioSelector, SelectionKey.OP_READ); Transmission transmission = TransmissionFactory .getTransmission(connectionId, channel, key, socket.getInetAddress().getHostAddress(), socket.getPort(), time, metrics, portType, sslFactory, SSLFactory.Mode.SERVER); key.attach(transmission); this.keyMap.put(connectionId, key); activeConnections.set(this.keyMap.size()); return connectionId; }