Replace !Optional.isPresent with Optional.isEmpty
See gh-39259
This commit is contained in:
committed by
Phillip Webb
parent
48343cc531
commit
24e0864105
@@ -194,7 +194,7 @@ public abstract class UpgradeDependencies extends DefaultTask {
|
||||
java.util.Optional<Milestone> matchingMilestone = milestones.stream()
|
||||
.filter((milestone) -> milestone.getName().equals(getMilestone().get()))
|
||||
.findFirst();
|
||||
if (!matchingMilestone.isPresent()) {
|
||||
if (matchingMilestone.isEmpty()) {
|
||||
throw new InvalidUserDataException("Unknown milestone: " + getMilestone().get());
|
||||
}
|
||||
return matchingMilestone.get();
|
||||
|
||||
@@ -37,7 +37,7 @@ class DisabledOnOsCondition implements ExecutionCondition {
|
||||
|
||||
@Override
|
||||
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) {
|
||||
if (!context.getElement().isPresent()) {
|
||||
if (context.getElement().isEmpty()) {
|
||||
return ConditionEvaluationResult.enabled("No element for @DisabledOnOs found");
|
||||
}
|
||||
MergedAnnotation<DisabledOnOs> annotation = MergedAnnotations
|
||||
|
||||
Reference in New Issue
Block a user