1 package com.puppycrawl.tools.checkstyle.checks.coding.requirethis; 2 3 public class InputRequireThisCaseGroup { 4 private String aVariable; 5 6 public String method1(int val) { 7 switch (val) { 8 case 0: 9 String aVariable = ""; 10 11 if (this.aVariable != null) { 12 aVariable = this.aVariable; 13 } 14 15 return aVariable; 16 default: 17 return null; 18 } 19 } 20 21 public String method2(int val) { 22 switch (val) { 23 case 0: 24 String aVariable = ""; 25 26 if (this.aVariable != null) { 27 aVariable = this.aVariable; 28 } 29 30 return aVariable; 31 } 32 return null; 33 } 34 35 public String method3(int val) { 36 switch (val) { 37 case 0: 38 String other = ""; 39 40 if (aVariable != null) { 41 other = aVariable; 42 } 43 44 return other; 45 } 46 return null; 47 } 48 }