use FileProvider to find exclusions file

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2831 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
dolby-oss 2008-05-23 15:39:37 +00:00
parent 8fe9467be8
commit 50dd4919eb
3 changed files with 11 additions and 3 deletions

View File

@ -40,6 +40,7 @@ import com.ibm.wala.ssa.DefaultIRFactory;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.config.AnalysisScopeReader;
import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.io.FileProvider;
/**
*
@ -159,7 +160,7 @@ public abstract class AbstractAnalysisEngine implements AnalysisEngine {
Assertions.UNREACHABLE("no j2selibs specified. You probably did not call AppAnalysisEngine.setJ2SELibrary.");
}
scope = AnalysisScopeReader.read(SYNTHETIC_J2SE_MODEL, new File(getExclusionsFile()), getClass().getClassLoader());
scope = AnalysisScopeReader.read(SYNTHETIC_J2SE_MODEL, FileProvider.getFile(getExclusionsFile()), getClass().getClassLoader());
// add standard libraries
for (int i = 0; i < j2seLibs.length; i++) {

View File

@ -63,9 +63,11 @@ public class AnalysisScopeReader {
String entryPathname = toks.nextToken();
if ("classFile".equals(entryType)) {
File cf = FileProvider.getFile(entryPathname, javaLoader);
assert cf != null && cf.exists();
scope.addClassFileToScope(walaLoader, cf);
} else if ("sourceFile".equals(entryType)) {
File sf = FileProvider.getFile(entryPathname, javaLoader);
assert sf != null && sf.exists();
scope.addSourceFileToScope(walaLoader, sf, entryPathname);
} else if ("binaryDir".equals(entryType)) {
File bd = FileProvider.getFile(entryPathname, javaLoader);
@ -95,6 +97,7 @@ public class AnalysisScopeReader {
}
} catch (IOException e) {
e.printStackTrace();
Assertions.UNREACHABLE(e.toString());
}

View File

@ -14,6 +14,7 @@ import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -39,8 +40,11 @@ public class FileOfClasses extends SetOfClasses {
private boolean needsCompile = false;
public FileOfClasses(File textFile) throws IOException {
BufferedReader is = new BufferedReader(new InputStreamReader(new FileInputStream(textFile)));
this(new FileInputStream(textFile));
}
public FileOfClasses(InputStream input) throws IOException {
BufferedReader is = new BufferedReader(new InputStreamReader(input));
StringBuffer regex = null;
String line;