auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ScheduleTableView(Context context, AttributeSet attrs, @AttrRes int defStyleAttr, @StyleRes int defStyleRes) { super(context, attrs, defStyleAttr); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ScheduleTableView, defStyleAttr, defStyleRes); int itemsPaddingHorizontal = a.getDimensionPixelSize(R.styleable.ScheduleTableView_itemsPaddingHorizontal, 0); int itemsPaddingVertical = a.getDimensionPixelSize(R.styleable.ScheduleTableView_itemsPaddingVertical, 0); int rowHeightPx = a.getDimensionPixelSize(R.styleable.ScheduleTableView_rowHeight, 0); int timeSlotUnitWidthPx = a.getDimensionPixelSize(R.styleable.ScheduleTableView_timeSlotUnitWidth, 0); int timeSlotDurationMinutes = a.getInt(R.styleable.ScheduleTableView_timeSlotUnitDurationMinutes, 0); a.recycle(); int timeSlotDurationMilliseconds = timeSlotDurationMinutes * 60 * 1000; adapter = new ScheduleTableAdapter(context); setHasFixedSize(true); addItemDecoration(new TableItemPaddingDecoration(itemsPaddingHorizontal, itemsPaddingVertical)); setLayoutManager( new TableLayoutManager( rowHeightPx, timeSlotUnitWidthPx, timeSlotDurationMilliseconds, itemsPaddingHorizontal, itemsPaddingVertical)); setAdapter(adapter); }

Target:
public ScheduleTableView(Context context, AttributeSet attrs, @AttrRes int defStyleAttr, @StyleRes int defStyleRes) { super(context, attrs, defStyleAttr); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ScheduleTableView, defStyleAttr, defStyleRes); int itemsPaddingHorizontal = a.getDimensionPixelSize(R.styleable.ScheduleTableView_itemsPaddingHorizontal, 0); int itemsPaddingVertical = a.getDimensionPixelSize(R.styleable.ScheduleTableView_itemsPaddingVertical, 0); int rowHeightPx = a.getDimensionPixelSize(R.styleable.ScheduleTableView_rowHeight, 0); int timeSlotUnitWidthPx = a.getDimensionPixelSize(R.styleable.ScheduleTableView_timeSlotUnitWidth, 0); int timeSlotDurationMinutes = a.getInt(R.styleable.ScheduleTableView_timeSlotUnitDurationMinutes, 0); a.recycle(); int timeSlotDurationMilliseconds = (int) TimeUnit.MINUTES.toMillis(timeSlotDurationMinutes); adapter = new ScheduleTableAdapter(context); setHasFixedSize(true); addItemDecoration(new TableItemPaddingDecoration(itemsPaddingHorizontal, itemsPaddingVertical)); setLayoutManager( new TableLayoutManager( rowHeightPx, timeSlotUnitWidthPx, timeSlotDurationMilliseconds, itemsPaddingHorizontal, itemsPaddingVertical)); setAdapter(adapter); }
Source:
public int getNumThreads() { getReadLock().lock(); try { if (m_config.getNumThreads() <= 0) { return m_config.getNumThreads(); } else { return Runtime.getRuntime().availableProcessors() * 2; } } finally { getReadLock().unlock(); } }

Target:
public int getNumThreads() { getReadLock().lock(); try { if (m_config.getNumThreads() <= 0) { return Runtime.getRuntime().availableProcessors() * 2; } else { return m_config.getNumThreads(); } } finally { getReadLock().unlock(); } }
Source:
public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Entry<String, DockerContainerConfig> containerEntry : internalEnv.getContainers().entrySet()) { DockerContainerConfig value = containerEntry.getValue(); List<String> newVolumes = new ArrayList<>(); for (String volume : value.getVolumes()) { String[] volumeSourceTarget = volume.split(":"); if (VolumeNames.matches(volumeSourceTarget[0], "projects", identity.getWorkspaceId())) { newVolumes.add(getProjectsVolumeSpec(identity.getWorkspaceId(), volumeSourceTarget[1])); } else { newVolumes.add(volume); } } value.setVolumes(newVolumes); } }

Target:
public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Entry<String, DockerContainerConfig> containerEntry : internalEnv.getContainers().entrySet()) { DockerContainerConfig value = containerEntry.getValue(); List<String> newVolumes = new ArrayList<>(); for (String volume : value.getVolumes()) { String[] volumeSourceTarget = volume.split(":"); if (VolumeNames.matches( volumeSourceTarget[0], ProjectsVolumeForWsAgentProvisioner.PROJECTS_VOLUME_NAME, identity.getWorkspaceId())) { newVolumes.add(getProjectsVolumeSpec(identity.getWorkspaceId(), volumeSourceTarget[1])); } else { newVolumes.add(volume); } } value.setVolumes(newVolumes); } }
Source:
public final LogEventRequestType transformResponseToAuditMsg(T request, K response, AssertionType assertion, NhinTargetSystemType target, String direction, String _interface, boolean isRequesting, Properties webContextProperties, String serviceName) { setRequest(request); setAssertion(assertion); AuditMessageType auditMsg = createBaseAuditMessage(assertion, target, isRequesting, webContextProperties, serviceName); auditMsg = getParticipantObjectIdentificationForResponse(request, response, assertion, auditMsg); String userID = getUserId(auditMsg.getActiveParticipant()); AssertionHelper assertionHelper = new AssertionHelper(); if (StringUtils.isEmpty(userID)){ userID = assertionHelper.extractUserName(assertion); LOG.debug("Extract userName from assertion: {}", userID); } return buildLogEventRequestType(auditMsg, direction, getMessageCommunityId(assertion, target, isRequesting), serviceName, assertion, auditMsg.getEventIdentification().getEventID().getDisplayName(), auditMsg.getEventIdentification().getEventOutcomeIndicator(), auditMsg.getEventIdentification().getEventDateTime(), userID); }

Target:
public final LogEventRequestType transformResponseToAuditMsg(T request, K response, AssertionType assertion, NhinTargetSystemType target, String direction, String _interface, boolean isRequesting, Properties webContextProperties, String serviceName) { setRequest(request); setAssertion(assertion); AuditMessageType auditMsg = createBaseAuditMessage(assertion, target, isRequesting, webContextProperties, serviceName); auditMsg = getParticipantObjectIdentificationForResponse(request, response, assertion, auditMsg); String userID = getUserId(auditMsg.getActiveParticipant()); if (StringUtils.isEmpty(userID)){ userID = new AssertionHelper().extractUserName(assertion); LOG.debug("Extract userName from assertion: {}", userID); } return buildLogEventRequestType(auditMsg, direction, getMessageCommunityId(assertion, target, isRequesting), serviceName, assertion, auditMsg.getEventIdentification().getEventID().getDisplayName(), auditMsg.getEventIdentification().getEventOutcomeIndicator(), auditMsg.getEventIdentification().getEventDateTime(), userID); }
Source:
private void submitNetworkConfiguration(List<String> modifiedInterfaceNames, NetworkConfiguration networkConfiguration) throws KuraException { double timeout = 30; this.pendingNetworkConfigurationChange = true; if (modifiedInterfaceNames != null && !modifiedInterfaceNames.isEmpty()) { networkConfiguration.setModifiedInterfaceNames(modifiedInterfaceNames); logger.debug("Set modified interface names: {}", modifiedInterfaceNames.toString()); } this.networkConfigurationService.setNetworkConfiguration(networkConfiguration); this.configurationService.snapshot(); while (this.pendingNetworkConfigurationChange && timeout > 0) { timeout -= 0.5; try { Thread.sleep(500); } catch (InterruptedException e) { } } if (this.pendingNetworkConfigurationChange) { logger.warn("Did not receive a network configuration change event"); this.pendingNetworkConfigurationChange = false; } }

Target:
private void submitNetworkConfiguration(List<String> modifiedInterfaceNames, NetworkConfiguration networkConfiguration) throws KuraException { short timeout = 30000; final short sleep = 500; this.pendingNetworkConfigurationChange = true; if (modifiedInterfaceNames != null && !modifiedInterfaceNames.isEmpty()) { networkConfiguration.setModifiedInterfaceNames(modifiedInterfaceNames); logger.debug("Set modified interface names: {}", modifiedInterfaceNames.toString()); } this.networkConfigurationService.setNetworkConfiguration(networkConfiguration); this.configurationService.snapshot(); while (this.pendingNetworkConfigurationChange && timeout > 0) { timeout -= sleep; try { Thread.sleep(sleep); } catch (InterruptedException e) { } } if (this.pendingNetworkConfigurationChange) { logger.warn("Did not receive a network configuration change event"); this.pendingNetworkConfigurationChange = false; } }
Source:
protected PageableResult doSearch(RequestContext context) { IdentifierSourceService identifierSourceService = Context.getService(IdentifierSourceService.class); UserService service = Context.getUserService(); String source = context.getRequest().getParameter("source"); String fromDate = context.getRequest().getParameter("fromDate"); String toDate = context.getRequest().getParameter("toDate"); String identifier = context.getRequest().getParameter("identifier"); String comment = context.getRequest().getParameter("comment"); String generatedBy = context.getRequest().getParameter("generatedBy"); List<LogEntry> logEntries = new ArrayList<LogEntry>(); IdentifierSource logSource = source != null ? identifierSourceService.getIdentifierSourceByUuid(source) : null; Date dateFrom = fromDate != null ? (Date) ConversionUtil.convert(fromDate, Date.class) : null; Date dateTo = toDate != null ? (Date) ConversionUtil.convert(toDate, Date.class) : null; User user = generatedBy != null ? service.getUserByUuid(generatedBy) : null; if (logSource == null && identifier == null && comment == null && dateFrom == null && dateTo == null && user == null) { return new EmptySearchResult(); } logEntries = identifierSourceService.getLogEntries(logSource, dateFrom, dateTo, identifier, user, comment); return new NeedsPaging<LogEntry>(logEntries, context); }

Target:
protected PageableResult doSearch(RequestContext context) { IdentifierSourceService identifierSourceService = Context.getService(IdentifierSourceService.class); UserService service = Context.getUserService(); String source = context.getRequest().getParameter("source"); String fromDate = context.getRequest().getParameter("fromDate"); String toDate = context.getRequest().getParameter("toDate"); String identifier = context.getRequest().getParameter("identifier"); String comment = context.getRequest().getParameter("comment"); String generatedBy = context.getRequest().getParameter("generatedBy"); IdentifierSource logSource = source != null ? identifierSourceService.getIdentifierSourceByUuid(source) : null; Date dateFrom = fromDate != null ? (Date) ConversionUtil.convert(fromDate, Date.class) : null; Date dateTo = toDate != null ? (Date) ConversionUtil.convert(toDate, Date.class) : null; User user = generatedBy != null ? service.getUserByUuid(generatedBy) : null; if (logSource == null && identifier == null && comment == null && dateFrom == null && dateTo == null && user == null) { return new EmptySearchResult(); } List<LogEntry> logEntries = identifierSourceService.getLogEntries(logSource, dateFrom, dateTo, identifier, user, comment); return new NeedsPaging<LogEntry>(logEntries, context); }
Source:
private ValidationResult validate( ValidationResult validationResult ) { if ( StringUtils.isEmpty( this.nameTextField.getText() ) ) { final String nameCaption = Messages.getString( "ParameterDialog.Name" ); validationResult.addValidationMessage( new ValidationMessage( ValidationMessage.Severity.ERROR, Messages .getString( "ParameterDialog.ValueMustBeSetMessage", nameCaption ) ) ); } if ( this.dataFormatField.getText().contains( "Y" ) && !this.dataFormatField.getText().contains( "ww" ) ) { final String dataFormatCaption = Messages.getString( "ParameterDialog.DataFormat" ); validationResult.addValidationMessage( new ValidationMessage( ValidationMessage.Severity.ERROR, Messages .getString( "ParameterDialog.InvalidDateFormatPatter", dataFormatCaption ) ) ); } return validationResult; }

Target:
private ValidationResult validate( ValidationResult validationResult ) { if ( StringUtils.isEmpty( this.nameTextField.getText() ) ) { final String nameCaption = Messages.getString( "ParameterDialog.Name" ); validationResult.addValidationMessage( new ValidationMessage( ValidationMessage.Severity.ERROR, Messages .getString( "ParameterDialog.ValueMustBeSetMessage", nameCaption ) ) ); } if ( this.dataFormatField.getText().contains( "Y" ) && !this.dataFormatField.getText().contains( "ww" ) ) { final String dataFormatCaption = Messages.getString( "ParameterDialog.DataFormat" ); validationResult.addValidationMessage( new ValidationMessage( ValidationMessage.Severity.ERROR, Messages .getString( "ParameterDialog.InvalidDateFormatPattern", dataFormatCaption ) ) ); } return validationResult; }
Source:
public DiscoveryServiceEvent(DiscoveryServiceEventType type, String clusterId) { this.type = type; this.remoteSiteInfo = new ClusterDescriptor(clusterId, LogReplicationClusterInfo.ClusterRole.STANDBY); }

Target:
public DiscoveryServiceEvent(DiscoveryServiceEventType type, String clusterId) { this.type = type; remoteClusterInfo = new ClusterDescriptor(clusterId, LogReplicationClusterInfo.ClusterRole.STANDBY); }
Source:
public void setSwitchAuthorityRole(String switchAuthorityRole) { this.switchAuthorityRole = switchAuthorityRole; }

Target:
public void setSwitchAuthorityRole(String switchAuthorityRole) { Assert.notNull(switchAuthorityRole, "switchAuthorityRole cannot be null"); this.switchAuthorityRole = switchAuthorityRole; }
Source:
public void update(Library library) throws IOException { Library updatedLibrary = get(library.getId()); authorizationManager.throwIfNotWritable(updatedLibrary); applyChanges(updatedLibrary, library); setChangeDetails(updatedLibrary); loadChildEntities(updatedLibrary); save(updatedLibrary); }

Target:
public void update(Library library) throws IOException { Library updatedLibrary = get(library.getId()); authorizationManager.throwIfNotWritable(updatedLibrary); applyChanges(updatedLibrary, library); validateAliasOrThrow(updatedLibrary); setChangeDetails(updatedLibrary); loadChildEntities(updatedLibrary); save(updatedLibrary); }
Source:
private BaseWebInspector connect(WebkitPage webkitPage) { for (WebkitPage page : getPages()) { if (page.equals(webkitPage)) { WebInspector inspector = new WebInspector(null, webkitPage.getPageId(), protocol, bundleId, connectionKey, session); protocol.attachToPage(page.getPageId()); boolean ok = created.add(inspector); if (ok) { protocol.addListener(inspector); } for (MessageListener l : protocol.getListeners()) { if (l instanceof ConnectListener) { ((ConnectListener) l).onConnect(inspector); } } return inspector; } } throw new WebDriverException("Cannot connect to page " + webkitPage + ".Cannot find it."); }

Target:
private BaseWebInspector connect(WebkitPage webkitPage) { for (WebkitPage page : getPages()) { if (page.equals(webkitPage)) { protocol.attachToPage(page.getPageId()); WebInspector inspector = new WebInspector( null, webkitPage.getPageId(), protocol, bundleId, connectionKey, session); protocol.addListener(inspector); return inspector; } } throw new WebDriverException("Cannot connect to page " + webkitPage + ".Cannot find it."); }
Source:
private void renderRadio(int row, List<Short> columns, LabelAndValues lv) { String id = lv.info.name(); labelHelpColumn = 1 + columns.size(); labelsTable.setText(row, 0, id); CellFormatter fmt = labelsTable.getCellFormatter(); fmt.setStyleName(row, 0, style.label_name()); fmt.setStyleName(row, labelHelpColumn, style.label_help()); ApprovalInfo self = Gerrit.isSignedIn() ? lv.info.for_user(Gerrit.getUserAccount().getId().get()) : null; final LabelRadioGroup group = new LabelRadioGroup(row, id, lv.permitted.size()); for (int i = 0; i < columns.size(); i++) { Short v = columns.get(i); if (lv.permitted.contains(v)) { String text = lv.info.value_text(LabelValue.formatValue(v)); LabelRadioButton b = new LabelRadioButton(group, text, v); short dv = lv.info.defaultValue(); info("default value is: "+String.valueOf(dv)); if ((self != null && v == self.value()) || (self == null && v == dv)) { b.setValue(true); group.select(b); labelsTable.setText(row, labelHelpColumn, b.text); } group.buttons.add(b); labelsTable.setWidget(row, 1 + i, b); } } if (CODE_REVIEW.equalsIgnoreCase(id) && !group.buttons.isEmpty()) { lgtm = new Runnable() { @Override public void run() { group.selectMax(); } }; } }

Target:
private void renderRadio(int row, List<Short> columns, LabelAndValues lv) { String id = lv.info.name(); Short dv = lv.info.defaultValue(); labelHelpColumn = 1 + columns.size(); labelsTable.setText(row, 0, id); CellFormatter fmt = labelsTable.getCellFormatter(); fmt.setStyleName(row, 0, style.label_name()); fmt.setStyleName(row, labelHelpColumn, style.label_help()); ApprovalInfo self = Gerrit.isSignedIn() ? lv.info.for_user(Gerrit.getUserAccount().getId().get()) : null; final LabelRadioGroup group = new LabelRadioGroup(row, id, lv.permitted.size()); for (int i = 0; i < columns.size(); i++) { Short v = columns.get(i); if (lv.permitted.contains(v)) { String text = lv.info.value_text(LabelValue.formatValue(v)); LabelRadioButton b = new LabelRadioButton(group, text, v); if ((self != null && v == self.value()) || (self == null && v == dv)) { b.setValue(true); group.select(b); in.label(group.label, v); labelsTable.setText(row, labelHelpColumn, b.text); } group.buttons.add(b); labelsTable.setWidget(row, 1 + i, b); } } if (CODE_REVIEW.equalsIgnoreCase(id) && !group.buttons.isEmpty()) { lgtm = new Runnable() { @Override public void run() { group.selectMax(); } }; } }
Source:
public void init() { if (INSECURE_METHODS == null) { INSECURE_METHODS = new ArrayList<String>(); INSECURE_METHODS.addAll(Arrays.asList(INSECURE_DEFAULT_METHODS)); INSECURE_METHODS.addAll(Arrays.asList(WEBDAV_METHODS)); } }

Target:
public void init() { }
Source:
public Builder withProjectId(String projectId) { return (Builder) super.withProjectId(projectId); }

Target:
public Builder withProjectId(String projectId) { super.withProjectId(projectId); return this; }
Source:
public PrepScore mapRow(ResultSet rs, int rowNum) throws SQLException { PrepScore prepScore = new PrepScore(); prepScore.setScore(rs.getLong(HibernateConsts.BEHAVIOR_POINT_VALUE)); prepScore.setStudentId(rs.getLong(HibernateConsts.STUDENT_FK)); prepScore.setStartDate(rs.getDate("start_date")); prepScore.setEndDate(rs.getDate("end_date")); return prepScore; }

Target:
public PrepScore mapRow(ResultSet rs, int rowNum) throws SQLException { PrepScore prepScore = new PrepScore(); prepScore.setScore(rs.getLong(HibernateConsts.BEHAVIOR_POINT_VALUE)); prepScore.setStudentId(rs.getLong(HibernateConsts.STUDENT_FK)); prepScore.setStartDate(rs.getDate(HibernateConsts.START_DATE)); prepScore.setEndDate(rs.getDate(HibernateConsts.END_DATE)); return prepScore; }
Source:
public JobKickoffTask( final boolean runAsUserEnabled, final boolean userCreationEnabled, @NotNull final Executor executor, @NotNull final String hostname, @NotNull final Registry registry ) { this.isRunAsUserEnabled = runAsUserEnabled; this.isUserCreationEnabled = userCreationEnabled; this.executor = executor; this.hostname = hostname; this.timer = registry.timer("genie.jobs.tasks.jobKickoffTask.timer"); retryTemplate = new RetryTemplate(); retryTemplate.setBackOffPolicy(new ExponentialBackOffPolicy()); }

