Skip to content

Commit

Permalink
πŸ”₯ : remove useless constructor term in kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
cdubuisson committed Apr 9, 2020
1 parent cd7a38c commit 2b737b2
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/auth")
class AuthenticationRestController constructor(
class AuthenticationRestController(
@Autowired(required = false) var oAuth2ClientProperties: OAuth2ClientProperties? = null) {

@GetMapping("/user")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/build-info")
class BuildInfoRestController constructor(
class BuildInfoRestController(
@Autowired(required = false) var buildProperties: BuildProperties? = null,
@Autowired(required = false) var gitProperties: GitProperties? = null) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ data class ApiErrorResponse(
}

@Component
class SuccessHandler constructor(val userRepository: UserRepository) : AuthenticationSuccessHandler {
class SuccessHandler(val userRepository: UserRepository) : AuthenticationSuccessHandler {

override fun onAuthenticationSuccess(request: HttpServletRequest, response: HttpServletResponse, authentication: Authentication) {
if (!userRepository.existsById(authentication.name)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.springframework.security.web.csrf.CookieCsrfTokenRepository

@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
class SecurityConfig constructor(
class SecurityConfig(
val successHandler: SuccessHandler,
val failureHandler: FailureHandler,
val logoutSuccessHandler: LogoutSuccessHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.springframework.security.web.util.matcher.OrRequestMatcher
@Configuration
@Order(70)
@Conditional(ClientsConfiguredCondition::class)
class OAuth2ClientSecurityConfig constructor(
class OAuth2ClientSecurityConfig(
val oAuth2SuccessHandler: OAuth2SuccessHandler) : WebSecurityConfigurerAdapter() {

private final val oauth2Endpoint = "/auth/oauth2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import javax.servlet.http.HttpServletResponse

@Component
@Conditional(ClientsConfiguredCondition::class)
class OAuth2SuccessHandler constructor(
class OAuth2SuccessHandler(
userRepository: UserRepository,
val registryOAuth2Providers: List<RegistryOAuth2Provider>,
val oAuth2AuthorizedClientService: OAuth2AuthorizedClientService) : SuccessHandler(userRepository) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/codeka/gaia/modules/api/DockerRegistryApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.springframework.web.client.RestTemplate
inline fun <reified T : Any> typeRef(): ParameterizedTypeReference<T> = object : ParameterizedTypeReference<T>() {}

@Repository
class DockerRegistryApi constructor(
class DockerRegistryApi(
@Value("\${docker.registry.api.url}") private val dockerRegistryApiUrl: String,
private val restTemplate: RestTemplate) {

Expand All @@ -38,4 +38,4 @@ class DockerRegistryApi constructor(
} else listOf()
}

}
}
2 changes: 1 addition & 1 deletion src/main/java/io/codeka/gaia/modules/bo/TerraformImage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package io.codeka.gaia.modules.bo
import javax.validation.constraints.NotBlank
import javax.validation.constraints.Pattern

data class TerraformImage constructor(
data class TerraformImage(
@field:NotBlank @field:Pattern(regexp = """^[\w][\w.\-\/]{0,127}$""") val repository: String,
@field:NotBlank val tag: String) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GitlabRegistryApi(restTemplate: RestTemplate): AbstractRegistryApi<GitlabR
/**
* Gitlab source repository implementation
*/
data class GitlabRepository constructor(
data class GitlabRepository(
@JsonAlias("id") override val id: String,
@JsonAlias("path_with_namespace") override val fullName: String,
@JsonAlias("web_url") override val htmlUrl: String): SourceRepository
@JsonAlias("web_url") override val htmlUrl: String): SourceRepository

0 comments on commit 2b737b2

Please sign in to comment.