Skip to content

Commit b6e31e1

Browse files
authored
Merge pull request #1396 from WebFuzzing/phg/fixEnumGene
Use parent instead of it for checking ChoiceGene
2 parents 67e656a + b91230d commit b6e31e1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • core/src/main/kotlin/org/evomaster/core/output/dto

core/src/main/kotlin/org/evomaster/core/output/dto/GeneToDto.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ class GeneToDto(
106106
result.add(dtoOutput.getSetterStatement(dtoVarName, attributeName, childDtoCall.varName))
107107
}
108108
else -> {
109-
if (leafGene is EnumGene<*> && it is ChoiceGene<*>) {
110-
val children = it.getViewOfChildren()
109+
val parent = leafGene.parent
110+
if (leafGene is EnumGene<*> && parent is ChoiceGene<*>) {
111+
val children = parent.getViewOfChildren()
111112
val otherChoice = children.find { child -> child != leafGene }
112113
result.add(dtoOutput.getSetterStatement(dtoVarName, attributeName, "${leafGene.getValueAsPrintableString(targetFormat = outputFormat)}${getValueSuffix(otherChoice)}"))
113114
} else {

0 commit comments

Comments
 (0)