Target:
public JobKickoffTask( final boolean runAsUserEnabled, final boolean userCreationEnabled, @NotNull final Executor executor, @NotNull final String hostname, @NotNull final Registry registry ) { this.isRunAsUserEnabled = runAsUserEnabled; this.isUserCreationEnabled = userCreationEnabled; this.executor = executor; this.hostname = hostname; this.registry = registry; this.timer = registry.timer("genie.jobs.tasks.jobKickoffTask.timer"); retryTemplate = new RetryTemplate(); retryTemplate.setBackOffPolicy(new ExponentialBackOffPolicy()); }
Source:
public boolean reconfigureStorageProcessor(EnumMap<VmwareStorageProcessorConfigurableFields,Object> params) { VmwareStorageProcessor processor = (VmwareStorageProcessor) this.processor; try { for (VmwareStorageProcessorConfigurableFields key : params.keySet()){ switch (key){ case NFS_VERSION: Integer nfsVersion = (Integer) params.get(key); processor.setNfsVersion(nfsVersion); this._nfsVersion = nfsVersion; break; case FULL_CLONE_FLAG: boolean fullClone = (boolean) params.get(key); processor.setFullCloneFlag(fullClone); break; default: String msg = "Unknown reconfigurable field " + key.getName() + " for VmwareStorageProcessor"; throw new Exception(msg); } } return true; } catch (Exception e){ s_logger.error("Couldn't reconfigure VmwareStorageProcessor due to " + e.getMessage()); return false; } }

Target:
public boolean reconfigureStorageProcessor(EnumMap<VmwareStorageProcessorConfigurableFields,Object> params) { VmwareStorageProcessor processor = (VmwareStorageProcessor) this.processor; for (VmwareStorageProcessorConfigurableFields key : params.keySet()){ switch (key){ case NFS_VERSION: Integer nfsVersion = (Integer) params.get(key); processor.setNfsVersion(nfsVersion); this._nfsVersion = nfsVersion; break; case FULL_CLONE_FLAG: boolean fullClone = (boolean) params.get(key); processor.setFullCloneFlag(fullClone); break; default: s_logger.error("Unknown reconfigurable field " + key.getName() + " for VmwareStorageProcessor"); return false; } } return true; }
Source:
private void setupTrustManager() throws Exception{ ServerConfigurationService config = ServerConfiguration.getInstance(); TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); InputStream trustStoreInputStream = null; KeyStore clientTrustStore = null; String trustStoreFile = config.getFirstProperty("Security.TrustStore.Location"); String TRUSTSTORE_TYPE = config.getFirstProperty("Security.TrustStore.Type"); try { clientTrustStore = KeyStore.getInstance(TRUSTSTORE_TYPE); } catch (KeyStoreException e) { throw e; } try { trustStoreInputStream = new FileInputStream(trustStoreFile); } catch (FileNotFoundException e) { throw e; } try { clientTrustStore.load(trustStoreInputStream, null); } catch (IOException e) { throw e; } catch (CertificateException e) { throw e; } catch (NoSuchAlgorithmException e) { throw e; } trustManagerFactory.init(clientTrustStore); TrustManager[] trustManagers = trustManagerFactory.getTrustManagers(); for(TrustManager t : trustManagers) { if(t instanceof X509TrustManager) { trustManager = (X509TrustManager)t; System.setProperty(PROP_TRUST_STORE_UPDATE_REQUIRED, "false"); return; } } throw new NoSuchAlgorithmException("No X509TrustManager in TrustManagerFactory"); }

Target:
private void setupTrustManager() throws Exception{ TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); InputStream trustStoreInputStream = null; KeyStore clientTrustStore = null; try { clientTrustStore = KeyStore.getInstance(TRUSTSTORE_TYPE); } catch (KeyStoreException e) { throw e; } try { trustStoreInputStream = new FileInputStream(TRUSTSTORE_LOCATION); } catch (FileNotFoundException e) { throw e; } try { clientTrustStore.load(trustStoreInputStream, null); } catch (IOException e) { throw e; } catch (CertificateException e) { throw e; } catch (NoSuchAlgorithmException e) { throw e; } trustManagerFactory.init(clientTrustStore); TrustManager[] trustManagers = trustManagerFactory.getTrustManagers(); for(TrustManager t : trustManagers) { if(t instanceof X509TrustManager) { trustManager = (X509TrustManager)t; System.setProperty(PROP_TRUST_STORE_UPDATE_REQUIRED, "false"); return; } } throw new NoSuchAlgorithmException("No X509TrustManager in TrustManagerFactory"); }
Source:
public void testIsEmailValid() { assertEquals(true, EMailValidator.isEmailValid("pete@mailinator.com", null)); assertEquals(true, EMailValidator.isEmailValid(" leadingWhitespace@mailinator.com", null)); assertEquals(true, EMailValidator.isEmailValid("trailingWhitespace@mailinator.com ", null)); assertEquals(false, EMailValidator.isEmailValid("elisah.da mota@example.com", null)); assertEquals(false, EMailValidator.isEmailValid("pete1@mailinator.com;pete2@mailinator.com", null)); assertEquals(true, EMailValidator.isEmailValid("michélle.pereboom@example.com", null)); assertEquals(true, EMailValidator.isEmailValid("begüm.vriezen@example.com", null)); assertEquals(true, EMailValidator.isEmailValid("lótus.gonçalves@example.com", null)); assertEquals(true, EMailValidator.isEmailValid("lótus.gonçalves@éxample.com", null)); assertEquals(true, EMailValidator.isEmailValid("begüm.vriezen@example.cologne", null)); assertEquals(true, EMailValidator.isEmailValid("رونیکا.محمدخان@example.com", null)); assertEquals(false, EMailValidator.isEmailValid("lótus.gonçalves@example.cóm", null)); assertEquals(false, EMailValidator.isEmailValid("dora@.com", null)); assertEquals(false, EMailValidator.isEmailValid("", null)); assertEquals(false, EMailValidator.isEmailValid(null, null)); assertEquals(true, EMailValidator.isEmailValid("ziller@wiso.uni-koeln.de", null)); assertEquals(true, EMailValidator.isEmailValid("jayned@essex.ac.uk", null)); }

