diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java index b7f14f19..33ece33e 100644 --- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java +++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java @@ -427,6 +427,9 @@ public class SyntaxTreeGenerator{ GenericsRegistry ret = new GenericsRegistry(this.globalGenerics); ret.putAll(generics); if(ctx == null || ctx.typeParameterList() == null)return ret; + for(Java8Parser.TypeParameterContext tp : ctx.typeParameterList().typeParameter()){ + ret.put(tp.Identifier().getText(), new GenericContext(parentClass, parentMethod)); + } for(Java8Parser.TypeParameterContext tp : ctx.typeParameterList().typeParameter()){ TypeGenerator.convert(tp, parentClass, parentMethod, reg, ret); } diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java index db577030..371a5d79 100644 --- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java +++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java @@ -61,10 +61,6 @@ public class TypeGenerator { public static GenericDeclarationList convert(Java8Parser.TypeParametersContext typeParametersContext, JavaClassName parentClass, String parentMethod, JavaClassRegistry reg, GenericsRegistry generics) { - for(Java8Parser.TypeParameterContext tp : typeParametersContext.typeParameterList().typeParameter()){ - generics.put(tp.Identifier().getText(), new GenericContext(parentClass, parentMethod)); - } - Token endOffset = typeParametersContext.getStop(); List typeVars = new ArrayList<>(); for(Java8Parser.TypeParameterContext typeParameter : typeParametersContext.typeParameterList().typeParameter()){