private boolean tryAsBoolean(Node val, Class<?> expectedType, List<Object> returnValues) { if (expectedType != boolean.class) return false; if (val instanceof BooleanLiteral) { boolean v = ((BooleanLiteral)val).astValue(); returnValues.add(v); return true; } throw new ResolutionException(val, "Expected boolean literal"); }
private boolean tryAsBoolean(Node val, Class<?> expectedType, List<Object> returnValues) { if (expectedType != boolean.class) return false; if (val instanceof BooleanLiteral) { boolean v = ((BooleanLiteral)val).astValue(); returnValues.add(v); return true; } throw new ResolutionException(val, "Expected boolean literal"); }
@Override public boolean visitBooleanLiteral(BooleanLiteral node) { return posSet(node, treeMaker.Literal(TypeTags.BOOLEAN, node.astValue() ? 1 : 0)); }
private boolean tryAsBoolean(Node val, Class<?> expectedType, List<Object> returnValues) { if (expectedType != boolean.class) return false; if (val instanceof BooleanLiteral) { boolean v = ((BooleanLiteral)val).astValue(); returnValues.add(v); return true; } throw new ResolutionException(val, "Expected boolean literal"); }
@Override public void visitFalseLiteral(FalseLiteral node) { set(node, setPosition(node, new lombok.ast.BooleanLiteral().astValue(false))); }
@Override public boolean visitBooleanLiteral(BooleanLiteral node) { return posSet(node, treeMaker.Literal(TypeTags.BOOLEAN, node.astValue() ? 1 : 0)); }
@Override public boolean visitBooleanLiteral(BooleanLiteral node) { return posSet(node, treeMaker.Literal(TypeTags.BOOLEAN, node.astValue() ? 1 : 0)); }
@Override public void visitFalseLiteral(FalseLiteral node) { set(node, setPosition(node, new lombok.ast.BooleanLiteral().astValue(false))); }
@Override public void visitTrueLiteral(TrueLiteral node) { set(node, setPosition(node, new lombok.ast.BooleanLiteral().astValue(true))); }
@Override public void visitTrueLiteral(TrueLiteral node) { set(node, setPosition(node, new lombok.ast.BooleanLiteral().astValue(true))); }
@Override public void visitTrueLiteral(TrueLiteral node) { set(node, setPosition(node, new lombok.ast.BooleanLiteral().astValue(true))); }
@Override public void visitFalseLiteral(FalseLiteral node) { set(node, setPosition(node, new lombok.ast.BooleanLiteral().astValue(false))); }
@Override public boolean visitBooleanLiteral(lombok.ast.BooleanLiteral node) { return set(node, node.astValue() ? new TrueLiteral(start(node), end(node)) : new FalseLiteral(start(node), end(node))); }
@Override public boolean visitBooleanLiteral(lombok.ast.BooleanLiteral node) { return set(node, node.astValue() ? new TrueLiteral(start(node), end(node)) : new FalseLiteral(start(node), end(node))); }
@Override public boolean visitBooleanLiteral(lombok.ast.BooleanLiteral node) { return set(node, node.astValue() ? new TrueLiteral(start(node), end(node)) : new FalseLiteral(start(node), end(node))); }
return null; } else if (node instanceof BooleanLiteral) { return ((BooleanLiteral)node).astValue(); } else if (node instanceof StringLiteral) { StringLiteral string = (StringLiteral) node;
@Override public boolean visitAssert(Assert node) { if (!context.getMainProject().isAndroidProject()) { return true; } Expression assertion = node.astAssertion(); // Allow "assert true"; it's basically a no-op if (assertion instanceof BooleanLiteral) { Boolean b = ((BooleanLiteral) assertion).astValue(); if (b != null && b) { return false; } } else { // Allow assertions of the form "assert foo != null" because they are often used // to make statements to tools about known nullness properties. For example, // findViewById() may technically return null in some cases, but a developer // may know that it won't be when it's called correctly, so the assertion helps // to clear nullness warnings. if (isNullCheck(assertion)) { return false; } } String message = "Assertions are unreliable. Use `BuildConfig.DEBUG` conditional checks instead."; context.report(ISSUE, node, context.getLocation(node), message); return false; } };
return; case BOOLEAN_LITERAL: set(node, new BooleanLiteral().astValue((Boolean)val)); return; case CHAR_LITERAL:
return; case BOOLEAN_LITERAL: set(node, new BooleanLiteral().astValue((Boolean)val)); return; case CHAR_LITERAL:
return; case BOOLEAN_LITERAL: set(node, new BooleanLiteral().astValue((Boolean)val)); return; case CHAR_LITERAL: