Skip to content

Commit cd8e1b2

Browse files
committed
FIX: Fixed a bug with the import checking of the type parameter representation. Should be revisited some time for a more in-depth analysis.
1 parent 680a4c8 commit cd8e1b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/jce/generators/TypeParameterRepresentation.xtend

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ class TypeParameterRepresentation {
7474
checkGenericType(argument, importDeclaration, ecoreInterface)
7575
}
7676
}
77-
77+
7878
/**
7979
* Checks if a import declarations ends with the name of the EClassifier of an EGenericType (which is either a type parameter bound or a generic argument of a type parameter bound). If that is the case, the import will be added to the list of necessary imports.
8080
*/
8181
def private void checkImport(IImportDeclaration importDeclaration, EGenericType type) {
82-
if(importDeclaration.elementName.endsWith(type.EClassifier.name)) {
82+
val name = type.EClassifier?.name
83+
if(name !== null && importDeclaration.elementName.endsWith(name)) { // TODO (MEDIUM) when does this fail? (Generic Self Reference Test)
8384
imports.add(importDeclaration.elementName) // add to import string list.
8485
}
8586
}

0 commit comments

Comments
 (0)