本文整理汇总了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());
}
}
示例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());
}
}
示例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;
}
示例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);
}
}
示例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());
}
}