Skip to content

Parse Kotlin SMAP only once for each class#2114

Merged
Godin merged 6 commits into
jacoco:masterfrom
Godin:kotlin_smap
May 12, 2026
Merged

Parse Kotlin SMAP only once for each class#2114
Godin merged 6 commits into
jacoco:masterfrom
Godin:kotlin_smap

Conversation

@Godin

@Godin Godin commented May 9, 2026

Copy link
Copy Markdown
Member

No description provided.

@Godin Godin added this to the 0.8.15 milestone May 9, 2026
@Godin Godin requested a review from marchof May 9, 2026 19:31
@Godin Godin self-assigned this May 9, 2026
@Godin Godin added component: core component: core.filters language: Kotlin Tickets about Kotlin language support labels May 9, 2026
@Godin Godin changed the title Parse Kotlin SMAP only once Parse Kotlin SMAP only once for each class May 9, 2026
Comment thread org.jacoco.core/src/org/jacoco/core/internal/analysis/ClassAnalyzer.java Outdated
final String[] exceptions) {

if (sourceDebugExtension != null && Filters.isKotlinClass(this)) {
// Note that visitSource is invoked before visitAnnotation,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In this context but for a separate PR to improve readablity: Maybe our ASM *Visitor implementations should have the visit*() methods always in the source files ordered like the call sequence defined by ASM.

Comment thread org.jacoco.core/src/org/jacoco/core/internal/analysis/ClassAnalyzer.java Outdated
Comment thread org.jacoco.core/src/org/jacoco/core/internal/analysis/ClassAnalyzer.java Outdated
mv.accept(mn, mv);
analyzer.visitAnnotation("Lkotlin/Metadata;", false);
fail("exception expected");
} catch (Exception e) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we test for the specific exception type?

Suggested change
} catch (Exception e) {
} catch (IllegalStateException e) {

@Godin Godin requested a review from marchof May 12, 2026 08:27
@Godin Godin enabled auto-merge (squash) May 12, 2026 21:17
@Godin Godin merged commit 92e669d into jacoco:master May 12, 2026
56 checks passed
@Godin Godin deleted the kotlin_smap branch May 12, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants