• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SuperNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PlanValidationException类代码示例发布时间:2022-05-15
下一篇:
Java SWTBotPerspective类代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap