https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
getting-started
  • l

    Lance Clark

    12/02/2022, 2:46 PM
    Is this the channel I ask for suggestions?
    s
    g
    • 3
    • 3
  • h

    He

    12/02/2022, 11:44 PM
    Hi not too sure if this is the channel i ask about mockk but I want to mock some behavior.
    fun wait(){
        val timeout= TimeHelper.getNow() + timeoutInterval // <- part of class constructor
        if(processor.getLag() > 0){
            val currentTIme = TimeHelper.getNow() 
    
            if(currentTime >= timeout){ System.exit(42) }
            Thread.sleep(someTime)
        }
    }
    Is there a way for me to use mockk to either that
    wait()
    has executed for x amount of time with
    verify(exactly = x) { someProcessor.wait() }
    , or
    Thread.sleep()
    has been sleeping for x number of time? I have something like this in my test class
    every { processor.getLag() } returns 1
    every { TimeHelper.getNow() } returns 100
    So after some number of executions
    ever{ processor.getLag() } returns 0
    to validate that it finishes
    e
    • 2
    • 2
  • m

    Mustafa Ozhan

    12/03/2022, 4:41 PM
    Is there any way that I can force compiler, IDE or any tool like detekt, klint to give error/warning when a method explicitly not defines the return type ?
    fun exampleMethod() = "SomeString" // want to have warning/error
    fun exampleMethod(): String = "SomeString" // this should pass
    c
    • 2
    • 2
  • x

    xun su

    12/04/2022, 3:13 AM
    Hi, I'm a little confused about lambda expression. say we have a expression below
    val return5 = {5}
    I think it is equal to
    fun return5(): Int {
      // note return here
      return 5
    }
    if so, please explain the code bellow:
    fun test(fn: () -> Unit) {}
    
    val foo =
        fun(name: String): String {
          return name
        }
    
    test { foo } // why no error ?
    I mean ,
    test
    accept a parameter , which is a function with the type
    ()->Unit
    , but I think
    test { foo }
    is equals to
    test(
          fun() {
            return foo
          })
    Apparently it mismatch the type of parameter
    fn
    of the function
    test
    , the case above is
    () -> String -> String
    , but why no error here ? ``` ```
    e
    v
    • 3
    • 10
  • l

    LIRAN Y

    12/04/2022, 5:45 PM
    Hi all 🙂 How can i use
    removePrefix()
    if i have this string
    Expiration Date: "2023-01-03 16:06:52 +0000 UTC"
    and i want to get
    "2023-01-03 16:06:52 +0000 UTC"
    c
    j
    ö
    • 4
    • 11
  • c

    chiroptical

    12/04/2022, 11:03 PM
    Are there any obvious resources for profiling concurrency in Kotlin? I ran the profiler in intellij idea but I had a hard time interpreting it.
  • c

    corneil

    12/05/2022, 6:45 PM
    I believe the lincheck library can help. https://github.com/Kotlin/kotlinx-lincheck
    c
    • 2
    • 1
  • z

    zt

    12/06/2022, 6:28 AM
    Are there any libraries like hljs? I'm trying to identify the programing language in an input
    c
    g
    • 3
    • 3
  • d

    Diego DeSouza

    12/07/2022, 4:15 PM
    I’m trying the kotlin REPL in Intellij in my macbook pro for the first time, and running into an issue when trying to do something like.
    min(10, 2)
    error: unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
    public fun <T : Comparable<TypeVariable(T)>> Array<out TypeVariable(T)>.min(): TypeVariable(T) defined in kotlin.collections
    public fun Array<out Double>.min(): Double defined in kotlin.collections
    public fun Array<out Float>.min(): Float defined in kotlin.collections
    public fun ByteArray.min(): Byte defined in kotlin.collections
    j
    e
    • 3
    • 9
  • k

    Ken

    12/07/2022, 11:26 PM
    Hi everybody, are there any suggested materials for Kotlin algorithm for coding interview? Like how to do BFS, DFS in Kotlin? Thanks!
    a
    • 2
    • 2
  • c

    chiroptical

    12/08/2022, 2:01 AM
    How would I write an extension function for a
    T?
    . In Haskell, I use the maybe function pretty frequently. The type is like
    (default: U, f: (T) -> U, x: T?): U
    e
    p
    m
    • 4
    • 20
  • j

    Jakub Chrzanowski

    12/09/2022, 9:32 AM
    Hi, folks! I have the following code snippet presented on the screenshot and two questions related to it: 1. the
    srcDirs
    property provides
    Set<File!>
    I further use with
    .map(File::toPath)
    – I assume it’s rather necessary to
    .filterNotNull()
    before, right? 2. As I have couple of chained operations – wouldn’t it be better to convert the initial set to sequence?
    j
    s
    • 3
    • 4
  • a

    Alan B

    12/09/2022, 1:15 PM
    I posted this to #reflect but that channel doesn’t see any action. Perhaps someone can point me to resources to understand this probably very simple problem regarding reflection and copying data in a generic way from an instance of one class to another type. I am lost on receivers. grr. https://kotlinlang.slack.com/archives/C0AVAB92L/p1670535073508719
    s
    • 2
    • 8
  • l

    Luke Armitage

    12/09/2022, 11:31 PM
    anyone know any good tutorials or walkthroughs of idiomatic Kotlin unit testing? coming from Junit/hamcrest/mockito experience in Java and it'd be nice to know how it 'should' be done. thanks
  • j

    Joshua Hansen

    12/10/2022, 5:07 AM
    I have an issue with ktor in my project. Where is the best place to ask for troubleshooting advice?
    v
    • 2
    • 1
  • e

    elye

    12/10/2022, 7:35 AM
    Hi All, I'm going through Koan's Lazy Property example. The question is
    Add a custom getter to make the val lazy really lazy. It should be initialized by invoking initializer() during the first access.
    You can add any additional properties as you need.
    Do not use delegated properties!
    The answer code is
    class LazyProperty(val initializer: () -> Int) {
        var value: Int? = null
        val lazy: Int
            get() {
                if (value == null) {
                    value = initializer()
                }
                return value!!
            }
    }
    I tried the below and it also pass
    class LazyProperty(val initializer: () -> Int) {
        val lazy by lazy {
            initializer()
        }
    }
    I'm not sure the intent of this tutorial introducing
    lazy
    , but not using
    by lazy
    . Is it to show us the
    get()
    instead? Thanks 🙏
    c
    • 2
    • 2
  • j

    Jakub Gwóźdź

    12/10/2022, 8:01 AM
    Hi. A question about function references. Say I have two packages,
    foo
    and
    bar
    . in
    bar.Baz.kt
    I have this:
    package bar
    
    fun baz(i: Int) = i + 1
    and in
    foo.Foo.kt
    this:
    package foo
    
    import bar.baz
    
    fun xd(op: (Int) -> Int) {
        println("calling $op with param 4 and getting ${op(4)}")
    }
    
    fun main() {
        xd(::baz)
    }
    everything works great. now I want to get rid of
    import bar.baz
    . How do I do that?
    xd(::bar.baz)
    does not compile. What’s the syntax here?
    r
    j
    r
    • 4
    • 6
  • p

    PHondogo

    12/10/2022, 7:58 PM
    Hello! Want to use value classes in multiplatform project in common source, but have faced with compiltion error. If not annotating value class with JvmInline got error for jvm target, else got error in js target for unresolved Jvminline annotation.
    g
    e
    • 3
    • 2
  • g

    Gavin Ray

    12/10/2022, 10:27 PM
    Does anyone know why the Kotlin compiler does not work with JDK 20, even with the Maven extension instead of Gradle? 🤔
    s
    • 2
    • 4
  • c

    Colton Idle

    12/11/2022, 4:24 AM
    If I want to have two loops to iterate an array of Int values (to compare them to each other), but I want the inner loop always start at outerIndex++, how would I do that? Currently I have
    array.forEachIndexed { indexOuter, outer ->
            array.forEachIndexed { indexInnter, inner ->
                //I want this inner forEachIndexed to start at indexOuter++
            }
        }
    j
    l
    f
    • 4
    • 14
  • c

    Colton Idle

    12/11/2022, 5:04 AM
    Maybe a dumb question, but is there such a thing as a Map in Kotlin where you only need to specify the type of Key because you never actually plan on using the value? Or is there a different data structure that allows you to have constant time inserts and lookups? Example: I just want to know if I already "saw" a number in a list that I'm traversing, so I'm currently saving the fact that I saw it as a mapOf<Int, Boolean>, but the very existence of the Int would suffice and so the boolean seems redundant
    j
    r
    j
    • 4
    • 10
  • e

    Elizeu Silva dos Santos

    12/11/2022, 4:55 PM
    Hi fellows Im using kgraphql and I have the following structure on my models:
    data class A (
        val id: String,
        val b: B
    )
    
    enum class B{
        AA, BB, CC
    }
    Trying to run the app I have the following error:
    Exception in thread "main" com.apurebase.kgraphql.schema.SchemaException: Cannot handle enum class class com.example.B as Object type
    . Does someone know how to solve it?
    d
    a
    • 3
    • 4
  • a

    André Martins

    12/12/2022, 10:56 AM
    Hello, I’m developing a kotlin library and using it on a java project but it is not including sources in my jar when I try to access it from intellij it says
    compiled code
    on the method implementations, any ideias?
    t
    r
    v
    • 4
    • 6
  • d

    Dickens A S

    12/12/2022, 11:42 AM
    👋 Hello, team!
  • s

    Stylianos Gakis

    12/12/2022, 2:02 PM
    When declaring an interface, I’ve kinda automatically defaulted to not exposing fields, but exposing functions directly, but not quite sure why. I’ve now had this one case where I had an interface expose a
    StateFlow<Foo>
    and had it behind a function
    stateFlow(): StateFlow<Foo>
    but the implementation simply had the private declaration and the overridden function was simply doing
    return this.stateFlow
    . So I wonder, is it weird for the interface to simply expose
    val stateFlow: StateFlow<Foo>
    instead? Are there any reasons why I would want to avoid that?
    s
    • 2
    • 2
  • v

    Viktor Sirotin

    12/12/2022, 2:09 PM
    Dear colleagues, please allow me to introduce my Kotlin library for work with physical and other units: KotUniL. There are also other libraries that try to solve similar tasks. Unfortunately, they were all not good enough for my purposes and I developed my own. KotUniL is subject to Apache 2 license terms. It is available via MavenCentral. KotUniL is a library of functions and objects of Kotlin that meet the following requirements in total: 1. It covers all units of SI base units (see https://en.wikipedia.org/wiki/International_System_of_Units) like meter, second etc. as well as some other common units like currencies, percentages etc. 2. It allows various formulas to be written in Kotlin in a way maximally similar to the way formulas are written in physics and economics. 3. It allows analyzing dimensions of results of applications of complicated formulas. 4. It allows to detect most of the typical errors when working with SI units already at the compilation stage. Errors in incorrect use of physical units in complex formulas are detected in runtime. 5. It is pure library (no plug-in, no parser etc.), it has no dependencies MavenCentral: https://central.sonatype.dev/artifact/eu.sirotin.kotunil/kotunil/1.0.1/overview GitHub repository: https://github.com/vsirotin/si-units
    r
    • 2
    • 1
  • a

    Aaron Barsky

    12/12/2022, 4:57 PM
    I'm just getting started developing Kotlin MP. I'm on the 4th step of the getting started tutorial: https://kotlinlang.org/docs/multiplatform-mobile-upgrade-app.html Android app runs fine, but the iOS app crashes with:
    /Users/abarsky/AndroidStudioProjects/KotlinMultiplatformSandbox/build/ios/Debug-iphonesimulator/iosApp.app
    Uncaught Kotlin exception: kotlin.native.IncorrectDereferenceException: illegal attempt to access non-shared <object>@3d723a8 from other thread
        at 0   shared                              0x10375ea73        kfun:kotlin.Throwable#<init>(kotlin.String?){} + 95 
        at 1   shared                              0x103757f93        kfun:kotlin.Exception#<init>(kotlin.String?){} + 91 
        at 2   shared                              0x1037581c7        kfun:kotlin.RuntimeException#<init>(kotlin.String?){} + 91 
        at 3   shared                              0x10376a393        kfun:kotlin.native.IncorrectDereferenceException#<init>(kotlin.String){} + 91 
        at 4   shared                              0x10376ce9b        ThrowIllegalObjectSharingException + 415 
        at 5   shared                              0x103b0a02f        _ZN12_GLOBAL__N_128throwIllegalSharingExceptionEP9ObjHeader + 27 
        at 6   shared                              0x103b0b5f7        _ZN12_GLOBAL__N_136terminateWithIllegalSharingExceptionEP9ObjHeader + 11 
        at 7   shared                              0x103b0b7a7        _ZNK27BackRefFromAssociatedObject3refIL11ErrorPolicy3EEEP9ObjHeaderv + 231 
        at 8   shared                              0x103b0a837        _ZN12_GLOBAL__N_111toKotlinImpEP11objc_objectP13objc_selectorPP9ObjHeader + 51 
        at 9   shared                              0x103b011ab        Kotlin_Interop_refFromObjC + 111 
        at 10  shared                              0x1039e2cbb        _696f2e6b746f723a6b746f722d636c69656e742d64617277696e_knbridge101 + 207 
        at 11  shared                              0x103acb7cb        _696f2e6b746f723a6b746f722d636c69656e742d64617277696e_kncfun103 + 79 
        at 12  CFNetwork                           0x1049e37cf        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork + 47055 
        at 13  Foundation                          0x105e4f8d7        __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 15 
        at 14  Foundation                          0x105e4f7cb        -[NSBlockOperation main] + 99 
        at 15  Foundation                          0x105e524f3        __NSOPERATION_IS_INVOKING_MAIN__ + 11
    as the httpClient line is executed
    @Throws(Exception::class)
        suspend fun greeting(): String {
            val rockets: List<RocketLaunch> =
                httpClient.get("<https://api.spacexdata.com/v4/launches>").body()
    Here are my plugin versions
    plugins {
        //trick: for the same plugin versions in all sub-modules
        id("com.android.application").version("7.3.1").apply(false)
        id("com.android.library").version("7.3.1").apply(false)
        kotlin("android").version("1.7.10").apply(false)
        kotlin("multiplatform").version("1.7.10").apply(false)
    }
    which were setup automatically for me when I made a new Kotlin Multiplatform App from within Android studio. https://kotlinlang.org/docs/multiplatform-mobile-create-first-app.html Running XCode 14.. Is there a complete project I can download to make sure it's not a mistake typing in the tutorial code?
    h
    • 2
    • 2
  • h

    He

    12/13/2022, 2:12 AM
    Hi all not really sure if this is the right place to ask but I have some design questions/ best practice questions that I have. So essentially I was told that singleton / static variables should not be used for the business logic in my application. So essentially what I have is something like
    class someClass(){
    
    lateinit var one: String,
    lateinit var two: String,
    lateinit var three: customObject
    
    }
    So what I'm doing is throughout my code I'm updating these variables based on some conditions/criteria and I have another class that calls
    someClass
    and I will use getters to retrieve the
    lateinit var
    . Instead of these singleton variables, what should I be using? Should I be using a custom
    data class
    to store the state of the variables? The logic I have for these variables: one - Does the data already exist? yes -> one = existingData.one no -> one = generate some value and set two - Does the data already exist? yes -> two = existingData.two no -> two = generate some value and set && Are we done? yes -> no nothing. no -> generate some value and set three - Just update consistently to get the most recent Object to be passed into different class
    a
    s
    • 3
    • 3
  • s

    sarvagya agarwal

    12/13/2022, 5:14 AM
    Not sure if this is the right place to ask but I can't seem to fix this error
    java.lang.RuntimeException: java.rmi.RemoteException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException:Cannot construct instance of `com.arcesium.recon.workflow.domain.BreakAnalysis` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
     at [Source: (String)"{
      "@UUID" : "46435929-0621-40b9-b623-871dda721fdf",
      "breakAnalysisList" : [ {
        "@UUID" : "d339332a-babf-49b6-a17e-05584595810b",
        "id" : -1,
        "key" : {
          "@UUID" : "a96c68bb-4f80-49aa-b346-67a34b564123",
          "recUnitKey" : "1e364133-a8c1-590f-b13c-41e2f4e661bd",
          "componentId" : 67,
          "breakAnalysisId" : -1
        },
        "recGrainId" : 136,
        "openDate" : "2022-03-28",
        "closeDate" : "2022-04-08",
        "amount" : -0.58,
        "isChild" : false,
        "ttBegin" : "2022-12"[truncated 1484 chars]; line: 4, column: 5] (through reference chain: com.arcesium.recon.workflow.domain.BreakAnalysisRequest["breakAnalysisList"]->java.util.ArrayList[0]). For further assistance, please contact - <mailto:help@arcesium.com|help@arcesium.com> with tracking request id : 3e3453cc-0549-4117-81a7-c34530095500
    	at com.arcesium.frames.client.RESTfulClient.handleThrowable(RESTfulClient.java:599)
    	at com.arcesium.frames.client.RESTfulClient.executePost(RESTfulClient.java:479)
    	at com.arcesium.frames.client.RESTfulClient.executePost(RESTfulClient.java:637)
    	at com.arcesium.frames.service.util.JavaLightHelper.callRestMethod(JavaLightHelper.java:336)
    	at com.arcesium.frames.client.api.proxy.ClientProxyUtils.executeApi(ClientProxyUtils.java:298)
    	at com.arcesium.frames.client.api.proxy.RemoteProxy.invoke(RemoteProxy.java:304)
    	at com.sun.proxy.$Proxy266.createBreakAnalysis(Unknown Source)
    	at deshaw.munshi.reconcilers.service.util.BreakSyncUtil.createBreakSync(BreakSyncUtil.kt:181)
    	at deshaw.munshi.reconcilers.service.util.BreakSyncUtil$$FastClassBySpringCGLIB$$b6334f06.invoke(<generated>)
    	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
    	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
    	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    Caused by: java.rmi.RemoteException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException:Cannot construct instance of `com.arcesium.recon.workflow.domain.BreakAnalysis` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
     at [Source: (String)"{
      "@UUID" : "46435929-0621-40b9-b623-871dda721fdf",
      "breakAnalysisList" : [ {
        "@UUID" : "d339332a-babf-49b6-a17e-05584595810b",
        "id" : -1,
        "key" : {
          "@UUID" : "a96c68bb-4f80-49aa-b346-67a34b564123",
          "recUnitKey" : "1e364133-a8c1-590f-b13c-41e2f4e661bd",
          "componentId" : 67,
          "breakAnalysisId" : -1
        },
        "recGrainId" : 136,
        "openDate" : "2022-03-28",
        "closeDate" : "2022-04-08",
        "amount" : -0.58,
        "isChild" : false,
        "ttBegin" : "2022-12"[truncated 1484 chars]; line: 4, column: 5] (through reference chain: com.arcesium.recon.workflow.domain.BreakAnalysisRequest["breakAnalysisList"]->java.util.ArrayList[0]).
    Adding a default constructor doesn't help , does anyone have any idea how to resolve this ? This is how my class looks like
    data class BreakAnalysis(
    	var id: Long,
    	val key: BreakAnalysisKey,
    	val recGrainId: Int,
    	val openDate: LocalDate,
    	val closeDate: LocalDate,
    	val amount: BigDecimal,
    	val isChild: Boolean?,
    	var associatedBreakIds: List<Long>?,
    	val ttBegin: LocalDateTime,
    	val ttEnd: LocalDateTime,
    	val systemInsertionRuleId: Int?,
    	val groupId: Long,
    	val partitionDate: LocalDate,
    	val associatedBreakMetaData: Map<String, Any>?,
    	val breakMetadata: Map<String, Any>?,
    	val recTypeFamilyId: Int,
    	val reasonId: Int,
    	val ageStartDate: LocalDate,
    	val cpidDetails: Map<String, Any?>?,
    	val expressionEvaluationDetails: Map<String, Any?>?,
    	val grainMap: Map<String, Any?>?,
    	val clientUserName: String?,
    	val createdBy: String?,
    	val updatedBy: String?,
    	val previousModificationBy: String?,
    	val isWriteOff: Boolean?,
    	val comments: String?,
    	val clientComments: String?,
    	val wireId: Int?,
    	val userTranId: String?,
    	val settlementPrice: BigDecimal?,
    	val side1Quantity: BigDecimal?,
    	val side2Quantity: BigDecimal?,
    	val side1Amount: BigDecimal?,
    	val side2Amount: BigDecimal?,
    	val tick: BigDecimal?,
    	val side1TradePrice: BigDecimal?,
    	val side2TradePrice: BigDecimal?,
    	val adminInvestmentCode: String?,
    	val investmentDescription: String?,
    	val recStatusId: Int,
    	val breakAnalysisWorkflow: BreakAnalysisWorkflow?,
    	val attachments: List<Attachment>,
    	val workUnitId: Int,
    	val workUnitTypeId: Int,
    	val contributedToComponentIds: Set<Int>?,
    	val reconManifestationId: Long?,
    	val uiWorkUnitId: Int?
    ) {
    	constructor(): this(-1, BreakAnalysisKey(),-1,LocalDate.now(),LocalDate.now(),
    			BigDecimal.valueOf(0),null,null,LocalDateTime.now(),
    			LocalDateTime.now(),null,-1,LocalDate.now(),null,
    			null,1,-1,LocalDate.now(),null,null,
    			null,null,null,null,null,null,
    			null,null,null,null,null,null,
    			null,null,null,null,null,null,
    			null,null,-1, null, emptyList(),
    			-1,-1,null,null,null
    	)
    }
    s
    • 2
    • 3
  • z

    Zea

    12/13/2022, 7:20 AM
    Hi guys, Can I use Android Studio to learn basic Kotlin, or should I use intelij IDEA instead? I want to learn Android development eventually. Thanks!
    a
    v
    • 3
    • 3
Powered by Linen
Title
z

Zea

12/13/2022, 7:20 AM
Hi guys, Can I use Android Studio to learn basic Kotlin, or should I use intelij IDEA instead? I want to learn Android development eventually. Thanks!
a

AndreyVanDenHaag

12/13/2022, 7:27 AM
I think they provide the same if you just learn Kotlin. The difference will be there when you try to code, debug, test your Android application
z

Zea

12/13/2022, 7:29 AM
I see... No need to install 2 IDE then. Thanks @AndreyVanDenHaag! 🙂
v

Vampire

12/13/2022, 7:55 AM
AS actually is a customized IJ, so, ...
View count: 10