Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmews committed May 30, 2024
1 parent 34d8b4c commit 281d552
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,12 @@ private Object mergeTypeArgs(RuleEnvironment G, Object... typeArgs) {
List<Object> result = new ArrayList<>();

for (Object currTypeArg : typeArgs) {
Collection<?> l = (currTypeArg instanceof Collection<?>) ? (Collection<?>) currTypeArg
: List.of(currTypeArg);
Collection<?> l = (currTypeArg instanceof Collection<?>)
? (Collection<?>) currTypeArg
: currTypeArg == null
? Collections.emptyList()
: List.of(currTypeArg);

for (Object currO : l) {
if (currO != null && !typeArgAwareContains(G, result, currO)) {
result.add(currO);
Expand All @@ -241,10 +245,10 @@ private Object mergeTypeArgs(RuleEnvironment G, Object... typeArgs) {

private boolean typeArgAwareContains(RuleEnvironment G, Collection<?> l, Object o) {
if (o instanceof TypeArgument) {
Wildcard oSubst = (Wildcard) ts.substTypeVariables(G, (TypeArgument) o);
TypeArgument oSubst = ts.substTypeVariables(G, (TypeArgument) o);
for (Object currO : l) {
if (currO instanceof TypeArgument) {
Wildcard currOSubst = (Wildcard) ts.substTypeVariables(G, (TypeArgument) currO);
TypeArgument currOSubst = ts.substTypeVariables(G, (TypeArgument) currO);
if (typeCompareHelper.compare(currOSubst, oSubst) == 0) {
return true;
}
Expand Down

0 comments on commit 281d552

Please sign in to comment.