- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.ibm.wala.util.warnings.Warnings.add()
方法的一些代码示例,展示了Warnings.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Warnings.add()
方法的具体详情如下:
包路径:com.ibm.wala.util.warnings.Warnings
类名称:Warnings
方法名:add
暂无
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
@Override
protected FileModule makeFile(final File file) {
try {
return new ClassFileModule(file, this);
} catch (InvalidClassFileException e) {
Warnings.add(new Warning(Warning.MODERATE) {
@Override
public String getMsg() {
return "Invalid class file at path " + file.getAbsolutePath();
}
});
return null;
}
}
代码示例来源:origin: wala/WALA
@Override
protected FileModule makeFile(final File file) {
try {
return new ClassFileModule(file, this);
} catch (InvalidClassFileException e) {
Warnings.add(new Warning(Warning.MODERATE) {
@Override
public String getMsg() {
return "Invalid class file at path " + file.getAbsolutePath();
}
});
return null;
}
}
代码示例来源:origin: wala/WALA
/**
* @param interfaces a set of class names
* @return Set of all IClasses that can be loaded corresponding to the class names in the interfaces array; raise warnings if
* classes can not be loaded
*/
private Collection<IClass> array2IClassSet(ImmutableByteArray[] interfaces) {
ArrayList<IClass> result = new ArrayList<>(interfaces.length);
for (ImmutableByteArray name : interfaces) {
IClass klass = null;
klass = loader.lookupClass(TypeName.findOrCreate(name));
if (klass == null) {
Warnings.add(ClassNotFoundWarning.create(name));
} else {
result.add(klass);
}
}
return result;
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
/**
* @param interfaces a set of class names
* @return Set of all IClasses that can be loaded corresponding to the class names in the interfaces array; raise warnings if
* classes can not be loaded
*/
private Collection<IClass> array2IClassSet(ImmutableByteArray[] interfaces) {
ArrayList<IClass> result = new ArrayList<>(interfaces.length);
for (ImmutableByteArray name : interfaces) {
IClass klass = null;
klass = loader.lookupClass(TypeName.findOrCreate(name));
if (klass == null) {
Warnings.add(ClassNotFoundWarning.create(name));
} else {
result.add(klass);
}
}
return result;
}
代码示例来源:origin: wala/WALA
private TypeAbstraction interceptType(TypeAbstraction T) {
TypeReference type = T.getType().getReference();
if (type.equals(TypeReference.JavaIoSerializable)) {
Warnings.add(IgnoreSerializableWarning.create());
return null;
} else {
return T;
}
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
private TypeAbstraction interceptType(TypeAbstraction T) {
TypeReference type = T.getType().getReference();
if (type.equals(TypeReference.JavaIoSerializable)) {
Warnings.add(IgnoreSerializableWarning.create());
return null;
} else {
return T;
}
}
代码示例来源:origin: wala/WALA
Warnings.add(MethodResolutionFailure.moderate(target));
Warnings.add(MethodResolutionFailure.severe(target));
} else {
TypeReference[] exceptionTypes = M.getDeclaredExceptions();
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
Warnings.add(MethodResolutionFailure.moderate(target));
Warnings.add(MethodResolutionFailure.severe(target));
} else {
TypeReference[] exceptionTypes = M.getDeclaredExceptions();
代码示例来源:origin: wala/WALA
Warnings.add(new Warning() {
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
Warnings.add(new Warning() {
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
Warnings.add(new Warning() {
代码示例来源:origin: wala/WALA
Warnings.add(new Warning() {
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
/**
* @return Collection of IClasses, representing the interfaces this class implements.
*/
protected Collection<IClass> computeAllInterfacesAsCollection() {
Collection<? extends IClass> c = getDirectInterfaces();
Set<IClass> result = HashSetFactory.make();
for (IClass klass : c) {
if (klass.isInterface()) {
result.add(klass);
} else {
Warnings.add(ClassHierarchyWarning.create("expected an interface " + klass));
}
}
// at this point result holds all interfaces the class directly extends.
// now expand to a fixed point.
Set<IClass> last = null;
do {
last = HashSetFactory.make(result);
for (IClass i : last) {
result.addAll(i.getDirectInterfaces());
}
} while (last.size() < result.size());
// now add any interfaces implemented by the super class
IClass sup = null;
sup = getSuperclass();
if (sup != null) {
result.addAll(sup.getAllImplementedInterfaces());
}
return result;
}
代码示例来源:origin: wala/WALA
/**
* @return Collection of IClasses, representing the interfaces this class implements.
*/
protected Collection<IClass> computeAllInterfacesAsCollection() {
Collection<? extends IClass> c = getDirectInterfaces();
Set<IClass> result = HashSetFactory.make();
for (IClass klass : c) {
if (klass.isInterface()) {
result.add(klass);
} else {
Warnings.add(ClassHierarchyWarning.create("expected an interface " + klass));
}
}
// at this point result holds all interfaces the class directly extends.
// now expand to a fixed point.
Set<IClass> last = null;
do {
last = HashSetFactory.make(result);
for (IClass i : last) {
result.addAll(i.getDirectInterfaces());
}
} while (last.size() < result.size());
// now add any interfaces implemented by the super class
IClass sup = null;
sup = getSuperclass();
if (sup != null) {
result.addAll(sup.getAllImplementedInterfaces());
}
return result;
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
protected void processPutStatic(int rval, FieldReference field, IField f) {
PointerKey fKey = getPointerKeyForStaticField(f);
PointerKey rvalKey = getPointerKeyForLocal(rval);
// if (!supportFullPointerFlowGraph &&
// contentsAreInvariant(rval)) {
if (contentsAreInvariant(symbolTable, du, rval)) {
system.recordImplicitPointsToSet(rvalKey);
InstanceKey[] ik = getInvariantContents(rval);
for (InstanceKey element : ik) {
system.newConstraint(fKey, element);
}
} else {
system.newConstraint(fKey, assignOperator, rvalKey);
}
if (DEBUG) {
System.err.println("visitPut class init " + field.getDeclaringClass() + ' ' + field);
}
// side effect of putstatic: may call class initializer
IClass klass = getClassHierarchy().lookupClass(field.getDeclaringClass());
if (klass == null) {
Warnings.add(FieldResolutionFailure.create(field));
} else {
processClassInitializer(klass);
}
}
代码示例来源:origin: wala/WALA
protected void processPutStatic(int rval, FieldReference field, IField f) {
PointerKey fKey = getPointerKeyForStaticField(f);
PointerKey rvalKey = getPointerKeyForLocal(rval);
// if (!supportFullPointerFlowGraph &&
// contentsAreInvariant(rval)) {
if (contentsAreInvariant(symbolTable, du, rval)) {
system.recordImplicitPointsToSet(rvalKey);
InstanceKey[] ik = getInvariantContents(rval);
for (InstanceKey element : ik) {
system.newConstraint(fKey, element);
}
} else {
system.newConstraint(fKey, assignOperator, rvalKey);
}
if (DEBUG) {
System.err.println("visitPut class init " + field.getDeclaringClass() + ' ' + field);
}
// side effect of putstatic: may call class initializer
IClass klass = getClassHierarchy().lookupClass(field.getDeclaringClass());
if (klass == null) {
Warnings.add(FieldResolutionFailure.create(field));
} else {
processClassInitializer(klass);
}
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
public void visitPutInternal(int rval, int ref, boolean isStatic, FieldReference field) {
if (DEBUG) {
System.err.println("visitPut " + field);
}
// skip putfields of primitive type
if (field.getFieldType().isPrimitiveType()) {
return;
}
IField f = getClassHierarchy().resolveField(field);
if (f == null) {
if (DEBUG) {
System.err.println("Could not resolve field " + field);
}
Warnings.add(FieldResolutionFailure.create(field));
return;
}
assert f.getFieldTypeReference().getName().equals(field.getFieldType().getName()) :
"name clash of two fields with the same name but different type: " + f.getReference() + " <=> " + field;
assert isStatic || !symbolTable.isStringConstant(ref) : "put to string constant shouldn't be allowed?";
if (isStatic) {
processPutStatic(rval, field, f);
} else {
processPutField(rval, ref, f);
}
}
代码示例来源:origin: wala/WALA
public void visitPutInternal(int rval, int ref, boolean isStatic, FieldReference field) {
if (DEBUG) {
System.err.println("visitPut " + field);
}
// skip putfields of primitive type
if (field.getFieldType().isPrimitiveType()) {
return;
}
IField f = getClassHierarchy().resolveField(field);
if (f == null) {
if (DEBUG) {
System.err.println("Could not resolve field " + field);
}
Warnings.add(FieldResolutionFailure.create(field));
return;
}
assert f.getFieldTypeReference().getName().equals(field.getFieldType().getName()) :
"name clash of two fields with the same name but different type: " + f.getReference() + " <=> " + field;
assert isStatic || !symbolTable.isStringConstant(ref) : "put to string constant shouldn't be allowed?";
if (isStatic) {
processPutStatic(rval, field, f);
} else {
processPutField(rval, ref, f);
}
}
代码示例来源:origin: wala/WALA
private void recordExceptionTypes(Set<ExceptionHandler> set, IClassLoader loader) {
for (ExceptionHandler handler : set) {
TypeReference t = null;
if (handler.getCatchClass() == null) {
// by convention, in ShrikeCT this means catch everything
t = TypeReference.JavaLangThrowable;
} else if (handler.getCatchClassLoader() instanceof ClassLoaderReference) {
t = ShrikeUtil.makeTypeReference((ClassLoaderReference)handler.getCatchClassLoader(), handler.getCatchClass());
} else {
TypeReference exceptionType = ShrikeUtil.makeTypeReference(loader.getReference(), handler.getCatchClass());
IClass klass = null;
klass = loader.lookupClass(exceptionType.getName());
if (klass == null) {
Warnings.add(ExceptionLoadFailure.create(exceptionType, method));
t = exceptionType;
} else {
t = klass.getReference();
}
}
int instructionIndex = handler.getHandler();
IBasicBlock b = getBlockForInstruction(instructionIndex);
if (!(b instanceof ExceptionHandlerBasicBlock)) {
assert b instanceof ExceptionHandlerBasicBlock : "not exception handler " + b + " index " + instructionIndex;
}
ExceptionHandlerBasicBlock bb = (ExceptionHandlerBasicBlock) getBlockForInstruction(instructionIndex);
bb.addCaughtExceptionType(t);
}
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
private void recordExceptionTypes(Set<ExceptionHandler> set, IClassLoader loader) {
for (ExceptionHandler handler : set) {
TypeReference t = null;
if (handler.getCatchClass() == null) {
// by convention, in ShrikeCT this means catch everything
t = TypeReference.JavaLangThrowable;
} else if (handler.getCatchClassLoader() instanceof ClassLoaderReference) {
t = ShrikeUtil.makeTypeReference((ClassLoaderReference)handler.getCatchClassLoader(), handler.getCatchClass());
} else {
TypeReference exceptionType = ShrikeUtil.makeTypeReference(loader.getReference(), handler.getCatchClass());
IClass klass = null;
klass = loader.lookupClass(exceptionType.getName());
if (klass == null) {
Warnings.add(ExceptionLoadFailure.create(exceptionType, method));
t = exceptionType;
} else {
t = klass.getReference();
}
}
int instructionIndex = handler.getHandler();
IBasicBlock b = getBlockForInstruction(instructionIndex);
if (!(b instanceof ExceptionHandlerBasicBlock)) {
assert b instanceof ExceptionHandlerBasicBlock : "not exception handler " + b + " index " + instructionIndex;
}
ExceptionHandlerBasicBlock bb = (ExceptionHandlerBasicBlock) getBlockForInstruction(instructionIndex);
bb.addCaughtExceptionType(t);
}
}
I have a question about adding files in git. I have found multiple stackoverflow questions about
我是 visual studio 的新手,来自 Delphi。 我有一个充满 .cs 文件的目录树(根是\Common)。 我还有一个充满应用程序的目录树(根目录是\Applications) 最后,
这个问题在这里已经有了答案: Array's lookup time complexity vs. how it is stored (4 个答案) Time complexity for java
谁能告诉我这两者有什么区别: ALTER TABLE x1 ADD INDEX(a); ALTER TABLE x1 ADD INDEX(b); 和 ALTER TABLE x1 ADD INDEX(
为什么有时我们使用 getChildren() add() 而其他时候我们直接使用 add() es: https://docs.oracle.com/javafx/2/get_started/for
如何使用 bootstrap css 在输入下方添加跨度?我需要做这样的事情: 最佳答案 是这样的吗? http://jsfiddle.net/swm53ran/205/ 您可以使用纯 CSS 来实现
问题 np.add(X, 2*Y, out=X) 比 np.add(X, Y, out=X); np.add(X, Y, out=X).使用 np.add(X, Y, out=X); 是一种实际做法吗
当我跑 git add --intent-to-add .所有未跟踪的文件将其状态从“未跟踪的文件”( git status -s 显示 ?? )更改为“未暂存以进行提交的更改”( git statu
我不知道 .add 之间有什么区别和 .sink.add ? 例子: StreamController myStreamController = StreamController(); stream
getContentPane().add() 和 add() 的意思一样吗? public class TestFrame extends JFrame{ public TestFrame()
git add . 和 git add * 会完成完全相同的事情吗? 最佳答案 不,不会。 * 是一个 glob 模式,不会匹配以 开头的文件。 例如,假设这是当前目录,我有 2 个新文件要添加 fo
git的分支与合并的两种方法 git add -A和 git add . git add -u在功能上看似很相近,但还是存在一点差别 git add . :他会
git add [--all | -A] 之间有什么区别?和 git add . ? 最佳答案 此答案仅适用于 Git 版本 1.x。对于 Git 版本 2.x,请参阅其他答案。 总结: git ad
我刚刚安装了最新的 Wix v3.7。我创建了一个 VS 2010“Excel 2010 加载项”项目,并在同一个解决方案中创建了一个 Wix“安装项目”。 问题是,当我尝试从 Wix 项目中引用 A
YUI.add 和 YUI().add 有什么区别? 最佳答案 在第一种情况下,您要注册一个模块可以加载到 YUI 沙箱中,在第二种情况下,您要构建一个沙箱,然后进行注册(这是一种非常不典型的用法)。
测试代码时,任何输入到列表中的值在按下“enter”后都会消失。 我对编程和网络开发非常陌生。请具体一点,以便我理解。 function addItem(){ var item = documen
我正在浏览 python 的 dis 包。我尝试了代码以查看它是如何工作的 >>> def get(): ... x=4 ... y=x+3 ............ this lin
我已经对我的文件夹进行了版本控制 git init git add . git commit -m 'Initial commit' 我应该怎么做 git add 对于我在 .? 中创建的每个新文件
当我执行 $ git add * 时,有时我意识到 git 不会将已删除的文件添加到舞台上,如果删除或添加它,我需要手动指示,但我想不通找出 $ git add --all 有什么区别。因此,如果星号
这个问题在这里已经有了答案: Difference between "git add -A" and "git add ." (12 个答案) 关闭 6 年前。 目前,当我想提交并将内容推送到远程
我是一名优秀的程序员,十分优秀!