Skip to content

Commit 24e0864

Browse files
tobias-lippertphilwebb
authored andcommitted
Replace !Optional.isPresent with Optional.isEmpty
See gh-39259
1 parent 48343cc commit 24e0864

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private Milestone determineMilestone(GitHubRepository repository) {
194194
java.util.Optional<Milestone> matchingMilestone = milestones.stream()
195195
.filter((milestone) -> milestone.getName().equals(getMilestone().get()))
196196
.findFirst();
197-
if (!matchingMilestone.isPresent()) {
197+
if (matchingMilestone.isEmpty()) {
198198
throw new InvalidUserDataException("Unknown milestone: " + getMilestone().get());
199199
}
200200
return matchingMilestone.get();

spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class DisabledOnOsCondition implements ExecutionCondition {
3737

3838
@Override
3939
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) {
40-
if (!context.getElement().isPresent()) {
40+
if (context.getElement().isEmpty()) {
4141
return ConditionEvaluationResult.enabled("No element for @DisabledOnOs found");
4242
}
4343
MergedAnnotation<DisabledOnOs> annotation = MergedAnnotations

0 commit comments

Comments
 (0)