if (null == user) {
// Abort here
throw new NullPointerException("user is null"); //NOI18N
- } else if (user.getUserId() instanceof Long) {
+ } else if (user.getUserId() == null) {
// Id is set
- throw new IllegalArgumentException("user.userId is not null"); //NOI18N
+ throw new NullPointerException("user.userId is null"); //NOI18N
+ } else if (user.getUserId() < 1) {
+ // Id is set
+ throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is null", user.getUserId())); //NOI18N
} else if (user.getUserContact() == null) {
// Throw NPE again
throw new NullPointerException("user.userContact is null"); //NOI18N
if (null == user) {
// Abort here
throw new NullPointerException("user is null"); //NOI18N
- } else if (user.getUserId() instanceof Long) {
+ } else if (user.getUserId() == null) {
// Id is set
- throw new IllegalArgumentException("user.userId is not null"); //NOI18N
+ throw new NullPointerException("user.userId is null"); //NOI18N
+ } else if (user.getUserId() < 1) {
+ // Id is set
+ throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is null", user.getUserId())); //NOI18N
} else if (user.getUserContact() == null) {
// Throw NPE again
throw new NullPointerException("user.userContact is null"); //NOI18N