Java 类org.eclipse.jdt.core.dom.BooleanLiteral 实例源码

项目:Convert-For-Each-Loop-to-Lambda-Expression-Eclipse-Plugin    文件:EnhancedForStatementVisitor.java   
/**
 * checking if returnStatement is boolean, not null and has only one return
 * 
 * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ReturnStatement)
 */
@Override
public boolean visit(ReturnStatement node) {
    // one more return statement encountered.
    returnCount++;

    // examine what is being returned.
    ASTNode expression = node.getExpression();

    // if there is a return statement, it must return a boolean literal.
    if (expression == null || !(expression instanceof BooleanLiteral)) {
        this.encounteredInvalidReturnStatement = true;
    }

    return super.visit(node);
}
项目:j2d    文件:J2dVisitor.java   
private boolean hasNonStaticFieldsWithInitializers(ASTNode node) {
    if (node instanceof TypeDeclaration) {
        TypeDeclaration td = (TypeDeclaration)node;
        for (FieldDeclaration fd : td.getFields()) {
            if (!hasStaticModifier(fd)) {
                for (Object o : fd.fragments()) {
                    VariableDeclarationFragment vdf = (VariableDeclarationFragment)o;
                    if (vdf.getInitializer() != null &&
                        (vdf.getInitializer() instanceof BooleanLiteral ||
                         vdf.getInitializer() instanceof NumberLiteral ||
                         vdf.getInitializer() instanceof StringLiteral)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
    // TODO is this correct for enums?
    return false;
}
项目:bayou    文件:RefinementBoolean.java   
public RefinementBoolean(Expression e) {
    if (knownConstants(e))
        return;

    if (! (e instanceof BooleanLiteral)) {
        this.exists = false;
        this.value = false;
        return;
    }

    this.exists = true;
    this.value = ((BooleanLiteral) e).booleanValue();
}
项目:evosuite    文件:TestExtractingVisitor.java   
private VariableReference retrieveVariableReference(BooleanLiteral boolLiteral) {
    boolean bool = boolLiteral.booleanValue();
    PrimitiveStatement<Boolean> charAssignment = new BooleanPrimitiveStatement(
            testCase.getReference(), bool);
    testCase.addStatement(charAssignment);
    return charAssignment.getReturnValue();
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ASTFlattener.java   
@Override
public boolean visit(BooleanLiteral node) {
    if (node.booleanValue() == true) {
        this.fBuffer.append("true");//$NON-NLS-1$
    } else {
        this.fBuffer.append("false");//$NON-NLS-1$
    }
    return false;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:NaiveASTFlattener.java   
public boolean visit(BooleanLiteral node) {
    if (node.booleanValue() == true) {
        this.buffer.append("true");//$NON-NLS-1$
    } else {
        this.buffer.append("false");//$NON-NLS-1$
    }
    return false;
}
项目:fb-contrib-eclipse-quick-fixes    文件:NeedlessBoxingResolution.java   
@Override
public boolean visit(BooleanLiteral node) {
    if (this.badBooleanLiteral != null) {
        return false;
    }
    if (node.resolveBoxing()) { // did boxing happen? If so, that's our cue
        badBooleanLiteral = node;
        return false;
    }

    return true;
}
项目:junit2spock    文件:ASTNodeFactory.java   
public BooleanLiteral booleanLiteral(boolean value) {
    return ast.get().newBooleanLiteral(value);
}
项目:eclipse.jdt.ls    文件:FlowAnalyzer.java   
@Override
public void endVisit(BooleanLiteral node) {
    // Leaf node.
}
项目:che    文件:InferTypeArgumentsConstraintCreator.java   
@Override
public void endVisit(BooleanLiteral node) {
  ITypeBinding typeBinding = node.resolveTypeBinding();
  ImmutableTypeVariable2 cv = fTCModel.makeImmutableTypeVariable(typeBinding, node);
  setConstraintVariable(node, cv);
}
项目:che    文件:SemanticHighlightingReconciler.java   
@Override
public boolean visit(BooleanLiteral node) {
  return visitLiteral(node);
}
项目:evosuite    文件:LoggingVisitor.java   
/** {@inheritDoc} */
@Override
public void endVisit(BooleanLiteral node) {
    logger.warn("Method endVisitBooleanLiteral for " + node + " for " + node + " not implemented!");
    super.endVisit(node);
}
项目:evosuite    文件:LoggingVisitor.java   
/** {@inheritDoc} */
@Override
public boolean visit(BooleanLiteral node) {
    logger.warn("Method visitBooleanLiteral for " + node + " for " + node + " not implemented!");
    return super.visit(node);
}
项目:Beagle    文件:NotRecursingAstVisitor.java   
@Override
public boolean visit(final BooleanLiteral node) {
    return false;
}
项目:Beagle    文件:InstrumentableAstNodeLister.java   
@Override
public boolean visit(final BooleanLiteral node) {
    // not instrumentable, contains no instrumentable nodes
    return false;
}
项目:Eclipse-Postfix-Code-Completion    文件:InferTypeArgumentsConstraintCreator.java   
@Override
public void endVisit(BooleanLiteral node) {
    ITypeBinding typeBinding= node.resolveTypeBinding();
    ImmutableTypeVariable2 cv= fTCModel.makeImmutableTypeVariable(typeBinding, node);
    setConstraintVariable(node, cv);
}
项目:Eclipse-Postfix-Code-Completion    文件:FlowAnalyzer.java   
@Override
public void endVisit(BooleanLiteral node) {
    // Leaf node.
}
项目:Eclipse-Postfix-Code-Completion    文件:AstMatchingNodeFinder.java   
@Override
public boolean visit(BooleanLiteral node) {
    if (node.subtreeMatch(fMatcher, fNodeToMatch))
        return matches(node);
    return super.visit(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:ConstraintCollector.java   
@Override
public boolean visit(BooleanLiteral node) {
    add(fCreator.create(node));
    return true;
}
项目:Eclipse-Postfix-Code-Completion    文件:GenericVisitor.java   
@Override
public void endVisit(BooleanLiteral node) {
    endVisitNode(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:GenericVisitor.java   
@Override
public boolean visit(BooleanLiteral node) {
    return visitNode(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:SemanticHighlightingReconciler.java   
@Override
public boolean visit(BooleanLiteral node) {
    return visitLiteral(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:InferTypeArgumentsConstraintCreator.java   
@Override
public void endVisit(BooleanLiteral node) {
    ITypeBinding typeBinding= node.resolveTypeBinding();
    ImmutableTypeVariable2 cv= fTCModel.makeImmutableTypeVariable(typeBinding, node);
    setConstraintVariable(node, cv);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:FlowAnalyzer.java   
@Override
public void endVisit(BooleanLiteral node) {
    // Leaf node.
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:AstMatchingNodeFinder.java   
@Override
public boolean visit(BooleanLiteral node) {
    if (node.subtreeMatch(fMatcher, fNodeToMatch))
        return matches(node);
    return super.visit(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ConstraintCollector.java   
@Override
public boolean visit(BooleanLiteral node) {
    add(fCreator.create(node));
    return true;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:HierarchicalASTVisitor.java   
@Override
public boolean visit(BooleanLiteral node) {
    return visit((Expression)node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:HierarchicalASTVisitor.java   
@Override
public void endVisit(BooleanLiteral node) {
    endVisit((Expression)node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:GenericVisitor.java   
@Override
public boolean visit(BooleanLiteral node) {
    return visitNode(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:GenericVisitor.java   
@Override
public void endVisit(BooleanLiteral node) {
    endVisitNode(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:SemanticHighlightingReconciler.java   
@Override
public boolean visit(BooleanLiteral node) {
    return visitLiteral(node);
}
项目:eclipse-i18ntools    文件:ASTNodeFinder.java   
@Override
public boolean visit(final BooleanLiteral node) {
    return this.internalVisit(node);
}
项目:j2d    文件:J2dVisitor.java   
@Override
public boolean visit(BooleanLiteral node) {
    //System.out.println("Found: " + node.getClass());
    print(node.booleanValue() ? "true" : "false");
    return false;
}
项目:j2d    文件:J2dVisitor.java   
@Override
public boolean visit(VariableDeclarationFragment node) {
    //System.out.println("Found: " + node.getClass());
    print(" ");
    Writer w = new StringWriter();
    pushWriter(w);
    if (inMethod) {
        doRewrite = false;
    }
    node.getName().accept(this);
    if (inMethod) {
        doRewrite = true;
    }
    popWriter();
    locals.add(w.toString());
    print(w.toString());
    Expression e = node.getInitializer();
    if (e != null) {
        if (node.getParent() instanceof FieldDeclaration) {
            FieldDeclaration parent = (FieldDeclaration)node.getParent();
            if (e instanceof NumberLiteral ||
                e instanceof BooleanLiteral ||
                e instanceof StringLiteral) {
                ;
            } else {
                String initializer = w.toString() + " = ";
                w = new StringWriter();
                pushWriter(w);
                e.accept(this);
                popWriter();
                initializer += w.toString() + ";";
                if (hasStaticModifier(parent)) {
                    staticFieldInitializers.add(initializer);
                } else {
                    fieldInitializers.add(initializer);
                }
                return false;
            }
        }
        print(" = ");
        // TODO Things that can't be computed at compile time need
        //      moving into a static ctor
        e.accept(this);
    }
    return false;
}
项目:Eclipse-Postfix-Code-Completion    文件:ConstraintCreator.java   
/**
 * @param node the AST node
 * @return array of type constraints, may be empty
 * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BooleanLiteral)
 */
public ITypeConstraint[] create(BooleanLiteral node) {
    return EMPTY_ARRAY;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ConstraintCreator.java   
/**
 * @param node the AST node
 * @return array of type constraints, may be empty
 * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BooleanLiteral)
 */
public ITypeConstraint[] create(BooleanLiteral node) {
    return EMPTY_ARRAY;
}