dmcg
10/19/2021, 9:28 PMCody Mikol
10/20/2021, 3:41 PMtodd.ginsberg
10/20/2021, 3:49 PMdmcg
10/20/2021, 6:09 PMMarcus Brito
10/20/2021, 8:31 PMMarcus Brito
10/20/2021, 8:34 PMdmcg
10/20/2021, 8:34 PMdmcg
10/20/2021, 8:35 PMMarcus Brito
10/20/2021, 8:35 PMMarcus Brito
10/20/2021, 8:38 PMdmcg
10/21/2021, 7:53 AMPiotr Krzemiński
11/05/2021, 8:43 AMstdlib
explicitly, it's added by default. I wanted to report an errata via O'reilly, but formally it's not an error, just an idea for simplification showing that onboarding Kotlin is even simpler. Is this channel a good place for such suggestions?Piotr Krzemiński
11/08/2021, 1:31 PMequals
and hashCode
, and it's actually great point - I've never looked at it this way, maybe because I create deeply immutable data classes (unless I refactor some JavaBeans-style code, I leave `var`s temporarily)
IMO IntelliJ should add a warning/inspection, like it's done for e.g. using Optional
for class fields. The goal still being able to create a concise, kotlinic version of a JavaBean, but not pretending that it's fine 🙂 .WDYT?Philipp Mayer
03/28/2022, 7:01 PMPhilipp Mayer
03/29/2022, 9:00 AMWesley Hartford
05/05/2022, 7:43 PMMap.computeIfAbsent()
function documentation includes:
However, when calling this function from Kotlin code, the mapping function has a signatureCopy codeIf the mapping function returns {@code null}, no mapping is recorded.
(K) -> V
, meaning that the passed in function cannot return null
. Is there any way to use computeIfAbsent
from kotlin passing a function which may return null
?Kev
11/17/2023, 6:05 AMkotlin.collections.List
interface. Does anyone know where I can find the implementation of this interface?natpryce
11/17/2023, 12:00 PMnatpryce
11/17/2023, 12:01 PMJose Ramon (JR)
12/02/2023, 11:35 PMdmcg
12/08/2023, 8:15 PMdmcg
12/08/2023, 8:17 PMDarryl Miles
12/16/2023, 4:55 PMDarryl Miles
12/16/2023, 4:57 PMkotlin('plugin.jpa')
already provides for JPADarryl Miles
12/16/2023, 4:58 PMDarryl Miles
12/17/2023, 11:33 AMlateinit
to confirm they have an expected injection annotation on the field, and maybe warn if the field is left public.
Maybe there is also the ability to put the plugin in debug build mode and it will insert implicit call to assertion check of all lateinit
at runtime maybe at the end of all constructors such as constructor() { myBusinessLogicMethodCall(); injectedKotlinLateInitInjectionChecker() }
and a method inserted like private fun injectedKotlinLateInitInjectionChecker() { assert((FieldType?)fieldName != null) {"injected Kotlin lateinit usage check failed on field: fieldName"} }
Darryl Miles
03/03/2024, 5:26 AMval kclass = MyEntity::class
val randomMember = kclass.members.findLast { it.name == "randomProperty" } // KCallable<*>
val kmutable = if(randomMember is KMutableProperty) randomMember as KMutableProperty else null // KMutableProperty is the real type
val javaField = kmutable?.annotations // this is the only non-empty annotations field/member/method/property that exists around "randomProperty"
Darryl Miles
03/03/2024, 5:27 AMDarryl Miles
03/03/2024, 5:29 AM@jakarta.validation.constraints.Size(max = 123) open var randomProperty: String? = null