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

Fix duplicate method exception when registering ai services #492

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

iocanel
Copy link
Collaborator

@iocanel iocanel commented Apr 24, 2024

Resolves: #491

@iocanel iocanel requested a review from a team as a code owner April 24, 2024 04:09
@iocanel iocanel force-pushed the fix-duplicate-method-exception branch from 589c8fc to dc99610 Compare April 24, 2024 04:12
Copy link
Collaborator

@geoand geoand left a comment

Choose a reason for hiding this comment

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

Thanks for this!

I added a comment


import org.jboss.jandex.MethodInfo;

public final class MethodUtil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am wondering if there is already a util like this in Quarkus

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe Methods has something like it. Looking.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Didn't find any.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll get back to you in a few minutes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, meanwhile I added a couple of tests:

  • one the verifies the problem
  • one the verifies the correctness of the util

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll get back to you in a few minutes

Does io.quarkus.gizmo.SignatureBuilder do the trick?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me check

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I don't think we can use that.

They don't seem to provide the name and that makes it of limited use to our use case: https://github.com/quarkusio/gizmo/blob/main/src/main/java/io/quarkus/gizmo/MethodSignatureBuilderImpl.java

@iocanel iocanel force-pushed the fix-duplicate-method-exception branch from dc99610 to fc8b469 Compare April 24, 2024 05:00
Copy link
Collaborator

@geoand geoand left a comment

Choose a reason for hiding this comment

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

Thanks!

@geoand geoand merged commit 1ae1e9a into quarkiverse:main Apr 24, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ClassFormatError: Duplicate method name when registering AI Service
2 participants