auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setValue(int value) { healthValue = value; }

Target:
public void setValue(int value) { _healthValue = value; }
Source:
public Object[] transform(String sourceData) throws FormatException { try { Object list[] = m_parser.parseLine(sourceData); if (list != null) { for (int i = 0; i < list.length; i++) { if ("NULL".equals(list[i]) || Constants.CSV_NULL.equals(list[i]) || Constants.QUOTED_CSV_NULL.equals(list[i])) { list[i] = null; } } } return list; } catch (IOException e) { throw new FormatException(e); } }

Target:
public Object[] transform(String sourceData) throws FormatException { try { Object list[] = m_parser.parseLine(sourceData); if (list != null) { for (int i = 0; i < list.length; i++) { if ("NULL".equals(list[i]) || Constants.CSV_NULL.equals(list[i]) || Constants.QUOTED_CSV_NULL.equals(list[i])) { list[i] = null; } } } return list; } catch (IOException e) { throw new FormatException("failed to format " + sourceData, e); } }
Source:
private boolean overlapsInterval(final VariantContext ctx, final Interval interval) { if (!ctx.getContig().equals(interval.getContig())) return false; else if (CoordMath.overlaps(ctx.getStart(), ctx.getEnd(), interval.getStart(), interval.getEnd())) return true; else if (CoordMath.encloses(ctx.getStart(), ctx.getEnd(), interval.getStart(), interval.getEnd())) return true; else if (CoordMath.encloses(interval.getStart(), interval.getEnd(), ctx.getStart(), ctx.getEnd())) return true; else return false; }

Target:
private boolean overlapsInterval(final VariantContext ctx, final Interval interval) { if (!ctx.getContig().equals(interval.getContig())) return false; else if (CoordMath.overlaps(ctx.getStart(), ctx.getEnd(), interval.getStart(), interval.getEnd())) return true; else return false; }
Source:
public void addDollarAmount(KualiDecimal amountToAdd) { this.setDollarAmount(this.getDollarAmount().add(amountToAdd)); }

Target:
public void addDollarAmount(KualiDecimal amountToAdd) { dollarAmount = dollarAmount.add(amountToAdd); }
Source:
public void contextInitialized(final ServletContextEvent sce) { configure(METRICS_REGISTRY); super.contextInitialized(sce); initializeServices(); }

Target:
public void contextInitialized(final ServletContextEvent sce) { super.contextInitialized(sce); initializeServices(); }
Source:
public void setKind(int kind) { this.kind = kind; }

Target:
void setKind(int kind) { this.kind = kind; }
Source:
private void populatePushNotificationConfig(PushNotificationProvider pushNotificationProvider) { if (pushNotificationProvider != null) { if (pushNotificationProvider.isFileBasedProperties()) { Map<String, String> staticProps = new HashMap<>(); if (pushNotificationProvider.getConfigProperties() != null && pushNotificationProvider.getConfigProperties().getProperty() != null && pushNotificationProvider.getConfigProperties().getProperty().size() > 0) { for (Property property : pushNotificationProvider.getConfigProperties().getProperty()) { staticProps.put(property.getName(), property.getValue()); } } pushNotificationConfig = new PushNotificationConfig(pushNotificationProvider.getType(), pushNotificationProvider.isScheduled(), staticProps); } else { try { PlatformConfiguration deviceTypeConfig = deviceManager.getConfiguration(); if (deviceTypeConfig != null) { List<ConfigurationEntry> configuration = deviceTypeConfig.getConfiguration(); if (configuration.size() > 0) { Map<String, String> properties = this.getConfigProperty(configuration); pushNotificationConfig = new PushNotificationConfig( pushNotificationProvider.getType(), pushNotificationProvider.isScheduled(), properties); } } } catch (DeviceManagementException e) { log.error("Unable to get the " + type + " platform configuration from registry."); } } } }

Target:
private void populatePushNotificationConfig(PushNotificationProvider pushNotificationProvider) { if (pushNotificationProvider != null) { if (pushNotificationProvider.isFileBasedProperties()) { Map<String, String> staticProps = new HashMap<>(); ConfigProperties configProperties = pushNotificationProvider.getConfigProperties(); if (configProperties != null) { List<Property> properties = configProperties.getProperty(); if (properties != null && properties.size() > 0) { for (Property property : properties) { staticProps.put(property.getName(), property.getValue()); } } } pushNotificationConfig = new PushNotificationConfig(pushNotificationProvider.getType(), pushNotificationProvider.isScheduled(), staticProps); } else { try { PlatformConfiguration deviceTypeConfig = deviceManager.getConfiguration(); if (deviceTypeConfig != null) { List<ConfigurationEntry> configuration = deviceTypeConfig.getConfiguration(); if (configuration.size() > 0) { Map<String, String> properties = this.getConfigProperty(configuration); pushNotificationConfig = new PushNotificationConfig( pushNotificationProvider.getType(), pushNotificationProvider.isScheduled(), properties); } } } catch (DeviceManagementException e) { log.error("Unable to get the " + type + " platform configuration from registry."); } } } }
Source:
public long getMinAverageValueSizeInBytes() { if (!hasMinAverageValueSizeInBytes()) { return 0L; } if (booleanStatistics != null) { return 1L; } if (integerStatistics != null) { return Integer.BYTES; } if (doubleStatistics != null) { return Double.BYTES; } if (stringStatistics != null) { return stringStatistics.getSum() / numberOfValues; } if (dateStatistics != null) { return Integer.BYTES; } if (decimalStatistics != null) { return 8L; } if (binaryStatistics != null) { return binaryStatistics.getSum() / numberOfValues; } return 0L; }

Target:
public long getMinAverageValueSizeInBytes() { return minAverageValueSizeInBytes; }
Source:
public void setUp() throws Exception { activity = buildActivity(Activity.class).create().get(); attrs = shadowOf(RuntimeEnvironment.application).createAttributeSet(); group = new TestPreferenceGroup(activity, attrs); shadow = shadowOf(group); shadow.callOnAttachedToHierarchy(new PreferenceManager(activity, 0)); pref1 = new Preference(activity); pref1.setKey("pref1"); pref2 = new Preference(activity); pref2.setKey("pref2"); }

Target:
public void setUp() throws Exception { activity = buildActivity(Activity.class).create().get(); attrs = ShadowApplication.getInstance().createAttributeSet(); group = new TestPreferenceGroup(activity, attrs); shadow = shadowOf(group); shadow.callOnAttachedToHierarchy(new PreferenceManager(activity, 0)); pref1 = new Preference(activity); pref1.setKey("pref1"); pref2 = new Preference(activity); pref2.setKey("pref2"); }
Source:
private Map<String, Object> joinTwoMapsWithKeys(Map<String, Object> map1, Map<String, Object> map2) { Set<String> keySetStream2 = new HashSet<>(); for (int i = 0; i < keys.length; i = i+2) { String key1=keys[i]; String key2=keys[i+1]; keySetStream2.add(key2); if (!map1.get(key1).equals(map2.get(key2))) { return null; } } for (String field : map2.keySet()) { if (!keySetStream2.contains(field)) { map1.put(field, map2.get(field)); } } return map1; }

Target:
private Map<String, Object> joinTwoMapsWithKeys(Map<String, Object> map1, Map<String, Object> map2) { for (int i = 0; i < keys.length; i = i + 2) { String key1 = keys[i]; String key2 = keys[i + 1]; if (!map1.get(key1).equals(map2.get(key2))) { return null; } } for (String field : map2.keySet()) { if (!keySetStream2.contains(field)) { map1.put(field, map2.get(field)); } } return map1; }
Source:
public void doImport(Properties migrationProps) { Validate.notNull(migrationProps, "invalid null migration properties"); if (!currentProductBranding.equals(this.productBranding)) { throw new MigrationException( Messages.IMPORT_MISMATCH_PRODUCT_ERROR, this.productBranding, currentProductBranding); } List<String> supportedVersions = getSupportedVersions(migrationProps.getProperty("supported.versions")); if (this.currentProductVersion != this.productVersion && !supportedVersions.contains(this.productVersion)) { throw new MigrationException( Messages.IMPORT_UNSUPPORTED_PRODUCT_VERSION_ERROR, this.productVersion, supportedVersions); } LOGGER.debug( "Importing product from version [{}]...", currentProductBranding, currentProductVersion, version); contexts.values().forEach(c -> c.doImport(migrationProps)); }

Target:
public void doImport(Properties migrationProps) { Validate.notNull(migrationProps, "invalid null migration properties"); if (!currentProductBranding.equals(this.productBranding)) { throw new MigrationException( Messages.IMPORT_MISMATCH_PRODUCT_ERROR, this.productBranding, currentProductBranding); } LOGGER.debug( "Importing product from version [{}]...", currentProductBranding, currentProductVersion, version); if (this.currentProductVersion.equals(this.productVersion)) { contexts.values().forEach(ImportMigrationContextImpl::doImport); } else { Set<String> supportedVersions = getSupportedVersions(migrationProps.getProperty("supported.versions")); if (!supportedVersions.contains(this.productVersion)) { throw new MigrationException( Messages.IMPORT_UNSUPPORTED_PRODUCT_VERSION_ERROR, this.productVersion, supportedVersions); } contexts.values().forEach(ImportMigrationContextImpl::doVersionUpgradeImport); } }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VariantDeclaration other = (VariantDeclaration) obj; if (fDeclarationToPopulate == null) { if (other.fDeclarationToPopulate != null) { return false; } } else if (!fDeclarationToPopulate.equals(other.fDeclarationToPopulate)) { return false; } if (fFields == null) { if (other.fFields != null) { return false; } } else { if (!fFields.equals(other.fFields)) { return false; } } if (!equalsNullable(fTag, other.fTag)) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VariantDeclaration other = (VariantDeclaration) obj; if (!equalsNullable(fDeclarationToPopulate, other.fDeclarationToPopulate)) { return false; } if (!equalsNullable(fFields, other.fFields)) { return false; } if (!equalsNullable(fTag, other.fTag)) { return false; } return true; }
Source:
public void testCacheEventListener() throws Exception { Configuration configuration = new XmlConfiguration(this.getClass().getResource("/configs/ehcache-cacheEventListener.xml")); assertThat(configuration.getCacheConfigurations().containsKey("bar"), is(true)); final CacheManager cacheManager = CacheManagerBuilder.newCacheManager(configuration); final Cache<Number, String> cache = cacheManager.getCache("bar", Number.class, String.class); cache.put(10, "dog"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.CREATED)); cache.put(10, "cat"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.UPDATED)); cache.remove(10); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.REMOVED)); cache.put(10, "dog"); Thread.sleep(5000); cache.get(10); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.EXPIRED)); TestCacheEventListener.FIRED_EVENT = null; assertThat(configuration.getCacheConfigurations().containsKey("template1"), is(true)); final Cache<Number, String> templateCache = cacheManager.getCache("template1", Number.class, String.class); templateCache.put(10,"cat"); assertThat(TestCacheEventListener.FIRED_EVENT, nullValue()); templateCache.put(10, "dog"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.UPDATED)); }

Target:
public void testCacheEventListener() throws Exception { Configuration configuration = new XmlConfiguration(this.getClass().getResource("/configs/ehcache-cacheEventListener.xml")); assertThat(configuration.getCacheConfigurations().containsKey("bar"), is(true)); final CacheManager cacheManager = CacheManagerBuilder.newCacheManager(configuration); cacheManager.init(); final Cache<Number, String> cache = cacheManager.getCache("bar", Number.class, String.class); cache.put(10, "dog"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.CREATED)); cache.put(10, "cat"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.UPDATED)); cache.remove(10); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.REMOVED)); cache.put(10, "dog"); resetValues(); assertThat(configuration.getCacheConfigurations().containsKey("template1"), is(true)); final Cache<Number, String> templateCache = cacheManager.getCache("template1", Number.class, String.class); templateCache.put(10,"cat"); assertThat(TestCacheEventListener.FIRED_EVENT, nullValue()); templateCache.put(10, "dog"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.UPDATED)); }
Source:
ASession(final QueryContext qc, final Str id) throws QueryException { this.qc = qc; this.id = id; if(id == null) { final Object ws = qc.getProperty(HTTPText.WEBSOCKET); if(ws != null) { session = ((WsAdapter) ws).httpsession; if(session != null) return; } else { final Object req = qc.getProperty(HTTPText.REQUEST); if(req == null) throw BASEX_HTTP.get(null); session = ((HttpServletRequest) req).getSession(); } } else { session = SessionListener.sessions().get(id.toJava()); if(session == null) throw SESSIONS_NOTFOUND_X.get(null, id); } }

