Adjust lombok annotations to reduce 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.
This commit is contained in:
ghubstan 2020-12-29 12:39:08 -03:00
parent 1f06429d25
commit 7e24c57dc8
No known key found for this signature in database
GPG Key ID: E35592D6800A861E
5 changed files with 14 additions and 6 deletions

View File

@ -29,7 +29,7 @@ import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.Value;
import lombok.Getter;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@ -39,7 +39,7 @@ import javax.annotation.concurrent.Immutable;
* Gets persisted.
*/
@Immutable
@Value
@Getter
public final class Tx extends BaseTx implements PersistablePayload, ImmutableDaoStateModel {
// Created after parsing of a tx is completed. We store only the immutable tx in the block.
public static Tx fromTempTx(TempTx tempTx) {

View File

@ -24,7 +24,8 @@ import bisq.common.proto.persistable.PersistablePayload;
import java.util.Objects;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@ -36,7 +37,8 @@ import javax.annotation.concurrent.Immutable;
* Gets persisted.
*/
@Immutable
@Data
@Getter
@Setter
public class TxOutput extends BaseTxOutput implements PersistablePayload, ImmutableDaoStateModel {
public static TxOutput fromTempOutput(TempTxOutput tempTxOutput) {
return new TxOutput(tempTxOutput.getIndex(),

View File

@ -29,14 +29,16 @@ import java.util.Date;
import java.util.Map;
import java.util.Objects;
import lombok.Value;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.experimental.FieldDefaults;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.concurrent.Immutable;
@Immutable
@Slf4j
@Value
@Getter
public final class ChangeParamProposal extends Proposal implements ImmutableDaoStateModel {
private final Param param;
private final String paramValue;

View File

@ -21,9 +21,11 @@ package bisq.core.network.p2p.inventory.messages;
import bisq.common.app.Version;
import bisq.common.proto.network.NetworkEnvelope;
import lombok.EqualsAndHashCode;
import lombok.Value;
@Value
@EqualsAndHashCode(callSuper = false)
public class GetInventoryRequest extends NetworkEnvelope {
private final String version;

View File

@ -28,9 +28,11 @@ import com.google.common.base.Optional;
import java.util.HashMap;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Value;
@Value
@EqualsAndHashCode(callSuper = false)
public class GetInventoryResponse extends NetworkEnvelope {
private final Map<InventoryItem, String> inventory;