Skip to content

Commit 3c70263

Browse files
authored
Merge pull request #1514 from WebFuzzing/pr/kotlin-warnings
Eliminating close to 120 Kotlin compilation warnings
2 parents 1947085 + 9700194 commit 3c70263

62 files changed

Lines changed: 166 additions & 165 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core-tests/e2e-tests/spring/spring-rest-bb/src/main/kotlin/com/foo/rest/examples/bb/authcookie/CookieDashboardRest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletResponse
1212
@RequestMapping(path = ["/"])
1313
class CookieDashboardRest {
1414
@GetMapping(path = ["/dashboard"])
15-
open fun check() : ResponseEntity<String>{
15+
fun check() : ResponseEntity<String>{
1616
return ResponseEntity.ok("OK")
1717
}
1818
}

core-tests/e2e-tests/spring/spring-rest-bb/src/main/kotlin/com/foo/rest/examples/bb/authcookie/CookieLoginRest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import javax.servlet.http.HttpServletResponse
1313
class CookieLoginRest {
1414

1515
@PostMapping(path = ["/login"], consumes = [MediaType.APPLICATION_JSON_VALUE])
16-
open fun login(@RequestBody login : LoginDto, response : HttpServletResponse) : ResponseEntity<String>{
16+
fun login(@RequestBody login : LoginDto, response : HttpServletResponse) : ResponseEntity<String>{
1717

1818

1919
if(login.username == "foo" && login.password == "123"){
@@ -32,7 +32,7 @@ class CookieLoginRest {
3232
}
3333

3434
@PostMapping(path = ["/login_redirect"], consumes = [MediaType.APPLICATION_JSON_VALUE])
35-
open fun login_redirect(@RequestBody login : LoginDto, response : HttpServletResponse) : ResponseEntity<String>{
35+
fun login_redirect(@RequestBody login : LoginDto, response : HttpServletResponse) : ResponseEntity<String>{
3636

3737

3838
if(login.username == "foo" && login.password == "123"){
@@ -56,7 +56,7 @@ class CookieLoginRest {
5656

5757

5858
@GetMapping(path = ["/check"])
59-
open fun check(@CookieValue("username") authorization: String?) : ResponseEntity<String>{
59+
fun check(@CookieValue("username") authorization: String?) : ResponseEntity<String>{
6060

6161
if(authorization.isNullOrEmpty()){
6262
return ResponseEntity.status(401).build()
@@ -69,4 +69,4 @@ class CookieLoginRest {
6969

7070
return ResponseEntity.ok(token + authorization)
7171
}
72-
}
72+
}

core-tests/e2e-tests/spring/spring-rest-bb/src/main/kotlin/com/foo/rest/examples/bb/authextractheader/LoginTokenExtractHeaderRest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class LoginTokenExtractHeaderRest {
1616
private val SECRET = "a complex secret..."
1717

1818
@PostMapping(path = ["/login"], consumes = [MediaType.APPLICATION_JSON_VALUE])
19-
open fun login(@RequestBody login : LoginDto) : ResponseEntity<*>{
19+
fun login(@RequestBody login : LoginDto) : ResponseEntity<*>{
2020

2121
if(login.userId == "foo" && login.password == "123"){
2222
return ResponseEntity.ok().header("X-Auth-Token", SECRET).build<Any>()
@@ -26,7 +26,7 @@ class LoginTokenExtractHeaderRest {
2626
}
2727

2828
@GetMapping(path = ["/check"])
29-
open fun check(@RequestHeader("Authorization") authorization: String?) : ResponseEntity<String>{
29+
fun check(@RequestHeader("Authorization") authorization: String?) : ResponseEntity<String>{
3030

3131
if(authorization == "Bearer $SECRET"){
3232
CoveredTargets.cover("OK")
@@ -35,4 +35,4 @@ class LoginTokenExtractHeaderRest {
3535

3636
return ResponseEntity.status(401).build()
3737
}
38-
}
38+
}

core-tests/e2e-tests/spring/spring-rest-bb/src/main/kotlin/com/foo/rest/examples/bb/authtoken/LoginTokenRest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class LoginTokenRest {
1313
private val SECRET = "a complex secret..."
1414

1515
@PostMapping(path = ["/login"], consumes = [MediaType.APPLICATION_JSON_VALUE])
16-
open fun login(@RequestBody login : LoginDto) : ResponseEntity<AuthDto>{
16+
fun login(@RequestBody login : LoginDto) : ResponseEntity<AuthDto>{
1717

1818
if(login.userId == "foo" && login.password == "123"){
1919
return ResponseEntity.ok(AuthDto("foo", TokenDto(SECRET)))
@@ -23,7 +23,7 @@ class LoginTokenRest {
2323
}
2424

2525
@GetMapping(path = ["/check"])
26-
open fun check(@RequestHeader("Authorization") authorization: String?) : ResponseEntity<String>{
26+
fun check(@RequestHeader("Authorization") authorization: String?) : ResponseEntity<String>{
2727

2828
if(authorization == "Bearer $SECRET"){
2929
CoveredTargets.cover("OK")
@@ -32,4 +32,4 @@ class LoginTokenRest {
3232

3333
return ResponseEntity.status(401).build()
3434
}
35-
}
35+
}

core-tests/e2e-tests/spring/spring-rest-bb/src/main/kotlin/com/foo/rest/examples/bb/flakinessdetect/FlakinessDetectRest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ class FlakinessDetectRest {
2323
}
2424

2525
@GetMapping(path = ["/stringfirst/{n}"])
26-
open fun getFirst( @PathVariable("n") n: Int) : ResponseEntity<String> {
26+
fun getFirst( @PathVariable("n") n: Int) : ResponseEntity<String> {
2727
CoveredTargets.cover("First")
2828
return ResponseEntity.ok(getPartialDate(n))
2929
}
3030

3131
@GetMapping(path = ["/next/{n}"])
32-
open fun getNext( @PathVariable("n") n: Int) : ResponseEntity<FlakinessDetectData> {
32+
fun getNext( @PathVariable("n") n: Int) : ResponseEntity<FlakinessDetectData> {
3333
CoveredTargets.cover("Next")
3434
return ResponseEntity.ok(FlakinessDetectData(getPartialDate(n), randomInt(n)))
3535
}
3636

3737
@GetMapping(path = ["/multiplelines/{num}"])
38-
open fun getMultipleLines( @PathVariable("num") num: Int) : ResponseEntity<FlakinessDetectData> {
38+
fun getMultipleLines( @PathVariable("num") num: Int) : ResponseEntity<FlakinessDetectData> {
3939

4040
val num = max(2, randomInt(min(30+ abs(num), 100)))
4141
val msg = (1..num).joinToString(System.lineSeparator()) { "LINE $it:${randomInt(max(1000, num))}" }
@@ -92,4 +92,4 @@ data class FlakinessDetectData(
9292
data class TimeAgoData(
9393
val message: String,
9494
val calculatedPastTime: String
95-
)
95+
)

core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/main/kotlin/com/foo/rest/examples/spring/openapi/v3/aiclassification/allornone/ACAllOrNoneRest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController
1414
class ACAllOrNoneRest {
1515

1616
@GetMapping
17-
open fun get(
17+
fun get(
1818
@RequestParam("x") x: String?,
1919
@RequestParam("y") y: Int?,
2020
@RequestParam("z" )z: Boolean?
@@ -32,7 +32,7 @@ class ACAllOrNoneRest {
3232
}
3333

3434
@PostMapping
35-
open fun post(@RequestBody(required = true) body : ACAllOrNoneDto) : ResponseEntity<String> {
35+
fun post(@RequestBody(required = true) body : ACAllOrNoneDto) : ResponseEntity<String> {
3636

3737
val pa = body.a == false
3838
val pd = body.d == ACAllOrNoneEnum.HELLO
@@ -46,4 +46,4 @@ class ACAllOrNoneRest {
4646
}
4747

4848

49-
}
49+
}

core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/main/kotlin/com/foo/rest/examples/spring/openapi/v3/aiclassification/arithmetic/ACArithmeticRest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController
1212
@RequestMapping(path = ["/api/arithmetic"])
1313
class ACArithmeticRest {
1414
@GetMapping
15-
open fun get(
15+
fun get(
1616
@RequestParam("x") x: Int?,
1717
@RequestParam("y") y: Int?,
1818
@RequestParam("z" )z: Double?,
@@ -34,7 +34,7 @@ class ACArithmeticRest {
3434
}
3535

3636
@PostMapping
37-
open fun post(@RequestBody(required = true) body : ACArithmeticDto) : ResponseEntity<String> {
37+
fun post(@RequestBody(required = true) body : ACArithmeticDto) : ResponseEntity<String> {
3838

3939
val x = body.c!!
4040
val y = body.e!!
@@ -49,4 +49,4 @@ class ACArithmeticRest {
4949
}
5050

5151

52-
}
52+
}

core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/main/kotlin/com/foo/rest/examples/spring/openapi/v3/aiclassification/basic/ACBasicRest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController
1111
class ACBasicRest {
1212

1313
@GetMapping
14-
open fun getData(
14+
fun getData(
1515
@RequestParam("x") x: String?,
1616
@RequestParam("y") y: Int?,
1717
@RequestParam("z" )z: Boolean?
@@ -26,4 +26,4 @@ class ACBasicRest {
2626
return ResponseEntity.ok().body("OK")
2727
}
2828

29-
}
29+
}

core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/main/kotlin/com/foo/rest/examples/spring/openapi/v3/aiclassification/imply/ACImplyRest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController
1818
class ACImplyRest {
1919

2020
@GetMapping
21-
open fun get(
21+
fun get(
2222
@RequestParam("x") x: String?,
2323
@RequestParam("y") y: Int?,
2424
@RequestParam("z" )z: Boolean?
@@ -34,7 +34,7 @@ class ACImplyRest {
3434
}
3535

3636
@PostMapping
37-
open fun post(@RequestBody(required = true) body : ACImplyDto) : ResponseEntity<String> {
37+
fun post(@RequestBody(required = true) body : ACImplyDto) : ResponseEntity<String> {
3838

3939
if(body.a == true){
4040
if(! (body.d == ACImplyEnum.HELLO || body.f == ACImplyEnum.HELLO)){
@@ -46,4 +46,4 @@ class ACImplyRest {
4646
}
4747

4848

49-
}
49+
}

core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/main/kotlin/com/foo/rest/examples/spring/openapi/v3/aiclassification/mixed/ACMixedRest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController
1717
class ACMixedRest {
1818

1919
@GetMapping
20-
open fun get(
20+
fun get(
2121
@RequestParam("x") x: Int?,
2222
@RequestParam("y") y: Int?,
2323
@RequestParam("a" )a: Boolean?,
@@ -49,4 +49,4 @@ class ACMixedRest {
4949
}
5050

5151

52-
}
52+
}

0 commit comments

Comments
 (0)