Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Illegal reflective access by org.jetbrains.kotlin.com.intellij.util.ReflectionUtil in 0.47.0 #1618

Open
kkocel opened this issue Aug 29, 2022 · 4 comments
Labels
Parked Issue is not likely to be solved or has no clear resolution yet

Comments

@kkocel
Copy link

kkocel commented Aug 29, 2022

I noticed that Illegal reflective access reappeared:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jetbrains.kotlin.com.intellij.util.ReflectionUtil (file:/opt/homebrew/Cellar/ktlint/0.47.0/libexec/ktlint) to field java.lang.Throwable.backtrace
WARNING: Please consider reporting this to the maintainers of org.jetbrains.kotlin.com.intellij.util.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
@paul-dingemans
Copy link
Collaborator

I expect this to be a problem caused by a transitive dependency. At least that seemed the solution in #1143. Please add a clear reproduction path (with exact java version) and sample project.

@kkocel
Copy link
Author

kkocel commented Aug 31, 2022

$ java --version
openjdk 17.0.3 2022-04-19 LTS
OpenJDK Runtime Environment (build 17.0.3+7-LTS)
OpenJDK 64-Bit Server VM (build 17.0.3+7-LTS, mixed mode, sharing)

Reproduction:

  1. checkout sample project: https://github.com/kkocel/ktlint-reproduction
  2. run ktlint -F
  3. Observed behavior:
$ ktlint -F
13:28:16.135 [main] INFO com.pinterest.ktlint.internal.KtlintCommandLine - Enable default patterns [**/*.kt, **/*.kts]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jetbrains.kotlin.com.intellij.util.ReflectionUtil (file:/opt/homebrew/Cellar/ktlint/0.47.0/libexec/ktlint) to field java.lang.Throwable.backtrace
WARNING: Please consider reporting this to the maintainers of org.jetbrains.kotlin.com.intellij.util.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

@paul-dingemans
Copy link
Collaborator

I just found that @Goooler already reported this to jetbrains as a comment on https://youtrack.jetbrains.com/issue/KT-43704. I am doubting whether it gets any priority from the kotlin team. So until then, you have to ignore it, or try one of the workarounds mentioned in the issue.

@Goooler
Copy link
Contributor

Goooler commented Sep 1, 2022

Also

@paul-dingemans paul-dingemans added the Parked Issue is not likely to be solved or has no clear resolution yet label Jul 23, 2023
Julian added a commit to bowtie-json-schema/bowtie that referenced this issue Sep 5, 2023
pre-commit should already auto-find the right files and pass them to
these hooks, and not passing them should I *think* mean it's harder for
new implementers to forget adding explicitly to this list.

Manually testing seems to confirm this is the case (by breaking a file
and seeing ktlint complain).

Though we're running into pinterest/ktlint#1618 (AKA
pinterest/ktlint#1391) and I can't seem to figure out how to pass
through JVM args...
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Parked Issue is not likely to be solved or has no clear resolution yet
Projects
None yet
Development

No branches or pull requests

3 participants