Bug in JavaClassRegistry contains Methode gefixt
This commit is contained in:
parent
2c7f4770a3
commit
752f59172f
src/de/dhbwstuttgart
@ -199,7 +199,7 @@ public class SyntaxTreeGenerator{
|
|||||||
modifiers += newModifier;
|
modifiers += newModifier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
JavaClassName name = convert(ctx.Identifier());
|
JavaClassName name = reg.getName(ctx.Identifier().getText());
|
||||||
GenericDeclarationList genericClassParameters = TypeGenerator.convert(ctx.typeParameters(), reg, generics);
|
GenericDeclarationList genericClassParameters = TypeGenerator.convert(ctx.typeParameters(), reg, generics);
|
||||||
Block class_block = null;
|
Block class_block = null;
|
||||||
List<Field> fielddecl = convertFields(ctx.classBody());
|
List<Field> fielddecl = convertFields(ctx.classBody());
|
||||||
@ -324,21 +324,6 @@ public class SyntaxTreeGenerator{
|
|||||||
return convertModifier(ctx.getText());
|
return convertModifier(ctx.getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Converts a TerminalNode to JavaClassName. If pkgName is set, it will be included like expected.
|
|
||||||
**/
|
|
||||||
private JavaClassName convert(TerminalNode t){
|
|
||||||
String name = "";
|
|
||||||
if(this.pkgName != null){
|
|
||||||
name = this.pkgName + "." + t.toString();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
name = t.toString();
|
|
||||||
}
|
|
||||||
return this.reg.getName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ClassOrInterface convertEnum(Java8Parser.EnumDeclarationContext ctx){
|
private ClassOrInterface convertEnum(Java8Parser.EnumDeclarationContext ctx){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package de.dhbwstuttgart.typecheck;
|
package de.dhbwstuttgart.typecheck;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package de.dhbwstuttgart.typecheck;
|
package de.dhbwstuttgart.typecheck;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Speichert die Klassen im aktuellen Projektscope
|
* Speichert die Klassen im aktuellen Projektscope
|
||||||
@ -32,6 +34,6 @@ public class JavaClassRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean contains(String whole) {
|
public boolean contains(String whole) {
|
||||||
return existingClasses.contains(whole);
|
return existingClasses.contains(new JavaClassName(whole));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user