View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.coding.multiplestringliterals;
2   
3   public class InputMultipleStringLiterals
4   {   /*string literals*/
5       String m = "StringContents";
6       String m1 = "SingleString";
7       String m2 = "DoubleString" + "DoubleString";
8       String m3 = "" + "";
9       String m4 = "" + "";
10      String debugStr = ", " + ", " + ", ";
11  
12      void method1() {
13          String a1 = "StringContents";
14          System.identityHashCode("StringContents");
15          // The following is not reported, since it is two string literals.
16          String a2 = "String" + "Contents";
17      }
18  
19      @SuppressWarnings("unchecked")
20      void method2(){}
21  
22      @SuppressWarnings("unchecked")
23      void method3(){}
24  
25      @SuppressWarnings("unchecked")
26      void method4(){}
27  
28      @SuppressWarnings("unchecked")
29      void method5(){}
30  }