Committing change the Eclipse plugin forgot.

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4419 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
msridhar1 2012-01-06 21:52:40 +00:00
parent 8b547b4812
commit d419096ddb
1 changed files with 0 additions and 43 deletions

View File

@ -1,43 +0,0 @@
package com.ibm.wala.cast.test;
import java.util.Iterator;
import junit.framework.Assert;
import com.ibm.wala.cast.loader.CAstAbstractLoader;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.classLoader.ModuleEntry;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.warnings.Warning;
public class Util {
public static void checkForFrontEndErrors(IClassHierarchy cha) {
StringBuffer message = null;
for(IClassLoader loader : cha.getLoaders()) {
if (loader instanceof CAstAbstractLoader) {
Iterator<ModuleEntry> errors = ((CAstAbstractLoader)loader).getModulesWithParseErrors();
if (errors.hasNext()) {
if (message == null) {
message = new StringBuffer("front end errors:\n");
}
while (errors.hasNext()) {
ModuleEntry errorModule = errors.next();
for(Warning w : (((CAstAbstractLoader)loader).getMessages(errorModule))) {
message.append("error in ").append(errorModule.getName()).append(":\n");
message.append(w.toString()).append("\n");
}
}
}
// clear out the errors to free some memory
((CAstAbstractLoader)loader).clearMessages();
}
}
if (message != null) {
message.append("end of front end errors\n");
}
Assert.assertTrue(String.valueOf(message), message == null);
}
}