Changes from Omer Tripp:
- Null check for fields (allows tolerance of bytecode parser problems) - Support for determining if a class loader is an application class loader. (needed for cross languages support) git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3482 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
8cc7e2bd40
commit
1d751fc92f
|
@ -487,15 +487,19 @@ public abstract class BytecodeClass<T extends IClassLoader> implements IClass {
|
|||
}
|
||||
|
||||
protected IField findDeclaredField(Atom name) {
|
||||
for (int i = 0; i < instanceFields.length; i++) {
|
||||
if (instanceFields[i].getName() == name) {
|
||||
return instanceFields[i];
|
||||
if (instanceFields != null) {
|
||||
for (int i = 0; i < instanceFields.length; i++) {
|
||||
if (instanceFields[i].getName() == name) {
|
||||
return instanceFields[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < staticFields.length; i++) {
|
||||
if (staticFields[i].getName() == name) {
|
||||
return staticFields[i];
|
||||
if (staticFields != null) {
|
||||
for (int i = 0; i < staticFields.length; i++) {
|
||||
if (staticFields[i].getName() == name) {
|
||||
return staticFields[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.util.jar.Manifest;
|
|||
import com.ibm.wala.classLoader.ArrayClassLoader;
|
||||
import com.ibm.wala.classLoader.BinaryDirectoryTreeModule;
|
||||
import com.ibm.wala.classLoader.ClassFileModule;
|
||||
import com.ibm.wala.classLoader.IClassLoader;
|
||||
import com.ibm.wala.classLoader.JarFileModule;
|
||||
import com.ibm.wala.classLoader.Language;
|
||||
import com.ibm.wala.classLoader.Module;
|
||||
|
@ -131,6 +132,10 @@ public class AnalysisScope {
|
|||
return languages.get(name);
|
||||
}
|
||||
|
||||
public boolean isApplicationLoader(IClassLoader loader) {
|
||||
return loader.getReference().equals(getLoader(APPLICATION));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the information regarding the primordial loader.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue