diff --git a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/Typinferenz.java b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/Typinferenz.java index 62e65e8..4244dd2 100644 --- a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/Typinferenz.java +++ b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/Typinferenz.java @@ -62,7 +62,11 @@ public class Typinferenz { try { compiler = new JavaTXCompiler(editor.getFilePath().toFile(), false); - this.parsedSource = compiler.sourceFiles.get(editor.getFilePath().toFile()); + SourceFile parsedSourceOrNull = compiler.sourceFiles.get(editor.getFilePath().toFile()); + + if (parsedSourceOrNull != null) { + this.parsedSource = parsedSourceOrNull; + } return compiler.typeInferenceAsync(resultListener, new OutputStreamWriter(new NullOutputStream())); } catch (ClassNotFoundException e) { diff --git a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java index a4dbc76..2304f6c 100644 --- a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java +++ b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java @@ -352,7 +352,7 @@ public class JavEditor extends TextEditor implements UnifyResultListener { typeinference.updateresultSets(new Vector(evt.getNewTypeResult())); Set markers = new HashSet(); - typeReplaceMarkers = typeinference.updateWithResult(new Vector(markers), evt.getNewTypeResult()); + typeReplaceMarkers.addAll(typeinference.updateWithResult(new Vector(markers), evt.getNewTypeResult())); for (TypeReplaceMarker m : this.getTypeReplaceMarkers()) { markers.add(m);