]> git.mxchange.org Git - jphone-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 14:52:18 +0000 (16:52 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 14:52:18 +0000 (16:52 +0200)
- copyFooData() shall always check if both source and target are not the same

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jphone/model/phonenumbers/fax/FaxNumbers.java
src/org/mxchange/jphone/model/phonenumbers/landline/LandLineNumbers.java
src/org/mxchange/jphone/model/phonenumbers/mobile/MobileNumbers.java

index 28347fa117b3c0527e7da8233281eba1146ff98f..7ad2b88e82dfe82d31442b480bb8d40d2788bf95 100644 (file)
@@ -45,6 +45,9 @@ public class FaxNumbers implements Serializable {
                } else if (null == targetNumber) {
                        // Throw NPE
                        throw new NullPointerException("targetNumber is null"); //NOI18N
+               } else if (Objects.equals(sourceNumber, targetNumber)) {
+                       // Is exactly the same!
+                       throw new IllegalArgumentException("sourcerNumber and targetNumber are the same."); //NOI18N
                }
 
                // Copy all
index bc92e5cda2dc01b0efa6f9c5ac1e43ee5d4f4647..46abe5cd314409bd1d5f9294d9c00002d421366a 100644 (file)
@@ -45,6 +45,9 @@ public class LandLineNumbers implements Serializable {
                } else if (null == targetNumber) {
                        // Throw NPE
                        throw new NullPointerException("targetNumber is null"); //NOI18N
+               } else if (Objects.equals(sourceNumber, targetNumber)) {
+                       // Is exactly the same!
+                       throw new IllegalArgumentException("sourcerNumber and targetNumber are the same."); //NOI18N
                }
 
                // Copy all
index b6c0d5b2ca8e9249fc11bda2599c91ddc8ed13b7..da76d4075fb86ac2d00d389f03f09da60cbf5103 100644 (file)
@@ -45,6 +45,9 @@ public class MobileNumbers implements Serializable {
                } else if (null == targetNumber) {
                        // Throw NPE
                        throw new NullPointerException("targetNumber is null"); //NOI18N
+               } else if (Objects.equals(sourceNumber, targetNumber)) {
+                       // Is exactly the same!
+                       throw new IllegalArgumentException("sourcerNumber and targetNumber are the same."); //NOI18N
                }
 
                // Copy all fields