Skip to content

Commit

Permalink
Fix DynamothCodeGenesis
Browse files Browse the repository at this point in the history
Signed-off-by: André Silva <andre15andre@hotmail.com>
  • Loading branch information
andre15silva committed Mar 22, 2021
1 parent 7bf9366 commit bad1f95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public DynamothCodeGenesisImpl(File[] projectRoots, SourceLocation location, URL
this.classes = new ArrayList<>();
ClassLoader cl = ClassLoader.getSystemClassLoader();

URL[] urls = ((URLClassLoader) cl).getURLs();
String[] pathElements = System.getProperty("java.class.path").split(System.getProperty("path.separator"));
ArrayList<URL> liClasspath = new ArrayList<>();
for (int i = 0; i < classpath.length; i++) {
URL url = classpath[i];
Expand All @@ -112,11 +112,14 @@ public DynamothCodeGenesisImpl(File[] projectRoots, SourceLocation location, URL
liClasspath.add(url);
}
}
for (int i = 0; i < urls.length; i++) {
URL url = urls[i];
File file = new File(url.getFile());
if (file.exists()) {
liClasspath.add(url);
for (int i = 0; i < pathElements.length; i++) {
try {
File file = new File(pathElements[i]);
if (file.exists()) {
liClasspath.add(file.toURI().toURL());
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
this.classpath = liClasspath.toArray(new URL[0]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.inria.lille.repair.synthesis;

import ca.cgjennings.jvm.JarLoader;
import fr.inria.lille.repair.TestUtility;
import fr.inria.lille.repair.common.config.NopolContext;
import fr.inria.lille.repair.nopol.SourceLocation;
Expand Down

0 comments on commit bad1f95

Please sign in to comment.