Java: Deprecate StringLiteral.getRepresentedString()

This commit is contained in:
Marcono1234
2021-10-29 14:50:15 +02:00
parent 3a1836c9f6
commit bfb9577d15
27 changed files with 104 additions and 104 deletions

View File

@@ -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."