Target:
ASession(final QueryContext qc, final Str id) throws QueryException { this.qc = qc; this.id = id; final Object ws = qc.getProperty(HTTPText.WEBSOCKET); final Object req = qc.getProperty(HTTPText.REQUEST); if(ws == null && req == null) throw BASEX_HTTP.get(null); if(id == null) { if(ws != null) { session = ((WsAdapter) ws).httpsession; } else { session = ((HttpServletRequest) req).getSession(); } } else { session = SessionListener.sessions().get(id.toJava()); } if(session == null) throw SESSIONS_NOTFOUND_X.get(null, id); }
Source:
public List<LunModel> getLunsToRefresh() { List<LunModel> luns = Collections.emptyList(); if (!getIsGrouppedByTarget()) { List<LunModel> items = (List<LunModel>) getItems(); luns.addAll(items.stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .distinct() .collect(Collectors.toList())); } else { List<SanTargetModel> sanTargetModels = (List<SanTargetModel>) getItems(); for (SanTargetModel sanTargetModel : sanTargetModels) { luns = sanTargetModel.getLuns().stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .distinct() .collect(Collectors.toList()); } } return luns; }

Target:
public Set<String> getLunsToRefresh() { if (!getIsGrouppedByTarget()) { return ((List<LunModel>) getItems()).stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .map(LunModel::getLunId) .collect(Collectors.toSet()); } return ((List<SanTargetModel>) getItems()).stream() .map(SanTargetModel::getLuns) .flatMap(List::stream) .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .map(LunModel::getLunId) .collect(Collectors.toSet()); }
Source:
private Mono<CosmosUserResponse> createUserInternal(CosmosUserProperties userProperties, Context context) { String spanName = "createUser." + this.getId(); Mono<CosmosUserResponse> responseMono = createUserInternal(userProperties); return this.client.getTracerProvider().traceEnabledCosmosResponsePublisher(responseMono, context, spanName, getId(), getClient().getServiceEndpoint()); }

Target:
private Mono<CosmosUserResponse> createUserInternal(CosmosUserProperties userProperties, Context context) { String spanName = "createUser." + this.getId(); Mono<CosmosUserResponse> responseMono = getDocClientWrapper().createUser(this.getLink(), ModelBridgeInternal.getV2User(userProperties), null) .map(response -> ModelBridgeInternal.createCosmosUserResponse(response)).single(); return this.client.getTracerProvider().traceEnabledCosmosResponsePublisher(responseMono, context, spanName, getId(), getClient().getServiceEndpoint()); }
Source:
public void reset(DataSourceMetadata dataSourceMetadata) { if (dataSourceMetadata == null) { DataSourceMetadata oldMetadata = metadataStorageCoordinator.getDataSourceMetadata(dataSource); if (oldMetadata != null && oldMetadata instanceof DerivativeDataSourceMetadata) { if (!((DerivativeDataSourceMetadata) oldMetadata).getBaseDataSource().equals(spec.getBaseDataSource()) || !((DerivativeDataSourceMetadata) oldMetadata).getDimensions().equals(spec.getDimensions()) || !((DerivativeDataSourceMetadata) oldMetadata).getMetrics().equals(spec.getMetrics())) { synchronized (taskLock) { clearTasks(); clearSegments(); } } } commitDataSourceMetadata( new DerivativeDataSourceMetadata(spec.getBaseDataSource(), spec.getDimensions(), spec.getMetrics()) ); } else { throw new IAE("DerivedDataSourceMetadata is not allowed to reset to a new DerivedDataSourceMetadata"); } }

Target:
public void reset(DataSourceMetadata dataSourceMetadata) { if (dataSourceMetadata == null) { DataSourceMetadata oldMetadata = metadataStorageCoordinator.getDataSourceMetadata(dataSource); if (oldMetadata instanceof DerivativeDataSourceMetadata) { if (!((DerivativeDataSourceMetadata) oldMetadata).getBaseDataSource().equals(spec.getBaseDataSource()) || !((DerivativeDataSourceMetadata) oldMetadata).getDimensions().equals(spec.getDimensions()) || !((DerivativeDataSourceMetadata) oldMetadata).getMetrics().equals(spec.getMetrics())) { synchronized (taskLock) { clearTasks(); clearSegments(); } } } commitDataSourceMetadata( new DerivativeDataSourceMetadata(spec.getBaseDataSource(), spec.getDimensions(), spec.getMetrics()) ); } else { throw new IAE("DerivedDataSourceMetadata is not allowed to reset to a new DerivedDataSourceMetadata"); } }
Source:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (!(getActivity() instanceof PhoneActivity)) { throw new IllegalStateException("Activity must implement PhoneVerificationHandler"); } mVerifier = (PhoneActivity) getActivity(); if (savedInstanceState != null) { return; } Bundle params = getArguments().getBundle(ExtraConstants.EXTRA_PARAMS); String phone = null; String countryCode = null; String nationalNumber = null; if (params != null) { phone = params.getString(ExtraConstants.EXTRA_PHONE); countryCode = params.getString(ExtraConstants.EXTRA_COUNTRY_CODE); nationalNumber = params.getString(ExtraConstants.EXTRA_NATIONAL_NUMBER); } if (!TextUtils.isEmpty(countryCode) && !TextUtils.isEmpty(nationalNumber)) { PhoneNumber phoneNumber = PhoneNumberUtils.getPhoneNumber(countryCode, nationalNumber); setPhoneNumber(phoneNumber); setCountryCode(phoneNumber); } else if (!TextUtils.isEmpty(countryCode)) { setCountryCode(new PhoneNumber( "", PhoneNumberUtils.getCountryIsoForCountryCode(countryCode), countryCode)); } else if (!TextUtils.isEmpty(phone)) { PhoneNumber phoneNumber = PhoneNumberUtils.getPhoneNumber(phone); setPhoneNumber(phoneNumber); setCountryCode(phoneNumber); } else if (getFlowParams().enableHints) { showPhoneAutoCompleteHint(); } }

Target:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (!(getActivity() instanceof PhoneActivity)) { throw new IllegalStateException("Activity must implement PhoneVerificationHandler"); } mVerifier = (PhoneActivity) getActivity(); if (savedInstanceState != null) { return; } Bundle params = getArguments().getBundle(ExtraConstants.EXTRA_PARAMS); String phone = null; String countryIso = null; String nationalNumber = null; if (params != null) { phone = params.getString(ExtraConstants.EXTRA_PHONE); countryIso = params.getString(ExtraConstants.EXTRA_COUNTRY_ISO); nationalNumber = params.getString(ExtraConstants.EXTRA_NATIONAL_NUMBER); } if (!TextUtils.isEmpty(countryIso) && !TextUtils.isEmpty(nationalNumber)) { PhoneNumber phoneNumber = PhoneNumberUtils.getPhoneNumber(countryIso, nationalNumber); setPhoneNumber(phoneNumber); setCountryCode(phoneNumber); } else if (!TextUtils.isEmpty(countryIso)) { setCountryCode(new PhoneNumber( "", countryIso, String.valueOf(PhoneNumberUtils.getCountryCode(countryIso)))); } else if (!TextUtils.isEmpty(phone)) { PhoneNumber phoneNumber = PhoneNumberUtils.getPhoneNumber(phone); setPhoneNumber(phoneNumber); setCountryCode(phoneNumber); } else if (getFlowParams().enableHints) { showPhoneAutoCompleteHint(); } }
Source:
public List<String> getJars(Class<?> jarClass, boolean makeJarFromFolder, boolean addJarDependencies) { List<String> list = new LinkedList<>(); String jar = getJar(jarClass, makeJarFromFolder); if (jar != null) { list.add(jar); } if (addJarDependencies) { try { getDependentJarsFromManifest(new JarFile(jar), list); } catch (IOException ex) { logger.warn("Cannot open Jar-file {}", jar); } } return list; }

Target:
public Set<String> getJars(Class<?> jarClass, boolean makeJarFromFolder, boolean addJarDependencies) { String jar = getJar(jarClass, makeJarFromFolder); Set<String> set = new HashSet<>(); if (jar != null) { set.add(jar); if (addJarDependencies) { try { getDependentJarsFromManifest(new JarFile(jar), set); } catch (IOException ex) { logger.warn("Cannot open Jar-file {}", jar); } } } return set; }
Source:
private void run() { try { while (running) { try { final long start = Time.monotonicNow(); final Set<ContainerID> containerIds = containerManager.getContainerIDs(); containerIds.forEach(this::processContainer); LOG.info("Replication Monitor Thread took milliseconds for" + " processing containers.", Time.monotonicNow() - start, containerIds.size()); if (!Thread.interrupted()) { Thread.sleep(interval); } } catch (InterruptedException ex) { LOG.debug("Replication Monitor Thread got interrupted."); } } } catch (Throwable t) { LOG.error("Exception in Replication Monitor Thread.", t); ExitUtil.terminate(1, t); } }

Target:
private synchronized void run() { try { while (running) { final long start = Time.monotonicNow(); final Set<ContainerID> containerIds = containerManager.getContainerIDs(); containerIds.forEach(this::processContainer); LOG.info("Replication Monitor Thread took milliseconds for" + " processing containers.", Time.monotonicNow() - start, containerIds.size()); wait(interval); } } catch (Throwable t) { LOG.error("Exception in Replication Monitor Thread.", t); ExitUtil.terminate(1, t); } }
Source:
public Response intercept(Chain chain) throws IOException { long numTries = 0; boolean successful = false; Request request = chain.request(); Response response = null; while (!successful && numTries < maxNumTries) { try { numTries++; response = chain.proceed(request); successful = response.isSuccessful(); } catch (IOException e) { if (numTries >= maxNumTries) { throw e; } } if (!successful) { log.error("Request to url failed on attempt {}", request.url(), SafeArg.of("numTries", numTries)); } } return response; }

Target:
public Response intercept(Chain chain) throws IOException { long numTries = 0; boolean successful = false; Request request = chain.request(); Response response = null; while (!successful && numTries < maxNumTries) { try { numTries++; response = chain.proceed(request); successful = response.isSuccessful(); } catch (IOException e) { if (numTries >= maxNumTries) { throw e; } } if (!successful) { log.error("Request to url failed", SafeArg.of("numTries", numTries)); } } return response; }
Source:
private void changeSchemaByAnotherRealm() { SharedRealm sharedRealm = SharedRealm.getInstance(config); sharedRealm.beginTransaction(); sharedRealm.createTable("NewTable"); sharedRealm.commitTransaction(); }

Target:
private void changeSchemaByAnotherRealm() { SharedRealm sharedRealm = SharedRealm.getInstance(config); sharedRealm.beginTransaction(); sharedRealm.createTable("NewTable"); sharedRealm.commitTransaction(); sharedRealm.close(); }
Source:
public void setElement( IAdaptable element ) { if (element instanceof ICLineBreakpoint) { fElement = new CBreakpointContext((ICBreakpoint)element, null); } else { fElement = element; } }