Target:
public void testIsEmailValid() { assertEquals(true, EMailValidator.isEmailValid("pete@mailinator.com", null)); assertEquals(true, EMailValidator.isEmailValid(" leadingWhitespace@mailinator.com", null)); assertEquals(true, EMailValidator.isEmailValid("trailingWhitespace@mailinator.com ", null)); assertEquals(false, EMailValidator.isEmailValid("elisah.da mota@example.com", null)); assertEquals(false, EMailValidator.isEmailValid("pete1@mailinator.com;pete2@mailinator.com", null)); assertEquals(true, EMailValidator.isEmailValid("michélle.pereboom@example.com", null)); assertEquals(true, EMailValidator.isEmailValid("begüm.vriezen@example.com", null)); assertEquals(true, EMailValidator.isEmailValid("lótus.gonçalves@example.com", null)); assertEquals(true, EMailValidator.isEmailValid("lótus.gonçalves@éxample.com", null)); assertEquals(true, EMailValidator.isEmailValid("begüm.vriezen@example.cologne", null)); assertEquals(true, EMailValidator.isEmailValid("رونیکا.محمدخان@example.com", null)); assertEquals(false, EMailValidator.isEmailValid("lótus.gonçalves@example.cóm", null)); assertEquals(false, EMailValidator.isEmailValid("dora@.com", null)); assertEquals(false, EMailValidator.isEmailValid("", null)); assertEquals(false, EMailValidator.isEmailValid(null, null)); assertEquals(true, EMailValidator.isEmailValid("blah@wiso.uni-unc.de", null)); assertEquals(true, EMailValidator.isEmailValid("foo@essex.co.uk", null)); assertEquals(true, EMailValidator.isEmailValid("jack@bu.cloud", null)); }
Source:
public void stdlib_symbols() { Map<String, Symbol> mathSymbols = TypeShed.standardLibrarySymbols("math").stream().collect(Collectors.toMap(Symbol::name, Function.identity())); assertThat(mathSymbols).hasSize(54); Symbol acosSymbol = mathSymbols.get("acos"); assertThat(acosSymbol.kind()).isEqualTo(Symbol.Kind.FUNCTION); assertThat(((FunctionSymbolImpl) acosSymbol).declaredReturnType().canOnlyBe("float")).isTrue(); assertThat(TypeShed.standardLibrarySymbol("math", "math.acos")).isSameAs(acosSymbol); Map<String, Symbol> threadingSymbols = TypeShed.standardLibrarySymbols("threading").stream().collect(Collectors.toMap(Symbol::name, Function.identity())); assertThat(threadingSymbols.get("Thread").kind()).isEqualTo(Symbol.Kind.CLASS); Map<String, Symbol> imaplibSymbols = TypeShed.standardLibrarySymbols("imaplib").stream().collect(Collectors.toMap(Symbol::name, Function.identity())); assertThat(imaplibSymbols).hasSize(27); }

Target:
public void stdlib_symbols() { Map<String, Symbol> mathSymbols = TypeShed.standardLibrarySymbols("math").stream().collect(Collectors.toMap(Symbol::name, Function.identity())); Symbol acosSymbol = mathSymbols.get("acos"); assertThat(acosSymbol.kind()).isEqualTo(Symbol.Kind.FUNCTION); assertThat(((FunctionSymbolImpl) acosSymbol).declaredReturnType().canOnlyBe("float")).isTrue(); assertThat(TypeShed.standardLibrarySymbol("math", "math.acos")).isSameAs(acosSymbol); Map<String, Symbol> threadingSymbols = TypeShed.standardLibrarySymbols("threading").stream().collect(Collectors.toMap(Symbol::name, Function.identity())); assertThat(threadingSymbols.get("Thread").kind()).isEqualTo(Symbol.Kind.CLASS); Map<String, Symbol> imaplibSymbols = TypeShed.standardLibrarySymbols("imaplib").stream().collect(Collectors.toMap(Symbol::name, Function.identity())); assertThat(imaplibSymbols).isNotEmpty(); }
Source:
public int hashCode() { int result = methodName.hashCode(); result = 31 * result + Arrays.hashCode(parameterTypes); result = 31 * result + declaringClass.hashCode(); return result; }

Target:
public int hashCode() { return Objects.hashCode(declaringClass, methodName, parameterTypes); }
Source:
public void execute(Tuple tuple) { if (timeBasedRetention) { expireAndAckTimedOutEntries(lookupBuffer); } String streamId = getStreamSelector(tuple); if ( isLookupStream(streamId) ) { String key = makeLookupTupleKey(tuple); if(dropOlderDuplicates) lookupBuffer.removeAll(key); lookupBuffer.put(key, new TupleInfo(tuple) ); if(timeBasedRetention) { timeTracker.add(System.currentTimeMillis()); } else { if (lookupBuffer.size() > retentionCount) { TupleInfo expired = removeHead(lookupBuffer); if( (joinType==JoinType.RIGHT) || (joinType==JoinType.OUTER) ) { emitUnMatchedTuples(expired); } collector.ack(expired.tuple); } } } else if (isDataStream(streamId) ) { List<TupleInfo> matches = matchWithLookupStream(tuple); if (matches==null || matches.isEmpty() ) { if (joinType==JoinType.LEFT || joinType==JoinType.OUTER ) { ArrayList<Object> outputTuple = doProjection(tuple, null); emit(outputTuple, tuple); return; } collector.ack(tuple); } for (TupleInfo lookupTuple : matches) { lookupTuple.unmatched = false; ArrayList<Object> outputTuple = doProjection(lookupTuple.tuple, tuple); emit(outputTuple, tuple, lookupTuple.tuple); } collector.ack(tuple); } else { LOG.warn("Received tuple from unexpected stream/source : {}. Tuple will be dropped.", streamId); } }

Target:
public void execute(Tuple tuple) { long currTime = System.currentTimeMillis(); for (JoinInfo joinInfo : joinInfos) { joinInfo.expireAndAckTimedOutEntries(collector, currTime); } if (TupleUtils.isTick(tuple)) return; try { String stream = streamKind.getStreamId(tuple); if (stream.equalsIgnoreCase(fromStream)) processFromStreamTuple(tuple, currTime); else if(stream.equalsIgnoreCase(joinStream)) processJoinStreamTuple(tuple, currTime); else throw new InvalidTuple("Source component/streamId for Tuple not part of streams being joined : " + stream, tuple); } catch (InvalidTuple e) { collector.ack(tuple); LOG.warn("{}. Tuple will be dropped.", e.toString()); } }
Source:
public CreditCurveZeroRateSensitivity mapSensitivity(DoubleUnaryOperator operator) { return new CreditCurveZeroRateSensitivity(curveCurrency, legalEntityId, yearFraction, currency, operator.applyAsDouble(sensitivity)); }

