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.BytecodeGen;
import de.dhbwstuttgart.bytecode.Exception.BytecodeGeneratorError; import de.dhbwstuttgart.bytecode.Exception.BytecodeGeneratorError;
import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor; 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.core.JavaTXCompiler;
import de.dhbwstuttgart.exceptions.TypeinferenceException; import de.dhbwstuttgart.exceptions.TypeinferenceException;
import de.dhbwstuttgart.syntaxtree.SourceFile; 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) { public synchronized HashMap<String, byte[]> getBytecode(SourceFile sf, Collection<ResultSet> resultSets, String path) {
HashMap<String, byte[]> classFiles = new HashMap<>(); try {
BytecodeGen bytecodeGen = new BytecodeGen(classFiles, resultSets, sf, path); HashMap<String, byte[]> classFiles = new HashMap<>();
bytecodeGen.visit(sf); List<GenericGenratorResultForSourceFile> genericResults = compiler.getGeneratedGenericResultsForAllSourceFiles(new ArrayList<>(resultSets));
List<HashMap<String, SimplifyResult>> simplifyResultsList = bytecodeGen.getSimplifyResultsList(); BytecodeGen bytecodeGen = new BytecodeGen(classFiles,resultSets, genericResults, sf,path);
return bytecodeGen.getClassFiles(); bytecodeGen.visit(sf);
return bytecodeGen.getClassFiles();
} catch (ClassNotFoundException e) {
e.printStackTrace();
return new HashMap<>();
}
} }
public void writeClassFile(String outputDirectory, HashMap<String, byte[]> classFiles) { public void writeClassFile(String outputDirectory, HashMap<String, byte[]> classFiles) {