Skip to content
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

Merged
merged 5 commits into from
Aug 29, 2024

Conversation

MRgenial
Copy link
Contributor

What's changed?

  • Modify the vaild parameter
  • Modify relevant unit tests
  • Simplify the controller

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

@Calvin979 Calvin979 merged commit 89be682 into apache:master Aug 29, 2024
3 checks passed
@@ -78,7 +78,7 @@ public class Tag {
accessMode = READ_WRITE)
@Min(0)
@Max(3)
private byte type;
private Byte type;
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok 👍

Copy link
Contributor

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());

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants