File tree Expand file tree Collapse file tree
core/src/main/kotlin/org/evomaster/core
externalservice/httpws/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -532,10 +532,11 @@ class HarvestActualHttpWsResponseHandler {
532532 try {
533533 val template = getACopyOfItsActualResponseIfExist(geneToMutate, probability)?.responseBody ? : return false
534534
535- val v = ParamUtil .getValueGene(geneToMutate )
536- val t = ParamUtil .getValueGene(template )
535+ val v = geneToMutate.getLeafGene( )
536+ val t = template.getLeafGene( )
537537 if (v::class .java == t::class .java) {
538538 v.copyValueFrom(t)
539+ v.forceNewTaints()
539540 return true
540541 } else if (v is StringGene ) {
541542 // add template as part of specialization
Original file line number Diff line number Diff line change @@ -191,7 +191,9 @@ class RestCallAction(
191191 For example, they could be a ChoiceGene when dealing with "examples" or Regex when having patterns
192192 only defined on some endpoints
193193 */
194- parameters[i].primaryGene().copyValueFrom(k.primaryGene())
194+ val g = parameters[i].primaryGene()
195+ g.copyValueFrom(k.primaryGene())
196+ g.forceNewTaints()
195197 }
196198 }
197199 }
Original file line number Diff line number Diff line change @@ -527,7 +527,7 @@ abstract class Individual(
527527 y != x && ! y.hasAnyBindingRelationship(x)
528528 }
529529 }){
530- errors.add(" Taint id ${d.key} has duplicate genes that are not related} " )
530+ errors.add(" Taint id ${d.key} has duplicate genes that are not related" )
531531 }
532532 }
533533 return errors
Original file line number Diff line number Diff line change @@ -79,11 +79,7 @@ abstract class Action(children: List<StructuralElement>) : ActionComponent(
7979
8080 fun forceNewTaints (){
8181 seeTopGenes().forEach { g ->
82- g.flatView().forEach { r ->
83- if (r is TaintableGene && ! r.isDependentTaint()){
84- r.forceNewTaintId()
85- }
86- }
82+ g.forceNewTaints()
8783 }
8884 }
8985
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import org.evomaster.core.Lazy
1515import org.evomaster.core.problem.enterprise.EnterpriseIndividual
1616import org.evomaster.core.problem.enterprise.SampleType
1717import org.evomaster.core.search.RootElement
18+ import org.evomaster.core.search.gene.interfaces.TaintableGene
1819import org.evomaster.core.search.gene.utils.GeneUtils
1920import org.evomaster.core.search.gene.interfaces.WrapperGene
2021import org.evomaster.core.search.service.SearchGlobalState
@@ -1133,6 +1134,14 @@ abstract class Gene(
11331134 abstract fun unsafeCopyValueFrom (other : Gene ): Boolean
11341135
11351136
1137+ fun forceNewTaints (){
1138+ flatView().forEach { r ->
1139+ if (r is TaintableGene && ! r.isDependentTaint()){
1140+ r.forceNewTaintId()
1141+ }
1142+ }
1143+ }
1144+
11361145 /* *
11371146 * Update current value of this gene, base on [other] gene.
11381147 * If for any reason the update fails, there is not going to be any side-effects.
Original file line number Diff line number Diff line change @@ -209,6 +209,7 @@ class ChoiceGene<T>(
209209 options even if not selected
210210 */
211211 val updated = g.copyValueFrom(x)
212+ g.forceNewTaints()
212213 if (updated){
213214 this .activeGeneIndex = i
214215 return true
You can’t perform that action at this time.
0 commit comments