Skip to content

Conversation

@oetr
Copy link
Contributor

@oetr oetr commented Nov 24, 2025

We forgot about chars in the past!

Not sure if @Positive and @Negative , etc. make sense on chars (the only signed integral in Java? 😆)
@InRange can be used like in the sample fuzz test.

fuzzerTestOneInput(@InRange(min = '\u0000', max = '\uFFFF') char data) {


@Override
public void write(Character value, DataOutputStream out) throws IOException {
out.writeShort(value);
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, why not use writeChar here for consistency with the readChar call above?

(though DataOutput defines both writeChar and writeShort to be implemented in the same way, so this might not matter)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea behind using writeShort here was sloppy copy & paste. Nice catch, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants