Skip to content
Browse files

fix test

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4554 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
  • Loading branch information...
1 parent a28f0df commit d81d8569ebb7c63915e7d03111f15fddd647e43a @msridhar msridhar committed Apr 3, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/DupFieldsTest.java
View
10 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/DupFieldsTest.java
@@ -24,6 +24,7 @@
import com.ibm.wala.ipa.cha.ClassHierarchy;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.types.ClassLoaderReference;
+import com.ibm.wala.types.FieldReference;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.config.AnalysisScopeReader;
import com.ibm.wala.util.io.FileProvider;
@@ -35,17 +36,18 @@
AnalysisScope scope = null;
scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), DupFieldsTest.class.getClassLoader());
ClassHierarchy cha = ClassHierarchy.make(scope);
- IClass klass = cha.lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application, "LDupFieldName"));
+ TypeReference ref = TypeReference.findOrCreate(ClassLoaderReference.Application, "LDupFieldName");
+ IClass klass = cha.lookupClass(ref);
boolean threwException = false;
try {
klass.getField(Atom.findOrCreateUnicodeAtom("a"));
} catch (IllegalStateException e) {
threwException = true;
}
- Assert.assertTrue(threwException);
- IField f = klass.getField(Atom.findOrCreateUnicodeAtom("a"), TypeReference.IntName);
+ Assert.assertTrue(threwException);
+ IField f = cha.resolveField(FieldReference.findOrCreate(ref, Atom.findOrCreateUnicodeAtom("a"), TypeReference.Int));
Assert.assertEquals(f.getFieldTypeReference(), TypeReference.Int);
- f = klass.getField(Atom.findOrCreateUnicodeAtom("a"), TypeReference.BooleanName);
+ f = cha.resolveField(FieldReference.findOrCreate(ref, Atom.findOrCreateUnicodeAtom("a"), TypeReference.Boolean));
Assert.assertEquals(f.getFieldTypeReference(), TypeReference.Boolean);
}
}

0 comments on commit d81d856

Please sign in to comment.
Something went wrong with that request. Please try again.