protected final boolean isZero(final JakExpression expr) { if (expr.hasConstantValue(this.context)) { Object object = expr.constantValue(this.context); if (object instanceof Boolean) { Boolean booleanValue = (Boolean) object; return booleanValue.equals(Boolean.FALSE); } else if (object instanceof Number) { Number numberValue = (Number) object; return (numberValue.intValue() == 0); } else { return false; } } return false; }
protected final boolean isInt(final JakExpression expr) { Type type = expr.type(this.context); return type.equals(boolean.class) || type.equals(byte.class) || type.equals(char.class) || type.equals(short.class) || type.equals(int.class); }
protected final boolean isNull(final JakExpression expr) { return expr.hasConstantValue(this.context) && (expr.constantValue(this.context) == null); }
protected final boolean isLong(final JakExpression expr) { return expr.type(this.context).equals(long.class); }
protected final boolean isRef(final JakExpression expr) { Type type = expr.type(this.context); return JavaTypes.getRawClass(type).isAssignableFrom(Object.class); }