1 /* 2 FallThrough 3 checkLastCaseGroup = (default)false 4 reliefPattern = (default)falls?[ -]?thr(u|ough) 5 6 7 */ 8 9 package com.puppycrawl.tools.checkstyle.checks.coding.fallthrough; 10 11 public class InputFallThroughFallThroughLotsOfComment { 12 13 void method(int lineNumber) { 14 switch (lineNumber) { 15 case 3: 16 Object pi = null; 17 int line = 2; 18 // fall-through intended - the line contains already the first entries 19 // the following 4 lines contain additional satellite ids 20 case 4: // violation 'Fall\ through from previous branch of the switch statement' 21 case 5: 22 case 6: 23 case 7: { 24 int lineLength = 2; 25 int startIdx = 9; 26 while (lineLength++ < 2&& (startIdx + 3) <= lineLength) { 27 String satId; 28 startIdx += 3; 29 } 30 break; 31 } 32 33 case 14: 34 // ignore additional custom fields 35 break; 36 37 // position/velocity/clock components 38 case 15: { 39 // String base = line.substring(3, 13).trim(); 40 41 // base = line.substring(14, 26).trim(); 42 } 43 case 16: // violation 'Fall\ through from previous branch of the switch statement' 44 case 17: 45 case 18: 46 // ignore additional custom parameters 47 break; 48 49 case 19: 50 case 20: 51 case 21: 52 case 22: 53 // ignore comment lines 54 break; 55 default: 56 // ignore -> method should only be called up to line 22 57 break; 58 } 59 // CHECKSTYLE: resume FallThrough check 60 } 61 }