Skip to content

Commit

Permalink
Restore two deleted comments
Browse files Browse the repository at this point in the history
Deleted in 5f2b9f3
  • Loading branch information
knutwannheden committed Nov 6, 2023
1 parent 1bb253f commit 112b76e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/main/java/org/openrewrite/analysis/InvocationMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ public boolean isSelect(Cursor cursor) {
public boolean isAnyArgument(Cursor cursor) {
return asExpression(
cursor,
expression -> nearestMethodCall(cursor).map(call -> call.getArguments().contains(expression)
&& matcher.matches(call)).orElse(false)
expression -> nearestMethodCall(cursor).map(call ->
call.getArguments().contains(expression)
&& matcher.matches(call) // Do the matcher.matches(...) last as this can be expensive
).orElse(false)
);
}

Expand Down Expand Up @@ -137,11 +139,11 @@ public boolean isParameter(Cursor cursor, int parameterIndex) {
if (finalParameterIndex == parameterIndex) {
List<Expression> varargs = arguments.subList(finalParameterIndex, arguments.size());
return varargs.contains(expression) &&
matcher.matches(call); // Do the matcher.matches(...) last as this can be expensive
matcher.matches(call); // Do the matcher.matches(...) last as this can be expensive
}
}
return arguments.get(parameterIndex) == expression &&
matcher.matches(call); // Do the matcher.matches(...) last as this can be expensive
matcher.matches(call); // Do the matcher.matches(...) last as this can be expensive
}).orElse(false));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class SecurityUtils {
PORTS = new HashSet<>();
PORTS.add(443);
PORTS.add(80);
PORTS.add(3000);
PORTS.add(3000); // we allow port 3000 for SAM local
}

public static boolean isValidPort(String port) {
Expand Down

0 comments on commit 112b76e

Please sign in to comment.