Skip to content

Commit 52750bb

Browse files
committed
fixed for base dictionary
1 parent 4a3135d commit 52750bb

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

core/src/main/kotlin/org/evomaster/core/problem/rest/service/sampler/AbstractRestSampler.kt

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,7 @@ abstract class AbstractRestSampler : HttpWsSampler<RestIndividual>() {
151151
initializeDerivedParamRules(problem.derivedParams)
152152
}
153153

154-
if(dictionaryService.isActive()){
155-
updateDictionaryService(actionCluster)
156-
}
157-
158-
if(config.useObjectExampleDataPool){
159-
feedObjectExamplesToDataPool(actionCluster)
160-
}
154+
updateDataPoolBasedOnSchema(actionCluster)
161155

162156
initSqlInfo(infoDto)
163157

@@ -357,9 +351,8 @@ abstract class AbstractRestSampler : HttpWsSampler<RestIndividual>() {
357351
initSeededTests()
358352
}
359353

360-
if(config.useObjectExampleDataPool){
361-
feedObjectExamplesToDataPool(actionCluster)
362-
}
354+
updateDataPoolBasedOnSchema(actionCluster)
355+
363356

364357
log.debug("Done initializing {}", AbstractRestSampler::class.simpleName)
365358
}
@@ -462,11 +455,24 @@ abstract class AbstractRestSampler : HttpWsSampler<RestIndividual>() {
462455
}
463456

464457

458+
private fun updateDataPoolBasedOnSchema(actionCluster: MutableMap<String, Action>){
459+
460+
//pre-filled dictionary and LLM
461+
if(dictionaryService.isActive()){
462+
updateDictionaryService(actionCluster)
463+
}
464+
465+
//fields inside object examples
466+
if(config.useObjectExampleDataPool){
467+
feedObjectExamplesToDataPool(actionCluster)
468+
}
469+
}
470+
465471
private fun updateDictionaryService(actionCluster: MutableMap<String, Action>) {
466472
actionCluster.values
467473
.flatMap { it.seeAllGenes() }
468474
.filterIsInstance<StringGene>()
469-
// .filter{g -> RestGeneSpecialNames.entries.none { e -> e.name == g.name } }
475+
.filter{g -> RestGeneSpecialNames.entries.none { e -> e.name == g.name } }
470476
.map { FieldInfo(it.name, it.description) }
471477
.let { dictionaryService.updatePoolFromDictionary(it.toList()) }
472478
}

0 commit comments

Comments
 (0)