langtools/make/test/crules/CodingRulesAnalyzerPlugin/Test.java
changeset 29294 376a915b4ff0
parent 25848 3bc09f4676a9
equal deleted inserted replaced
29293:1583c6dd6df7 29294:376a915b4ff0
     3  */
     3  */
     4 
     4 
     5 import com.sun.tools.javac.util.Assert;
     5 import com.sun.tools.javac.util.Assert;
     6 
     6 
     7 public class Test {
     7 public class Test {
     8     public void check(String value) {
     8 
     9         Assert.check(value.trim().length() > 0, "value=" + value);
     9     String v;
       
    10 
       
    11     public void check1(String value) {
       
    12         Assert.check(value.trim().length() > 0, "value=" + value); //fail
       
    13     }
       
    14     public void check2(String value) {
       
    15         Assert.check(value.trim().length() > 0, "value=" + "value"); //ok
       
    16     }
       
    17     public void check3(String value) {
       
    18         Assert.check(value.trim().length() > 0, () -> "value=" + value); //ok
       
    19     }
       
    20     public void check4(String value) {
       
    21         Assert.check(value.trim().length() > 0, value); //ok
       
    22     }
       
    23     public void check5(String value) {
       
    24         Assert.check(value.trim().length() > 0, v); //ok
       
    25     }
       
    26     public void check6(String value) {
       
    27         Assert.check(value.trim().length() > 0, () -> "value=" + "value"); //fail
       
    28     }
       
    29     public void check7(String value) {
       
    30         Assert.check(value.trim().length() > 0, () -> value); //fail
       
    31     }
       
    32     public void check8(String value) {
       
    33         Assert.check(value.trim().length() > 0, () -> v); //fail
    10     }
    34     }
    11 }
    35 }