mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
8043643: Add an crules analyzer avoiding string concatenation in messages of Assert checks
Generalizing the crules infrastructure, adding a new analyzer to check String concatenation in Assert calls. Reviewed-by: jjg, vromero
This commit is contained in:
parent
5284120119
commit
66ea31ef63
17 changed files with 374 additions and 73 deletions
|
@ -0,0 +1,11 @@
|
|||
/**@test /nodynamiccopyright/
|
||||
* @compile/fail/ref=Test.out -Xplugin:coding_rules -XDrawDiagnostics Test.java
|
||||
*/
|
||||
|
||||
import com.sun.tools.javac.util.Assert;
|
||||
|
||||
public class Test {
|
||||
public void check(String value) {
|
||||
Assert.check(value.trim().length() > 0, "value=" + value);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue