Permalink
Browse files

changed FileProvider to have instance methods

  • Loading branch information...
1 parent 43848b6 commit 2edb070437030294b53d9cdbcbc9ab2f5fdb8b38 @msridhar msridhar committed Apr 16, 2012
Showing with 63 additions and 66 deletions.
  1. +1 −1 com.ibm.wala.cast.java.jdt.test/source/com/ibm/wala/cast/java/test/JDTJava15IRTests.java
  2. +1 −1 com.ibm.wala.cast.java.jdt.test/source/com/ibm/wala/cast/java/test/JDTJavaIRTests.java
  3. +1 −1 ...va.polyglot/source/com/ibm/wala/cast/java/client/polyglot/EclipseProjectSourceAnalysisEngine.java
  4. +1 −1 com.ibm.wala.cast.js.rhino.test/harness-src/com/ibm/wala/cast/js/rhino/test/HTMLCGBuilder.java
  5. +1 −1 com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/correlations/CorrelationFinder.java
  6. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/callGraph/CallGraphTestUtil.java
  7. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/DupFieldsTest.java
  8. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/ExclusionsTest.java
  9. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/GetTargetsTest.java
  10. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/InnerClassesTest.java
  11. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/InterfaceTest.java
  12. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/LibraryVersionTest.java
  13. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/ir/AnnotationTest.java
  14. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/ir/CFGSanitizerTest.java
  15. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/ir/CFGTest.java
  16. +2 −2 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/ir/CornerCasesTest.java
  17. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/ir/DeterministicIRTest.java
  18. +2 −2 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/ir/LocalNamesTest.java
  19. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/ir/MultiNewArrayTest.java
  20. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/typeInference/TypeInferenceTest.java
  21. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/examples/analysis/dataflow/DataflowTest.java
  22. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/JavaViewerDriver.java
  23. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFCallGraph.java
  24. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFControlDependenceGraph.java
  25. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFSDG.java
  26. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFSlice.java
  27. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFTypeHierarchy.java
  28. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFWalaIR.java
  29. +1 −1 com.ibm.wala.core.tests/src/com/ibm/wala/examples/properties/WalaExamplesProperties.java
  30. +2 −2 com.ibm.wala.core.tests/src/com/ibm/wala/util/io/FileProviderTest.java
  31. +1 −1 com.ibm.wala.core/src/com/ibm/wala/classLoader/AbstractURLModule.java
  32. +1 −1 com.ibm.wala.core/src/com/ibm/wala/classLoader/ClassLoaderImpl.java
  33. +1 −1 com.ibm.wala.core/src/com/ibm/wala/client/AbstractAnalysisEngine.java
  34. +1 −1 com.ibm.wala.core/src/com/ibm/wala/properties/WalaProperties.java
  35. +7 −6 com.ibm.wala.core/src/com/ibm/wala/util/config/AnalysisScopeReader.java
  36. +15 −19 com.ibm.wala.core/src/com/ibm/wala/util/io/FileProvider.java
  37. +1 −1 com.ibm.wala.ide.tests/src/com/ibm/wala/examples/drivers/SWTCallGraph.java
  38. +1 −1 com.ibm.wala.ide.tests/src/com/ibm/wala/examples/drivers/SWTPointsTo.java
  39. +1 −1 com.ibm.wala.ide.tests/src/com/ibm/wala/examples/drivers/SWTTypeHierarchy.java
  40. +1 −1 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/J2EEAnalysisScope.java
@@ -62,7 +62,7 @@ protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDes
};
try {
- engine.setExclusionsFile(FileProvider
+ engine.setExclusionsFile((new FileProvider())
.getFileFromPlugin(CoreTestsPlugin.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
} catch (IOException e) {
Assert.assertFalse("Cannot find exclusions file", true);
@@ -96,7 +96,7 @@ protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDes
};
try {
- engine.setExclusionsFile(FileProvider
+ engine.setExclusionsFile((new FileProvider())
.getFileFromPlugin(CoreTestsPlugin.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
} catch (IOException e) {
Assert.assertFalse("Cannot find exclusions file", true);
@@ -64,7 +64,7 @@ public EclipseProjectSourceAnalysisEngine(IJavaProject project, String fileExt)
super(project);
this.fileExt = fileExt;
try {
- setExclusionsFile(FileProvider.getFileFromPlugin(CorePlugin.getDefault(), "J2SEClassHierarchyExclusions.txt")
+ setExclusionsFile((new FileProvider()).getFileFromPlugin(CorePlugin.getDefault(), "J2SEClassHierarchyExclusions.txt")
.getAbsolutePath());
} catch (IOException e) {
Assertions.UNREACHABLE("Cannot find exclusions file");
@@ -125,7 +125,7 @@ private static URL toUrl(String src) throws MalformedURLException {
// first try interpreting as local file name, if that doesn't work just
// assume it's a URL
try {
- File f = FileProvider.getFileFromClassLoader(src, HTMLCGBuilder.class.getClassLoader());
+ File f = (new FileProvider()).getFileFromClassLoader(src, HTMLCGBuilder.class.getClassLoader());
URL url = f.toURI().toURL();
return url;
} catch (FileNotFoundException fnfe) {
@@ -270,7 +270,7 @@ public int compare(Pair<Position, String> o1, Pair<Position, String> o2) {
private URL toUrl(String src) throws MalformedURLException {
// first try interpreting as local file name, if that doesn't work just assume it's a URL
try {
- File f = FileProvider.getFileFromClassLoader(src, this.getClass().getClassLoader());
+ File f = (new FileProvider()).getFileFromClassLoader(src, this.getClass().getClassLoader());
URL url = f.toURI().toURL();
return url;
} catch(FileNotFoundException fnfe) {
@@ -45,7 +45,7 @@ public static AnalysisOptions makeAnalysisOptions(AnalysisScope scope, Iterable<
private static final boolean CHECK_FOOTPRINT = false;
public static AnalysisScope makeJ2SEAnalysisScope(String scopeFile, String exclusionsFile) throws IOException {
- AnalysisScope scope = AnalysisScopeReader.readJavaScope(scopeFile, FileProvider.getFile(exclusionsFile), MY_CLASSLOADER);
+ AnalysisScope scope = AnalysisScopeReader.readJavaScope(scopeFile, (new FileProvider()).getFile(exclusionsFile), MY_CLASSLOADER);
return scope;
}
@@ -34,7 +34,7 @@
@Test public void testDupFieldNames() throws IOException, ClassHierarchyException {
AnalysisScope scope = null;
- scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), DupFieldsTest.class.getClassLoader());
+ scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), DupFieldsTest.class.getClassLoader());
ClassHierarchy cha = ClassHierarchy.make(scope);
TypeReference ref = TypeReference.findOrCreate(ClassLoaderReference.Application, "LDupFieldName");
IClass klass = cha.lookupClass(ref);
@@ -28,7 +28,7 @@
@Test
public void testExclusions() throws IOException {
- AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("GUIExclusions.txt"),
+ AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("GUIExclusions.txt"),
ExclusionsTest.class.getClassLoader());
TypeReference buttonRef = TypeReference.findOrCreate(ClassLoaderReference.Application,
StringStuff.deployment2CanonicalTypeString("java.awt.Button"));
@@ -48,7 +48,7 @@ public static void main(String[] args) {
@BeforeClass
public static void beforeClass() throws Exception {
- scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
+ scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
ClassLoaderFactory factory = new ClassLoaderFactoryImpl(scope.getExclusions() );
@@ -48,7 +48,7 @@ public static void main(String[] args) {
@BeforeClass
public static void beforeClass() throws Exception {
- scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("J2SEClassHierarchyExclusions.txt"),
+ scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"),
MY_CLASSLOADER);
ClassLoaderFactory factory = new ClassLoaderFactoryImpl(scope.getExclusions());
@@ -45,7 +45,7 @@ public static void main(String[] args) {
@BeforeClass
public static void beforeClass() throws Exception {
- scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
+ scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
ClassLoaderFactory factory = new ClassLoaderFactoryImpl(scope.getExclusions() );
@@ -34,7 +34,7 @@
private static final ClassLoader MY_CLASSLOADER = DeterministicIRTest.class.getClassLoader();
@Test public void testLibraryVersion() throws IOException {
- AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
+ AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
System.err.println("java library version is " + scope.getJavaLibraryVersion());
Assert.assertTrue(scope.isJava16Libraries() || scope.isJava15Libraries()||scope.isJava14Libraries());
}
@@ -41,7 +41,7 @@ public static void main(String[] args) {
@BeforeClass
public static void before() throws IOException, ClassHierarchyException {
AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA,
- FileProvider.getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS), AnnotationTest.class.getClassLoader());
+ (new FileProvider()).getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS), AnnotationTest.class.getClassLoader());
cha = ClassHierarchy.make(scope);
}
@@ -53,7 +53,7 @@
*/
@Test
public void testSyntheticEdgeToExit() throws IOException, IllegalArgumentException, WalaException {
- AnalysisScope scope = AnalysisScopeReader.makePrimordialScope(FileProvider.getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
+ AnalysisScope scope = AnalysisScopeReader.makePrimordialScope((new FileProvider()).getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
ClassHierarchy cha = ClassHierarchy.make(scope);
ClassLoader cl = CFGSanitizerTest.class.getClassLoader();
@@ -56,7 +56,7 @@
public static void beforeClass() throws Exception {
scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA,
- FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), CFGTest.class.getClassLoader());
+ (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), CFGTest.class.getClassLoader());
ClassLoaderFactory factory = new ClassLoaderFactoryImpl(scope.getExclusions());
try {
@@ -53,7 +53,7 @@
*/
@Test public void testBug38484() throws ClassHierarchyException, IOException {
AnalysisScope scope = null;
- scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
+ scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
ClassHierarchy cha = ClassHierarchy.make(scope);
TypeReference t = TypeReference.findOrCreateClass(scope.getApplicationLoader(), "cornerCases", "YuckyInterface");
IClass klass = cha.lookupClass(t);
@@ -71,7 +71,7 @@
*/
@Test public void testBug38540() throws ClassHierarchyException, IOException {
AnalysisScope scope = null;
- scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
+ scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
AnalysisOptions options = new AnalysisOptions();
ClassHierarchy cha = ClassHierarchy.make(scope);
TypeReference t = TypeReference.findOrCreateClass(scope.getApplicationLoader(), "cornerCases", "Main");
@@ -66,7 +66,7 @@ public static void main(String[] args) {
public static void beforeClass() throws Exception {
scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA,
- FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
+ (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
options = new AnalysisOptions(scope, null);
cache = new AnalysisCache();
ClassLoaderFactory factory = new ClassLoaderFactoryImpl(scope.getExclusions());
@@ -68,7 +68,7 @@ public static void main(String[] args) {
public static void beforeClass() throws Exception {
scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA,
- FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
+ (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
options = new AnalysisOptions(scope, null);
cache = new AnalysisCache();
@@ -100,7 +100,7 @@ public static void afterClass() throws Exception {
@Test
public void testAliasNames() {
try {
- AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider
+ AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider())
.getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
ClassHierarchy cha = ClassHierarchy.make(scope);
TypeReference t = TypeReference.findOrCreateClass(scope.getApplicationLoader(), "cornerCases", "AliasNames");
@@ -41,7 +41,7 @@
@Test public void testMultiNewArray1() throws IOException, ClassHierarchyException {
AnalysisScope scope = null;
- scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
+ scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
ClassHierarchy cha = ClassHierarchy.make(scope);
IClass klass = cha.lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application, TestConstants.MULTI_DIM_MAIN));
Assert.assertTrue(klass != null);
@@ -64,7 +64,7 @@ public static void main(String[] args) {
@BeforeClass
public static void beforeClass() throws Exception {
- scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
+ scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
options = new AnalysisOptions(scope, null);
cache = new AnalysisCache();
@@ -67,7 +67,7 @@
public static void beforeClass() throws Exception {
scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA,
- FileProvider.getFile("J2SEClassHierarchyExclusions.txt"), DataflowTest.class.getClassLoader());
+ (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), DataflowTest.class.getClassLoader());
try {
cha = ClassHierarchy.make(scope);
@@ -40,7 +40,7 @@ public static void validateCommandLine(Properties p) {
private static void run(String classPath, String exclusionFilePath) throws IOException, ClassHierarchyException, CallGraphBuilderCancelException{
- File exclusionFile = FileProvider.getFile(exclusionFilePath);
+ File exclusionFile = (new FileProvider()).getFile(exclusionFilePath);
AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(classPath, exclusionFile != null ? exclusionFile
: new File(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
@@ -108,7 +108,7 @@ public static Process run(String[] args) throws WalaException, IllegalArgumentEx
*/
public static Process run(String appJar, String exclusionFile) throws IllegalArgumentException, CancelException {
try {
- Graph<CGNode> g = buildPrunedCallGraph(appJar, FileProvider.getFile(exclusionFile));
+ Graph<CGNode> g = buildPrunedCallGraph(appJar, (new FileProvider()).getFile(exclusionFile));
Properties p = null;
try {
@@ -87,7 +87,7 @@ public static Process run(String appJar, String methodSig) throws IOException {
if (PDFCallGraph.isDirectory(appJar)) {
appJar = PDFCallGraph.findJarFiles(new String[] { appJar });
}
- AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(appJar, FileProvider.getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
+ AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(appJar, (new FileProvider()).getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
ClassHierarchy cha = ClassHierarchy.make(scope);
@@ -117,7 +117,7 @@ public static ControlDependenceOptions getControlDependenceOptions(Properties p)
*/
public static Process run(String appJar, String mainClass, DataDependenceOptions dOptions, ControlDependenceOptions cOptions) throws IllegalArgumentException, CancelException, IOException {
try {
- AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(appJar, FileProvider.getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
+ AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(appJar, (new FileProvider()).getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
// generate a WALA-consumable wrapper around the incoming scope object
@@ -145,7 +145,7 @@ public static Process run(String appJar, String mainClass, String srcCaller, Str
IOException {
try {
// create an analysis scope representing the appJar as a J2SE application
- AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(appJar, FileProvider
+ AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(appJar, (new FileProvider())
.getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
// build a class hierarchy, call graph, and system dependence graph
@@ -71,7 +71,7 @@ public static Process run(String[] args) throws IOException {
try {
validateCommandLine(args);
String classpath = args[CLASSPATH_INDEX];
- AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(classpath, FileProvider.getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
+ AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(classpath, (new FileProvider()).getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
// invoke WALA to build a class hierarchy
ClassHierarchy cha = ClassHierarchy.make(scope);
@@ -72,7 +72,7 @@ public static Process run(String appJar, String methodSig) throws IOException {
// Build an AnalysisScope which represents the set of classes to analyze. In particular,
// we will analyze the contents of the appJar jar file and the Java standard libraries.
- AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(appJar, FileProvider
+ AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(appJar, (new FileProvider())
.getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
// Build a class hierarchy representing all classes to analyze. This step will read the class
@@ -43,7 +43,7 @@ public static String getWalaCoreTestsHomeDirectory() {
throw new IllegalStateException("failed to find URL for wala.examples.properties");
}
- return new File(FileProvider.filePathFromURL(url)).getParentFile().getParentFile().getAbsolutePath();
+ return new File((new FileProvider()).filePathFromURL(url)).getParentFile().getParentFile().getAbsolutePath();
}
}
@@ -17,7 +17,7 @@ public void testValidFile() throws MalformedURLException {
URL url = new URL("file:///c:/my/File.jar");
String expected = "/c:/my/File.jar";
// exercise:
- String actual = FileProvider.filePathFromURL(url);
+ String actual = (new FileProvider()).filePathFromURL(url);
// verify:
assertEquals(expected, actual);
}
@@ -29,7 +29,7 @@ public void testURLWithInvalidURIChars() throws MalformedURLException {
URL url = new URL("file:///[Eclipse]/File.jar");
String expected = PlatformUtil.onWindows() ? "/C:/[Eclipse]/File.jar" : "/[Eclipse]/File.jar";
// exercise:
- String actual = FileProvider.filePathFromURL(url);
+ String actual = (new FileProvider()).filePathFromURL(url);
// verify:
assertEquals(expected, actual);
}
@@ -40,7 +40,7 @@ public String getName() {
if (con instanceof JarURLConnection)
return ((JarURLConnection) con).getEntryName();
else
- return FileProvider.filePathFromURL(url);
+ return (new FileProvider()).filePathFromURL(url);
} catch (IOException e) {
Assertions.UNREACHABLE();
return null;
@@ -510,7 +510,7 @@ private void getJarFileContents(JarFileModule archive) {
String jarFileName = archive.getJarFile().getName();
InputStream s = null;
try {
- File jarFile = FileProvider.getFile(jarFileName);
+ File jarFile = (new FileProvider()).getFile(jarFileName);
int bufferSize = 65536;
s = new BufferedInputStream(new FileInputStream(jarFile), bufferSize);
byte[] b = new byte[1024];
@@ -154,7 +154,7 @@ public void buildAnalysisScope() throws IOException {
Assertions.UNREACHABLE("no j2selibs specified. You probably did not call AppAnalysisEngine.setJ2SELibrary.");
}
- scope = AnalysisScopeReader.readJavaScope(SYNTHETIC_J2SE_MODEL, FileProvider.getFile(getExclusionsFile()), getClass()
+ scope = AnalysisScopeReader.readJavaScope(SYNTHETIC_J2SE_MODEL, (new FileProvider()).getFile(getExclusionsFile()), getClass()
.getClassLoader());
// add standard libraries
@@ -143,7 +143,7 @@ public static String getWalaHomeDir() {
if (url == null) {
return System.getProperty("user.dir"); //$NON-NLS-1$
} else {
- return new File(FileProvider.filePathFromURL(url)).getParentFile().getParentFile().getPath();
+ return new File((new FileProvider()).filePathFromURL(url)).getParentFile().getParentFile().getPath();
}
}
Oops, something went wrong.

0 comments on commit 2edb070

Please sign in to comment.