fix: use .equals() instead of == for strings by yanikapitanov · Pull Request #1065 · firebase/firebase-admin-java
Expand Up
@@ -487,7 +487,7 @@ public UpdateRequest setPhoneNumber(@Nullable String phone) {
// *and* by setting providersToUnlink to include 'phone', then we'll reject that. Though
// it might also be reasonable to relax this restriction and just unlink it.
for (String dp : deleteProviderIterable) {
if (dp == "phone") {
if ("phone".equals(dp)) {
throw new IllegalArgumentException(
"Both UpdateRequest.setPhoneNumber(null) and "
+ "UpdateRequest.setProvidersToUnlink(['phone']) were set. To unlink from a "
Expand Down
Expand Up
@@ -601,7 +601,7 @@ public UpdateRequest setProvidersToUnlink(Iterable<String> providerIds) {
for (String id : providerIds) {
checkArgument(!Strings.isNullOrEmpty(id), "providerIds must not be null or empty");
if (id == "phone" && properties.containsKey("phoneNumber") if ("phone".equals(id) && properties.containsKey("phoneNumber") && properties.get("phoneNumber") == null) { // If we've been told to unlink the phone provider both via setting phoneNumber to null // *and* by setting providersToUnlink to include 'phone', then we'll reject that. Though Expand Down
if (id == "phone" && properties.containsKey("phoneNumber") if ("phone".equals(id) && properties.containsKey("phoneNumber") && properties.get("phoneNumber") == null) { // If we've been told to unlink the phone provider both via setting phoneNumber to null // *and* by setting providersToUnlink to include 'phone', then we'll reject that. Though Expand Down