Skip to content

Commit 92ffd8c

Browse files
authored
Merge pull request github#6749 from aschackmull/java/istextblock
Java: Add StringLiteral.isTextBlock().
2 parents b0836a6 + 854f2a0 commit 92ffd8c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,9 @@ class StringLiteral extends Literal, @stringliteral {
726726
*/
727727
string getRepresentedString() { result = getValue() }
728728

729+
/** Holds if this string literal is a text block (`""" ... """`). */
730+
predicate isTextBlock() { getLiteral().matches("\"\"\"%") }
731+
729732
override string getAPrimaryQlClass() { result = "StringLiteral" }
730733
}
731734

0 commit comments

Comments
 (0)