Skip to content

Commit

Permalink
fix(deps): update dependency org.jmailen.gradle:kotlinter-gradle to v…
Browse files Browse the repository at this point in the history
…3.11.1 (#122)

* chore(deps): update dependency org.jmailen.gradle:kotlinter-gradle to v3.11.1

* Fix by bump Kotlin

Co-authored-by: Erwin Wessels <54856303+erwinw@users.noreply.github.com>
Co-authored-by: Erwin Wessels <erwin@pleo.io>
  • Loading branch information
3 people committed Sep 8, 2022
1 parent b8fda00 commit 08fe25f
Show file tree
Hide file tree
Showing 27 changed files with 38 additions and 40 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

buildscript {
ext {
kotlinVersion = "1.7.0"
kotlinVersion = "1.7.10"
kotlinCoroutinesVersion = "1.6.0"
kotlinGradlePluginVersion = "1.7.0"
kotlinGradlePluginVersion = "1.7.10"

kotlinterGradleVersion = "3.10.0"
kotlinterGradleVersion = "3.11.1"
}

repositories {
Expand All @@ -31,7 +31,7 @@ subprojects {
ext {
junitVersion = "5.9.0"
kotlinGuiceVersion = "1.6.0"
kotlinReflectVersion = "1.7.0"
kotlinReflectVersion = "1.7.10"
mockkVersion = "1.12.4"
}

Expand Down
1 change: 0 additions & 1 deletion gradle.properties

This file was deleted.

4 changes: 2 additions & 2 deletions prop-all/src/test/kotlin/io/pleo/prop/PropTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PropTest {
ComplexObjects.ParsingStage.UNDER_HUMAN_REVIEW to "This is under human review",
ComplexObjects.ParsingStage.OUTPUT to "This is output",
ComplexObjects.ParsingStage.FINISHED to "This is finished",
ComplexObjects.ParsingStage.ERROR to "This is error",
ComplexObjects.ParsingStage.ERROR to "This is error"
)

val complexObjects = injector.getInstance(ComplexObjects::class.java)
Expand Down Expand Up @@ -312,7 +312,7 @@ class PropTest {
"io.pleo",
modules.toList(),
CommonsConfigPropFactory(),
JacksonParserFactory(),
JacksonParserFactory()
)

val allModules: List<Module> = buildList {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import javax.inject.Named as JavaxNamed

class BothNamedAnnotations @Inject constructor(
@JavaxNamed("io.pleo.test.prop3") val stringProp1: Prop<String>,
@GoogleNamed("io.pleo.test.prop4") val stringProp2: Prop<String>,
@GoogleNamed("io.pleo.test.prop4") val stringProp2: Prop<String>
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ComplexObjects @Inject constructor(
@Named("io.pleo.test.prop1") val withConstructor: Prop<InjectedObjectWithConstructor>,
@Named("io.pleo.test.prop2") val myListOfComplexObjectProp: Prop<List<InjectedObject>>,
@Named("io.pleo.test.prop3") val myStringProp: Prop<String>,
@Named("io.pleo.test.prop7") val myMappedEnumProp: Prop<Map<ParsingStage, String>>,
@Named("io.pleo.test.prop7") val myMappedEnumProp: Prop<Map<ParsingStage, String>>
) {
enum class ParsingStage {
UPLOADED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import javax.inject.Named
class DefaultValue @Inject constructor(
@Default(DEFAULT_VALUE)
@Named("io.pleo.undefined.property")
val usesDefaultValue: Prop<String>,
val usesDefaultValue: Prop<String>
) {
companion object {
const val DEFAULT_VALUE = "This is the default value!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty
@Suppress("unused", "unused_parameter")
class InjectedObjectWithConstructor @JsonCreator constructor(
@JsonProperty("name") var name: String,
@JsonProperty("age") age: Int,
@JsonProperty("age") age: Int
) {
var age = 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class InlineProviderModule : AbstractModule() {
fun tiesto(
io: InjectedObject?,
@Named("io.pleo.test.prop4") w_w: Prop<String>,
@Named("io.pleo.test.prop3") u_u: Prop<String>,
@Named("io.pleo.test.prop3") u_u: Prop<String>
): InjectedObject {
return InjectedObject()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import javax.inject.Named
class InvalidDefaultValue @Inject constructor(
@Default(DEFAULT_VALUE)
@Named("io.pleo.undefined.property")
val usesDefaultValue: Prop<Double>,
val usesDefaultValue: Prop<Double>
) {
companion object {
const val DEFAULT_VALUE = "This is not a double!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import javax.inject.Named
class InvalidDefaultValueButValidValue @Inject constructor(
@Default(DEFAULT_VALUE)
@Named("io.pleo.test.prop6")
val usesDefaultValue: Prop<Double>,
val usesDefaultValue: Prop<Double>
) {

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ import javax.inject.Named
@Suppress("unused")
class MyAssistedInjectFactoryImp @Inject constructor(
@Named("io.pleo.test.prop3") private val prop: Prop<String>,
@Assisted private val assistedArg: String,
@Assisted private val assistedArg: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import javax.inject.Named
import javax.inject.Provider

class MyInterfaceProvider @Inject constructor(
@Named("io.pleo.test.prop3") val prop: Prop<String>,
@Named("io.pleo.test.prop3") val prop: Prop<String>
) : Provider<MyInterface> {
override fun get(): MyInterface =
object : MyInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import javax.inject.Inject
import javax.inject.Named

class SamePropertyAsComplexObjects @Inject constructor(
@Named("io.pleo.test.prop1") val myComplexObjectProp: Prop<InjectedObject>,
@Named("io.pleo.test.prop1") val myComplexObjectProp: Prop<InjectedObject>
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import javax.inject.Named

class UsesTwiceSameProp @Inject constructor(
@Named("io.pleo.test.prop3") val stringProp1: Prop<String>,
@Named("io.pleo.test.prop3") val stringProp2: Prop<String>,
@Named("io.pleo.test.prop3") val stringProp2: Prop<String>
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import org.apache.commons.configuration2.builder.fluent.Configurations
import java.io.File

class CommonsConfigPropFactory(
private val builder: ConfigurationBuilder<*>? = null,
private val builder: ConfigurationBuilder<*>? = null
) : PropFactory {
override fun <T> createProp(
propName: String,
parse: Parser<T>,
defaultValue: T?,
defaultValue: T?
): Prop<T> =
CommonsConfigProp(
ParsingProperty(
builder = builder ?: createDefaultBuilder(),
name = propName,
parser = parse,
defaultValue = defaultValue,
defaultValue = defaultValue
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ParsingProperty<T>(
private val builder: ConfigurationBuilder<*>,
val name: String,
private val parser: Parser<T>,
private val defaultValue: T?,
private val defaultValue: T?
) {
@Volatile
private var value: T = parseProperty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,21 @@ class CompositeConfigurationBuilder : ConfigurationBuilder<CompositeConfiguratio
ConfigurationBuilderResultCreatedEvent(
this,
ConfigurationBuilderResultCreatedEvent.RESULT_CREATED,
compositeConfiguration,
compositeConfiguration
)
)
}
}

private fun <E : Event> registerListener(
eventSource: EventSource,
registrationData: EventListenerRegistrationData<E>,
registrationData: EventListenerRegistrationData<E>
) {
eventSource.addEventListener(registrationData.eventType, registrationData.listener)
}

private fun createResult(): CompositeConfiguration =
CompositeConfiguration().apply {

items.forEach {
val configuration =
when (it) {
Expand Down
2 changes: 1 addition & 1 deletion prop-core/src/main/kotlin/io/pleo/prop/core/Default.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ package io.pleo.prop.core
@Target(AnnotationTarget.VALUE_PARAMETER)
annotation class Default(
/** The default value */
val value: String = "",
val value: String = ""
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package io.pleo.prop.core

open class PropException(
message: String? = null,
cause: Throwable? = null,
cause: Throwable? = null
) : RuntimeException(message, cause)
5 changes: 5 additions & 0 deletions prop-core/src/main/kotlin/io/pleo/prop/core/Types.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package io.pleo.prop.core

typealias Callback<T> = (T) -> Unit
typealias Supplier<T> = () -> T
typealias Parser<T> = (String) -> T
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import io.pleo.prop.core.Supplier
import java.time.Instant

class LocalProp<T>(
private val supplier: Supplier<T>,
private val supplier: Supplier<T>
) : Prop<T> {
private val created: Instant = Instant.now()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ interface PropFactory {
fun <T> createProp(
propName: String,
parse: Parser<T>,
defaultValue: T?,
defaultValue: T?
): Prop<T>
}
5 changes: 0 additions & 5 deletions prop-core/src/main/kotlin/io/pleo/prop/core/types.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AutoPropModule(
private val packagePrefix: String,
private val modulesToScan: Iterable<Module>,
private val propFactory: PropFactory,
private val parserFactory: ParserFactory,
private val parserFactory: ParserFactory
) : Module {
override fun configure(binder: Binder) {
PropMappingVisitor(
Expand All @@ -23,7 +23,7 @@ class AutoPropModule(
.forEach { (key, value) ->
value.fold(
{ binder.bind(key).toInstance(it) },
{ binder.addError(it) },
{ binder.addError(it) }
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typealias PropResult = Result<Prop<*>>
class PropMappingVisitor(
filter: Predicate<TypeLiteral<*>>,
private val propFactory: PropFactory,
private val parserFactory: ParserFactory,
private val parserFactory: ParserFactory
) : DefaultElementVisitor<Map<Key<Prop<*>>, PropResult>>() {
private val injectionPointExtractor: InjectionPointExtractor = InjectionPointExtractor(filter)

Expand Down Expand Up @@ -108,7 +108,7 @@ class PropMappingVisitor(
return propFactory.createProp(
propertyName,
parser as Parser<Any>,
defaultValue,
defaultValue
)
} catch (ex: RuntimeException) {
throw FailedToCreatePropException(propertyName, ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import com.google.inject.TypeLiteral

class PropParameters<T>(
val typeLiteral: TypeLiteral<T>,
val annotations: List<Annotation>,
val annotations: List<Annotation>
)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import java.time.ZonedDateTime
import javax.money.Monetary

class JacksonParserFactory @JvmOverloads constructor(
private val objectMapper: ObjectMapper = ObjectMapper(),
private val objectMapper: ObjectMapper = ObjectMapper()
) : ParserFactory {
@Suppress("MemberVisibilityCanBePrivate")
private val knownParsers: MutableMap<Type, (String) -> Any> = mutableMapOf(
Expand Down

0 comments on commit 08fe25f

Please sign in to comment.