Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ngone51 committed Apr 28, 2021
1 parent 38976b7 commit 646f3cf
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,48 +27,48 @@ public class CorruptionCause extends BlockTransferMessage {
public Cause cause;

public CorruptionCause(Cause cause) {
this.cause = cause;
this.cause = cause;
}

@Override
protected Type type() {
return Type.CORRUPTION_CAUSE;
return Type.CORRUPTION_CAUSE;
}

@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
.append("cause", cause)
.toString();
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
.append("cause", cause)
.toString();
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

CorruptionCause that = (CorruptionCause) o;
return cause == that.cause;
CorruptionCause that = (CorruptionCause) o;
return cause == that.cause;
}

@Override
public int hashCode() {
return cause.hashCode();
return cause.hashCode();
}

@Override
public int encodedLength() {
return 4; /* encoded length of cause */
return 4; /* encoded length of cause */
}

@Override
public void encode(ByteBuf buf) {
buf.writeInt(cause.ordinal());
buf.writeInt(cause.ordinal());
}

public static CorruptionCause decode(ByteBuf buf) {
int ordinal = buf.readInt();
return new CorruptionCause(Cause.values()[ordinal]);
int ordinal = buf.readInt();
return new CorruptionCause(Cause.values()[ordinal]);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public DiagnoseCorruption(String appId, String execId, String blockId, long chec

@Override
protected Type type() {
return Type.DIAGNOSE_CORRUPTION;
return Type.DIAGNOSE_CORRUPTION;
}

@Override
Expand All @@ -53,24 +53,24 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

DiagnoseCorruption that = (DiagnoseCorruption) o;
DiagnoseCorruption that = (DiagnoseCorruption) o;

if (!appId.equals(that.appId)) return false;
if (!execId.equals(that.execId)) return false;
if (!blockId.equals(that.blockId)) return false;
return checksum == that.checksum;
if (!appId.equals(that.appId)) return false;
if (!execId.equals(that.execId)) return false;
if (!blockId.equals(that.blockId)) return false;
return checksum == that.checksum;
}

@Override
public int hashCode() {
int result = appId.hashCode();
result = 31 * result + execId.hashCode();
result = 31 * result + blockId.hashCode();
result = 31 * result + (int) checksum;
return result;
int result = appId.hashCode();
result = 31 * result + execId.hashCode();
result = 31 * result + blockId.hashCode();
result = 31 * result + (int) checksum;
return result;
}

@Override
Expand Down

0 comments on commit 646f3cf

Please sign in to comment.