Target:
public void setElement( IAdaptable element ) { if (element instanceof ICBreakpoint) { fElement = new CBreakpointContext((ICBreakpoint)element, null); } else { fElement = element; } }
Source:
private void internalPutMetadataForTables( Map<TableReference, byte[]> unfilteredTableNameToMetadata, boolean possiblyNeedToPerformSettingsChanges) { Map<TableReference, byte[]> tableNameToMetadata = Maps.filterValues( unfilteredTableNameToMetadata, Predicates.not(Predicates.equalTo(AtlasDbConstants.EMPTY_TABLE_METADATA))); if (tableNameToMetadata.isEmpty()) { return; } Map<Cell, byte[]> metadataRequestedForUpdate = Maps.newHashMapWithExpectedSize(tableNameToMetadata.size()); for (Entry<TableReference, byte[]> tableEntry : tableNameToMetadata.entrySet()) { metadataRequestedForUpdate.put(getMetadataCell(tableEntry.getKey()), tableEntry.getValue()); } Map<Cell, Long> requestForLatestDbSideMetadata = Maps.transformValues( metadataRequestedForUpdate, Functions.constant(Long.MAX_VALUE)); Map<Cell, Value> persistedMetadata = get( AtlasDbConstants.DEFAULT_METADATA_TABLE, requestForLatestDbSideMetadata); final Map<Cell, byte[]> newMetadata = Maps.newHashMap(); final Collection<CfDef> updatedCfs = Lists.newArrayList(); for (Entry<Cell, byte[]> entry : metadataRequestedForUpdate.entrySet()) { if (newMetadataFound(persistedMetadata.get(entry.getKey()), entry.getValue())) { newMetadata.put(entry.getKey(), entry.getValue()); } updatedCfs.add(getCfForTable( tableReferenceFromBytes(entry.getKey().getRowName()), entry.getValue())); } if (newMetadata.isEmpty()) { return; } try { putMetadataAndMaybeAlterTables(possiblyNeedToPerformSettingsChanges, newMetadata, updatedCfs); } catch (Exception e) { throw Throwables.throwUncheckedException(e); } }

Target:
private void internalPutMetadataForTables( Map<TableReference, byte[]> unfilteredTableNameToMetadata, boolean possiblyNeedToPerformSettingsChanges) { Map<TableReference, byte[]> tableNameToMetadata = Maps.filterValues( unfilteredTableNameToMetadata, Predicates.not(Predicates.equalTo(AtlasDbConstants.EMPTY_TABLE_METADATA))); if (tableNameToMetadata.isEmpty()) { return; } Map<Cell, byte[]> metadataRequestedForUpdate = Maps.newHashMapWithExpectedSize(tableNameToMetadata.size()); for (Entry<TableReference, byte[]> tableEntry : tableNameToMetadata.entrySet()) { metadataRequestedForUpdate.put(getMetadataCell(tableEntry.getKey()), tableEntry.getValue()); } Map<Cell, Long> requestForLatestDbSideMetadata = Maps.transformValues( metadataRequestedForUpdate, Functions.constant(Long.MAX_VALUE)); Map<Cell, Value> persistedMetadata = get( AtlasDbConstants.DEFAULT_METADATA_TABLE, requestForLatestDbSideMetadata); final Map<Cell, byte[]> updatedMetadata = Maps.newHashMap(); final Collection<CfDef> updatedCfs = Lists.newArrayList(); for (Entry<Cell, byte[]> entry : metadataRequestedForUpdate.entrySet()) { if (updatedMetadataFound(persistedMetadata.get(entry.getKey()), entry.getValue())) { updatedMetadata.put(entry.getKey(), entry.getValue()); updatedCfs.add(getCfForTable( tableReferenceFromBytes(entry.getKey().getRowName()), entry.getValue(), configManager.getConfig().gcGraceSeconds())); } } if (!updatedMetadata.isEmpty()) { putMetadataAndMaybeAlterTables(possiblyNeedToPerformSettingsChanges, updatedMetadata, updatedCfs); } }
Source:
public MavenProject readProject(final File pomFile, IProgressMonitor monitor) throws CoreException { return context().execute(new ICallable<MavenProject>() { public MavenProject call(IMavenExecutionContext context, IProgressMonitor monitor) throws CoreException { MavenExecutionRequest request = DefaultMavenExecutionRequest.copy(context.getExecutionRequest()); try { lookup(MavenExecutionRequestPopulator.class).populateDefaults(request); ProjectBuildingRequest configuration = request.getProjectBuildingRequest(); configuration.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL); configuration.setRepositorySession(createRepositorySession(request)); return lookup(ProjectBuilder.class).build(pomFile, configuration).getProject(); } catch(ProjectBuildingException ex) { throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_project, ex)); } catch(MavenExecutionRequestPopulationException ex) { throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_project, ex)); } } }, monitor); }

Target:
public MavenProject readProject(final File pomFile, IProgressMonitor monitor) throws CoreException { return context().execute((context, pm) -> { MavenExecutionRequest request = DefaultMavenExecutionRequest.copy(context.getExecutionRequest()); try { lookup(MavenExecutionRequestPopulator.class).populateDefaults(request); ProjectBuildingRequest configuration = request.getProjectBuildingRequest(); configuration.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL); configuration.setRepositorySession(createRepositorySession(request)); return lookup(ProjectBuilder.class).build(pomFile, configuration).getProject(); } catch(ProjectBuildingException ex) { throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_project, ex)); } catch(MavenExecutionRequestPopulationException ex) { throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_project, ex)); } }, monitor); }
Source:
public void testPseudoState() { org.eclipse.uml2.uml.Pseudostate i = UMLFactory.eINSTANCE.createPseudostate(); i.setContainer(region); i.setName("I"); i.setKind(PseudostateKind.INITIAL_LITERAL); org.eclipse.uml2.uml.Pseudostate c = UMLFactory.eINSTANCE.createPseudostate(); c.setContainer(region); c.setName("C"); c.setKind(PseudostateKind.CHOICE_LITERAL); RectangleObject recti = new RectangleObject("package.A.I", new Point(1, 2)); recti.setWidth(3); recti.setHeight(4); RectangleObject rectc = new RectangleObject("package.A.C", new Point(5, 6)); rectc.setWidth(7); rectc.setHeight(8); PseudoState statec = new PseudoState(rectc, c); PseudoState statei = new PseudoState(recti, i); Assert.assertEquals("package.A.I", statei.getId()); Assert.assertEquals("package.A.C", statec.getId()); Assert.assertEquals("I", statei.getName()); Assert.assertEquals("C", statec.getName()); Assert.assertEquals((Integer) 1, statei.getPosition().getX()); Assert.assertEquals((Integer) 5, statec.getPosition().getX()); Assert.assertEquals((Integer) 2, statei.getPosition().getY()); Assert.assertEquals((Integer) 6, statec.getPosition().getY()); Assert.assertEquals((Integer) 3, statei.getWidth()); Assert.assertEquals((Integer) 7, statec.getWidth()); Assert.assertEquals((Integer) 4, statei.getHeight()); Assert.assertEquals((Integer) 8, statec.getHeight()); Assert.assertEquals("initial", statei.getKind()); Assert.assertEquals("choice", statec.getKind()); }

