diff --git a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/Typinferenz.java b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/Typinferenz.java index c94ec94..d9e7b3c 100644 --- a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/Typinferenz.java +++ b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/Typinferenz.java @@ -69,7 +69,6 @@ public class Typinferenz { if (Strings.isNullOrEmpty(editor.getSourceCode())) { return new UnifyResultModel(new ConstraintSet<>(), new FiniteClosure(new HashSet<>(), new OutputStreamWriter(new NullOutputStream()))); } - return compiler.typeInferenceAsync(resultListener, new OutputStreamWriter(new NullOutputStream())); } catch (ClassNotFoundException e) { LOG.log(new Status(ERROR, PLUGIN_ID, e.getMessage(), e)); @@ -84,7 +83,7 @@ public class Typinferenz { return this.forByteCode; } - public Vector updateWithResult(Vector ret, List newResults) { + public synchronized Vector updateWithResult(Vector ret, List newResults) { this.tiResults.addAll(newResults); this.forByteCode.addAll(newResults); @@ -95,7 +94,7 @@ public class Typinferenz { if (this.forByteCode.size() > 0) { for (SourceFile sf : compiler.sourceFiles.values()) { try { - var generatedClasses = compiler.generateBytecode(sf, newResults); + var generatedClasses = compiler.generateBytecode(sf, tiResults); compiler.writeClassFile(generatedClasses, new File(outputDirectory)); } catch (IOException ex) { ErrorMarker toAdd = new ErrorMarker(ex.getMessage(), new CodePoint(sf.getOffset())); diff --git a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java index 8de5a5b..89ec94c 100644 --- a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java +++ b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java @@ -105,7 +105,7 @@ public class JavEditor extends TextEditor implements UnifyResultListener { IResourceChangeListener listener = new IResourceChangeListener() { @Override public void resourceChanged(IResourceChangeEvent arg0) { - System.out.println("Text changed"); + //System.out.println("Text changed"); } }; ResourcesPlugin.getWorkspace().addResourceChangeListener(listener);