Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
erwan-serandour committed Dec 13, 2024
1 parent 3519442 commit ca50526
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,9 @@ void annotated(){}
@MyAnnotation2()
String endpoint_url_path = "/a-great/path/for-this-example"; // Compliant, an annotation is applied on the variable

void reachFullCoverage(){
int path = 0;
path = 10;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ private static boolean isHardcodedURI(ExpressionTree expr) {
@Nullable
private static String stringLiteral(ExpressionTree expr) {
ExpressionTree unquoted = ExpressionUtils.skipParentheses(expr);
if (unquoted instanceof LiteralTree literalTree) {

if (unquoted instanceof LiteralTree literalTree && literalTree.is(Tree.Kind.STRING_LITERAL)) {
return LiteralUtils.trimQuotes(literalTree.value());
}
return null;
Expand Down

0 comments on commit ca50526

Please sign in to comment.