Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit 4ac5112

Browse files
committed
Fixed == .vs. .equal bug
1 parent 3c9976f commit 4ac5112

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/java/org/energyos/espi/common/domain/Subscription.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,6 @@ public void unlink() {
190190
}
191191

192192
public boolean equals (Subscription s) {
193-
return (this.getId() == s.getId());
193+
return (this.getId().equals(s.getId()));
194194
}
195195
}

src/main/java/org/energyos/espi/common/service/impl/ExportServiceImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ private EntryTypeIterator findEntryTypeIteratorXPath(Long subscriptionId,
11331133

11341134
try {
11351135

1136-
if (subscriptionId != 0) {
1136+
if (!(subscriptionId.equals(0L))) {
11371137
subscription = resourceService.findById(subscriptionId, Subscription.class);
11381138
Authorization authorization = subscription.getAuthorization();
11391139
if (!(authorization.getThirdParty().contentEquals("third_party"))) {
@@ -1149,10 +1149,10 @@ private EntryTypeIterator findEntryTypeIteratorXPath(Long subscriptionId,
11491149
}
11501150

11511151
// do we have a usagepointId?
1152-
if (id2 != 0) {
1152+
if (!(id2.equals(0L))) {
11531153
// is it in the subscription?
11541154
for (UsagePoint up : subscription.getUsagePoints()) {
1155-
if (up.getId() == id2) {
1155+
if (up.getId().equals(id2)) {
11561156
valid = true;
11571157
}
11581158
}
@@ -1163,15 +1163,15 @@ private EntryTypeIterator findEntryTypeIteratorXPath(Long subscriptionId,
11631163
}
11641164

11651165
if (valid) {
1166-
if (id3 != 0) {
1166+
if (!(id3.equals(0L))) {
11671167
temp = resourceService.findAllIdsByXPath(id1, id2, id3,
11681168
clazz);
11691169
} else {
1170-
if (id2 != 0) {
1170+
if (!(id2.equals(0L))) {
11711171
temp = resourceService.findAllIdsByXPath(id1, id2,
11721172
clazz);
11731173
} else {
1174-
if (id1 != 0) {
1174+
if (!(id1.equals(0L))) {
11751175
// temp = resourceService.findAllIdsByXPath(id1,
11761176
// clazz);
11771177
// we just want the UsagePoints in the Subscription

0 commit comments

Comments
 (0)