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

项目:eclipse.jdt.ls    文件:NecessaryParenthesesChecker.java   
private static boolean locationNeedsParentheses(StructuralPropertyDescriptor locationInParent) {
    if (locationInParent instanceof ChildListPropertyDescriptor && locationInParent != InfixExpression.EXTENDED_OPERANDS_PROPERTY) {
        // e.g. argument lists of MethodInvocation, ClassInstanceCreation, dimensions of ArrayCreation ...
        return false;
    }
    if (locationInParent == VariableDeclarationFragment.INITIALIZER_PROPERTY
            || locationInParent == SingleVariableDeclaration.INITIALIZER_PROPERTY
            || locationInParent == ReturnStatement.EXPRESSION_PROPERTY
            || locationInParent == EnhancedForStatement.EXPRESSION_PROPERTY
            || locationInParent == ForStatement.EXPRESSION_PROPERTY
            || locationInParent == WhileStatement.EXPRESSION_PROPERTY
            || locationInParent == DoStatement.EXPRESSION_PROPERTY
            || locationInParent == AssertStatement.EXPRESSION_PROPERTY
            || locationInParent == AssertStatement.MESSAGE_PROPERTY
            || locationInParent == IfStatement.EXPRESSION_PROPERTY
            || locationInParent == SwitchStatement.EXPRESSION_PROPERTY
            || locationInParent == SwitchCase.EXPRESSION_PROPERTY
            || locationInParent == ArrayAccess.INDEX_PROPERTY
            || locationInParent == ThrowStatement.EXPRESSION_PROPERTY
            || locationInParent == SynchronizedStatement.EXPRESSION_PROPERTY
            || locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) {
        return false;
    }
    return true;
}
项目:che    文件:NecessaryParenthesesChecker.java   
private static boolean locationNeedsParentheses(StructuralPropertyDescriptor locationInParent) {
  if (locationInParent instanceof ChildListPropertyDescriptor
      && locationInParent != InfixExpression.EXTENDED_OPERANDS_PROPERTY) {
    // e.g. argument lists of MethodInvocation, ClassInstanceCreation, dimensions of ArrayCreation
    // ...
    return false;
  }
  if (locationInParent == VariableDeclarationFragment.INITIALIZER_PROPERTY
      || locationInParent == SingleVariableDeclaration.INITIALIZER_PROPERTY
      || locationInParent == ReturnStatement.EXPRESSION_PROPERTY
      || locationInParent == EnhancedForStatement.EXPRESSION_PROPERTY
      || locationInParent == ForStatement.EXPRESSION_PROPERTY
      || locationInParent == WhileStatement.EXPRESSION_PROPERTY
      || locationInParent == DoStatement.EXPRESSION_PROPERTY
      || locationInParent == AssertStatement.EXPRESSION_PROPERTY
      || locationInParent == AssertStatement.MESSAGE_PROPERTY
      || locationInParent == IfStatement.EXPRESSION_PROPERTY
      || locationInParent == SwitchStatement.EXPRESSION_PROPERTY
      || locationInParent == SwitchCase.EXPRESSION_PROPERTY
      || locationInParent == ArrayAccess.INDEX_PROPERTY
      || locationInParent == ThrowStatement.EXPRESSION_PROPERTY
      || locationInParent == SynchronizedStatement.EXPRESSION_PROPERTY
      || locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) {
    return false;
  }
  return true;
}
项目:Eclipse-Postfix-Code-Completion    文件:NecessaryParenthesesChecker.java   
private static boolean locationNeedsParentheses(StructuralPropertyDescriptor locationInParent) {
    if (locationInParent instanceof ChildListPropertyDescriptor && locationInParent != InfixExpression.EXTENDED_OPERANDS_PROPERTY) {
        // e.g. argument lists of MethodInvocation, ClassInstanceCreation, dimensions of ArrayCreation ...
        return false;
    }
    if (locationInParent == VariableDeclarationFragment.INITIALIZER_PROPERTY
            || locationInParent == SingleVariableDeclaration.INITIALIZER_PROPERTY
            || locationInParent == ReturnStatement.EXPRESSION_PROPERTY
            || locationInParent == EnhancedForStatement.EXPRESSION_PROPERTY
            || locationInParent == ForStatement.EXPRESSION_PROPERTY
            || locationInParent == WhileStatement.EXPRESSION_PROPERTY
            || locationInParent == DoStatement.EXPRESSION_PROPERTY
            || locationInParent == AssertStatement.EXPRESSION_PROPERTY
            || locationInParent == AssertStatement.MESSAGE_PROPERTY
            || locationInParent == IfStatement.EXPRESSION_PROPERTY
            || locationInParent == SwitchStatement.EXPRESSION_PROPERTY
            || locationInParent == SwitchCase.EXPRESSION_PROPERTY
            || locationInParent == ArrayAccess.INDEX_PROPERTY
            || locationInParent == ThrowStatement.EXPRESSION_PROPERTY
            || locationInParent == SynchronizedStatement.EXPRESSION_PROPERTY
            || locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) {
        return false;
    }
    return true;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:NecessaryParenthesesChecker.java   
private static boolean locationNeedsParentheses(StructuralPropertyDescriptor locationInParent) {
    if (locationInParent instanceof ChildListPropertyDescriptor && locationInParent != InfixExpression.EXTENDED_OPERANDS_PROPERTY) {
        // e.g. argument lists of MethodInvocation, ClassInstanceCreation, dimensions of ArrayCreation ...
        return false;
    }
    if (locationInParent == VariableDeclarationFragment.INITIALIZER_PROPERTY
            || locationInParent == SingleVariableDeclaration.INITIALIZER_PROPERTY
            || locationInParent == ReturnStatement.EXPRESSION_PROPERTY
            || locationInParent == EnhancedForStatement.EXPRESSION_PROPERTY
            || locationInParent == ForStatement.EXPRESSION_PROPERTY
            || locationInParent == WhileStatement.EXPRESSION_PROPERTY
            || locationInParent == DoStatement.EXPRESSION_PROPERTY
            || locationInParent == AssertStatement.EXPRESSION_PROPERTY
            || locationInParent == AssertStatement.MESSAGE_PROPERTY
            || locationInParent == IfStatement.EXPRESSION_PROPERTY
            || locationInParent == SwitchStatement.EXPRESSION_PROPERTY
            || locationInParent == SwitchCase.EXPRESSION_PROPERTY
            || locationInParent == ArrayAccess.INDEX_PROPERTY
            || locationInParent == ThrowStatement.EXPRESSION_PROPERTY
            || locationInParent == SynchronizedStatement.EXPRESSION_PROPERTY
            || locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) {
        return false;
    }
    return true;
}
项目:eclipse.jdt.ls    文件:FlowAnalyzer.java   
@Override
public void endVisit(AssertStatement node) {
    if (skipNode(node)) {
        return;
    }
    IfFlowInfo info = new IfFlowInfo();
    setFlowInfo(node, info);
    info.mergeCondition(getFlowInfo(node.getExpression()), fFlowContext);
    info.merge(getFlowInfo(node.getMessage()), null, fFlowContext);
}
项目:Eclipse-Postfix-Code-Completion    文件:FlowAnalyzer.java   
@Override
public void endVisit(AssertStatement node) {
    if (skipNode(node))
        return;
    IfFlowInfo info= new IfFlowInfo();
    setFlowInfo(node, info);
    info.mergeCondition(getFlowInfo(node.getExpression()), fFlowContext);
    info.merge(getFlowInfo(node.getMessage()), null, fFlowContext);
}
项目:Eclipse-Postfix-Code-Completion    文件:AdvancedQuickAssistProcessor.java   
private static Expression getBooleanExpression(ASTNode node) {
    if (!(node instanceof Expression)) {
        return null;
    }

    // check if the node is a location where it can be negated
    StructuralPropertyDescriptor locationInParent= node.getLocationInParent();
    if (locationInParent == QualifiedName.NAME_PROPERTY) {
        node= node.getParent();
        locationInParent= node.getLocationInParent();
    }
    while (locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) {
        node= node.getParent();
        locationInParent= node.getLocationInParent();
    }
    Expression expression= (Expression) node;
    if (!isBoolean(expression)) {
        return null;
    }
    if (expression.getParent() instanceof InfixExpression) {
        return expression;
    }
    if (locationInParent == Assignment.RIGHT_HAND_SIDE_PROPERTY || locationInParent == IfStatement.EXPRESSION_PROPERTY
            || locationInParent == WhileStatement.EXPRESSION_PROPERTY || locationInParent == DoStatement.EXPRESSION_PROPERTY
            || locationInParent == ReturnStatement.EXPRESSION_PROPERTY || locationInParent == ForStatement.EXPRESSION_PROPERTY
            || locationInParent == AssertStatement.EXPRESSION_PROPERTY || locationInParent == MethodInvocation.ARGUMENTS_PROPERTY
            || locationInParent == ConstructorInvocation.ARGUMENTS_PROPERTY || locationInParent == SuperMethodInvocation.ARGUMENTS_PROPERTY
            || locationInParent == EnumConstantDeclaration.ARGUMENTS_PROPERTY || locationInParent == SuperConstructorInvocation.ARGUMENTS_PROPERTY
            || locationInParent == ClassInstanceCreation.ARGUMENTS_PROPERTY || locationInParent == ConditionalExpression.EXPRESSION_PROPERTY
            || locationInParent == PrefixExpression.OPERAND_PROPERTY) {
        return expression;
    }
    return null;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:FlowAnalyzer.java   
@Override
public void endVisit(AssertStatement node) {
    if (skipNode(node))
        return;
    IfFlowInfo info= new IfFlowInfo();
    setFlowInfo(node, info);
    info.mergeCondition(getFlowInfo(node.getExpression()), fFlowContext);
    info.merge(getFlowInfo(node.getMessage()), null, fFlowContext);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ASTFlattener.java   
@Override
public boolean visit(AssertStatement node) {
    this.fBuffer.append("assert ");//$NON-NLS-1$
    node.getExpression().accept(this);
    if (node.getMessage() != null) {
        this.fBuffer.append(" : ");//$NON-NLS-1$
        node.getMessage().accept(this);
    }
    this.fBuffer.append(";");//$NON-NLS-1$
    return false;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:AdvancedQuickAssistProcessor.java   
private static Expression getBooleanExpression(ASTNode node) {
    if (!(node instanceof Expression)) {
        return null;
    }

    // check if the node is a location where it can be negated
    StructuralPropertyDescriptor locationInParent= node.getLocationInParent();
    if (locationInParent == QualifiedName.NAME_PROPERTY) {
        node= node.getParent();
        locationInParent= node.getLocationInParent();
    }
    while (locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) {
        node= node.getParent();
        locationInParent= node.getLocationInParent();
    }
    Expression expression= (Expression) node;
    if (!isBoolean(expression)) {
        return null;
    }
    if (expression.getParent() instanceof InfixExpression) {
        return expression;
    }
    if (locationInParent == Assignment.RIGHT_HAND_SIDE_PROPERTY || locationInParent == IfStatement.EXPRESSION_PROPERTY
            || locationInParent == WhileStatement.EXPRESSION_PROPERTY || locationInParent == DoStatement.EXPRESSION_PROPERTY
            || locationInParent == ReturnStatement.EXPRESSION_PROPERTY || locationInParent == ForStatement.EXPRESSION_PROPERTY
            || locationInParent == AssertStatement.EXPRESSION_PROPERTY || locationInParent == MethodInvocation.ARGUMENTS_PROPERTY
            || locationInParent == ConstructorInvocation.ARGUMENTS_PROPERTY || locationInParent == SuperMethodInvocation.ARGUMENTS_PROPERTY
            || locationInParent == EnumConstantDeclaration.ARGUMENTS_PROPERTY || locationInParent == SuperConstructorInvocation.ARGUMENTS_PROPERTY
            || locationInParent == ClassInstanceCreation.ARGUMENTS_PROPERTY || locationInParent == ConditionalExpression.EXPRESSION_PROPERTY
            || locationInParent == PrefixExpression.OPERAND_PROPERTY) {
        return expression;
    }
    return null;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:NaiveASTFlattener.java   
public boolean visit(AssertStatement node) {
    printIndent();
    this.buffer.append("assert ");//$NON-NLS-1$
    node.getExpression().accept(this);
    if (node.getMessage() != null) {
        this.buffer.append(" : ");//$NON-NLS-1$
        node.getMessage().accept(this);
    }
    this.buffer.append(";\n");//$NON-NLS-1$
    return false;
}
项目:jive    文件:StatementVisitor.java   
/**
 * We do not support assert.
 * 
 * 'assert' Expression [ ':' Expression ] ';'
 */
@Override
public boolean visit(final AssertStatement node)
{
  // do not visit children
  return false;
}
项目:j2d    文件:J2dVisitor.java   
@Override
public boolean visit(AssertStatement node) {
    //System.out.println("Found: " + node.getClass());
    print("assert(");
    node.getExpression().accept(this);
    if (node.getMessage() != null) {
        print(", ");
        node.getMessage().accept(this);
    }
    println(");");
    return false;
}
项目:aDoctor    文件:AssertVisitor.java   
@Override
public boolean visit(AssertStatement node) {
    asserts.add(node);

    return super.visit(node);
}
项目:evosuite    文件:LoggingVisitor.java   
/** {@inheritDoc} */
@Override
public void endVisit(AssertStatement node) {
    logger.warn("Method endVisitAssertStatement for " + node + " for " + node + " not implemented!");
    super.endVisit(node);
}
项目:evosuite    文件:LoggingVisitor.java   
/** {@inheritDoc} */
@Override
public boolean visit(AssertStatement node) {
    logger.warn("Method visitAssertStatement for " + node + " for " + node + " not implemented!");
    return super.visit(node);
}
项目:Beagle    文件:NotRecursingAstVisitor.java   
@Override
public boolean visit(final AssertStatement node) {
    return false;
}
项目:Beagle    文件:InstrumentableAstNodeLister.java   
@Override
public boolean visit(final AssertStatement node) {
    return this.visitInstrumentable(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:AstMatchingNodeFinder.java   
@Override
public boolean visit(AssertStatement node) {
    if (node.subtreeMatch(fMatcher, fNodeToMatch))
        return matches(node);
    return super.visit(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:ConstraintCollector.java   
@Override
public boolean visit(AssertStatement node) {
    add(fCreator.create(node));
    return true;
}
项目:Eclipse-Postfix-Code-Completion    文件:GenericVisitor.java   
@Override
public void endVisit(AssertStatement node) {
    endVisitNode(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:GenericVisitor.java   
@Override
public boolean visit(AssertStatement node) {
    return visitNode(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:AstMatchingNodeFinder.java   
@Override
public boolean visit(AssertStatement node) {
    if (node.subtreeMatch(fMatcher, fNodeToMatch))
        return matches(node);
    return super.visit(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ConstraintCollector.java   
@Override
public boolean visit(AssertStatement node) {
    add(fCreator.create(node));
    return true;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:HierarchicalASTVisitor.java   
@Override
public boolean visit(AssertStatement node) {
    return visit((Statement)node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:HierarchicalASTVisitor.java   
@Override
public void endVisit(AssertStatement node) {
    endVisit((Statement)node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:GenericVisitor.java   
@Override
public boolean visit(AssertStatement node) {
    return visitNode(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:GenericVisitor.java   
@Override
public void endVisit(AssertStatement node) {
    endVisitNode(node);
}
项目:eclipse-i18ntools    文件:ASTNodeFinder.java   
@Override
public boolean visit(final AssertStatement node) {
    return this.internalVisit(node);
}
项目:aDoctor    文件:AssertVisitor.java   
/**
 * This method allows to get all the Blocks for the Class on which it is;
 *
 * @return a List of all Blocks;
 */
public Collection<AssertStatement> getAsserts() {
    return asserts;
}
项目: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.AssertStatement)
 */
public ITypeConstraint[] create(AssertStatement 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.AssertStatement)
 */
public ITypeConstraint[] create(AssertStatement node) {
    return EMPTY_ARRAY;
}
项目:Slicer    文件:AliasVisitor.java   
public boolean visit(AssertStatement node){return this.visitStatement(node);}