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

Take class hierarchy into account when resolving #290

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

CodeDrivenMitch
Copy link
Member

Both when resolving handlers and creators, the hierarchy of classes was not interpreted correctly. This has been resolved.

In addition, I discovered that the current interceptor implementation stood in the way of this fix, and that it should be implemented in another way. Interceptors are not handlers, after all, but this mechanism was abused for that. As such, the CommandHandlerInterceptor support has been removed. This may be re-added in the future.

Copy link

github-actions bot commented Sep 30, 2024

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

  1. Register at Qodana Cloud and configure the action
  2. Use GitHub Code Scanning with Qodana
  3. Host Qodana report at GitHub Pages
  4. Inspect and use qodana.sarif.json (see the Qodana SARIF format for details)

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/[email protected]
        with:
          upload-result: true
Contact Qodana team

Contact us at [email protected]

Copy link
Member

@smcvb smcvb left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -29,7 +29,7 @@ import org.axonframework.intellij.ide.plugin.util.creatorResolver
* Provides a gutter icon on all generic handler methods
*/
class CommonHandlerMethodLineMarkerProvider : AbstractHandlerLineMarkerProvider() {
private val blacklistedTypes = listOf(MessageHandlerType.DEADLINE, MessageHandlerType.COMMAND, MessageHandlerType.COMMAND_INTERCEPTOR)
private val blacklistedTypes = listOf(MessageHandlerType.DEADLINE)
Copy link
Member

Choose a reason for hiding this comment

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

Not sure that I comprehend why only the DEADLINE is left for black listing. Care to explain?

Copy link
Member Author

Choose a reason for hiding this comment

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

This class marks any @MessageHander annotated method, unless that handler type is in the list.

Before this PR, a command handler had a specific one, but with the interceptors gone it's not needed. Aditionally, in the future, the interceptors will be generic for any type of message and implemented in this provider.
The reason deadline is still here is because this is a specific one (DeadlineHandlerMethodLineMarkerProvider) because it uses the DeadlineManagerReferenceResolver instead of the MessageHandlerResolver

Copy link
Member Author

Choose a reason for hiding this comment

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

I left it a list, because maybe we need different MarkerProviders later after all

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the explanation; it makes sense to me!

Both when resolving handlers and creators, the hierarchy of classes was not interpreted correctly. This has been resolved.

In addition, I discovered that the current interceptor implementation stood in the way of this fix, and that it should be implemented in another way. Interceptors are not handlers, after all, but this mechanism was abused for that. As such, the CommandHandlerInterceptor support has been removed. This may be re-added in the future.
# Conflicts:
#	CHANGELOG.md
#	src/main/kotlin/org/axonframework/intellij/ide/plugin/resolving/handlers/searchers/CommandHandlerInterceptorSearcher.kt
#	src/main/kotlin/org/axonframework/intellij/ide/plugin/resolving/handlers/types/CommandHandlerInterceptor.kt
@CodeDrivenMitch CodeDrivenMitch linked an issue Oct 1, 2024 that may be closed by this pull request
@CodeDrivenMitch CodeDrivenMitch merged commit 90ea068 into master Oct 1, 2024
4 checks passed
@CodeDrivenMitch CodeDrivenMitch deleted the fix/take-hierarchy-into-account branch October 1, 2024 08:56
@CodeDrivenMitch CodeDrivenMitch restored the fix/take-hierarchy-into-account branch October 1, 2024 09:48
@smcvb smcvb deleted the fix/take-hierarchy-into-account branch October 1, 2024 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants