use of org.gradle.internal.MutableBoolean in project gradle by gradle.
the class JUnitPlatformTestExecutionListener method createDescriptorIfAbsent.
private boolean createDescriptorIfAbsent(TestIdentifier node) {
MutableBoolean wasCreated = new MutableBoolean(false);
descriptorsByUniqueId.computeIfAbsent(node.getUniqueId(), uniqueId -> {
wasCreated.set(true);
boolean isTestClassId = isTestClassIdentifier(node);
if (node.getType().isContainer() || isTestClassId) {
if (isTestClassId) {
return createTestClassDescriptor(node);
}
String displayName = node.getDisplayName();
Optional<TestDescriptorInternal> parentId = node.getParentId().map(descriptorsByUniqueId::get);
if (parentId.isPresent()) {
Object candidateId = parentId.get().getId();
if (candidateId instanceof CompositeIdGenerator.CompositeId) {
return createNestedTestSuite(node, displayName, (CompositeIdGenerator.CompositeId) candidateId);
}
}
}
return createTestDescriptor(node, node.getLegacyReportingName(), node.getDisplayName());
});
return wasCreated.get();
}
use of org.gradle.internal.MutableBoolean in project gradle by gradle.
the class AbstractFileCollection method visitAll.
/**
* Visits all the files of the given tree.
*/
protected static boolean visitAll(FileSystemMirroringFileTree tree) {
final MutableBoolean hasContent = new MutableBoolean();
tree.visit(new FileVisitor() {
@Override
public void visitDir(FileVisitDetails dirDetails) {
dirDetails.getFile();
hasContent.set(true);
}
@Override
public void visitFile(FileVisitDetails fileDetails) {
fileDetails.getFile();
hasContent.set(true);
}
});
return hasContent.get();
}
use of org.gradle.internal.MutableBoolean in project gradle by gradle.
the class AbstractFileTree method isEmpty.
@Override
public boolean isEmpty() {
final MutableBoolean found = new MutableBoolean();
visit(new EmptyFileVisitor() {
@Override
public void visitFile(FileVisitDetails fileDetails) {
found.set(true);
fileDetails.stopVisiting();
}
});
return !found.get();
}
use of org.gradle.internal.MutableBoolean in project gradle by gradle.
the class DefaultWorkerLeaseService method allLockedByCurrentThread.
private boolean allLockedByCurrentThread(final Iterable<? extends ResourceLock> locks) {
final MutableBoolean allLocked = new MutableBoolean();
coordinationService.withStateLock(new Transformer<ResourceLockState.Disposition, ResourceLockState>() {
@Override
public ResourceLockState.Disposition transform(ResourceLockState resourceLockState) {
allLocked.set(CollectionUtils.every(locks, new Spec<ResourceLock>() {
@Override
public boolean isSatisfiedBy(ResourceLock lock) {
return lock.isLockedByCurrentThread();
}
}));
return FINISHED;
}
});
return allLocked.get();
}
use of org.gradle.internal.MutableBoolean in project gradle by gradle.
the class OutputUnpacker method visitOutputFileProperty.
@Override
public void visitOutputFileProperty(String propertyName, boolean optional, PropertyValue value, OutputFilePropertyType filePropertyType) {
hasDeclaredOutputs = true;
MutableBoolean hasSpecs = new MutableBoolean();
if (finalizeBeforeUnpacking) {
value.maybeFinalizeValue();
}
FileParameterUtils.resolveOutputFilePropertySpecs(ownerDisplayName, propertyName, value, filePropertyType, fileCollectionFactory, locationOnly, spec -> {
hasSpecs.set(true);
unpackedOutputConsumer.visitUnpackedOutputFileProperty(propertyName, optional, value, spec);
});
if (!hasSpecs.get()) {
unpackedOutputConsumer.visitEmptyOutputFileProperty(propertyName, optional, value);
}
}
Aggregations