1 24 25 package org.aspectj.compiler.base.bcg; 26 27 28 abstract public class Asserts { 29 30 public static boolean isByte(int value) { 31 return Byte.MIN_VALUE <= value && value <= Byte.MAX_VALUE; 32 } 33 public static boolean isShort(int value) { 34 return Short.MIN_VALUE <= value && value <= Short.MAX_VALUE; 35 } 36 public static boolean isUByte(int value) { 37 return 0 <= value && value <= 0xFF; 38 } 39 public static boolean isUShort(int value) { 40 return 0 <= value && value <= 0xFFFF; 41 } 42 43 public static void assertU2(int nextIndex, String msg) { 45 if (Short.MIN_VALUE <= nextIndex && nextIndex <= Short.MAX_VALUE) return; 46 throw new RuntimeException (msg); 47 } 48 49 public static void assertUU2(int nextIndex, String msg) { 51 if (isUShort(nextIndex)) return; 52 throw new RuntimeException (msg); 53 } 54 55 56 } 57 | Popular Tags |