modified: bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/Typinferenz.java

Bug 180 - Andere Einsetzung als im Bytecode geloest
This commit is contained in:
pl@gohorb.ba-horb.de 2020-04-13 16:10:24 +02:00
parent 4139aa6a98
commit e4066b5125

View File

@ -93,13 +93,13 @@ public class Typinferenz {
Set<TypeInsert> tips = new HashSet<>();
String outputDirectory = getOutputDirectory();
List<GenericGenratorResultForSourceFile> genericResults = new ArrayList<>();//wird in getBytecode bestimmt
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = new ArrayList<>();//wird in getBytecode bestimmt
if (this.forByteCode.size() > 0) {
for (SourceFile sf : compiler.sourceFiles.values()) {
try {
HashMap<String, byte[]> bytecode = getBytecode(sf, this.forByteCode, outputDirectory, genericResults);
compiler.generateBytecodForFile(outputDirectory, bytecode, sf, new ArrayList<>(forByteCode));
this.writeClassFile(outputDirectory, bytecode);
//HashMap<String, byte[]> bytecode = getBytecode(sf, this.forByteCode, outputDirectory, genericResults);
compiler.generateBytecodForFile(outputDirectory, /*bytecode,*/ sf, new ArrayList<>(forByteCode), simplifyResultsForAllSourceFiles);
//this.writeClassFile(outputDirectory, bytecode);
} catch (BytecodeGeneratorError | IOException ex) {
ErrorMarker toAdd = new ErrorMarker(ex.getMessage(), new CodePoint(sf.getOffset()));
ret.add(toAdd);
@ -108,7 +108,7 @@ public class Typinferenz {
}
int i = 0;
for (ResultSet tiResult : newResults) {
tips.addAll(TypeInsertFactory.createTypeInsertPoints(parsedSource, tiResult, newResults, genericResults.get(i)));
tips.addAll(TypeInsertFactory.createTypeInsertPoints(parsedSource, tiResult, newResults, simplifyResultsForAllSourceFiles));
i++;
for (TypeInsert p : tips) {
TypeReplaceMarker toAdd = new TypeReplaceMarker(editor, tiResult, p);
@ -167,6 +167,7 @@ public class Typinferenz {
return ret;
}
//wird nicht mehr benoetigt
public synchronized HashMap<String, byte[]> getBytecode(SourceFile sf, Collection<ResultSet> resultSets, String path, List<GenericGenratorResultForSourceFile> genericResultsRet) {
try {
HashMap<String, byte[]> classFiles = new HashMap<>();