Skip to content

Java: Disable Kotlin element of test re: database inconsistency exposed by JDK18 extractor upgrade #10523

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

Merged

Conversation

smowton
Copy link
Contributor

@smowton smowton commented Sep 21, 2022

This is disabled for now because Kotlin doesn't extract java.lang.CharSequence.toString, even though that interface redeclares toString, and JDK18 points a call (syntactically to Editable.toString) that previous JDKs pointed at Object.toString. This produces a database inconsistency that should be fixed Kotlin-side.

@smowton smowton requested a review from a team as a code owner September 21, 2022 21:34
@github-actions github-actions bot added the Java label Sep 21, 2022
atorralba
atorralba previously approved these changes Sep 22, 2022
Copy link
Contributor

@atorralba atorralba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this gets fixed we will be able to also get rid of

private class EditableToStringStep extends AdditionalTaintStep {
override predicate step(DataFlow::Node n1, DataFlow::Node n2) {
exists(MethodAccess ma |
ma.getMethod().hasName("toString") and
ma.getReceiverType().getASourceSupertype*().hasQualifiedName("android.text", "Editable") and
n1.asExpr() = ma.getQualifier() and
n2.asExpr() = ma
or
ma.getMethod().hasQualifiedName("java.lang", "String", "valueOf") and
ma.getArgument(0)
.getType()
.(RefType)
.getASourceSupertype*()
.hasQualifiedName("android.text", "Editable") and
n1.asExpr() = ma.getArgument(0) and
n2.asExpr() = ma
)
}
}

This is disabled for now because Kotlin doesn't extract java.lang.CharSequence.toString, even though that interface redeclares toString, and JDK18 points a call (syntactically to Editable.toString) that previous JDKs pointed at
Object.toString. This produces a database inconsistency that should be fixed Kotlin-side.
@smowton smowton force-pushed the smowton/admin/jdk18-extractor-test-changes branch from 581aa00 to cea90d5 Compare September 22, 2022 19:45
@smowton smowton merged commit 9aebe87 into github:main Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants