Generic type inserts.

This commit is contained in:
Michael Uhl 2019-07-29 16:24:04 +02:00
parent 4a626d0949
commit 77be850557
2 changed files with 13 additions and 6 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.project

View File

@ -24,7 +24,7 @@ import org.eclipse.core.runtime.Status;
import de.dhbwstuttgart.bytecode.BytecodeGen;
import de.dhbwstuttgart.bytecode.Exception.BytecodeGeneratorError;
import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor;
import de.dhbwstuttgart.bytecode.utilities.SimplifyResult;
import de.dhbwstuttgart.bytecode.simplifyRes.GenericGenratorResultForSourceFile;
import de.dhbwstuttgart.core.JavaTXCompiler;
import de.dhbwstuttgart.exceptions.TypeinferenceException;
import de.dhbwstuttgart.syntaxtree.SourceFile;
@ -146,11 +146,17 @@ public class Typinferenz {
}
public synchronized HashMap<String, byte[]> getBytecode(SourceFile sf, Collection<ResultSet> resultSets, String path) {
HashMap<String, byte[]> classFiles = new HashMap<>();
BytecodeGen bytecodeGen = new BytecodeGen(classFiles, resultSets, sf, path);
bytecodeGen.visit(sf);
List<HashMap<String, SimplifyResult>> simplifyResultsList = bytecodeGen.getSimplifyResultsList();
return bytecodeGen.getClassFiles();
try {
HashMap<String, byte[]> classFiles = new HashMap<>();
List<GenericGenratorResultForSourceFile> genericResults = compiler.getGeneratedGenericResultsForAllSourceFiles(new ArrayList<>(resultSets));
BytecodeGen bytecodeGen = new BytecodeGen(classFiles,resultSets, genericResults, sf,path);
bytecodeGen.visit(sf);
return bytecodeGen.getClassFiles();
} catch (ClassNotFoundException e) {
e.printStackTrace();
return new HashMap<>();
}
}
public void writeClassFile(String outputDirectory, HashMap<String, byte[]> classFiles) {