From 25b1c189ecd8d21480b23112e968e1f29e9d078c Mon Sep 17 00:00:00 2001 From: Frank Zhang <fz2907@vt.edu> Date: Sat, 26 Nov 2022 23:29:01 -0500 Subject: [PATCH] Change == to equals --- .../SwitchRoom/controllers/InteractiveController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BackendFolder/SwitchRoom/src/main/java/vt/CS5934/SwitchRoom/controllers/InteractiveController.java b/BackendFolder/SwitchRoom/src/main/java/vt/CS5934/SwitchRoom/controllers/InteractiveController.java index c9b013cb..b0addc22 100644 --- a/BackendFolder/SwitchRoom/src/main/java/vt/CS5934/SwitchRoom/controllers/InteractiveController.java +++ b/BackendFolder/SwitchRoom/src/main/java/vt/CS5934/SwitchRoom/controllers/InteractiveController.java @@ -51,7 +51,7 @@ public class InteractiveController { InteractionModel result = interactionService.searchBothIdFromDB(newData.get("offerId").toString(), newData.get("wishlistId").toString()); if(result == null) { back = interactionService.addDataToDB(Integer.parseInt(newData.get("userId").toString()), null, newData.get("phone").toString(), null, false, newData.get("offerId").toString(), newData.get("wishlistId").toString()); - if(newData.get("see").toString() == "offer") { + if("offer".equals(newData.get("see").toString())) { MatchedWishlistRecordModel history = matchedWishlistRecordService.getHistoryFromDB(Long.parseLong(newData.get("offerId").toString()), Long.parseLong(newData.get("wishlistId").toString())); history.setOfferResult(LookupTables.MATCHING_RECORD_USER_RESULT.Accepted); matchedWishlistRecordService.updateToDB(history); @@ -77,7 +77,7 @@ public class InteractiveController { MatchedWishlistRecordModel history = matchedWishlistRecordService.getHistoryFromDB(Long.parseLong(newData.get("offerId").toString()), Long.parseLong(newData.get("wishlistId").toString())); System.out.println("why this happened " + history.toString()); } - if(newData.get("see").toString() == "offer") { + if("offer".equals(newData.get("see").toString())) { MatchedWishlistRecordModel history = matchedWishlistRecordService.getHistoryFromDB(Long.parseLong(newData.get("offerId").toString()), Long.parseLong(newData.get("wishlistId").toString())); history.setOfferResult(LookupTables.MATCHING_RECORD_USER_RESULT.Accepted); matchedWishlistRecordService.updateToDB(history); @@ -133,7 +133,7 @@ public class InteractiveController { System.out.println(result); if(result == null) { back = interactionService.addDataToDB(Integer.parseInt(newData.get("userId").toString()), null, null, null, false, newData.get("offerId").toString(), newData.get("wishlistId").toString()); - if(newData.get("see").toString() == "offer") { + if("offer".equals(newData.get("see").toString())) { MatchedWishlistRecordModel history = matchedWishlistRecordService.getHistoryFromDB(Long.parseLong(newData.get("offerId").toString()), Long.parseLong(newData.get("wishlistId").toString())); history.setOfferResult(LookupTables.MATCHING_RECORD_USER_RESULT.Declined); matchedWishlistRecordService.updateToDB(history); @@ -152,7 +152,7 @@ public class InteractiveController { InteractionModel resultAfterUpdate = interactionService.updateToDB(result); back = resultAfterUpdate; } - if(newData.get("see").toString() == "offer") { + if("offer".equals(newData.get("see").toString())) { MatchedWishlistRecordModel history = matchedWishlistRecordService.getHistoryFromDB(Long.parseLong(newData.get("offerId").toString()), Long.parseLong(newData.get("wishlistId").toString())); history.setOfferResult(LookupTables.MATCHING_RECORD_USER_RESULT.Declined); matchedWishlistRecordService.updateToDB(history); -- GitLab