Target:
public void testPseudoState() { org.eclipse.uml2.uml.Pseudostate inintialState = UMLFactory.eINSTANCE.createPseudostate(); inintialState.setContainer(region); inintialState.setName("I"); inintialState.setKind(PseudostateKind.INITIAL_LITERAL); org.eclipse.uml2.uml.Pseudostate choiceState = UMLFactory.eINSTANCE.createPseudostate(); choiceState.setContainer(region); choiceState.setName("C"); choiceState.setKind(PseudostateKind.CHOICE_LITERAL); PseudoState statec = new PseudoState(choiceState, "package.A.C"); PseudoState statei = new PseudoState(inintialState, "package.A.I"); statec.setLayout(new Rectangle(1, 2, 3, 4)); Assert.assertEquals("package.A.I", statei.getId()); Assert.assertEquals("package.A.C", statec.getId()); Assert.assertEquals("I", statei.getName()); Assert.assertEquals("C", statec.getName()); Assert.assertEquals(PseudostateKind.INITIAL_LITERAL, statei.getKind()); Assert.assertEquals(PseudostateKind.CHOICE_LITERAL, statec.getKind()); Assert.assertEquals(1, statec.getPosition().getX()); Assert.assertEquals(2, statec.getPosition().getY()); Assert.assertEquals(3, statec.getWidth().intValue()); Assert.assertEquals(4, statec.getHeight().intValue()); }
Source:
public Object call(Properties bindings, Object[] args) { if (args.length == 1 || args.length == 2 || args.length == 3) { Object v = args[0]; Object targetProjectName = args.length < 2 || args[1].equals("") ? ((Project) bindings.get("project")).getMetadata().getName() : args[1]; Object targetColumnName = args.length < 3 || args[2].equals("") ? INDEX_COLUMN_NAME: args[2]; long targetProjectID; ProjectLookup lookup; if (v != null && targetProjectName instanceof String && targetColumnName instanceof String) { try { targetProjectID = ProjectManager.singleton.getProjectID((String) targetProjectName); } catch (GetProjectIDException e) { return new EvalError(e.getMessage()); } try { lookup = ProjectManager.singleton.getLookupCacheManager().getLookup(targetProjectID, (String) targetColumnName); } catch (LookupException e) { return new EvalError(e.getMessage()); } if (v instanceof WrappedCell) { return lookup.getRows(((WrappedCell) v).cell.value); } else if (v instanceof Number && targetColumnName.equals(INDEX_COLUMN_NAME)){ return lookup.getRows(((Number) v).intValue()); } else { return lookup.getRows(v); } } } return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a cell or cell value, a project name to look up (optional), and a column name in that project (optional)"); }

Target:
public Object call(Properties bindings, Object[] args) { if (1 <= args.length && args.length <= 3) { Object v = args[0]; Object targetProjectName = ""; boolean isCurrentProject = false; if (args.length < 2 || args[1].equals("")) { isCurrentProject = true; } else { targetProjectName = args[1]; } Object targetColumnName = args.length < 3 || args[2].equals("") ? INDEX_COLUMN_NAME: args[2]; long targetProjectID; ProjectLookup lookup; if (v != null && targetProjectName instanceof String && targetColumnName instanceof String) { try { targetProjectID = isCurrentProject ? ((Project) bindings.get("project")).id : ProjectManager.singleton.getProjectID((String) targetProjectName); } catch (GetProjectIDException e) { return new EvalError(e.getMessage()); } try { lookup = ProjectManager.singleton.getLookupCacheManager().getLookup(targetProjectID, (String) targetColumnName); } catch (LookupException e) { return new EvalError(e.getMessage()); } if (v instanceof WrappedCell) { return lookup.getRows(((WrappedCell) v).cell.value); } else { return lookup.getRows(v); } } } return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a cell or value, a project name to look up (optional), and a column name in that project (optional)"); }
Source:
private AsyncQuery getFilteringCallBack() { AsyncQuery filteringAsyncQuery = new AsyncQuery(); filteringAsyncQuery.setModel(this); filteringAsyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { String searchString = getSearchString(); String domain = getDomain().getSelectedItem().toString(); AdElementListModel adElementListModel = (AdElementListModel) model; HashSet<Guid> excludeUsers = new HashSet<Guid>(); if (getExcludeItems() != null) { for (Object item : getExcludeItems()) { DbUser a = (DbUser) item; excludeUsers.add(a.getuser_id()); } } setusers(new ArrayList<EntityModel>()); for (IVdcQueryable item : (ArrayList<IVdcQueryable>) ((VdcQueryReturnValue) returnValue).getReturnValue()) { DbUser dbUser = (DbUser) item; if (matchesSearchFilter(dbUser, excludeUsers, domain, searchString)) { EntityModel tempVar2 = new EntityModel(); tempVar2.setEntity(dbUser); getusers().add(tempVar2); } } OnUserAndAdGroupsLoaded(adElementListModel); } private boolean matchesSearchFilter(DbUser dbUser, HashSet<Guid> excludeUsers, String domain, String searchString) { return !excludeUsers.contains(dbUser.getuser_id()) && dbUser.getdomain().equals(domain) && (StringHelper.isNullOrEmpty(searchString) || dbUserMatchesSearchFilter(dbUser, searchString.toLowerCase())); } private boolean dbUserMatchesSearchFilter(DbUser dbUser, String searchString) { return matchesSearchFilter(dbUser.getname().toLowerCase(), searchString) || matchesSearchFilter(dbUser.getsurname().toLowerCase(), searchString) || matchesSearchFilter(dbUser.getusername().toLowerCase(), searchString); } private boolean matchesSearchFilter(String name, String searchString) { return name.startsWith(searchString); } }; return filteringAsyncQuery; }

Target:
private AsyncQuery getFilteringCallBack() { AsyncQuery filteringAsyncQuery = new AsyncQuery(); filteringAsyncQuery.setModel(this); filteringAsyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { AdElementListModel adElementListModel = (AdElementListModel) model; Set<Guid> excludeUsers = getExcludeUsers(); setusers(new ArrayList<EntityModel>()); Iterable<DbUser> filteredUsers = Linq.Where( (ArrayList<DbUser>) ((VdcQueryReturnValue) returnValue).getReturnValue(), new Linq.DbUserPredicate(getTargetDbUser())); for (DbUser dbUser : filteredUsers) { if (!excludeUsers.contains(dbUser.getuser_id())) { EntityModel tempVar2 = new EntityModel(); tempVar2.setEntity(dbUser); getusers().add(tempVar2); } } OnUserAndAdGroupsLoaded(adElementListModel); } private Set<Guid> getExcludeUsers() { Set<Guid> excludeUsers = new HashSet<Guid>(); if (getExcludeItems() != null) { for (Object item : getExcludeItems()) { DbUser a = (DbUser) item; excludeUsers.add(a.getuser_id()); } } return excludeUsers; } private DbUser getTargetDbUser() { DbUser dbUser = new DbUser(); dbUser.setname(getSearchString()); dbUser.setdomain(getDomain().getSelectedItem().toString()); return dbUser; } }; return filteringAsyncQuery; }
Source:
void doCompactEntryLogs(double threshold) throws IOException { LOG.info("Do compaction to compact those files lower than {}", threshold); final int numBuckets = 10; int entryLogUsageBuckets[] = new int[numBuckets]; entryLogMetaMap.forEach((entryLogId, meta) -> { int bucketIndex = Math.min(numBuckets - 1, (int) Math.ceil(meta.getUsage() * numBuckets)); entryLogUsageBuckets[bucketIndex]++; if (meta.getUsage() >= threshold) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Compacting entry log below threshold {}", meta.getEntryLogId(), threshold); } long priorRemainingSize = meta.getRemainingSize(); compactEntryLog(meta); gcStats.getReclaimedSpaceViaCompaction().add(meta.getTotalSize() - priorRemainingSize); if (!running) { return; } }); LOG.info("Compaction: entry log usage buckets[10% 20% 30% 40% 50% 60% 70% 80% 90% 100%] = {}", entryLogUsageBuckets); }

Target:
void doCompactEntryLogs(double threshold) throws EntryLogMetadataMapException { LOG.info("Do compaction to compact those files lower than {}", threshold); final int numBuckets = 10; int entryLogUsageBuckets[] = new int[numBuckets]; entryLogMetaMap.forEach((entryLogId, meta) -> { int bucketIndex = Math.min(numBuckets - 1, (int) Math.ceil(meta.getUsage() * numBuckets)); entryLogUsageBuckets[bucketIndex]++; if (meta.getUsage() >= threshold) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Compacting entry log below threshold {}", meta.getEntryLogId(), threshold); } long priorRemainingSize = meta.getRemainingSize(); compactEntryLog(meta); gcStats.getReclaimedSpaceViaCompaction().add(meta.getTotalSize() - priorRemainingSize); if (!running) { return; } }); LOG.info("Compaction: entry log usage buckets[10% 20% 30% 40% 50% 60% 70% 80% 90% 100%] = {}", entryLogUsageBuckets); }
Source:
public SubTabProviderGeneralView(DetailModelProvider<ProviderListModel, ProviderGeneralModel> modelProvider) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); generateIds(); formBuilder = new FormBuilder(formPanel, 1, 4); formBuilder.setRelativeColumnWidth(0, 6); formBuilder.addFormItem(new FormItem(constants.nameProvider(), name, 0, 0), 4, 6); formBuilder.addFormItem(new FormItem(constants.typeProvider(), type, 1, 0), 4, 6); formBuilder.addFormItem(new FormItem(constants.descriptionProvider(), description, 2, 0), 4, 6); formBuilder.addFormItem(new FormItem(constants.urlProvider(), url, 3, 0), 4, 6); }

Target:
public SubTabProviderGeneralView(DetailModelProvider<ProviderListModel, ProviderGeneralModel> modelProvider) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); generateIds(); formBuilder = new FormBuilder(formPanel, 1, 4); formBuilder.addFormItem(new FormItem(constants.nameProvider(), name, 0, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.typeProvider(), type, 1, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.descriptionProvider(), description, 2, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.urlProvider(), url, 3, 0), 2, 10); }
Source:
private void refreshSnapshotsInCluster(VDSGroup cluster) { if (!supportsGlusterSnapshotFeature(cluster)) { return; } final VDS upServer = getClusterUtils().getRandomUpServer(cluster.getId()); List<GlusterVolumeEntity> volumes = getGlusterVolumeDao().getByClusterId(cluster.getId()); if (volumes != null && volumes.size() > 0) { List<Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>> taskList = new ArrayList<Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>>(); for (final GlusterVolumeEntity volume : volumes) { taskList.add(new Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>() { @Override public Pair<GlusterVolumeEntity, VDSReturnValue> call() throws Exception { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeSnapshotInfo, new GlusterVolumeSnapshotVDSParameters(upServer.getId(), volume.getName(), volume.getClusterId())); return new Pair<GlusterVolumeEntity, VDSReturnValue>(volume, returnValue); } }); } List<Pair<GlusterVolumeEntity, VDSReturnValue>> pairResults = ThreadPoolUtil.invokeAll(taskList); try { addOrUpdateSnapshots(cluster.getId(), pairResults); } catch (VdcBLLException e) { throw e; } } }

Target:
private void refreshSnapshotsInCluster(VDSGroup cluster) { if (!supportsGlusterSnapshotFeature(cluster)) { return; } final VDS upServer = getClusterUtils().getRandomUpServer(cluster.getId()); if (upServer == null) { return; } List<GlusterVolumeEntity> volumes = getGlusterVolumeDao().getByClusterId(cluster.getId()); if (volumes != null && volumes.size() > 0) { List<Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>> taskList = new ArrayList<Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>>(); for (final GlusterVolumeEntity volume : volumes) { taskList.add(new Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>() { @Override public Pair<GlusterVolumeEntity, VDSReturnValue> call() throws Exception { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeSnapshotInfo, new GlusterVolumeSnapshotVDSParameters(upServer.getId(), volume.getName(), volume.getClusterId())); return new Pair<GlusterVolumeEntity, VDSReturnValue>(volume, returnValue); } }); } List<Pair<GlusterVolumeEntity, VDSReturnValue>> pairResults = ThreadPoolUtil.invokeAll(taskList); try { addOrUpdateSnapshots(cluster.getId(), pairResults); } catch (VdcBLLException e) { throw e; } } }
Source:
public List<String> getTextsForAllStatusMessagesToUser() { List<WebElement> statusMessages = statusMessage.findElements(By.tagName("div")); List<String> statusMessageTexts = new ArrayList<String>(); for (WebElement status : statusMessages) { statusMessageTexts.add(status.getText()); } return statusMessageTexts; }

