Fix wrong result being passed and remove log spam

This commit is contained in:
Daniel Holle 2023-06-01 16:12:25 +02:00
parent 7c6cd3a4cf
commit 46aac7e366
2 changed files with 3 additions and 4 deletions

View File

@ -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<JavMarker> updateWithResult(Vector<JavMarker> ret, List<ResultSet> newResults) {
public synchronized Vector<JavMarker> updateWithResult(Vector<JavMarker> ret, List<ResultSet> 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()));

View File

@ -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);