1 54 55 package com.mullassery.act.util; 56 57 62 public final class DebugUtil { 63 64 private static boolean enabled = Boolean.getBoolean("ACT_DEBUG"); 65 66 public static void assertTrue(boolean b, String message) { 67 if (!b) { 68 debug(message); 69 throw new AssertFailedException(message); 70 } 71 } 72 73 public static void debug(String s) { 74 if (enabled) 75 System.out.println(s); 76 } 77 78 private static class AssertFailedException extends RuntimeException { 79 80 84 public AssertFailedException() { 85 super(); 86 } 88 89 93 public AssertFailedException(String message) { 94 super(message); 95 } 97 98 } 99 100 } 101 | Popular Tags |