1 package com.puppycrawl.tools.checkstyle; 6 7 12 public class InputSimplifyBoolean 13 { 14 15 public static boolean isOddMillis() 16 { 17 boolean even = System.currentTimeMillis() % 2 == 0; 18 19 if (even == true) { 21 return false; 22 } 23 else { 24 return true; 25 } 26 } 28 29 public static boolean isOddMillis2() 30 { 31 boolean even = System.currentTimeMillis() % 2 == 0; 32 if (!even) 34 return true; 35 else 36 return false; 37 } 38 39 public static boolean giveMeTrue() 40 { 41 boolean tt = isOddMillis() || true; 42 boolean ff = isOddMillis() && false; 43 return !false || (true != false); 44 } 45 46 public void tryToProvokeNPE() 47 { 48 if (true) { 49 } 50 else { 51 } 52 53 if (true) { 54 return; 55 } 56 else { 57 return; 58 } 59 } 60 61 public boolean ifNoElse() 62 { 63 if (isOddMillis()) { 64 return true; 65 } 66 return false; 67 } 68 } 69 | Popular Tags |