is `by lazy` supposed to work when calling from ja...
# announcements
t
is
by lazy
supposed to work when calling from java?
o
what do you mean? If you call
getProperty
, it should work of course
t
i had this line where i cached a stream:
Copy code
val cachedBytes = super.getInputStream().readBytes()
it was changed to
Copy code
val cachedBytes: ByteArray by lazy { super.getInputStream().readBytes() }
and everything appeared to work, all tests in intellij passed, and it worked when calling it from kotlin in external projects but something was different when calling it from java in external projects (the stream is consumed before it's cached?), and i can't figure out why 🤔
o
That looks like a discussion for #C0B8RC352, I think there might be some app server kicking in, e.g. if it’s a multipart
t
turns out i just ran the wrong main, behavior was consistent in both java and kotlin