- copyFooData() shall always check if both source and target are not the same
Signed-off-by: Roland Häder <roland@mxchange.org>
} 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
} 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
} 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