View Javadoc
1   /*
2   RightCurly
3   option = (default)same
4   tokens = LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, \
5            LITERAL_ELSE, METHOD_DEF, LITERAL_DO
6   
7   
8   */
9   
10  package com.puppycrawl.tools.checkstyle.checks.blocks.rightcurly;
11  
12  public class InputRightCurlyWithEmoji {
13  
14      static Runnable r = () -> {
15          String.valueOf("Hello world 🥳 🎄 !!");
16      };
17  
18      private void method2() {
19          String x = "🎄🤣";
20          { String y = "🎄🤣🎄🤣";}
21          try {
22              if (x.equals("🎄🤣")) {
23  
24              } // violation ''}' at column 13 should be on the same line as .*/else'
25  
26              else if (!x.equals("🎄🤣")) {
27                  ;
28              } // violation ''}' at column 13 should be on the same line as .*/else'
29  
30              else {
31                  x = "🎄🤣";
32              }
33              switch (x) {
34                  case "\uD83C\uDF84\uD83E\uDD23":
35                      break;
36                  default: {
37                      break;
38                  }
39              }
40  
41              switch ("🤣") {
42                  case "qw": {
43                      return;
44                  }
45                  default: {
46                      return;
47                  }
48              }
49          }
50          // violation above ''}' at column 9 should be on the same line as .*/catch'
51  
52          catch (Exception e) {
53          }
54          while (x == "🎄") {
55          }
56  
57      }
58  
59      public void foo3() {
60          String a = "😆🤩";
61          int i = 1;
62          do {
63              i++;
64              String.CASE_INSENSITIVE_ORDER.equals(i + " ");
65          } while (a.equals("🧐"));
66      }
67  
68      String method4(String a) {
69          if (a.equals("🎄")) a = "😆"; return "😆🤩"; }
70      // violation above ''}' at column 50 should have line break before.'
71  
72      public void foo4() {String a = "😆🤩";}
73      interface Interface3 {
74          void display();
75  
76          interface Interface4 {
77              default boolean foo5(){
78                  return "qwwe".equals("🎄🤣");}}
79          // violation above ''}' at column 44 should have line break before.'
80      }
81      public void foo5() {
82  
83          do { // violation below ''}' at column 41 should have line break before.'
84              String a = new String("🤣🤣");}
85           while (true);
86      }
87  }