Skip to content

Commit 9700194

Browse files
committed
List is already covariant in Kotlin (List<out E>), so List<out ABCClass> is redundant; List<ABCClass> is enough.
1 parent 5262eac commit 9700194

21 files changed

Lines changed: 39 additions & 39 deletions

core/src/main/kotlin/org/evomaster/core/mongo/MongoDbAction.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ class MongoDbAction(
5858
return "MONGO_Insert_${database}_${collection}_${documentsType}"
5959
}
6060

61-
override fun seeTopGenes(): List<out Gene> {
61+
override fun seeTopGenes(): List<Gene> {
6262
return genes
6363
}
6464

6565
override fun copyContent(): Action {
6666
return MongoDbAction(database, collection, documentsType, genes.map(Gene::copy))
6767
}
68-
}
68+
}

core/src/main/kotlin/org/evomaster/core/problem/externalservice/HostnameResolutionAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class HostnameResolutionAction(
5050
return "Hostname_${hostname}_${localIPAddress}"
5151
}
5252

53-
override fun seeTopGenes(): List<out Gene> {
53+
override fun seeTopGenes(): List<Gene> {
5454
return listOf()
5555
}
5656

core/src/main/kotlin/org/evomaster/core/problem/externalservice/httpws/HttpExternalServiceAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class HttpExternalServiceAction(
7575
(response.responseBody.gene as StringGene).forceTaintedValue()
7676
}
7777

78-
override fun seeTopGenes(): List<out Gene> {
78+
override fun seeTopGenes(): List<Gene> {
7979
return response.genes
8080
}
8181

core/src/main/kotlin/org/evomaster/core/problem/externalservice/rpc/DbAsExternalServiceAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DbAsExternalServiceAction (
5050
return getDbAsExternalServiceAction(commandName, requestRuleIdentifier, (response as ClassResponseParam).className)
5151
}
5252

53-
override fun seeTopGenes(): List<out Gene> {
53+
override fun seeTopGenes(): List<Gene> {
5454
return response.genes
5555
}
5656

core/src/main/kotlin/org/evomaster/core/problem/externalservice/rpc/RPCExternalServiceAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class RPCExternalServiceAction(
5959
return getRPCExternalServiceActionName(interfaceName, functionName, requestRuleIdentifier, (response as ClassResponseParam).className)
6060
}
6161

62-
override fun seeTopGenes(): List<out Gene> {
62+
override fun seeTopGenes(): List<Gene> {
6363
return response.genes
6464
}
6565

core/src/main/kotlin/org/evomaster/core/problem/graphql/GraphQLAction.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class GraphQLAction(
2727
return "$methodName"
2828
}
2929

30-
override fun seeTopGenes(): List<out Gene> {
30+
override fun seeTopGenes(): List<Gene> {
3131

3232
return parameters.flatMap { it.seeGenes() }
3333
}
@@ -42,4 +42,4 @@ class GraphQLAction(
4242
override fun toString(): String {
4343
return "$methodType $methodName, auth=${auth.name}"
4444
}
45-
}
45+
}

core/src/main/kotlin/org/evomaster/core/problem/rest/data/RestCallAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class RestCallAction(
158158
return "$verb:$path"
159159
}
160160

161-
override fun seeTopGenes(): List<out Gene> {
161+
override fun seeTopGenes(): List<Gene> {
162162
return parameters.flatMap { it.seeGenes() }
163163
}
164164

core/src/main/kotlin/org/evomaster/core/problem/rest/resource/RestResourceCalls.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class RestResourceCalls(
194194
/**
195195
* @return actions with specified action [filter]
196196
*/
197-
fun seeActions(filter: ActionFilter): List<out Action> {
197+
fun seeActions(filter: ActionFilter): List<Action> {
198198
return when (filter) {
199199
ActionFilter.ALL -> sqlActions.plus(externalServiceActions).plus(mainActions) // FIXME: Is this correct?
200200
ActionFilter.INIT -> sqlActions.plus(mongoDbActions).plus(redisDbActions).plus(dnsActions)
@@ -254,7 +254,7 @@ class RestResourceCalls(
254254
* @return the mutable SQL genes and they do not bind with any of Rest Actions
255255
*
256256
* */
257-
private fun seeMutableSQLGenes(): List<out Gene> = getResourceNode()
257+
private fun seeMutableSQLGenes(): List<Gene> = getResourceNode()
258258
.getMutableSQLGenes(sqlActions, getRestTemplate(), is2POST)
259259

260260

core/src/main/kotlin/org/evomaster/core/problem/rest/resource/RestResourceNode.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ open class RestResourceNode(
166166
/**
167167
* @return mutable genes in [dbactions] and they do not bind with rest actions.
168168
*/
169-
fun getMutableSQLGenes(dbactions: List<SqlAction>, template: String, is2POST : Boolean) : List<out Gene>{
169+
fun getMutableSQLGenes(dbactions: List<SqlAction>, template: String, is2POST : Boolean) : List<Gene>{
170170

171171
val related = getPossiblyBoundParams(template, is2POST, null).map {
172172
resourceToTable.paramToTable[it.key]
@@ -182,7 +182,7 @@ open class RestResourceNode(
182182
* @return mutable genes in [actions] which perform action on current [this] resource node
183183
* with [callsTemplate] template, e.g., POST-GET
184184
*/
185-
private fun getMutableRestGenes(actions: List<RestCallAction>, template: String) : List<out Gene>{
185+
private fun getMutableRestGenes(actions: List<RestCallAction>, template: String) : List<Gene>{
186186

187187
if (!RestResourceTemplateHandler.isNotSingleAction(template)) return actions.flatMap(RestCallAction::seeTopGenes).filter(Gene::isMutable)
188188

core/src/main/kotlin/org/evomaster/core/problem/rpc/RPCCallAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ open class RPCCallAction(
4444
return id
4545
}
4646

47-
override fun seeTopGenes(): List<out Gene> {
47+
override fun seeTopGenes(): List<Gene> {
4848
// ignore genes in response here
4949
return parameters.flatMap { it.seeGenes() }
5050
}

0 commit comments

Comments
 (0)