Skip to content

Commit

Permalink
fix issue pgjdbc#3170
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawnliving committed Mar 21, 2024
1 parent 3b7daa9 commit 4f2d0da
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pgjdbc/src/main/java/org/postgresql/jdbc/PgArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -505,4 +506,20 @@ public void free() throws SQLException {
fieldBytes = null;
arrayList = null;
}
@Override
public final boolean equals(Object obj){
if (obj == this){
return true;
}
if (obj instanceof PgArray){
PgArray pgArray = (PgArray) obj;
if (pgArray.fieldBytes != null && this.fieldBytes != null){
return Arrays.equals(pgArray.fieldBytes, this.fieldBytes);
}
if (pgArray.fieldString != null && this.fieldString != null){
return pgArray.fieldString.equals(this.fieldString);
}
}
return false;
}
}

0 comments on commit 4f2d0da

Please sign in to comment.