Target:
public CreditCurveZeroRateSensitivity mapSensitivity(DoubleUnaryOperator operator) { return new CreditCurveZeroRateSensitivity(legalEntityId, zeroRateSensitivity.mapSensitivity(operator)); }
Source:
synchronized public void testCrud() throws Exception { int counter = 0; verifyNumberOfHealthMonitors(counter); DtoHealthMonitor healthMonitor = createStockHealthMonitor(); verifyNumberOfHealthMonitors(++counter); DtoHealthMonitor healthMonitor2 = createStockHealthMonitor(); verifyNumberOfHealthMonitors(++counter); dtoResource.postAndVerifyStatus(topLevelHealthMonitorsUri, APPLICATION_HEALTH_MONITOR_JSON(), healthMonitor2, CONFLICT.getStatusCode()); verifyNumberOfHealthMonitors(counter); DtoHealthMonitor newHealthMonitor = getHealthMonitor(healthMonitor.getUri()); Assert.assertEquals(newHealthMonitor, healthMonitor); DtoHealthMonitor newHealthMonitor2 = getHealthMonitor(healthMonitor2.getUri()); Assert.assertEquals(newHealthMonitor2, healthMonitor2); newHealthMonitor.setAdminStateUp(false); DtoHealthMonitor updatedHealthMonitor = updateHealthMonitor(newHealthMonitor); Assert.assertEquals(updatedHealthMonitor, newHealthMonitor); Assert.assertNotSame(updatedHealthMonitor, healthMonitor); deleteHealthMonitor(healthMonitor.getUri()); verifyNumberOfHealthMonitors(--counter); deleteHealthMonitor(healthMonitor2.getUri()); verifyNumberOfHealthMonitors(--counter); ClientResponse response = resource().uri(healthMonitor.getUri()) .delete(ClientResponse.class); assertHealthMonitorNotFound(healthMonitor.getId(), response); response = resource().uri(healthMonitor.getUri()) .type(APPLICATION_HEALTH_MONITOR_JSON()) .put(ClientResponse.class, healthMonitor); assertHealthMonitorNotFound(healthMonitor.getId(), response); }

Target:
synchronized public void testCrud() throws Exception { int counter = 0; verifyNumberOfHealthMonitors(counter); DtoHealthMonitor healthMonitor = createStockHealthMonitor(); verifyNumberOfHealthMonitors(++counter); DtoHealthMonitor healthMonitor2 = createStockHealthMonitor(); verifyNumberOfHealthMonitors(++counter); dtoResource.postAndVerifyStatus(topLevelHealthMonitorsUri, APPLICATION_HEALTH_MONITOR_JSON(), healthMonitor2, CONFLICT.getStatusCode()); verifyNumberOfHealthMonitors(counter); DtoHealthMonitor newHealthMonitor = getHealthMonitor(healthMonitor.getUri()); Assert.assertEquals(newHealthMonitor, healthMonitor); DtoHealthMonitor newHealthMonitor2 = getHealthMonitor(healthMonitor2.getUri()); Assert.assertEquals(newHealthMonitor2, healthMonitor2); newHealthMonitor.setAdminStateUp(false); DtoHealthMonitor updatedHealthMonitor = updateHealthMonitor(newHealthMonitor); Assert.assertEquals(updatedHealthMonitor, newHealthMonitor); Assert.assertNotSame(updatedHealthMonitor, healthMonitor); deleteHealthMonitor(healthMonitor.getUri()); verifyNumberOfHealthMonitors(--counter); deleteHealthMonitor(healthMonitor2.getUri()); verifyNumberOfHealthMonitors(--counter); ClientResponse response = resource().uri(healthMonitor.getUri()) .delete(ClientResponse.class); assertEquals(204, response.getStatus()); response = resource().uri(healthMonitor.getUri()) .type(APPLICATION_HEALTH_MONITOR_JSON()) .put(ClientResponse.class, healthMonitor); assertHealthMonitorNotFound(healthMonitor.getId(), response); }
Source:
public Map<String, Object> toMap(){ final ImmutableList<String> propertiesName = properties.stream() .map(property -> property.getName()) .collect(toImmutableList()); return map("id", id, "label", label, "properties", propertiesName, "clazz", clazz, "helpText", helpText); }

Target:
public Map<String, Object> toMap(){ final ImmutableList<String> propertiesName = properties.stream() .map(ContentTypeFieldProperties::getName) .collect(toImmutableList()); return imap("id", id, "label", label, "properties", propertiesName, "clazz", clazz, "helpText", helpText); }
Source:
public SSLServerSocket createSSLServerSocket(int port) throws IOException { try { SSLServerSocket srvSock = null; SSLServerSocketFactory ssf = sslContext.getServerSocketFactory(); srvSock = (SSLServerSocket)ssf.createServerSocket(port); srvSock.setEnabledProtocols(SSLUtils.getSupportedProtocols(srvSock.getEnabledProtocols())); s_logger.info("create SSL server socket on port: " + port); return srvSock; } catch (Exception ioe) { s_logger.error(ioe.toString(), ioe); } return null; }

Target:
public SSLServerSocket createSSLServerSocket(int port) throws IOException { try { SSLServerSocket srvSock = null; SSLServerSocketFactory ssf = sslContext.getServerSocketFactory(); srvSock = (SSLServerSocket)ssf.createServerSocket(port); srvSock.setEnabledProtocols(SSLUtils.getSupportedProtocols(srvSock.getEnabledProtocols())); srvSock.setEnabledCipherSuites(SSLUtils.getSupportedProtocols(srvSock.getEnabledCipherSuites())); s_logger.info("create SSL server socket on port: " + port); return srvSock; } catch (Exception ioe) { s_logger.error(ioe.toString(), ioe); } return null; }
Source:
public Optional<StatisticGroup> getById(String id) { return Optional.ofNullable(this.groupMappings.get(checkNotNull(id).toLowerCase())); }

Target:
public Optional<StatisticGroup> getById(String id) { return Optional.ofNullable(this.groupMappings.get(checkNotNull(id).toLowerCase(Locale.ENGLISH))); }
Source:
public int execute() throws Exception { terminal.println("Downloading..."); validateParms(); if (verifyConnection) { verifyRepoConnection(); } val listed = objectId.size() > 0; if (listed) { return downloadObjects(objectId); } else { if (manifestResource.isGnosManifest()) { terminal .printError( "Manifest '%s' looks like a GNOS-format manifest file. Please ensure you are using a tab-delimited text file" + " manifest from <LINK_0>", manifestResource.getValue()); return FAILURE_STATUS; } val manifest = manifestService.getDownloadManifest(manifestResource); validateManifest(manifest); val entries = manifest.getEntries(); if (entries.isEmpty()) { terminal.printError("Manifest '%s' is empty", manifestResource); return FAILURE_STATUS; } return downloadObjects(manifest.getEntries().stream().map(entry -> entry.getFileUuid()).collect(toList())); } }

