View Javadoc
1   /*
2   NoWhitespaceAfter
3   allowLineBreaks = (default)true
4   tokens = ARRAY_INIT, AT, INC, DEC, UNARY_MINUS, UNARY_PLUS, BNOT, LNOT, DOT, TYPECAST, \
5            ARRAY_DECLARATOR, INDEX_OP, LITERAL_SYNCHRONIZED, METHOD_REF
6   
7   
8   */
9   
10  package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespaceafter;
11  
12  public class InputNoWhitespaceAfterWithEmoji {
13  
14      String txt = new String ("sd🤩🎄😂 " );
15      public String foo() {
16          String []   s =  { "🎄😂", // 2 violations
17                          "🎄😂12wq"
18          };
19  
20          for (int i = 0; i < s.length; i++) {
21              char[]c = "🤩🎄".toCharArray();
22  
23          /* 👉🏻😆*/ char  []c2= "🤩🎄".toCharArray(); // violation ''char' is followed by whitespace.'
24          }
25          return "😅🧐 dsad "; // ok
26      }
27      public String foo2() {
28          String str = (@ MyAnnotation String) "🤩dsa😂adsad"; // 2 violations
29          String str3 = str + "😂" + "sadsa" +"😅🧐" +    " " ;
30          return("  🎄😂  ");
31      }
32  
33      public String foo3() {
34  
35          return  ! "🎄". isEmpty() ?"dsa😂a":  "😂..😅" ; // 2 violations
36      }
37  
38      public String[] foo4 () {
39          return new String[] {
40            "sd😂"+  "😅🧐",
41                  "👉🏻"
42          };
43      }
44  
45  }