View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="JavadocLeadingAsteriskAlign">
5         <property name="tabWidth" value="2"/>
6       </module>
7     </module>
8   </module>
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocleadingasteriskalign;
12  
13  /** Title
14   * Testing check with Tabs...
15   */
16  public class InputJavadocLeadingAsteriskAlignTabs {
17  
18  	/** <- Preceded with Tabs. */
19  	private int a;
20  
21  	 /** <- Preceded with Tabs and Spaces.
22  		* <- Preceded with Tabs.
23  		*/ // <- Preceded with Tabs.
24    private int b;
25  
26  		/** <- Preceded with Tabs.
27  	   * <- Preceded with Tabs and Spaces.
28  	   */ // <- Preceded with Tabs and Spaces.
29  	private void foo() {}
30  
31  	/** <- Preceded with Tabs.
32     * <- Preceded with Spaces.
33     */ // <- Preceded with Spaces.
34    private void foo2() {}
35  
36     /** <- Preceded with Spaces.
37  		* <- Preceded with Tabs.
38  		*/ // <- Preceded with Tabs.
39    private void foo3() {}
40  
41  	private void foo4() {
42  		// foo2 code goes here
43  	} /**
44  		 * This is allowed.
45  		 */
46  	public InputJavadocLeadingAsteriskAlignTabs() {}
47  
48  	/***
49  	  * @param x testing..... */
50    // violation above 'Leading asterisk has .* indentation .* 5, expected is 4.'
51  	public InputJavadocLeadingAsteriskAlignTabs(int x) {}
52  
53  	/*****
54  	 * @param str testing...... */
55  	public InputJavadocLeadingAsteriskAlignTabs(String str) {}
56  
57  	private enum enumWithTabs {
58  
59  	  /**
60  		*  // violation 'Leading asterisk has .* indentation .* 5, expected is 6.'
61  		  */ // violation 'Leading asterisk has .* indentation .* 7, expected is 6.'
62  		ONE,
63  
64  		/**
65  				This javadoc is allowed because there is no leading asterisk.
66  		 */
67  		TWO,
68  
69  		/**
70  			* // violation 'Leading asterisk has .* indentation .* 7, expected is 6.'
71  		*/ // violation 'Leading asterisk has .* indentation .* 5, expected is 6.'
72  		THREE,
73  
74  		/**
75  		This is allowed because there is no leading asterisk. */
76  		FOUR
77  	}
78  }