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

Fix check for lint 30.4.0 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stkent
Copy link

@stkent stkent commented Jan 10, 2023

When I run this lint check using AGP 7.4.0-rc01 (i.e. lint 30.4.0), I see the following output in the lint report:

Unexpected failure during lint analysis of EditTextExtensions.kt (this is a bug in lint or one of the libraries it depends on)

Message: class com.redacted.lintchecks.SerializableObjectMissingReadResolveDetector$createUastHandler$1 tried to access protected method 'org.jetbrains.kotlin.psi.KtClassOrObject org.jetbrains.uast.kotlin.KotlinUClass.getKtClass()'

The problem appears to be the use of KotlinUClass::ktClass.

The same error appears for a check packaged in androidx.fragment (https://issuetracker.google.com/issues/237567009), which was fixed here: androidx/androidx@528b64f

CleanShot 2023-01-10 at 17 13 20@2x

This commit ports the same fix to SerializableObjectMissingReadResolveDetector, as best as I could tell. (The tests all still passed for me!)

I am not an AST-traversing expert, so feel free to fix/improve upon my code if desired!

When I run this lint check using AGP 7.4.0-rc01, I see the following
output in the lint report:

Unexpected failure during lint analysis of EditTextExtensions.kt (this is a bug in lint or one of the libraries it depends on)

Message: class com.youneedabudget.lintchecks.SerializableObjectMissingReadResolveDetector$createUastHandler$1 tried to access protected method 'org.jetbrains.kotlin.psi.KtClassOrObject org.jetbrains.uast.kotlin.KotlinUClass.getKtClass()

The problem appears to be the use of KotlinUClass::ktClass.

The same error appears for a check packaged in androidx.fragment
(https://issuetracker.google.com/issues/237567009), which was fixed
here: androidx/androidx@528b64f

This commit ports the same fix to
SerializableObjectMissingReadResolveDetector, as best as I could tell.
(The tests all still passed for me!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant