auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { boolean datalakeCluster = source.getSharedServiceConfigs() .map(SharedServiceConfigsView::isDatalakeCluster) .orElse(false); String cdhVersion = getCdhVersion(source); boolean is722OrNewer = isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_2); GeneralClusterConfigs generalClusterConfigs = source.getGeneralClusterConfigs(); <START> boolean sdxHbaseCloudStorageEnabled = entitlementService == null ? true : <END> entitlementService.sdxHbaseCloudStorageEnabled(generalClusterConfigs.getUserCrn(), generalClusterConfigs.getAccountId()); return source.getFileSystemConfigurationView().isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()) && (!datalakeCluster || (is722OrNewer && sdxHbaseCloudStorageEnabled)); }</code><technical_language>I EntitlementService null</technical_language>

Target:
public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { boolean datalakeCluster = source.getSharedServiceConfigs() .map(SharedServiceConfigsView::isDatalakeCluster) .orElse(false); String cdhVersion = getCdhVersion(source); boolean is722OrNewer = isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_2); String actorCrn = INTERNAL_ACTOR_CRN; String accountId = ThreadBasedUserCrnProvider.getAccountId(); boolean sdxHbaseCloudStorageEnabled = entitlementService.sdxHbaseCloudStorageEnabled(actorCrn, accountId); return source.getFileSystemConfigurationView().isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()) && (!datalakeCluster || (is722OrNewer && sdxHbaseCloudStorageEnabled)); }
Source:
<code>BitMappedTrie<T> prepend(T leading) { if (cannotAdd(leading)) { <START> return map(identity()).prepend(leading); <END> } else { final int newSize = length() + 1; if (length() == 0) { return new BitMappedTrie<>(type, type.asArray(leading), offset, newSize, depthShift); } else { Object array = this.array; int shift = depthShift, offset = this.offset; if (isFullLeft()) { array = obj().copyUpdate(obj().empty(), BRANCHING_FACTOR - 1, array); shift += BRANCHING_BASE; offset = treeSize(BRANCHING_FACTOR - 1, shift); } offset -= 1; array = modifyLeaf(array, shift, offset, COPY_NODE, updateLeafWith(type, leading)); return new BitMappedTrie<>(type, array, offset, newSize, shift); } } }</code><technical_language>create a method replace this idiom of copying BMT? java private BitMappedTrie<T> boxed() { return map(Function.identity()); }</technical_language>

Target:
BitMappedTrie<T> prepend(T leading) { if (cannotAdd(leading)) { return boxed().prepend(leading); } else { final int newSize = length() + 1; if (length() == 0) { return new BitMappedTrie<>(type, type.asArray(leading), offset, newSize, depthShift); } else { Object array = this.array; int shift = depthShift, offset = this.offset; if (isFullLeft()) { array = obj().copyUpdate(obj().empty(), BRANCHING_FACTOR - 1, array); shift += BRANCHING_BASE; offset = treeSize(BRANCHING_FACTOR - 1, shift); } offset -= 1; array = modifyLeaf(array, shift, offset, COPY_NODE, updateLeafWith(type, leading)); return new BitMappedTrie<>(type, array, offset, newSize, shift); } } }
Source:
<code>public void unlock(Object owner) { synchronized (this.lock) { <START> if (!owner.equals(this.owner)) { <END> throw new IllegalMonitorStateException(); } else { if (--lockCount == 0) { this.owner = null; if (waiters > 0) { lock.notifyAll(); } } } } }</code><technical_language>Add not-null assertion for owner, for lock(...)</technical_language>

Target:
public void unlock(Object owner) { Assert.checkNotNullParam("owner", owner); synchronized (this.lock) { if (!Objects.equals(owner,this.owner)) { throw new IllegalMonitorStateException(); } else { if (--lockCount == 0) { this.owner = null; if (waiters > 0) { lock.notifyAll(); } } } } }
Source:
<code>DiskManager(DiskId disk, List<ReplicaId> replicas, StoreConfig config, ScheduledExecutorService scheduler, StorageManagerMetrics metrics, StoreKeyFactory keyFactory, MessageStoreRecovery recovery, MessageStoreHardDelete hardDelete, Time time) { this.disk = disk; this.metrics = metrics; diskIOScheduler = new DiskIOScheduler(getThrottlers(config, time)); <START> ScheduledExecutorService storeStatsScheduler = Utils.newScheduler(1, false); <END> for (ReplicaId replica : replicas) { if (disk.equals(replica.getDiskId())) { String storeId = replica.getPartitionId().toString(); BlobStore store = new BlobStore(storeId, config, scheduler, storeStatsScheduler, diskIOScheduler, metrics, replica.getReplicaPath(), replica.getCapacityInBytes(), keyFactory, recovery, hardDelete, time); stores.put(replica.getPartitionId(), store); } } compactionManager = new CompactionManager(disk.getMountPath(), config, stores.values(), time); }</code><technical_language>a daemon thread</technical_language>

Target:
DiskManager(DiskId disk, List<ReplicaId> replicas, StoreConfig config, ScheduledExecutorService scheduler, StorageManagerMetrics metrics, StoreKeyFactory keyFactory, MessageStoreRecovery recovery, MessageStoreHardDelete hardDelete, Time time) { this.disk = disk; this.metrics = metrics; this.time = time; diskIOScheduler = new DiskIOScheduler(getThrottlers(config, time)); longLivedTaskScheduler = Utils.newScheduler(1, true); for (ReplicaId replica : replicas) { if (disk.equals(replica.getDiskId())) { String storeId = replica.getPartitionId().toString(); BlobStore store = new BlobStore(storeId, config, scheduler, longLivedTaskScheduler, diskIOScheduler, metrics, replica.getReplicaPath(), replica.getCapacityInBytes(), keyFactory, recovery, hardDelete, time); stores.put(replica.getPartitionId(), store); } } compactionManager = new CompactionManager(disk.getMountPath(), config, stores.values(), metrics, time); }
Source:
<code>private static void removeAllUnused(long threshold) throws IOException { for (Iterator<Map.Entry<ConnectionId, GitHubConnection>> iterator = connections.entrySet().iterator(); iterator.hasNext(); ) { GitHubConnection record = Objects.requireNonNull(iterator.next().getValue()); <START> Long lastUse = record.lastUsed; <END> if (record.usageCount == 0 && lastUse < threshold) { iterator.remove(); reverseLookup.remove(record.gitHub); if (record.cache != null && record.cleanupCacheFolder) { record.cache.delete(); record.cache.close(); } } } }</code><technical_language>suggestion: suggestion long lastUse = record.lastUsed;</technical_language>

Target:
private static void removeAllUnused(long threshold) throws IOException { for (Iterator<Map.Entry<ConnectionId, GitHubConnection>> iterator = connections.entrySet().iterator(); iterator.hasNext(); ) { Map.Entry<ConnectionId, GitHubConnection> entry = iterator.next(); try { GitHubConnection record = Objects.requireNonNull(entry.getValue()); long lastUse = record.lastUsed; if (record.usageCount == 0 && lastUse < threshold) { iterator.remove(); reverseLookup.remove(record.gitHub); if (record.cache != null && record.cleanupCacheFolder) { record.cache.delete(); record.cache.close(); } } } catch (IOException | NullPointerException e) { LOGGER.log(WARNING, "Exception removing cache directory for unused connection: " + entry.getKey(), e); } } }
Source:
<code>public void start() throws IOException { try { openTarFile(); verify(); restore(); } catch (IOException e) { log.error("failed to restore from backup tar file {}", filePath); throw e; } finally { cleanup(); } <START> log.debug("restore completed"); <END> }</code><technical_language>info</technical_language>

Target:
public void start() throws IOException { try { openTarFile(); verify(); restore(); } catch (IOException e) { log.error("failed to restore from backup tar file {}", filePath); throw e; } finally { cleanup(); } log.info("restore completed"); }
Source:
<code>private void glusterHostRemove(Guid sourceClusterId) { <START> if (getClusterUtils().hasServers(sourceClusterId) <END> && !getClusterUtils().hasVolumeOnServer(getVdsId())) { VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((getClusterUtils().getUpServer(sourceClusterId)).getId(), getVds().gethost_name(), false)); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { getReturnValue().getFault().setError(returnValue.getVdsError().getCode()); getReturnValue().getFault().setMessage(returnValue.getVdsError().getMessage()); errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; return; } } }</code><technical_language>this validation happening in canDoAction? If this if condition fails, method return error. Is ok</technical_language>

Target:
private void glusterHostRemove(Guid sourceClusterId) { VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((getClusterUtils().getUpServer(sourceClusterId)).getId(), getVds().gethost_name(), false)); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(returnValue); errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; return; } }
Source:
<code>public void testTestSuiteSetting() { List<String> errors = new ArrayList<>(); for (String group : totalGroups) { Set<TestInfo> testsToRun = TestMapping.getAllTests(testMappingsDir, group); for (TestInfo test : testsToRun) { if (!validateSuiteSetting(test.getName())) { errors.add( String.format( "Missing test_suite setting for test: %s with group: %s", <START> test.getName(), group)); <END> } } } if (!errors.isEmpty()) { throw new RuntimeException( String.format( "Fail test_suite setting check:\n%s", Joiner.on("\n").join(errors))); } }</code><technical_language>include test's source path, find in test.getSources() This developer locate TEST_MAPPING file</technical_language>

Target:
public void testTestSuiteSetting() { List<String> errors = new ArrayList<>(); for (String testGroup : allTests.keySet()) { for (TestInfo testInfo : allTests.get(testGroup)) { if (!validateSuiteSetting(testInfo.getName())) { errors.add( String.format( "Missing test_suite setting for test: %s, test group: %s, " + "TEST_MAPPING file path: %s", testInfo.getName(), testGroup, testInfo.getSources())); } } } if (!errors.isEmpty()) { throw new RuntimeException( String.format( "Fail test_suite setting check:\n%s", Joiner.on("\n").join(errors))); } }
Source:
<code>public List<ServiceDefinition> getServices(String name) { List<CatalogService> services = client.get().catalogClient() .getService(name, queryOptions) .getResponse(); List<ServiceHealth> healths = client.get().healthClient() .getAllServiceInstances(name, queryOptions) .getResponse(); return services.stream() .map(service -> newService( name, service, healths.stream() .filter(serviceHealth -> serviceHealth.getService().getId().equals(service.getServiceId())) <START> .collect(Collectors.toList()))) <END> .collect(Collectors.toList()); }</code><technical_language>Wondering if this moved newService</technical_language>

Target:
public List<ServiceDefinition> getServices(String name) { List<CatalogService> services = client.get().catalogClient() .getService(name, queryOptions) .getResponse(); List<ServiceHealth> healths = client.get().healthClient() .getAllServiceInstances(name, queryOptions) .getResponse(); return services.stream() .map(service -> newService(name, service, healths)) .collect(Collectors.toList()); }
Source:
<code>public void init() { <START> JOBS_ACB_CAN_CREATE.add(SplitDeveloperJob.JOB_NAME); <END> JOBS_ACB_CAN_CREATE.add(RealWorldTestingUploadJob.JOB_NAME); }</code><technical_language>I this extension. this is a useful construct</technical_language>

Target:
public void init() { BACKGROUND_JOBS_ACB_CAN_CREATE.add(SplitDeveloperJob.JOB_NAME); BACKGROUND_JOBS_ACB_CAN_CREATE.add(RealWorldTestingUploadJob.JOB_NAME); }
Source:
<code>public <A extends Arg, U> Optional<U> createMetadata( BuildTarget buildTarget, BuildRuleResolver resolver, A args, Class<U> metadataClass) throws NoSuchBuildTargetException { if (metadataClass.isAssignableFrom(FrameworkDependencies.class)) { ImmutableSet.Builder<SourcePath> sourcePaths = ImmutableSet.builder(); resolver.requireRule(buildTarget); sourcePaths.add(new BuildTargetSourcePath(buildTarget)); <START> return Optional.of(metadataClass.cast(FrameworkDependencies.of(sourcePaths.build()))); <END> } return Optional.absent(); }</code><technical_language>Easier ImmutableSet.of() for a singleton set</technical_language>

Target:
public <A extends Arg, U> Optional<U> createMetadata( BuildTarget buildTarget, BuildRuleResolver resolver, A args, Class<U> metadataClass) throws NoSuchBuildTargetException { if (metadataClass.isAssignableFrom(FrameworkDependencies.class)) { resolver.requireRule(buildTarget); ImmutableSet<BuildTargetSourcePath> sourcePaths = ImmutableSet.of(new BuildTargetSourcePath(buildTarget)); return Optional.of(metadataClass.cast(FrameworkDependencies.of(sourcePaths))); } return Optional.absent(); }
Source:
<code>private EndpointCache getOrAddEndpoint(URI endpoint) { EndpointCache endpointCache = this.addressCacheByEndpoint.computeIfAbsent(endpoint , key -> { GatewayAddressCache gatewayAddressCache = new GatewayAddressCache(endpoint, protocol, this.tokenProvider, this.userAgentContainer, this.httpClient); AddressResolver addressResolver = new AddressResolver(); addressResolver.initializeCaches(this.collectionCache, this.routingMapProvider, gatewayAddressCache); EndpointCache cache = new EndpointCache(); cache.addressCache = gatewayAddressCache; cache.addressResolver = addressResolver; return cache; }); if (this.addressCacheByEndpoint.size() > this.maxEndpoints) { <START> List<URI> allEndpoints = new ArrayList<URI>(this.endpointManager.getWriteEndpoints()); <END> allEndpoints.addAll(this.endpointManager.getReadEndpoints()); Collections.reverse(allEndpoints); LinkedList<URI> endpoints = new LinkedList<>(allEndpoints); while (this.addressCacheByEndpoint.size() > this.maxEndpoints) { if (endpoints.size() > 0) { URI dequeueEnpoint = endpoints.pop(); if (this.addressCacheByEndpoint.get(dequeueEnpoint) != null) { this.addressCacheByEndpoint.remove(dequeueEnpoint); } } else { break; } } } return endpointCache; }</code><technical_language>This diamond operator right hand side</technical_language>

Target:
private EndpointCache getOrAddEndpoint(URI endpoint) { EndpointCache endpointCache = this.addressCacheByEndpoint.computeIfAbsent(endpoint , key -> { GatewayAddressCache gatewayAddressCache = new GatewayAddressCache(endpoint, protocol, this.tokenProvider, this.userAgentContainer, this.httpClient); AddressResolver addressResolver = new AddressResolver(); addressResolver.initializeCaches(this.collectionCache, this.routingMapProvider, gatewayAddressCache); EndpointCache cache = new EndpointCache(); cache.addressCache = gatewayAddressCache; cache.addressResolver = addressResolver; return cache; }); if (this.addressCacheByEndpoint.size() > this.maxEndpoints) { List<URI> allEndpoints = new ArrayList<>(this.endpointManager.getWriteEndpoints()); allEndpoints.addAll(this.endpointManager.getReadEndpoints()); Collections.reverse(allEndpoints); LinkedList<URI> endpoints = new LinkedList<>(allEndpoints); while (this.addressCacheByEndpoint.size() > this.maxEndpoints) { if (endpoints.size() > 0) { URI dequeueEnpoint = endpoints.pop(); if (this.addressCacheByEndpoint.get(dequeueEnpoint) != null) { this.addressCacheByEndpoint.remove(dequeueEnpoint); } } else { break; } } } return endpointCache; }
Source:
<code>private void track() { Map<String, Object> props = new HashMap<>(); <START> props.put("login_phase", mLoginPhase.name()); <END> props.put("login_service_is_foreground", isForeground()); AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_WPCOM_BACKGROUND_SERVICE_UPDATE, props); }</code><technical_language>mLoginPhase is null here</technical_language>

Target:
private void track() { Map<String, Object> props = new HashMap<>(); props.put("login_phase", mLoginPhase == null ? "null" : mLoginPhase.name()); props.put("login_service_is_foreground", isForeground()); AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_WPCOM_BACKGROUND_SERVICE_UPDATE, props); }
Source:
<code>public Builder setSupportedCipherSuites(String... cipherSuites) { if (cipherSuites == null) { throw new NullPointerException("Connector must support at least one cipher suite"); } <START> if (cipherSuites.length == 0) { <END> throw new IllegalArgumentException("Connector must support at least one cipher suite"); } List<CipherSuite> suites = new ArrayList<>(cipherSuites.length); for (int i = 0; i < cipherSuites.length; i++) { if (CipherSuite.TLS_NULL_WITH_NULL_NULL.name().equals(cipherSuites[i])) { throw new IllegalArgumentException("NULL Cipher Suite is not supported by connector"); } CipherSuite knownSuite = CipherSuite.getTypeByName(cipherSuites[i]); if (knownSuite != null) { suites.add(knownSuite); } else { throw new IllegalArgumentException( String.format("Cipher suite [%s] is not (yet) supported", cipherSuites[i])); } } config.supportedCipherSuites = suites; return this; }</code><technical_language>rewrite this. (to avoid duplicate code checking) java public Builder setSupportedCipherSuites(String... cipherSuites) { if (cipherSuites == null) { throw new NullPointerException("Connector support cipher suite"); } List<CipherSuite> suites = new ArrayList<>(cipherSuites.length); for (String suiteName : cipherSuites) { CipherSuite suite = CipherSuite.getTypeByName(suiteName); if (suite == null) { throw new IllegalArgumentException( String.format("Cipher suite [%s] is (yet) supported", suiteName)); } suites.add(suite); } setSupportedCipherSuites(suites); return this; }</technical_language>

Target:
public Builder setSupportedCipherSuites(String... cipherSuites) { if (cipherSuites == null) { throw new NullPointerException("Connector must support at least one cipher suite"); } List<CipherSuite> suites = new ArrayList<>(cipherSuites.length); for (int i = 0; i < cipherSuites.length; i++) { CipherSuite knownSuite = CipherSuite.getTypeByName(cipherSuites[i]); if (knownSuite != null) { suites.add(knownSuite); } else { throw new IllegalArgumentException( String.format("Cipher suite [%s] is not (yet) supported", cipherSuites[i])); } } return setSupportedCipherSuites(suites); }
Source:
<code>private void handleUnexpectedEvent(QueryCacheEventData event) { int partitionId = event.getPartitionId(); long sequence = event.getSequence(); Long prev = brokenSequences.putIfAbsent(partitionId, sequence); if (prev == null && logger.isWarningEnabled()) { InternalQueryCache queryCache = getQueryCache(); if (queryCache != null) { long currentSequence = sequenceProvider.getSequence(partitionId); logger.warning(format("Event lost detected for queryCache=`%s` partitionId=%d, expectedSequence=%d " + "but foundSequence=%d, cacheSize=%d", queryCache.getCacheId(), partitionId, currentSequence + 1L, sequence, queryCache.size())); <START> publishEventLost(context, info.getMapName(), info.getCacheId(), event.getPartitionId()); <END> } } }</code><technical_language>If wrong publishEventLost() is triggered if logger.isWarningEnabled() is true. This before</technical_language>

Target:
private void handleUnexpectedEvent(QueryCacheEventData event) { int partitionId = event.getPartitionId(); long sequence = event.getSequence(); Long prev = brokenSequences.putIfAbsent(partitionId, sequence); if (prev != null) { return; } InternalQueryCache queryCache = getQueryCache(); if (queryCache != null) { if (logger.isWarningEnabled()) { long currentSequence = sequenceProvider.getSequence(partitionId); logger.warning(format("Event lost detected for queryCache=`%s`: " + "partitionId=%d, expectedSequence=%d, " + "foundSequence=%d, cacheSize=%d", queryCache.getCacheId(), partitionId, currentSequence + 1L, sequence, queryCache.size())); } publishEventLost(context, info.getMapName(), info.getCacheId(), event.getPartitionId()); } }
Source:
<code>public void testPattern02() { PackageNameMatcher matcher = PackageNameMatcher.compile("com.example.*"); <START> Assert.assertNotNull(matcher); <END> Assert.assertFalse(matcher.matches("com.example")); Assert.assertTrue(matcher.matches("com.example.child")); Assert.assertTrue(matcher.matches("com.example.child.granchild")); Assert.assertFalse(matcher.matches("parent.com.example")); }</code><technical_language>is completely implausible compile returns null if in testPattern01. this check is redundant omitted</technical_language>

Target:
public void testPattern02() { PackageNameMatcher matcher = PackageNameMatcher.compile(asList("com.example.*")); assertFalse(matcher.matches("com.example")); assertTrue(matcher.matches("com.example.child")); assertTrue(matcher.matches("com.example.child.granchild")); assertFalse(matcher.matches("parent.com.example")); }
Source:
<code><START> public void printInactiveBundles() { <END> printInactiveBundles(LOGGER::error, LOGGER::error); }</code><technical_language>methods private? Especially service related ones, I a bundle context load services. thoughts creating interface prevent exposing methods a service</technical_language>

Target:
private void printInactiveBundles() { printInactiveBundles(LOGGER::error, LOGGER::error); }
Source:
<code>public String getResourceCrnByResourceName(String resourceName) { <START> return repository.findByName(resourceName).get().getResourceCrn().toString(); <END> }</code><technical_language>get crn database</technical_language>

Target:
public String getResourceCrnByResourceName(String resourceName) { return repository.findResourceCrnByName(resourceName).orElseThrow(NotFoundException.notFound("databaseserver", resourceName)).toString(); }
Source:
<code>public static Slice jsonToLongDecimal(Slice json, long precision, long scale, BigInteger tenToScale) throws IOException { try (JsonParser parser = createJsonParser(JSON_FACTORY, json)) { parser.nextToken(); Slice result = castTokenAsLongDecimal(parser, intPrecision(precision), intScale(scale)); checkCondition(parser.nextToken() == null, INVALID_CAST_ARGUMENT, "Cannot cast input json to DECIMAL(%s,%s)", precision, scale); <START> return result; <END> } catch (IOException | NumberFormatException | PrestoException e) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast '%s' to DECIMAL(%s,%s)", json.toStringUtf8(), precision, scale), e); } }</code><technical_language>I replace this java if (parser.nextToken() != null) { throw new NumberFormatException(); } error code message is overriden in catch clause anyway</technical_language>

Target:
public static Slice jsonToLongDecimal(Slice json, long precision, long scale, BigInteger tenToScale) throws IOException { try (JsonParser parser = createJsonParser(JSON_FACTORY, json)) { parser.nextToken(); Slice result = currentTokenAsLongDecimal(parser, intPrecision(precision), intScale(scale)); checkCondition(parser.nextToken() == null, INVALID_CAST_ARGUMENT, "Cannot cast input json to DECIMAL(%s,%s)", precision, scale); return result; } catch (IOException | NumberFormatException | JsonCastException e) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast '%s' to DECIMAL(%s,%s)", json.toStringUtf8(), precision, scale), e); } }
Source:
<code>private List<Target<Object>> createTargets(ControllerMethod method) { Method javaMethod = method.getMethod(); List<Target<Object>> targets = new ArrayList<>(); <START> TypeExtractor typeExtractor = new TypeExtractor(method.getController().getType()); <END> for (Parameter p : nameProvider.parametersFor(javaMethod)) { Type type = p.getParameterizedType(); if (type instanceof TypeVariable) { type = typeExtractor.extractType(type); } targets.add(new Target<>(type, p.getName())); } return targets; }</code><technical_language>changing TypeExtractor a CDI managed bean? specialized -- extensible</technical_language>

Target:
private List<Target<Object>> createTargets(ControllerMethod method) { Method javaMethod = method.getMethod(); List<Target<Object>> targets = new ArrayList<>(); for (Parameter p : nameProvider.parametersFor(javaMethod)) { Type type = p.getParameterizedType(); if (type instanceof TypeVariable) { type = extractType(method, (TypeVariable<?>) type); } targets.add(new Target<>(type, p.getName())); } return targets; }
Source:
<code>public void unset(int x, int y) { int offset = y * rowSize + (x / 32); <START> int intMask = (1 << (x & 0x1f)); <END> if ((bits[offset] & intMask) > 0) { bits[offset] ^= intMask; } }</code><technical_language>I this method work set(). complement intMask ~ &= it</technical_language>

Target:
public void unset(int x, int y) { int offset = y * rowSize + (x / 32); bits[offset] &= ~(1 << (x & 0x1f)); }
Source:
<code>protected boolean matchesSafely(Errors item) { if (code == null) { return item.hasGlobalErrors(); } else { <START> return item.getGlobalErrors().stream().anyMatch(c -> code.equals(c.getCode())); <END> } }</code><technical_language>into? "findFirst().isPresent() fit behavior of anyMatch() for null elements findFirst() forbids finding null elements while anyMatch() allows matching them"</technical_language>

Target:
protected boolean matchesSafely(Errors item) { if (code == null) { return item.hasGlobalErrors(); } else { return item.getGlobalErrors().stream().filter(c -> code.equals(c.getCode())).findFirst().isPresent(); } }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); setContentView(R.layout.post_list_activity); mIsPage = getIntent().getBooleanExtra(EXTRA_VIEW_PAGES, false); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(getString(mIsPage ? R.string.pages : R.string.posts)); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } FragmentManager fm = getFragmentManager(); if (savedInstanceState == null) { mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE); } else { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); } if (mSite == null) { <START> mSite = mSiteStore.getSiteByLocalId(AppPrefs.getSelectedSite()); <END> } if (mSite == null) { ToastUtils.showToast(this, R.string.blog_not_found, ToastUtils.Duration.SHORT); finish(); return; } mPostList = (PostsListFragment) fm.findFragmentById(R.id.postList); showErrorDialogIfNeeded(getIntent().getExtras()); }</code><technical_language>I missed something, AppPrefs.getSelectedSite site picker "MySite" fragment</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); setContentView(R.layout.post_list_activity); mIsPage = getIntent().getBooleanExtra(EXTRA_VIEW_PAGES, false); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(getString(mIsPage ? R.string.pages : R.string.posts)); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } FragmentManager fm = getFragmentManager(); if (savedInstanceState == null) { mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE); } else { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); } if (mSite == null) { ToastUtils.showToast(this, R.string.blog_not_found, ToastUtils.Duration.SHORT); finish(); return; } mPostList = (PostsListFragment) fm.findFragmentById(R.id.postList); showErrorDialogIfNeeded(getIntent().getExtras()); }
Source:
<code>public static Set<Class<?>> scanPackage(ClassLoader classLoader, String pkg) throws IOException { Reflections reflections = new Reflections(new ConfigurationBuilder() .addUrls(ClasspathHelper.forPackage(pkg, classLoader)) .addClassLoader(classLoader) .setScanners(new SubTypesScanner(false)) <START> .setMetadataAdapter(new JavaReflectionAdapter())); <END> Set<Class<?>> classes = new HashSet<Class<?>>(); for (String typeNames : reflections.getStore().get(SubTypesScanner.class.getSimpleName()).values()) { Class<?> clazz = safeClassForName(classLoader, typeNames); if (clazz != null) { classes.add(clazz); } } return classes; }</code><technical_language>[Looking implementation of getMetadataAdapter()](<LINK_0> is safe (and more extensible) leave construction of MetadataAdapter reflections</technical_language>

Target:
public static Set<Class<?>> scanPackage(ClassLoader classLoader, String pkg) throws IOException { Reflections reflections = new Reflections(new ConfigurationBuilder() .addUrls(ClasspathHelper.forPackage(pkg, classLoader)) .addClassLoader(classLoader) .setScanners(new SubTypesScanner(false))); Set<Class<?>> classes = new HashSet<Class<?>>(); for (String typeNames : reflections.getStore().get(SubTypesScanner.class.getSimpleName()).values()) { Class<?> clazz = safeClassForName(classLoader, typeNames); if (clazz != null) { classes.add(clazz); } } return classes; }
Source:
<code>public void testCreateClassificationRequest() { final FlowDocument flowDocument = new FlowDocument(); ClassificationRequest classificationRequest; classificationRequest = enricher.createClassificationRequest(flowDocument); <START> assertFalse(classificationRequest.isClassifiable()); <END> flowDocument.setDstPort(123); classificationRequest = enricher.createClassificationRequest(flowDocument); assertFalse(classificationRequest.isClassifiable()); flowDocument.setSrcPort(456); classificationRequest = enricher.createClassificationRequest(flowDocument); assertFalse(classificationRequest.isClassifiable()); flowDocument.setProtocol(6); classificationRequest = enricher.createClassificationRequest(flowDocument); assertTrue(classificationRequest.isClassifiable()); }</code><technical_language>assertEquals assertThat. assertTrue assertFalse ideal fail, usual error messages telling is wrong, others actual true, expected false</technical_language>

Target:
public void testCreateClassificationRequest() { final FlowDocument flowDocument = new FlowDocument(); ClassificationRequest classificationRequest; classificationRequest = enricher.createClassificationRequest(flowDocument); assertEquals(false, classificationRequest.isClassifiable()); flowDocument.setDstPort(123); classificationRequest = enricher.createClassificationRequest(flowDocument); assertEquals(false, classificationRequest.isClassifiable()); flowDocument.setSrcPort(456); classificationRequest = enricher.createClassificationRequest(flowDocument); assertEquals(false, classificationRequest.isClassifiable()); flowDocument.setProtocol(6); classificationRequest = enricher.createClassificationRequest(flowDocument); assertEquals(true, classificationRequest.isClassifiable()); }
Source:
<code>public void testLoadCacheWrongRepository() throws Exception { BugzillaRestConnector connector = new BugzillaRestConnector(); assertNotNull(connector); <START> assertEquals(connector, BugzillaRestConnector.getDefault()); <END> TaskRepository taskRepository = new TaskRepository(BugzillaRestConnector.getDefault().getConnectorKind(), "<LINK_0>"); AuthenticationCredentials credentials = new AuthenticationCredentials("username", "password"); taskRepository.setCredentials(AuthenticationType.REPOSITORY, credentials, false); BugzillaRestConfiguration configuration = BugzillaRestConnector.getDefault().getRepositoryConfiguration( taskRepository); assertNull(configuration); }</code><technical_language>Instead of making a singleton, create connector in setUp</technical_language>

Target:
public void testLoadCacheWrongRepository() throws Exception { TaskRepository taskRepository = new TaskRepository(connector.getConnectorKind(), "<LINK_0>"); AuthenticationCredentials credentials = new AuthenticationCredentials("username", "password"); taskRepository.setCredentials(AuthenticationType.REPOSITORY, credentials, false); BugzillaRestConfiguration configuration = connector.getRepositoryConfiguration(taskRepository); assertNull(configuration); }
Source:
<code>private CurrentWsResponse.Homepage findHomepageFor(DbSession dbSession, UserDto user) { CurrentWsResponse.Homepage homepage = null; <START> if (isNotBlank(user.getHomepageType())) { <END> homepage = homepageOf(dbSession, user); } return homepage != null ? homepage : defaultHomepageOf(); }</code><technical_language>null a</technical_language>

Target:
private CurrentWsResponse.Homepage findHomepageFor(DbSession dbSession, UserDto user) { if (user.getHomepageType() == null) { return defaultHomepageOf(); } String homepageValue = getHomepageValue(dbSession, user.getHomepageType(), user.getHomepageValue()); CurrentWsResponse.Homepage.Builder homepage = CurrentWsResponse.Homepage.newBuilder() .setType(CurrentWsResponse.HomepageType.valueOf(user.getHomepageType())); setNullable(homepageValue, homepage::setValue); return homepage.build(); }
Source:
<code>public void validateDefaultRepresentation() throws Exception { super.validateDefaultRepresentation(); assertPropPresent("encounter_id"); assertPropPresent("condition_id"); assertPropPresent("certainty"); assertPropPresent("rank"); assertPropPresent("creator"); <START> assertPropPresent("date_created"); <END> assertPropPresent("voided"); }</code><technical_language>I thought dropped date_created</technical_language>

Target:
public void validateDefaultRepresentation() throws Exception { super.validateDefaultRepresentation(); assertPropPresent("uuid"); assertPropEquals("diagnosis", getObject().getDiagnosis()); assertPropPresent("patient"); assertPropPresent("condition"); assertPropPresent("encounter"); assertPropEquals("certainty", getObject().getCertainty()); assertPropEquals("rank", getObject().getRank()); assertPropEquals("voided", getObject().getVoided()); assertPropPresent("display"); }
Source:
<code>private ComplaintEntity getEntityById(Long id) throws EntityRetrievalException { ComplaintEntity entity = null; Query query = entityManager.createQuery("FROM ComplaintEntity c " + "JOIN FETCH c.certificationBody " + "LEFT JOIN FETCH c.complaintType " + "LEFT JOIN FETCH c.complaintStatusType " + "WHERE c.deleted = false " + "AND c.id = :complaintId", ComplaintEntity.class); query.setParameter("complaintId", id); List<ComplaintEntity> result = query.getResultList(); if (result.size() > 1) { <START> throw new EntityRetrievalException("Data error. Duplicate filter id in database."); <END> } else if (result.size() == 1) { entity = result.get(0); } return entity; }</code><technical_language>wrong error text</technical_language>

Target:
private ComplaintEntity getEntityById(Long id) throws EntityRetrievalException { ComplaintEntity entity = null; Query query = entityManager.createQuery("FROM ComplaintEntity c " + "JOIN FETCH c.certificationBody " + "LEFT JOIN FETCH c.complaintType " + "LEFT JOIN FETCH c.complaintStatusType " + "WHERE c.deleted = false " + "AND c.id = :complaintId", ComplaintEntity.class); query.setParameter("complaintId", id); List<ComplaintEntity> result = query.getResultList(); if (result.size() > 1) { throw new EntityRetrievalException("Data error. Duplicate complaint id in database."); } else if (result.size() == 1) { entity = result.get(0); } return entity; }
Source:
<code>public WordTemplateContentRendererHandler(OrcsApi orcsApi, Log logger) { this.orcsApi = orcsApi; this.logger = logger; <START> this.applicHandler = null; <END> }</code><technical_language>unnecessary</technical_language>

Target:
public WordTemplateContentRendererHandler(OrcsApi orcsApi, Log logger) { this.orcsApi = orcsApi; this.logger = logger; }
Source:
<code>protected EntityTag createEntityTag(RequestContext rc, String firstId, String lastId) { Set<String> postfixSet = new HashSet<String>(); String headerName = getHeaderName(); if ( headerName != null ) { Object[] roles = rc.getHeaders(headerName); if ( roles != null ) { for (int idx = 0; idx<roles.length; idx++) { <START> if ( roles[idx] != null ) { <END> String aRole = roles[idx].toString(); String postfix = headerTagPostfixMap.get(aRole); if ( postfix != null ) postfixSet.add(postfix); } } } } String allPostfix = StringUtils.join(postfixSet, ","); return new EntityTag(firstId + ":" + lastId + ":" + allPostfix, true); }</code><technical_language>is this check necessary</technical_language>

Target:
protected EntityTag createEntityTag(RequestContext rc, String firstId, String lastId) { Set<String> postfixSet = new HashSet<String>(); String headerName = getHeaderName(); if ( headerName != null ) { Object[] roles = rc.getHeaders(headerName); if ( roles != null ) { for (Object aRole: roles) { String postfix = headerTagPostfixMap.get(aRole); if ( postfix != null ) postfixSet.add(postfix); } } } String allPostfix = StringUtils.join(postfixSet, ","); return new EntityTag(firstId + ":" + lastId + ":" + allPostfix, true); }
Source:
<code>private static ZipInfoProperties checkFile(String filename) { InputStream bis = null; ZipFile zf = null; try { <START> zf = new ZipFile(filename); <END> ZipEntry thisEntry = null; for (String infoName : infoNames) { thisEntry = zf.getEntry(infoName); if (thisEntry != null) { break; } } if (thisEntry == null) { zf.close(); return null; } bis = zf.getInputStream(thisEntry); if (bis == null) { zf.close(); return null; } ZipInfoProperties zip = new ZipInfoProperties(ProductVersionHolder.getProductVersionHolderFromMyEnv(bis)); zip.setLocation(getCanonicalPath(new File(filename)).replace('/', File.separatorChar)); bis.close(); zf.close(); return zip; } catch (IOException ioe) { return null; } finally { if(bis != null) { try { bis.close(); } catch (IOException e) { } try { zf.close(); } catch (IOException e) { } } } }</code><technical_language>try resource for zf bis this cleaner</technical_language>

Target:
private static ZipInfoProperties checkFile(String filename) { try(ZipFile zf = new ZipFile(filename)) { ZipEntry thisEntry = null; for (String infoName : infoNames) { thisEntry = zf.getEntry(infoName); if (thisEntry != null) { break; } } if (thisEntry == null) { return null; } ZipInfoProperties zip; try(InputStream bis = zf.getInputStream(thisEntry)) { zip = new ZipInfoProperties(ProductVersionHolder.getProductVersionHolderFromMyEnv(bis)); zip.setLocation(getCanonicalPath(new File(filename)).replace('/', File.separatorChar)); } return zip; } catch (IOException ioe) { return null; } }
Source:
<code>public int compare(UserAlert a0, UserAlert a1) { if(a0 == a1) return 0; short prio0 = a0.getPriorityClass(); short prio1 = a1.getPriorityClass(); if(prio0 - prio1 == 0) { boolean isEvent0 = a0.isEventNotification(); boolean isEvent1 = a1.isEventNotification(); if(isEvent0 && !isEvent1) return 1; if((!isEvent0) && isEvent1) return -1; int classHash0 = a0.getClass().hashCode(); int classHash1 = a1.getClass().hashCode(); if(classHash0 > classHash1) return 1; else if(classHash0 < classHash1) return -1; boolean isN2NTM0 = a0 instanceof N2NTMUserAlert; boolean isN2NTM1 = a1 instanceof N2NTMUserAlert; if(isN2NTM0 && isN2NTM1) { if(a0.getUpdatedTime() < a1.getUpdatedTime()) return 1; else if(a0.getUpdatedTime() > a1.getUpdatedTime()) return -1; <START> } <END> int hash0 = a0.hashCode(); int hash1 = a1.hashCode(); if(hash0 > hash1) return 1; if(hash1 > hash0) return -1; return 0; } else { if(prio0 > prio1) return 1; else return -1; } }</code><technical_language>Ordering updated time is more ordering hash code. I need restrict this N2NTMUserAlert. that, prefer UserAlertManager agnostic of kind of UserAlert</technical_language>

Target:
public int compare(UserAlert a0, UserAlert a1) { if(a0 == a1) return 0; short prio0 = a0.getPriorityClass(); short prio1 = a1.getPriorityClass(); if(prio0 - prio1 == 0) { boolean isEvent0 = a0.isEventNotification(); boolean isEvent1 = a1.isEventNotification(); if(isEvent0 && !isEvent1) return 1; if((!isEvent0) && isEvent1) return -1; int classHash0 = a0.getClass().hashCode(); int classHash1 = a1.getClass().hashCode(); if(classHash0 > classHash1) return 1; else if(classHash0 < classHash1) return -1; if(a0.getUpdatedTime() < a1.getUpdatedTime()) return 1; else if(a0.getUpdatedTime() > a1.getUpdatedTime()) return -1; int hash0 = a0.hashCode(); int hash1 = a1.hashCode(); if(hash0 > hash1) return 1; if(hash1 > hash0) return -1; return 0; } else { if(prio0 > prio1) return 1; else return -1; } }
Source:
<code>public boolean showMuteOverlayOnVideoCall() { if (carrierConfig == null) { <START> return false; <END> } return carrierConfig.getBoolean(CarrierConfigManager.KEY_VIDEO_CALL_MUTE_OVERLAY_VISIBLE_BOOL); }</code><technical_language>carrierConfig sets showMuteOverlay true default: <LINK_0> this true/false. suggestions/thoughts this</technical_language>

Target:
public boolean showMuteOverlayOnVideoCall() { if (carrierConfig == null) { return true; } return carrierConfig.getBoolean(CarrierConfigManager.KEY_VIDEO_CALL_MUTE_OVERLAY_VISIBLE_BOOL); }
Source:
<code>private void setDefaultDnsSystemProperties(Collection<InetAddress> dnses) { int last = 0; for (InetAddress dns : dnses) { ++last; String key = "net.dns" + last; String value = dns.getHostAddress(); try { mSystemProperties.set(key, value); } catch (Exception ignored) <START> <END> } for (int i = last + 1; i <= mNumDnsEntries; ++i) { String key = "net.dns" + i; try { mSystemProperties.set(key, ""); } catch (Exception ignored) } mNumDnsEntries = last; }</code><technical_language>Is relevant log error</technical_language>

Target:
private void setDefaultDnsSystemProperties(Collection<InetAddress> dnses) { int last = 0; for (InetAddress dns : dnses) { ++last; setNetDnsProperty(last, dns.getHostAddress()); } for (int i = last + 1; i <= mNumDnsEntries; ++i) { setNetDnsProperty(i, ""); } mNumDnsEntries = last; }
Source:
<code>private void addMethodToClass(ICPPClassType classType, Method method) { if (!isDuplicate(method)) { List<Method> methods = fData.get(classType); <START> if (methods == null) { <END> methods = new ArrayList<>(); methods.add(method); fData.put(classType, methods); } else { methods.add(method); } } }</code><technical_language>do instead: if (methods == null) { methods = new ArrayList<>(); fData.put(classType, methods); } methods.add(method);</technical_language>

Target:
private void addMethodToClass(ICPPClassType classType, Method method) { if (!isDuplicate(method)) { List<Method> methods = fData.get(classType); if (methods == null) { methods = new ArrayList<>(); fData.put(classType, methods); } methods.add(method); } }
Source:
<code>private ArrayList<DiskImage> mockMultipleSourceImagesForDomain(int numberOfDisks, Guid storageDomainId, int actualDiskSize) { <START> ArrayList<DiskImage> listDisks = new ArrayList<DiskImage>(); <END> for (int index=0; index < numberOfDisks; index++) { Guid imageId = Guid.NewGuid(); DiskImage image = new DiskImage(); image.setImageId(imageId); ArrayList<Guid> list = new ArrayList<Guid>(); list.add(storageDomainId); image.setstorage_ids(list); image.setActualSize(actualDiskSize); listDisks.add(image); } return listDisks; }</code><technical_language>this defined a List<DiskImage></technical_language>

Target:
private static List<DiskImage> mockMultipleSourceImagesForDomain(int numberOfDisks, Guid storageDomainId, int actualDiskSize) { List<DiskImage> listDisks = new ArrayList<DiskImage>(); for (int index=0; index < numberOfDisks; index++) { Guid imageId = Guid.NewGuid(); DiskImage image = new DiskImage(); image.setImageId(imageId); ArrayList<Guid> list = new ArrayList<Guid>(); list.add(storageDomainId); image.setstorage_ids(list); image.setActualSize(actualDiskSize); listDisks.add(image); } return listDisks; }
Source:
<code>private void addTopLevelToContainer(String pid) throws DepositException { if (!topLevelPids.contains(pid)) return; try { <START> client.addResourceStatement(destinationPID, Relationship.contains.getURI().toString(), new PID(pid).getURI()); <END> } catch (FedoraException e) { throw new DepositException("Failed to add object " + pid + " to destination " + destinationPID.getPid(), e); } }</code><technical_language>causing harm, is a reason prefer addResourceStatement addObjectRelationship in this case? Oh, is a tab instead of a space "destinationPID, Relationship"</technical_language>

Target:
private void addTopLevelToContainer(String pid) throws DepositException { if (!topLevelPids.contains(pid)) return; try { client.addObjectRelationship(destinationPID, Relationship.contains.getURI().toString(), new PID(pid)); } catch (FedoraException e) { throw new DepositException("Failed to add object " + pid + " to destination " + destinationPID.getPid(), e); } }
Source:
<code>private void triggerTest(String packageName, boolean applyGroupSelectionAtTest) { TestNG tng = new TestNG(); tng.setVerbose(0); <START> final XmlSuite suite = new XmlSuite(); <END> suite.setName("1297_suite"); final XmlPackage xmlPackage = new XmlPackage(); xmlPackage.setName(packageName); final XmlTest xmlTest = new XmlTest(suite); xmlTest.setName("1297_test"); if (applyGroupSelectionAtTest) { xmlTest.setGroups(getGroup()); } else { suite.setGroups(getGroup()); } xmlTest.setPackages(new ArrayList<XmlPackage>(){{add(xmlPackage);}}); suite.setTests(new ArrayList<XmlTest>(){{add(xmlTest);}}); tng.setXmlSuites(new ArrayList<XmlSuite>(){{add(suite);}}); tng.setOutputDirectory(mTempDirectory.getAbsolutePath()); tng.run(); }</code><technical_language>helper methods SimpleBaseTest. update some legacy tests too</technical_language>

Target:
private void triggerTest(String packageName, boolean applyGroupSelectionAtTest) { final XmlSuite suite = createXmlSuite("1297_suite"); final XmlTest xmlTest = createXmlTestWithPackages(suite, "1297_test", packageName); XmlGroups groups = createGroupIncluding("run"); if (applyGroupSelectionAtTest) { xmlTest.setGroups(groups); } else { suite.setGroups(groups); } TestNG tng = create(mTempDirectory.toPath(), suite); tng.setUseDefaultListeners(true); tng.run(); }
Source:
<code>public void setDate(long columnIndex, long rowIndex, Date value){ if (parent.isImmutable()) throwImmutable(); <START> nativeSetTimestampValue(nativePtr, columnIndex, rowIndex, value.getTime()/1000); <END> }</code><technical_language>divide 1000 here. unit test catching this</technical_language>

Target:
public void setDate(long columnIndex, long rowIndex, Date value){ if (parent.isImmutable()) throwImmutable(); nativeSetTimestampValue(nativePtr, columnIndex, rowIndex, value.getTime()); }
Source:
<code>public void testInitWithMultiMarkerClass() { <START> if (!SecureLogging.hasExtClass()) <END> return; assertTrue("this test fails if the dependency org.owasp is not available.", SecureLogging.hasExtClass()); Marker multiMarker = SecureLogging.SECURITY_SUCCESS_CONFIDENTIAL; Marker securMarker = SecureLogging.SECURITY_SUCCESS; Marker confidMarker = SecureLogging.CONFIDENTIAL; assertTrue("MultiMarker must have references.", multiMarker.hasReferences()); assertTrue("MultiMarker must contain both of its constituent Markers.", multiMarker.contains(securMarker)); assertTrue("MultiMarker must contain both of its constituent Markers.", multiMarker.contains(confidMarker)); }</code><technical_language>omit curly braces in Java. IDE setup properly get warnings</technical_language>

Target:
public void testInitWithMultiMarkerClass() { if (!SecureLogging.hasExtClass()) { return; } assertThat(SecureLogging.hasExtClass()).as("dependency org.owasp is available.").isTrue(); Marker multiMarker = SecureLogging.SECURITY_SUCCESS_CONFIDENTIAL; Marker securMarker = SecureLogging.SECURITY_SUCCESS; Marker confidMarker = SecureLogging.CONFIDENTIAL; assertThat(multiMarker.hasReferences()).as("MultiMarker has references.").isTrue(); assertThat(multiMarker.contains(securMarker)).as("MultiMarker contains Security Marker.").isTrue(); assertThat(multiMarker.contains(confidMarker)).as("MultiMarker contains Confidential Marker.").isTrue(); }