Skip to content

Commit

Permalink
Revisit equals, hashCode and toString
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari committed Jan 31, 2024
1 parent 6c7e6e0 commit cfecfe4
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1000,58 +1000,58 @@ public String toString(int index, int length, Charset charset) {
}

@Override
public int hashCode() {
public int compareTo(ByteBuf buffer) {
throw new UnsupportedOperationException();
}

@Override
public boolean equals(Object obj) {
public ByteBuf retain(int increment) {
throw new UnsupportedOperationException();
}

@Override
public int compareTo(ByteBuf buffer) {
public int refCnt() {
throw new UnsupportedOperationException();
}

@Override
public String toString() {
public ByteBuf retain() {
throw new UnsupportedOperationException();
}

@Override
public ByteBuf retain(int increment) {
public ByteBuf touch() {
throw new UnsupportedOperationException();
}

@Override
public int refCnt() {
public ByteBuf touch(Object hint) {
throw new UnsupportedOperationException();
}

@Override
public ByteBuf retain() {
public boolean release() {
throw new UnsupportedOperationException();
}

@Override
public ByteBuf touch() {
public boolean release(int decrement) {
throw new UnsupportedOperationException();
}

@Override
public ByteBuf touch(Object hint) {
throw new UnsupportedOperationException();
public String toString() {
return Object.class.getSimpleName() + '@' + Integer.toHexString(System.identityHashCode(this));
}

@Override
public boolean release() {
throw new UnsupportedOperationException();
public int hashCode() {
return System.identityHashCode(this);
}

@Override
public boolean release(int decrement) {
throw new UnsupportedOperationException();
public boolean equals(Object obj) {
return obj == this;
}
}
}

0 comments on commit cfecfe4

Please sign in to comment.