Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

java.lang.IllegalStateException: Cannot find descriptor for values #240

Closed
yigit opened this issue Jan 8, 2021 · 0 comments · Fixed by #548
Closed

java.lang.IllegalStateException: Cannot find descriptor for values #240

yigit opened this issue Jan 8, 2021 · 0 comments · Fixed by #548
Assignees
Labels
bug Something isn't working P1 major features or blocking bugs
Milestone

Comments

@yigit
Copy link
Collaborator

yigit commented Jan 8, 2021

When calling getDeclaredMethods on an enum class declared in java, calling getJvmName on the values method throws IllegalStateException.

                public enum JavaEnum {
                    VAL1,
                    VAL2;
                }
val javaEnum = resolver.getClassDeclarationByName("JavaEnum")
val valuesMethod = javaEnum.getDeclaredMethods().filter {it.name == "values" }
resolver.getJvmName(valuesMethod) // throws

ksp version: 20210107

@neetopia neetopia added the bug Something isn't working label Jan 8, 2021
@ting-yuan ting-yuan added this to the 2021Q1 milestone Jan 9, 2021
copybara-service bot pushed a commit to androidx/androidx that referenced this issue Jan 13, 2021
This CL updates KSP to 20210111.
* Removed the fake checker impl since we don't need that anymore. KSP
skips fakes now.
* Re-enabled tests for java enums since that issue is fixed.
* Removed safeGetJvmName for properties because #200 is fixed.
Unfortunately, there is another bug for methods so we are still using
safeGet for them.
google/ksp#240
* Removed workaround in findOverridee but unfortunately, now we hit
another bug there: google/ksp#248

Bug: 160322705
Test: existing tests

Change-Id: Iddabe0a828821a13a20b8b23c7f9ad340893429b
@ting-yuan ting-yuan modified the milestones: 1.0.0-beta, 1.0.0 Mar 22, 2021
@ting-yuan ting-yuan added the P1 major features or blocking bugs label Mar 22, 2021
copybara-service bot pushed a commit to androidx/androidx that referenced this issue Aug 20, 2021
The related issue is now fixed.

Issue: google/ksp#240
Bug: 160322705
Test: existing tests pass without the workaround
Change-Id: I30d509f44a3c48e9da62884d00805315af5515cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 major features or blocking bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants