-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1146 from WebFuzzing/fix-optional-time-impact
first try to fix exception related to TimeOffset impact
- Loading branch information
Showing
6 changed files
with
124 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
.../org/evomaster/core/search/impact/impactinfocollection/value/date/TimeOffsetGeneImpact.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.evomaster.core.search.impact.impactinfocollection.value.date | ||
|
||
import org.evomaster.core.search.gene.Gene | ||
import org.evomaster.core.search.gene.datetime.TimeGene | ||
import org.evomaster.core.search.gene.datetime.TimeOffsetGene | ||
import org.evomaster.core.search.gene.root.CompositeFixedGene | ||
import org.evomaster.core.search.impact.impactinfocollection.* | ||
import org.evomaster.core.search.impact.impactinfocollection.value.numeric.IntegerGeneImpact | ||
|
||
//TODO should be handle in a correct way | ||
class TimeOffsetGeneImpact(sharedImpactInfo: SharedImpactInfo, specificImpactInfo: SpecificImpactInfo, | ||
val typeImpact: CompositeFixedGeneImpact | ||
) : GeneImpact(sharedImpactInfo, specificImpactInfo) { | ||
|
||
constructor(id: String, gene : TimeOffsetGene) | ||
: this(SharedImpactInfo(id), SpecificImpactInfo(), | ||
typeImpact = ImpactUtils.createGeneImpact(gene.type, gene.type.name) as? CompositeFixedGeneImpact ?:throw IllegalStateException("CompositeFixedGeneImpact should be created"), | ||
) | ||
|
||
override fun copy(): TimeOffsetGeneImpact { | ||
return TimeOffsetGeneImpact( | ||
shared.copy(), | ||
specific.copy(), | ||
typeImpact = typeImpact.copy() | ||
) | ||
} | ||
|
||
override fun clone(): TimeOffsetGeneImpact { | ||
return TimeOffsetGeneImpact( | ||
shared.clone(),specific.clone(), | ||
typeImpact = typeImpact.clone() | ||
) | ||
} | ||
|
||
override fun validate(gene: Gene): Boolean = gene is TimeOffsetGene | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters