Open aliaksei-lithium opened 7 years ago
open
if
ForwardFilter
if (uri.startsWithIC(arrayOf("/ui", "/ui/js", "/ui/css")) {}
@Autowired
// usage companion object { private val log by logger() } // definition fun <R : Any> R.logger(): Lazy<Logger> { return lazy { LoggerFactory.getLogger(unwrapCompanionClass(this.javaClass).name) } }
private fun <T: Any> unwrapCompanionClass(ofClass: Class<T>): Class<*> { return if (ofClass.enclosingClass != null && ofClass.enclosingClass.kotlin.companionObject?.java == ofClass) { ofClass.enclosingClass } else { ofClass } }
icu4j
val message: String get() = rule.format(value)
can be replaced to lazy delegate. Object is immutable, no needs to format each time
lazy
@Bean
SettingsUserDetailsService
settings.users.find {it.user == username}!!
OAuth2ErrorController
Thank you very much for code review. I fixed most of this.
open
keyword usage. Checkout here https://blog.jetbrains.com/kotlin/2016/12/kotlin-1-0-6-is-here/if
logic inForwardFilter
to simplify understanding. Like:@Autowired
from constructor DI (e.g. FooController)icu4j
- Big lib fo such small usage?can be replaced to
lazy
delegate. Object is immutable, no needs to format each time@Autowired
with@Bean
annotations(check config.oauth package)SettingsUserDetailsService
settings.users.find {it.user == username}!!
OAuth2ErrorController
not sure how it will work with clients w/o UI, just "rest" clients?