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

Adjust lombok annotations to reduce build warnings #5021

Merged
merged 5 commits into from
Jan 4, 2021

Conversation

ghubstan
Copy link
Contributor

This change fixes the underlying problems behind five compiler warnings: Generating equals/hashCode implementation but without a call to superclass.

Some core classes use @Value and @Data annotations where not necessary, for example, where equals, hashCode, and toString methods, and final class and field modifiers are defined by a developer.

From lombok classes and documents for the shortcut annotations @Value and @Data, we find some implicit annotations applied by these shortcuts are not needed. Adjustments are described below.

  • Tx Replace @Value with @Getter.

  • TxOutput Replace @Data with @Getter and @Setter.

  • ChangeParamProposal Replace @Value with @Getter.

  • GetInventoryRequest, GetInventoryResponse An @EqualsAndHashCode(callSuper = false) is added to supress build warnings.

This change fixes the underlying problems behind five compiler warnings:
"Generating equals/hashCode implementation but without a call to superclass".

Some core classes use @value and @DaTa annotations where not necessary, for
example, where equals, hashCode, and toString are implemented by the developer,
and where final class and field modifiers are defined by the developer.

From lombok classes and documents for the shortcut annotations
	@value https://projectlombok.org/features/Value and
	@DaTa  https://projectlombok.org/features/Data,
we find some implicit annotations applied by these shortcuts are not needed.
Adjustments are described below.

- Tx Replace @value with @Getter.

- TxOutput  Replace @DaTa with @Getter and @Setter.

- ChangeParamProposal  Replace @value with @Getter.

- GetInventoryRequest, GetInventoryResponse
  An @EqualsAndHashCode(callSuper = false) is added to supress build
  warnings.
@sqrrm sqrrm added in:build and removed in:api labels Jan 1, 2021
Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

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

Makes me nervous changing this magic annotations in the DAO module. It compiles nicely and seems to work fine.

This is the typical case where @ManfredKarrer has to review to make sure this is not breaking some hashes we rely on in the DAO.

Copy link
Contributor

@ManfredKarrer ManfredKarrer left a comment

Choose a reason for hiding this comment

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

utACK

@sqrrm sqrrm merged commit 6fc9ad4 into bisq-network:master Jan 4, 2021
@ghubstan ghubstan deleted the fix-annotations branch January 4, 2021 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants