From a6c93c881681ad089ecb75fe3f27a22a644d4efa Mon Sep 17 00:00:00 2001 From: Michael Uhl Date: Mon, 8 Apr 2019 23:30:49 +0200 Subject: [PATCH] Outline repariert. --- .../src/typinferenzplugin/Typinferenz.java | 6 +++++- .../src/typinferenzplugin/editor/JavEditor.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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);