Skip to content

Commit fbd2268

Browse files
committed
Drop redundant null check on non-null getRequested()
1 parent fe1db73 commit fbd2268

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/main/java/org/openrewrite/java/dependencies/RemoveRedundantDependencies.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ private ResolvedPom applyExclusions(ResolvedPom resolvedPom, List<GroupArtifact>
181181
// corrupted by dependency mediation, as an artifact excluded here may already have been pruned by a shared
182182
// node elsewhere, in which case the exclusion never fires and drops out of getEffectiveExclusions().
183183
private static Set<GroupArtifact> declaredExclusions(ResolvedDependency dep) {
184-
Dependency requested = dep.getRequested();
185-
List<GroupArtifact> exclusions = requested == null ? null : requested.getExclusions();
184+
List<GroupArtifact> exclusions = dep.getRequested().getExclusions();
186185
return exclusions == null || exclusions.isEmpty() ? emptySet() : new HashSet<>(exclusions);
187186
}
188187

0 commit comments

Comments
 (0)