View Javadoc
1   /*
2   WhitespaceAfter
3   tokens = (default)COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE, LITERAL_WHILE, \
4            LITERAL_DO, LITERAL_FOR, DO_WHILE
5   
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.whitespace.whitespaceafter;
10  
11  class InputWhitespaceAfterWithEmoji {
12  
13      private String[] emoji = new String[]{"🤩🎄" ,"🧐","🧐🧐", // 2 violations
14          "🧐🧐"};
15  
16      void foo1() {
17  
18          int i = 0, count = 0;
19          // ok
20          do {
21              count += "🎄🧐".charAt(i) == "🤩🎄".charAt(i) ? 1 : 0;
22          }
23          while ("🎄🧐".equals("🎄🧐weqwe"));
24  
25          while ("🤩".isEmpty()) ;
26          while ("🎄".equals("0sda"));
27          while (true)
28              if ("🎄🎄".equals("🎄dsaewwrrw🧐")) { // ok
29                  String b = "🎄🎄";return; // violation '';' is not followed by whitespace'
30              } else {
31                  if (!!"🎄🎄".equals("🎄dsaewwrrw🧐")) return;
32              }
33      }
34  
35      void foo2() {
36          Object obj = ("🎄dsaewwrrw🧐");
37          obj = (java.lang.
38                  Object)"🎄"; // violation ''typecast' is not followed by whitespace'
39          obj = (java.lang.
40              Object) "🎄"; // ok
41      }
42  
43      void foo3() {
44          char[] a = ("🎄🎄🎄" +
45              "asd🧐").toString(
46          ).toCharArray();
47  
48          for (int i = 0;i < 5 && emoji[i].equals("🎄");i++) { // 2 violations
49          }
50  
51      }
52  }