-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[imporve] Adjustment of parameter verification #2635
Conversation
@@ -78,7 +78,7 @@ public class Tag { | |||
accessMode = READ_WRITE) | |||
@Min(0) | |||
@Max(3) | |||
private byte type; | |||
private Byte type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this change cause null data conversion exceptions? when type is null in db, but use the Byte
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this change cause null data conversion exceptions? when type is null in db, but use the
Byte
I think it is ok. Byte
is compatible with null but byte
cannot convert null as a primitive data type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, we need make sure Byte type
can not null, due here will throws a NullPointerException since null cannot be converted to a primitive value.
List<Tag> tags = monitor.getTags().stream().filter(tag -> tag.getType() == (byte) 0).collect(Collectors.toList());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, we need make sure
Byte type
can not null, due here will throws a NullPointerException since null cannot be converted to a primitive value.List<Tag> tags = monitor.getTags().stream().filter(tag -> tag.getType() == (byte) 0).collect(Collectors.toList());
Okay, i will check it.
What's changed?
Checklist
Add or update API