Skip to content

Commit

Permalink
Guard against null effectiveExclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider committed Feb 20, 2023
1 parent a3bd2f6 commit bc7aa0b
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
import org.openrewrite.internal.lang.Nullable;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

import static java.util.Collections.emptyList;
import static org.openrewrite.internal.StringUtils.matchesGlob;

@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class, property = "@ref")
Expand Down Expand Up @@ -63,9 +65,14 @@ public class ResolvedDependency implements Serializable {

int depth;

@Nullable
@NonFinal
List<GroupArtifact> effectiveExclusions;

public List<GroupArtifact> getEffectiveExclusions() {
return effectiveExclusions == null ? emptyList() : effectiveExclusions;
}

/**
* Only used by dependency resolution to avoid unnecessary empty list allocations for leaf dependencies.
* @param dependencies A dependency list
Expand Down

0 comments on commit bc7aa0b

Please sign in to comment.