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


Java DataflowAnalysisException.getMessage方法代码示例

本文整理汇总了Java中edu.umd.cs.findbugs.ba.DataflowAnalysisException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java DataflowAnalysisException.getMessage方法的具体用法?Java DataflowAnalysisException.getMessage怎么用?Java DataflowAnalysisException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.umd.cs.findbugs.ba.DataflowAnalysisException的用法示例。


在下文中一共展示了DataflowAnalysisException.getMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: consumeStack

import edu.umd.cs.findbugs.ba.DataflowAnalysisException; //导入方法依赖的package包/类
/**
 * Consume stack. This is a convenience method for instructions where the
 * types of popped operands can be ignored.
 */
protected void consumeStack(Instruction ins) {
    ConstantPoolGen cpg = getCPG();
    TypeFrame frame = getFrame();

    int numWordsConsumed = ins.consumeStack(cpg);
    if (numWordsConsumed == Constants.UNPREDICTABLE)
        throw new InvalidBytecodeException("Unpredictable stack consumption for " + ins);
    try {
        while (numWordsConsumed-- > 0) {
            frame.popValue();
        }
    } catch (DataflowAnalysisException e) {
        throw new InvalidBytecodeException("Stack underflow for " + ins + ": " + e.getMessage());
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:20,代码来源:TypeFrameModelingVisitor.java

示例2: visitAALOAD

import edu.umd.cs.findbugs.ba.DataflowAnalysisException; //导入方法依赖的package包/类
@Override
public void visitAALOAD(AALOAD obj) {
    // To determine the type pushed on the stack,
    // we look at the type of the array reference which was
    // popped off of the stack.
    TypeFrame frame = getFrame();
    try {
        frame.popValue(); // index
        Type arrayType = frame.popValue(); // arrayref
        if (arrayType instanceof ArrayType) {
            ArrayType arr = (ArrayType) arrayType;
            pushValue(arr.getElementType());
        } else {
            pushValue(TypeFrame.getBottomType());
        }
    } catch (DataflowAnalysisException e) {
        throw new InvalidBytecodeException("Stack underflow: " + e.getMessage());
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:20,代码来源:TypeFrameModelingVisitor.java

示例3: getMethodConfig

import edu.umd.cs.findbugs.ba.DataflowAnalysisException; //导入方法依赖的package包/类
private TaintMethodConfig getMethodConfig(InvokeInstruction obj) {
    String signature = obj.getSignature(cpg);
    String returnType = getReturnType(signature);
    String className = getInstanceClassName(obj);
    String methodName = obj.getMethodName(cpg);
    String methodId = "." + methodName + signature;
    TaintMethodConfig config = taintConfig.getMethodConfig(getFrame(), methodDescriptor, className, methodId);
    if (config != null) {
        config = getConfigWithReplaceTags(config, className, methodName);
    }
    if (config != null && config.isConfigured()) {
        return config;
    }
    if (taintConfig.isClassTaintSafe(returnType)) {
        return TaintMethodConfig.SAFE_CONFIG;
    }
    if (config != null) {
        return config;
    }
    if (Constants.CONSTRUCTOR_NAME.equals(methodName)
            && !taintConfig.isClassTaintSafe("L" + className + ";")) {
        try {
            int stackSize = getFrame().getNumArgumentsIncludingObjectInstance(obj, cpg);
            return TaintMethodConfig.getDefaultConstructorConfig(stackSize);
        } catch (DataflowAnalysisException ex) {
            throw new InvalidBytecodeException(ex.getMessage(), ex);
        }
    }
    return null;
}
 
开发者ID:blackarbiter,项目名称:Android_Code_Arbiter,代码行数:31,代码来源:TaintFrameModelingVisitor.java

示例4: getConfigWithReplaceTags

import edu.umd.cs.findbugs.ba.DataflowAnalysisException; //导入方法依赖的package包/类
private TaintMethodConfig getConfigWithReplaceTags(
        TaintMethodConfig config, String className, String methodName) {
    if (!"java/lang/String".equals(className)) {
        return config;
    }
    boolean isRegex = "replaceAll".equals(methodName);
    if (!isRegex && !"replace".equals(methodName)) {
        // not a replace method
        return config;
    }
    try {
        String toReplace = getFrame().getStackValue(1).getConstantValue();
        if (toReplace == null) {
            // we don't know the exact value
            return config;
        }
        Taint taint = config.getOutputTaint();
        for (Map.Entry<String, Taint.Tag> replaceTag : REPLACE_TAGS.entrySet()) {
            String tagString = replaceTag.getKey();
            if ((isRegex && toReplace.contains(tagString))
                    || toReplace.equals(tagString)) {
                taint.addTag(replaceTag.getValue());
            }
        }
        TaintMethodConfig configCopy = new TaintMethodConfig(config);
        configCopy.setOuputTaint(taint);
        return configCopy;
    } catch (DataflowAnalysisException ex) {
        throw new InvalidBytecodeException(ex.getMessage(), ex);
    }
}
 
开发者ID:blackarbiter,项目名称:Android_Code_Arbiter,代码行数:32,代码来源:TaintFrameModelingVisitor.java

示例5: visitCHECKCAST

import edu.umd.cs.findbugs.ba.DataflowAnalysisException; //导入方法依赖的package包/类
@Override
public void visitCHECKCAST(CHECKCAST obj) {

    try {
        Type t = getFrame().popValue();
        if (t instanceof NullType)
            pushValue(t);
        else
            pushValue(obj.getType(getCPG()));
    } catch (DataflowAnalysisException e) {
        throw new InvalidBytecodeException("Stack underflow for " + obj + ": " + e.getMessage());
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:14,代码来源:TypeFrameModelingVisitor.java


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