Skip to content

Commit dcc17e8

Browse files
authored
Fix Grid equals (#78)
* Grid equals * Upd the CHANGELOG
1 parent 5e8c46d commit dcc17e8

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
- Fix Grid equals [#78](https://github.com/locationtech/proj4j/pull/78)
10+
911
## [1.1.4] - 2021-11-03
1012

1113
### Fixed

src/main/java/org/locationtech/proj4j/datum/Grid.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,17 +388,17 @@ public boolean equals(Object that) {
388388
if (that instanceof Grid) {
389389
Grid g = (Grid) that;
390390
if (gridName == null && g.gridName != null) return false;
391-
if (!gridName.equals(g.gridName)) return false;
391+
if (gridName != null && !gridName.equals(g.gridName)) return false;
392392
if (fileName == null && g.fileName != null) return false;
393-
if (!fileName.equals(g.fileName)) return false;
393+
if (fileName != null && !fileName.equals(g.fileName)) return false;
394394
if (format == null && g.format != null) return false;
395-
if (!format.equals(g.format)) return false;
395+
if (format != null && !format.equals(g.format)) return false;
396396
if (table == null && g.table != null) return false;
397-
if (!table.equals(g.table)) return false;
397+
if (table != null && !table.equals(g.table)) return false;
398398
if (next == null && g.next != null) return false;
399-
if (!next.equals(g.next)) return false;
399+
if (next != null && !next.equals(g.next)) return false;
400400
if (child == null && g.child != null) return false;
401-
if (!child.equals(g.child)) return false;
401+
if (child != null && !child.equals(g.child)) return false;
402402
return true;
403403
} else {
404404
return false;

0 commit comments

Comments
 (0)