Skip to content

Commit b874a92

Browse files
committed
EDIT: Excluded type parameters of generic methods from the type retention. As a result, only type parameters of types are now retained from the import manipulation.
1 parent 1ece930 commit b874a92

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

src/main/java/jce/codemanipulation/ecore/TypeRetentionVisitor.xtend

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,13 @@ class TypeRetentionVisitor extends ASTVisitor {
5050
* Visits all type declarations and retains the super interface types.
5151
*/
5252
override boolean visit(TypeDeclaration node) {
53-
for (Type superInterface : RawTypeUtil.castList(Type, node.superInterfaceTypes)) {
53+
for (superInterface : RawTypeUtil.castList(Type, node.superInterfaceTypes)) {
5454
retainSuperInterface(superInterface, node, node.AST)
5555
}
56-
return super.visit(node)
57-
}
58-
59-
/**
60-
* Visits all type parameter declarations and retains bound types.
61-
*/
62-
override boolean visit(TypeParameter node) {
63-
for (Type bound : RawTypeUtil.castList(Type, node.typeBounds)) {
64-
retainBoundType(bound)
56+
for (parameter : RawTypeUtil.castList(TypeParameter, node.typeParameters)) {
57+
for (Type bound : RawTypeUtil.castList(Type, parameter.typeBounds)) {
58+
retainBoundType(bound)
59+
}
6560
}
6661
return super.visit(node)
6762
}

0 commit comments

Comments
 (0)