langtools/make/test/crules/CodingRulesAnalyzerPlugin/Test.java
author jlahoda
Fri, 01 Aug 2014 11:09:40 -0700
changeset 25848 3bc09f4676a9
child 29294 376a915b4ff0
permissions -rw-r--r--
8043643: Add an crules analyzer avoiding string concatenation in messages of Assert checks. Summary: Generalizing the crules infrastructure, adding a new analyzer to check String concatenation in Assert calls. Reviewed-by: jjg, vromero

/**@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);
    }
}