Skip to content

Commit 8d16a56

Browse files
committed
FIX: Fixed isEmpty() method. It did not differ between EClassifiers of type EClass and EDataType.
1 parent bbb9b49 commit 8d16a56

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

src/main/java/jce/codegen/WrapperGenerator.xtend

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,14 @@ final class WrapperGenerator {
103103
* Checks whether the EPackage is empty or not. An empty ePackage has no classifiers and only empty subpackages.
104104
*/
105105
def private static boolean isEmpty(EPackage ePackage) {
106-
if (!ePackage.EClassifiers.empty) {
107-
return false // has classifier.
108-
} else {
109-
var empty = true
110-
for (EPackage eSubpackage : ePackage.ESubpackages) { // for every subpackage
111-
empty = empty && isEmpty(eSubpackage) // check if empty
112-
}
113-
return empty
106+
var empty = true;
107+
for (EClassifier eClassifier : ePackage.EClassifiers) { // for every classifier
108+
empty = empty && !(eClassifier instanceof EClass) // check if is EClass
109+
}
110+
for (EPackage eSubpackage : ePackage.ESubpackages) { // for every subpackage
111+
empty = empty && isEmpty(eSubpackage) // check if empty
114112
}
113+
return empty
115114
}
116115

117116
/**
@@ -136,4 +135,4 @@ final class WrapperGenerator {
136135
}
137136
}
138137
'''
139-
}
138+
}

0 commit comments

Comments
 (0)