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

Update KotlinLateinitFilter for Kotlin 1.5 #1166

Merged
merged 3 commits into from Mar 21, 2021
Merged

Conversation

Godin
Copy link
Member

@Godin Godin commented Mar 20, 2021

Currently execution of

mvn clean package -Dkotlin.version=1.5.0-M1

leads to

Failed tests:
  execute_assertions_in_comments(org.jacoco.core.test.validation.kotlin.KotlinLateinitTest): Instructions (KotlinLateinitTarget.kt:26) expected:<[FUL]LY_COVERED> but was:<[PART]LY_COVERED>

What seems to be related to the following change in Kotlin compiler - JetBrains/kotlin@7c95781

@Godin Godin added this to the 0.8.7 milestone Mar 20, 2021
@Godin Godin self-assigned this Mar 20, 2021
@Godin Godin added this to Implementation in Current work items via automation Mar 20, 2021
@Godin Godin added this to To Do in Filtering via automation Mar 20, 2021
@Godin Godin moved this from Implementation to Review in Current work items Mar 21, 2021
@Godin Godin marked this pull request as ready for review March 21, 2021 13:33
@Godin Godin requested a review from marchof March 21, 2021 13:33
@marchof
Copy link
Member

marchof commented Mar 21, 2021

m.visitInsn(Opcodes.ACONST_NULL);
m.visitInsn(Opcodes.ATHROW);

Oh shit, I hope for Kotlin the JVM will never tighten its verifier 😱

@marchof marchof merged commit 5bbe202 into master Mar 21, 2021
Filtering automation moved this from To Do to Done Mar 21, 2021
Current work items automation moved this from Review to Done Mar 21, 2021
@marchof marchof deleted the KotlinLateinitFilter branch March 21, 2021 19:34
@Godin
Copy link
Member Author

Godin commented Mar 22, 2021

@marchof what do you mean? according to https://docs.oracle.com/javase/specs/jvms/se16/html/jvms-6.html#jvms-6.5.athrow

If objectref is null, athrow throws a NullPointerException instead of objectref.

@marchof
Copy link
Member

marchof commented Mar 22, 2021

Sure... I mean something like SonarQube for bytecode 😅

ACONST_NULL
ATHROW
^ Warning: This will always result in a NPE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Filtering
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants