Hi folks, not sure if anyone noticed, but ktfmt is...
# ktfmt
s
Hi folks, not sure if anyone noticed, but ktfmt is (indirectly?) using some deprecated Unsafe APIs that will be removed from the JDK https://github.com/facebook/ktfmt/issues/533
👀 2
g
Oh ok. How are you running it?
s
image.png
👍 1
I don't see direct references to those classes in the code
so I think it may be somewhere in the parser where it delegates to IJ/Kotlin
I was trying to check the ktfmt version but the -h doesn't print it
😅 1
It is the latest available on homebrew tho
👍 1
❤️ 1
d
Hey! Joining this thread. Is there a way to pass
--sun-misc-unsafe-memory-access=allow
to the Ktfmt invoked via the gradle plugin? I tried to add that to my
org.gradle.jvmargs
but that makes no difference... 😕
OK, answering my own question. It seems that just making the work actions run with classloader isolation fixes the problem for me.
Copy code
ktfmt {
    useClassloaderIsolation = true
}
But then I get
java.lang.OutOfMemoryError: Compressed class space
errors... 😢