Target:
public int execute() throws Exception { validateParms(); if (verifyConnection) { verifyRepoConnection(); } terminal.println("Downloading..."); val listed = objectId.size() > 0; if (listed) { return downloadObjects(objectId); } else { if (manifestResource.isGnosManifest()) { terminal .printError( "Manifest '%s' looks like a GNOS-format manifest file. Please ensure you are using a tab-delimited text file" + " manifest from <LINK_0>", manifestResource.getValue()); return FAILURE_STATUS; } val manifest = manifestService.getDownloadManifest(manifestResource); validateManifest(manifest); val entries = manifest.getEntries(); if (entries.isEmpty()) { terminal.printError("Manifest '%s' is empty", manifestResource); return FAILURE_STATUS; } return downloadObjects(manifest.getEntries().stream().map(entry -> entry.getFileUuid()).collect(toList())); } }
Source:
public void testInvalidAddress() throws Throwable { Configuration conf = new Configuration(); Socket socket = NetUtils.getDefaultSocketFactory(conf) .createSocket(); socket.bind(new InetSocketAddress("127.0.0.1", 0)); try { NetUtils.connect(socket, new InetSocketAddress("invalid-test-host", 0), 20000); socket.close(); fail("Should not have connected"); } catch (UnknownHostException ce) { System.err.println("Got exception: " + ce); } }

Target:
public void testInvalidAddress() throws Throwable { Configuration conf = new Configuration(); Socket socket = NetUtils.getDefaultSocketFactory(conf) .createSocket(); socket.bind(new InetSocketAddress("127.0.0.1", 0)); try { NetUtils.connect(socket, new InetSocketAddress("invalid-test-host", 0), 20000); socket.close(); fail("Should not have connected"); } catch (UnknownHostException uhe) { LOG.info("Got exception: ", uhe); } }
Source:
private KalturaLiveEntry onClientConnect(WMSProperties properties, HashMap<String, String> requestParams) throws KalturaApiException, ClientConnectException, Exception { if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_ENTRY_ID)){ throw new ClientConnectException("Missing argument: entryId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_TOKEN)){ throw new ClientConnectException("Missing argument: token"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_PARTNER_ID)){ throw new ClientConnectException("Missing argument: partnerId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_SERVER_INDEX)){ throw new ClientConnectException("Missing argument: server index"); } int partnerId = Integer.parseInt(requestParams.get(Constants.REQUEST_PROPERTY_PARTNER_ID)); String entryId = requestParams.get(Constants.REQUEST_PROPERTY_ENTRY_ID); String token = requestParams.get(Constants.REQUEST_PROPERTY_TOKEN); KalturaEntryServerNodeType serverIndex = KalturaEntryServerNodeType.get(requestParams.get(Constants.REQUEST_PROPERTY_SERVER_INDEX)); KalturaLiveEntry liveEntry = KalturaAPI.getKalturaAPI().authenticate(entryId, partnerId, token, serverIndex); KalturaEntryDataPersistence.setProperty(entryId, Constants.CLIENT_PROPERTY_KALTURA_LIVE_ENTRY, liveEntry); logger.info("Entry added [" + entryId + "]"); return liveEntry; }

Target:
private KalturaLiveEntry onClientConnect(WMSProperties properties, HashMap<String, String> requestParams) throws KalturaApiException, ClientConnectException, Exception { if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_ENTRY_ID)){ throw new ClientConnectException("Missing argument: entryId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_TOKEN)){ throw new ClientConnectException("Missing argument: token"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_PARTNER_ID)){ throw new ClientConnectException("Missing argument: partnerId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_SERVER_INDEX)){ throw new ClientConnectException("Missing argument: server index"); } int partnerId = Integer.parseInt(requestParams.get(Constants.REQUEST_PROPERTY_PARTNER_ID)); String entryId = requestParams.get(Constants.REQUEST_PROPERTY_ENTRY_ID); String token = requestParams.get(Constants.REQUEST_PROPERTY_TOKEN); KalturaEntryServerNodeType serverIndex = KalturaEntryServerNodeType.get(requestParams.get(Constants.REQUEST_PROPERTY_SERVER_INDEX)); KalturaLiveEntry liveEntry = KalturaAPI.getKalturaAPI().authenticate(entryId, partnerId, token, serverIndex); KalturaEntryDataPersistence.setProperty(entryId, Constants.CLIENT_PROPERTY_KALTURA_LIVE_ENTRY, liveEntry); synchronized(properties) { properties.setProperty(Constants.CLIENT_PROPERTY_SERVER_INDEX, requestParams.get(Constants.REQUEST_PROPERTY_SERVER_INDEX)); properties.setProperty(Constants.KALTURA_LIVE_ENTRY_ID, liveEntry.id); } logger.info("Entry added [" + entryId + "]"); return liveEntry; }
Source:
public void onTopologyChange(TopologyChangedEvent event) { ConsistentHash ch = event.getWriteConsistentHashAtEnd(); Set<Integer> localSegments = ch.getMembers().contains(rpcManager.getAddress()) ? ch.getSegmentsForOwner(rpcManager.getAddress()) : Collections.emptySet(); Iterator<Object> it = remoteBias.keySet().iterator(); while (it.hasNext()) { if (!localSegments.contains(keyPartitioner.getSegment(it.next()))) { it.remove(); } } ConsistentHash previousHash = event.getReadConsistentHashAtStart(); if (previousHash != null && !previousHash.getMembers().contains(rpcManager.getAddress())) { localBias.clear(); } }

Target:
public void onTopologyChange(TopologyChangedEvent event) { ConsistentHash ch = event.getWriteConsistentHashAtEnd(); Set<Integer> localSegments = ch.getMembers().contains(rpcManager.getAddress()) ? ch.getSegmentsForOwner(rpcManager.getAddress()) : Collections.emptySet(); remoteBias.keySet().removeIf(key -> !localSegments.contains(keyPartitioner.getSegment(key))); ConsistentHash previousHash = event.getReadConsistentHashAtStart(); if (previousHash != null && !previousHash.getMembers().contains(rpcManager.getAddress())) { localBias.clear(); } }
Source:
public boolean equals(Object other) { if (other == null || !(other instanceof VdcParameter)) { return false; } VdcParameter otherParam = (VdcParameter) other; return getName().equals(otherParam.getName()) && getJavaType().equals(otherParam.getJavaType()) && getGuid().equals(otherParam.getGuid()); }

Target:
public boolean equals(Object other) { if (other == null || !(other instanceof VdcParameter)) { return false; } return getGuid().equals(((VdcParameter) other).getGuid()); }
Source:
public Header isHeroImageVisible() { wait.forElementVisible(headerWithHeroImage); PageObjectLogging.log("Hero image", MercuryMessages.VISIBLE_MSG, true); return this; }

Target:
public boolean isHeroImageVisible() { try { return header.getAttribute("class").contains("has-hero-image"); } catch (TimeoutException | ElementNotFoundException e) { return false; } }
Source:
public void testIsAllNotSatisfied() { Bundle bundle = mock(Bundle.class); Dictionary<String, String> headers = new Hashtable<>(); headers.put("Bundle-SymbolicName", "bundle3"); when(bundle.getHeaders()).thenReturn(headers); BundleNameCondition bundleNameCondition2 = new BundleNameCondition( bundle, new ConditionInfo( BundleNameCondition.class.getName(), new String[] {"bundle1/bundle2"})); bundle = mock(Bundle.class); headers = new Hashtable<>(); headers.put("Bundle-SymbolicName", "bundle4"); when(bundle.getHeaders()).thenReturn(headers); BundleNameCondition bundleNameCondition1 = new BundleNameCondition( bundle, new ConditionInfo( BundleNameCondition.class.getName(), new String[] {"bundle1/bundle2"})); boolean satisfied = bundleNameCondition1.isSatisfied( new Condition[] {bundleNameCondition1, bundleNameCondition2}, null); assertThat(satisfied, is(false)); }

Target:
public void testIsAllNotSatisfied() { Bundle bundle = mock(Bundle.class); Dictionary<String, String> headers = new Hashtable<>(); headers.put("Bundle-SymbolicName", "bundle3"); when(bundle.getHeaders()).thenReturn(headers); BundleNameCondition bundleNameCondition2 = new BundleNameCondition( bundle, new ConditionInfo( BundleNameCondition.class.getName(), new String[] {"bundle1", "bundle2"})); bundle = mock(Bundle.class); headers = new Hashtable<>(); headers.put("Bundle-SymbolicName", "bundle4"); when(bundle.getHeaders()).thenReturn(headers); BundleNameCondition bundleNameCondition1 = new BundleNameCondition( bundle, new ConditionInfo( BundleNameCondition.class.getName(), new String[] {"bundle1", "bundle2"})); boolean satisfied = bundleNameCondition1.isSatisfied( new Condition[] {bundleNameCondition1, bundleNameCondition2}, null); assertThat(satisfied, is(false)); }
Source:
public void updatingTimestampForOneConsistencyDoesNotAffectOther() { assertThat(progress.lastSweptTimestamp(10, true)).isEqualTo(0L); assertThat(progress.lastSweptTimestamp(10, false)).isEqualTo(0L); progress.updateLastSweptTimestamp(10, true, 128L); assertThat(progress.lastSweptTimestamp(10, false)).isEqualTo(0L); progress.updateLastSweptTimestamp(10, false, 32L); assertThat(progress.lastSweptTimestamp(10, true)).isEqualTo(128L); assertThat(progress.lastSweptTimestamp(10, false)).isEqualTo(32L); }

Target:
public void updatingTimestampForOneConsistencyDoesNotAffectOther() { assertThat(progress.lastSweptTimestamp(CONSERVATIVE_TEN)).isEqualTo(INITIAL_TIMESTAMP); assertThat(progress.lastSweptTimestamp(THOROUGH_TEN)).isEqualTo(INITIAL_TIMESTAMP); progress.updateLastSweptTimestamp(CONSERVATIVE_TEN, 128L); assertThat(progress.lastSweptTimestamp(THOROUGH_TEN)).isEqualTo(INITIAL_TIMESTAMP); progress.updateLastSweptTimestamp(THOROUGH_TEN, 32L); assertThat(progress.lastSweptTimestamp(CONSERVATIVE_TEN)).isEqualTo(128L); assertThat(progress.lastSweptTimestamp(THOROUGH_TEN)).isEqualTo(32L); }
Source:
public void reportDifferentMetaData(Class<?> eventType, Map<String, Object> missingEntries, Map<String, Object> additionalEntries) { StringBuilder sb = new StringBuilder("One of the events contained different metadata than expected"); sb.append(NEWLINE) .append(NEWLINE) .append("In an event of type [") .append(eventType.getSimpleName()) .append("], "); if (!additionalEntries.isEmpty()) { sb.append("metadata entries" + NEWLINE) .append("["); for (Map.Entry<String, Object> entry : additionalEntries.entrySet()) { sb.append(entryAsString(entry) + ","); } sb.deleteCharAt(sb.lastIndexOf(",")); sb.append("] " + NEWLINE); sb.append("were not expected."); } if (!missingEntries.isEmpty()) { sb.append("metadata entries " + NEWLINE) .append("["); for (Map.Entry<String, Object> entry : missingEntries.entrySet()) { sb.append(entryAsString(entry) + ","); } sb.deleteCharAt(sb.lastIndexOf(",")); sb.append("] " + NEWLINE); sb.append("were expected but not seen."); } throw new AxonAssertionError(sb.toString()); }

Target:
public void reportDifferentMetaData(Class<?> eventType, Map<String, Object> missingEntries, Map<String, Object> additionalEntries) { StringBuilder sb = new StringBuilder("One of the events contained different metadata than expected"); sb.append(NEWLINE) .append(NEWLINE) .append("In an event of type [") .append(eventType.getSimpleName()) .append("], "); if (!additionalEntries.isEmpty()) { sb.append("metadata entries" + NEWLINE).append("["); for (Map.Entry<String, Object> entry : additionalEntries.entrySet()) { sb.append(entryAsString(entry) + ", "); } sb.delete(sb.lastIndexOf(", "), sb.lastIndexOf(",") + 2); sb.append("] " + NEWLINE); sb.append("were not expected. "); } if (!missingEntries.isEmpty()) { sb.append("metadata entries " + NEWLINE).append("["); for (Map.Entry<String, Object> entry : missingEntries.entrySet()) { sb.append(entryAsString(entry) + ", "); } sb.delete(sb.lastIndexOf(","), sb.lastIndexOf(",") + 2); sb.append("] " + NEWLINE); sb.append("were expected but not seen."); } throw new AxonAssertionError(sb.toString()); }