mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Java: Deprecate StringLiteral.getRepresentedString()
This commit is contained in:
@@ -16,7 +16,7 @@ where
|
||||
mc.getQualifier().getType() instanceof TypeString and
|
||||
mc.getMethod().hasName("equals") and
|
||||
(
|
||||
mc.getArgument(0).(StringLiteral).getRepresentedString() = "" or
|
||||
mc.getQualifier().(StringLiteral).getRepresentedString() = ""
|
||||
mc.getArgument(0).(StringLiteral).getValue() = "" or
|
||||
mc.getQualifier().(StringLiteral).getValue() = ""
|
||||
)
|
||||
select mc, "Inefficient comparison to empty string, check for zero length instead."
|
||||
|
||||
Reference in New Issue
Block a user