Open
Description
It appears the class StringLiteral
matches String concatenation of two String literals.
This is not how the JLS defines a String literal. Instead they should be matched as separate String literals being operands of an AddExpr
(which is a CompileTimeConstantExpr
).
Query finding these erroneous StringLiteral
s:
import java
from StringLiteral s
where
exists(s.getLiteral().indexOf("+"))
and not exists(s.getValue().indexOf("+"))
select s