Target:
public List<String> getTextsForAllStatusMessagesToUser() { List<WebElement> statusMessagesToUser = statusMessage.findElements(By.tagName("div")); List<String> statusMessageTexts = new ArrayList<String>(); for (WebElement statusMessage : statusMessagesToUser) { statusMessageTexts.add(statusMessage.getText()); } return statusMessageTexts; }
Source:
public void debugClearLocalData() throws MessagingException { if (!K9.DEBUG) { throw new AssertionError("method must only be used in debug build!"); } try { localStore.database.execute(true, new DbCallback<Void>() { @Override public Void doDbWork(final SQLiteDatabase db) throws WrappedException, MessagingException { ContentValues cv = new ContentValues(); cv.putNull("message_part_id"); db.update("messages", cv, "id = ?", new String[] { Long.toString(mId) }); try { ((LocalFolder) mFolder).deleteMessagePartsAndDataFromDisk(messagePartId); } catch (MessagingException e) { throw new WrappedException(e); } setFlag(Flag.X_DOWNLOADED_FULL, false); setFlag(Flag.X_DOWNLOADED_PARTIAL, false); return null; } }); } catch (WrappedException e) { throw (MessagingException) e.getCause(); } localStore.notifyChange(); }

Target:
public void debugClearLocalData() throws MessagingException { if (!BuildConfig.DEBUG) { throw new AssertionError("method must only be used in debug build!"); } try { localStore.database.execute(true, new DbCallback<Void>() { @Override public Void doDbWork(final SQLiteDatabase db) throws WrappedException, MessagingException { ContentValues cv = new ContentValues(); cv.putNull("message_part_id"); db.update("messages", cv, "id = ?", new String[] { Long.toString(mId) }); try { ((LocalFolder) mFolder).deleteMessagePartsAndDataFromDisk(messagePartId); } catch (MessagingException e) { throw new WrappedException(e); } setFlag(Flag.X_DOWNLOADED_FULL, false); setFlag(Flag.X_DOWNLOADED_PARTIAL, false); return null; } }); } catch (WrappedException e) { throw (MessagingException) e.getCause(); } localStore.notifyChange(); }
Source:
public UrlWizardPage(ServerConnectionModel model) { super("server_url_page", "SonarQube ConnectedEngineFacade URL", model, 2); }

Target:
public UrlWizardPage(ServerConnectionModel model) { super("server_url_page", "SonarQube Server URL", model, 2); }
Source:
public void willReturnCommandIgnoreOnPipelineInternalLine() { final MarkupText markupText = new MarkupText("Some internal line"); markupText.addMarkup(0, "<span class=\"pipeline-new-node\">"); System.out.println(markupText.toString(false)); final ColorizedAction colorizedAction = ColorizedAction.parseAction(markupText, buildRun); assertEquals(ColorizedAction.Command.IGNORE, colorizedAction.getCommand()); }

Target:
public void willReturnCommandIgnoreOnPipelineInternalLine() { final MarkupText markupText = new MarkupText("Some internal line"); markupText.addMarkup(0, "<span class=\"pipeline-new-node\">"); final ColorizedAction colorizedAction = ColorizedAction.parseAction(markupText, buildRun); assertEquals(ColorizedAction.Command.IGNORE, colorizedAction.getCommand()); }
Source:
public T get() { Type providerType = Types.newParameterizedType( ConditionalBinder.class, key.getTypeLiteral().getRawType()); Set<ConditionalBinder<T>> providers = (Set<ConditionalBinder<T>>) injector.getInstance(key.ofType(Types.setOf(providerType))); ConditionalBinder<T> defaultProvider = null; List<ConditionalBinder<T>> matchedBindings = new ArrayList<>(); for (ConditionalBinder<T> provider : providers) { if (provider.matches()) { matchedBindings.add(provider); } else if (provider.isDefault()) { if (defaultProvider != null) { throw new ProvisionException("Only one default provider allowed for " + key.getTypeLiteral()); } defaultProvider = provider; } } if (matchedBindings.size() == 0) { if (defaultProvider != null) { return defaultProvider.get(); } else { throw new ProvisionException("No binding found for " + key.getTypeLiteral()); } } else if (matchedBindings.size() == 1) { return matchedBindings.iterator().next().get(); } else { throw new ProvisionException("Multiple (" + matchedBindings.size() + ") bindings found for " + key + "\n. " + matchedBindings); } }

Target:
public T get() { return resolveProvider().get(); }