This commit is contained in:
akshatbahety
2018-06-07 17:03:19 +05:30
parent 1de2313472
commit 7fd3ba4679
2 changed files with 7 additions and 7 deletions

View File

@ -78,7 +78,7 @@ public class SourceEditorController implements Initializable, SettingsOwner {
private Var<List<File>> auxclasspathFiles = Var.newSimpleVar(Collections.emptyList());
private final Val<ClassLoader> auxclasspathClassLoader = auxclasspathFiles.map(files -> {
try {
new ClasspathClassLoader(auxclasspathFiles.getValue(), SourceEditorController.class.getClassLoader());
new ClasspathClassLoader(files, SourceEditorController.class.getClassLoader());
} catch (IOException e) {
e.printStackTrace();
}
@ -135,7 +135,7 @@ public class SourceEditorController implements Initializable, SettingsOwner {
}
try {
current = astManager.updateCompilationUnit(source, auxclasspathClassLoader);
current = astManager.updateCompilationUnit(source, auxclasspathClassLoader.getValue());
} catch (ParseAbortedException e) {
invalidateAST(true);
return;
@ -188,7 +188,7 @@ public class SourceEditorController implements Initializable, SettingsOwner {
@PersistentProperty
public String getAuxclasspathFiles() {
return auxclasspathFiles.getValue().stream().map(p -> File.pathSeparator + p.getAbsolutePath()).collect(Collectors.joining(""));
return auxclasspathFiles.getValue().stream().map(p -> p.getAbsolutePath()).collect(Collectors.joining(File.pathSeparator));
}

View File

@ -39,7 +39,7 @@ public class ASTManager {
private LanguageVersion lastLanguageVersion;
/**
* Latest computed compilation unit (only null before the first call to
* {@link #updateCompilationUnit(String, Val<ClassLoader>)})
* {@link #updateCompilationUnit(String, ClassLoader)})
*/
private Var<Node> compilationUnit = Var.newSimpleVar(null);
/**
@ -85,7 +85,7 @@ public class ASTManager {
*
* @throws ParseAbortedException if parsing fails and cannot recover
*/
public Node updateCompilationUnit(String source, Val<ClassLoader> classLoader) throws ParseAbortedException {
public Node updateCompilationUnit(String source, ClassLoader classLoader) throws ParseAbortedException {
if (compilationUnit.isPresent()
&& getLanguageVersion().equals(lastLanguageVersion)
&& StringUtils.equals(source, lastValidSource)) {
@ -108,14 +108,14 @@ public class ASTManager {
}
try {
// TODO this should use the aux classpath
languageVersionHandler.getQualifiedNameResolutionFacade(classLoader.getValue());
languageVersionHandler.getQualifiedNameResolutionFacade(classLoader);
} catch (Exception e) {
designerRoot.getLogger().logEvent(new LogEntry(e, Category.QUALIFIED_NAME_RESOLUTION_EXCEPTION));
}
try {
// TODO this should use the aux classpath
languageVersionHandler.getTypeResolutionFacade(classLoader.getValue());
languageVersionHandler.getTypeResolutionFacade(classLoader);
} catch (Exception e) {
designerRoot.getLogger().logEvent(new LogEntry(e, Category.TYPERESOLUTION_EXCEPTION));
}