View Javadoc
1   /*
2   IllegalTokenText
3   format = a href
4   ignoreCase = (default)false
5   message = My custom message
6   tokens = STRING_LITERAL
7   
8   
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.coding.illegaltokentext;
12  
13  /**
14   * Test for illegal tokens
15   */
16  public class InputIllegalTokenTextCheckCustomMessageInStringLiteral
17  {
18      public void methodWithPreviouslyIllegalTokens()
19      {
20          int i = 0;
21          switch (i)
22          {
23              default:
24                  i--;
25                  i++;
26                  break;
27          }
28      }
29  
30      public native void nativeMethod();
31  
32      public void methodWithLiterals()
33      {
34          final String ref = "<a href=\""; // violation
35          final String refCase = "<A hReF=\"";
36      }
37  
38      public void methodWithLabels() {
39          label:
40          {
41              anotherLabel: // some comment href
42              do {
43                  continue anotherLabel;
44              } while (false);
45              break label; // some a href
46          }
47      }
48  }