Migrate Java code to separate QL repo.

This commit is contained in:
Pavel Avgustinov
2018-08-30 10:48:05 +01:00
parent d957c151a6
commit 846c9d5860
2319 changed files with 134386 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
/**
* @name Inefficient String constructor
* @description Using the 'String(String)' constructor is less memory efficient than using the
* constructor argument directly.
* @kind problem
* @problem.severity recommendation
* @precision high
* @id java/inefficient-string-constructor
* @tags efficiency
* maintainability
*/
import java
from ClassInstanceExpr e
where
e.getConstructor().getDeclaringType() instanceof TypeString and
e.getArgument(0).getType() instanceof TypeString
select e, "Inefficient new String(String) constructor."