Skip to content

Support finding caller of a companion object#13

Merged
alexander-yevsyukov merged 51 commits intomasterfrom
support-companion-in-stack
Jul 25, 2025
Merged

Support finding caller of a companion object#13
alexander-yevsyukov merged 51 commits intomasterfrom
support-companion-in-stack

Conversation

@alexander-yevsyukov
Copy link
Copy Markdown
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Jul 24, 2025

This PR extends the CallerFinder so that it can find a stackframe which calls a companion object function even if the enclosing class is given as an argument.

Other notable changes

  • AI Agent guidelines were added.
  • Latest config was applied.
  • Nullability annotates were migrated to JSpecify.

@alexander-yevsyukov alexander-yevsyukov self-assigned this Jul 24, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 24, 2025

Codecov Report

Attention: Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 86.84%. Comparing base (04b8083) to head (1eccb26).

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #13      +/-   ##
============================================
- Coverage     87.47%   86.84%   -0.63%     
- Complexity      124      127       +3     
============================================
  Files            15       17       +2     
  Lines           471      479       +8     
  Branches         59       62       +3     
============================================
+ Hits            412      416       +4     
- Misses           46       49       +3     
- Partials         13       14       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This comment was marked as outdated.

alexander-yevsyukov and others added 2 commits July 24, 2025 23:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review July 24, 2025 22:01

This comment was marked as outdated.

This comment was marked as outdated.

alexander-yevsyukov and others added 2 commits July 25, 2025 10:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

This comment was marked as outdated.

@alexander-yevsyukov
Copy link
Copy Markdown
Contributor Author

@alexander-yevsyukov some of Copilot's comments may make sense. So I am requesting changes just in case to avoid auto-merge.

I usually address them right after its review, and I think I've addressed most of them already. Those that I did not address, I commented with a reason.

alexander-yevsyukov and others added 3 commits July 25, 2025 11:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

This comment was marked as outdated.

alexander-yevsyukov and others added 2 commits July 25, 2025 12:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extends the CallerFinder to support finding stackframes that call companion object functions even when the enclosing class is given as an argument. Additionally, it applies the latest configuration updates, migrates nullability annotations to JSpecify, and adds AI Agent guidelines.

  • Adds companion object support to StackGetter implementations
  • Migrates from javax.annotation to JSpecify nullability annotations
  • Updates project dependencies and build configuration to latest versions

Reviewed Changes

Copilot reviewed 263 out of 279 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/kotlin/io/spine/reflect/StackWalkerStackGetter.kt Adds companion object detection logic with helper function
src/main/kotlin/io/spine/reflect/ThrowableStackGetter.kt Updates to use new companion object detection
src/test/kotlin/io/spine/reflect/given/ClassWithCompanion.kt Test classes for companion object functionality
src/test/kotlin/io/spine/reflect/AbstractStackGetterSpec.kt Test case for companion object caller finding
pom.xml Dependency version updates including Guava, Protobuf, and Kotlin
Files not reviewed (5)
  • .idea/codeStyles/Project.xml: Language not supported
  • .idea/dictionaries/common.xml: Language not supported
  • .idea/inspectionProfiles/Project_Default.xml: Language not supported
  • .idea/kotlinc.xml: Language not supported
  • .idea/misc.xml: Language not supported
Comments suppressed due to low confidence (1)

pom.xml:35

  • Protobuf version 4.31.0 appears to be invalid. The latest stable version of Protocol Buffers is in the 3.x series (e.g., 3.25.x). Version 4.31.0 does not exist in the official Protocol Buffers releases.
    <version>4.31.0</version>

alexander-yevsyukov and others added 3 commits July 25, 2025 12:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@alexander-yevsyukov alexander-yevsyukov merged commit 980720d into master Jul 25, 2025
6 of 7 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the support-companion-in-stack branch July 25, 2025 11:52
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in v2.0 Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants