View Javadoc
1   package com.google.checkstyle.test.chapter2filebasic.rule233nonascii;
2   
3   public class InputAvoidEscapedUnicodeCharacters {
4   
5       /*warn*/private String unitAbbrev2 = "\u03bcs";
6   
7       private String unitAbbrev3 = "\u03bcs"; //Greek letter mu ok
8   
9       private String unitAbbrev4 =
10              "\u03bcs"; //Greek letter mu
11  
12      public Object fooString()
13      {   
14          String unitAbbrev = "μs";
15          /*warn*/String unitAbbrev2 = "\u03bcs"; 
16          String unitAbbrev3 = "\u03bcs"; // Greek letter mu, "s" ok
17          String fakeUnicode = "asd\tsasd"; 
18          String fakeUnicode2 = "\\u23\\u123i\\u";
19          String content = "";
20          /*byte order mark ok*/return "\ufeff" + content ;
21      }
22  
23      public Object fooChar()
24      {
25          /*warn*/char unitAbbrev2 = '\u03bc'; 
26          char unitAbbrev3 = '\u03bc'; // Greek letter mu, "s" ok
27          String content = "";
28          /*byte order mark ok*/return '\ufeff' + content;
29      }
30  
31      public void multiplyString()
32      {
33          /*warn*/String unitAbbrev2 = "asd\u03bcsasd";
34          String unitAbbrev3 = "aBc\u03bcssdf\u03bc"; /* Greek letter mu, "s"*/ //ok
35          /*warn*/String unitAbbrev4 = "\u03bcaBc\u03bcssdf\u03bc";
36          /*warn*/String allCharactersEscaped = "\u03bc\u03bc"; 
37      }
38  }