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

Use proper toString() implementation in the API classes #9734

Closed
scholzj opened this issue Feb 22, 2024 · 3 comments · Fixed by #9810
Closed

Use proper toString() implementation in the API classes #9734

scholzj opened this issue Feb 22, 2024 · 3 comments · Fixed by #9810

Comments

@scholzj
Copy link
Member

scholzj commented Feb 22, 2024

The classes in our API module currently seem to mix several ways how to handle the toString methods:

  • Some use Jackson libraries to render a YAML string
  • Some do not do anything
  • Some use the Lombok @ToString annotation to generate the toString() method

We should pick one way (Lombok annotation?) and use it properly in all resources and their subclasses. This would help when debugging issues, with log readability etc.

@scholzj
Copy link
Member Author

scholzj commented Mar 7, 2024

Triaged on the community call on 7.3.2024: We should use the @ToString annotation on all the API classes.

@kockas
Copy link
Contributor

kockas commented Mar 10, 2024

I'd do it. I see quite a lot of inconsistencies also in @EqualsAndHashCode when callSuper = true is not used consistently. I would align it, and use @ToString inline with @EqualsAndHashCode, so both annotation use same callSuper = true (or false).
Is that approach ok for you?

@scholzj
Copy link
Member Author

scholzj commented Mar 11, 2024

I think that makes sense, yes.

kockas added a commit to kockas/strimzi-kafka-operator that referenced this issue Mar 11, 2024
…swordSecretSource and PasswordSource classes
kockas added a commit to kockas/strimzi-kafka-operator that referenced this issue Mar 11, 2024
…swordSecretSource and PasswordSource classes

Signed-off-by: Slavomir Kocka <slavomir.kocka@gmail.com>
kockas added a commit to kockas/strimzi-kafka-operator that referenced this issue Mar 11, 2024
…swordSecretSource and PasswordSource classes

Signed-off-by: Slavomir Kocka <slavomir.kocka@gmail.com>
scholzj pushed a commit that referenced this issue Mar 12, 2024
#9810)

Signed-off-by: Slavomir Kocka <slavomir.kocka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants