View Javadoc
1   /*xml
2   <module name="Checker">
3       <module name="TreeWalker">
4           <module name="AvoidEscapedUnicodeCharacters"/>
5       </module>
6   </module>
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.avoidescapedunicodecharacters;
10  
11  // xdoc section -- start
12  public class Example1 {
13    // OK, perfectly clear even without a comment.
14    String unitAbbrev = "μs";
15    // violation below, the reader has no idea what this is. 'should be avoided.'
16    String unitAbbrev1 = "\u03bcs";
17    // violation below
18    String unitAbbrev2 = "\u03bc\u03bc\u03bc";
19    // violation below
20    String unitAbbrev3 = "\u03bcs"; // it is  μs
21    // violation below
22    String unitAbbrev4 = "\u03bc\u03bcs";
23    public static int content() {
24      char content = 'r';
25      // violation below
26      return '\ufeff' + content;
27    }
28  }
29  // xdoc section -- end