View Javadoc
1   /*
2   IllegalToken
3   tokens = COMMENT_CONTENT
4   
5   
6   */
7   
8   package com.puppycrawl.tools.checkstyle.checks.coding.illegaltoken;
9   
10  /**
11   * // violation 10 lines above 'is not allowed'
12   * // violation 2 lines above 'is not allowed'
13   * Test for illegal tokens
14   */
15  
16  public class InputIllegalTokensCheckCommentsContent
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      public native void nativeMethod();
30  
31      public void methodWithLiterals()
32      {
33          final String ref = "<a href=\"";
34          final String refCase = "<A hReF=\"";
35      }
36  
37      public void methodWithLabels() {
38          label:
39          {
40              anotherLabel: // some comment href // violation, 'is not allowed'
41              do {
42                  continue anotherLabel;
43              } while (false);
44              break label; // some a href // violation, 'is not allowed'
45          }
46      }
47  }