当前位置: 首页>>代码示例>>Java>>正文


Java SuperNode类代码示例

本文整理汇总了Java中org.checkerframework.dataflow.cfg.node.SuperNode的典型用法代码示例。如果您正苦于以下问题:Java SuperNode类的具体用法?Java SuperNode怎么用?Java SuperNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SuperNode类属于org.checkerframework.dataflow.cfg.node包,在下文中一共展示了SuperNode类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitSuper

import org.checkerframework.dataflow.cfg.node.SuperNode; //导入依赖的package包/类
@Override
public TransferResult<Nullness, NullnessStore<Nullness>> visitSuper(
    SuperNode superNode, TransferInput<Nullness, NullnessStore<Nullness>> input) {
  return noStoreChanges(NONNULL, input);
}
 
开发者ID:uber,项目名称:NullAway,代码行数:6,代码来源:AccessPathNullnessPropagation.java

示例2: visitSuper

import org.checkerframework.dataflow.cfg.node.SuperNode; //导入依赖的package包/类
@Override
public final TransferResult<Nullness, LocalStore<Nullness>> visitSuper(
    SuperNode node, TransferInput<Nullness, LocalStore<Nullness>> input) {
  Nullness value = visitSuper();
  return noStoreChanges(value, input);
}
 
开发者ID:google,项目名称:error-prone,代码行数:7,代码来源:AbstractNullnessPropagationTransfer.java

示例3: internalReprOf

import org.checkerframework.dataflow.cfg.node.SuperNode; //导入依赖的package包/类
/**
 * We ignore operations such as widening and
 * narrowing when computing the internal representation.
 *
 * @return The internal representation (as {@link Receiver}) of any
 *         {@link Node}. Might contain {@link Unknown}.
 */
public static Receiver internalReprOf(AnnotationProvider provider,
        Node receiverNode, boolean allowNonDeterminitic) {
    Receiver receiver = null;
    if (receiverNode instanceof FieldAccessNode) {
        receiver = internalReprOfFieldAccess(provider,
                (FieldAccessNode) receiverNode);
    } else if (receiverNode instanceof ThisLiteralNode) {
        receiver = new ThisReference(receiverNode.getType());
    } else if (receiverNode instanceof SuperNode) {
        receiver = new ThisReference(receiverNode.getType());
    } else if (receiverNode instanceof LocalVariableNode) {
        LocalVariableNode lv = (LocalVariableNode) receiverNode;
        receiver = new LocalVariable(lv);
    } else if (receiverNode instanceof ArrayAccessNode) {
        ArrayAccessNode a = (ArrayAccessNode) receiverNode;
        receiver = internalReprOfArrayAccess(provider, a);
    } else if (receiverNode instanceof StringConversionNode) {
        // ignore string conversion
        return internalReprOf(provider,
                ((StringConversionNode) receiverNode).getOperand());
    } else if (receiverNode instanceof WideningConversionNode) {
        // ignore widening
        return internalReprOf(provider,
                ((WideningConversionNode) receiverNode).getOperand());
    } else if (receiverNode instanceof NarrowingConversionNode) {
        // ignore narrowing
        return internalReprOf(provider,
                ((NarrowingConversionNode) receiverNode).getOperand());
    } else if (receiverNode instanceof ClassNameNode) {
        ClassNameNode cn = (ClassNameNode) receiverNode;
        receiver = new ClassName(cn.getType());
    } else if (receiverNode instanceof ValueLiteralNode) {
        ValueLiteralNode vn = (ValueLiteralNode) receiverNode;
        receiver = new ValueLiteral(vn.getType(), vn);
    } else if (receiverNode instanceof MethodInvocationNode) {
        MethodInvocationNode mn = (MethodInvocationNode) receiverNode;
        ExecutableElement invokedMethod = TreeUtils.elementFromUse(mn
                .getTree());

        // check if this represents a boxing operation of a constant, in which
        // case we treat the method call as deterministic, because there is no way
        // to behave differently in two executions where two constants are being used.
        boolean considerDeterministic = false;
        if (invokedMethod.toString().equals("valueOf(long)")
                && mn.getTarget().getReceiver().toString().equals("Long")) {
            Node arg = mn.getArgument(0);
            if (arg instanceof ValueLiteralNode) {
                considerDeterministic = true;
            }
        }

        if (PurityUtils.isDeterministic(provider, invokedMethod) || allowNonDeterminitic || considerDeterministic) {
            List<Receiver> parameters = new ArrayList<>();
            for (Node p : mn.getArguments()) {
                parameters.add(internalReprOf(provider, p));
            }
            Receiver methodReceiver;
            if (ElementUtils.isStatic(invokedMethod)) {
                methodReceiver = new ClassName(mn.getTarget().getReceiver()
                        .getType());
            } else {
                methodReceiver = internalReprOf(provider, mn.getTarget()
                        .getReceiver());
            }
            receiver = new PureMethodCall(mn.getType(), invokedMethod,
                    methodReceiver, parameters);
        }
    }

    if (receiver == null) {
        receiver = new Unknown(receiverNode.getType());
    }
    return receiver;
}
 
开发者ID:reprogrammer,项目名称:checker-framework,代码行数:82,代码来源:FlowExpressions.java


注:本文中的org.checkerframework.dataflow.cfg.node.SuperNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。