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

Default message value for proto3 Java is null? #1718

Closed
biran0079 opened this issue Jun 27, 2016 · 2 comments
Closed

Default message value for proto3 Java is null? #1718

biran0079 opened this issue Jun 27, 2016 · 2 comments

Comments

@biran0079
Copy link

From this doc and #359, default value for message field is null, while from the generated code, it seems the DEFAULT_INSTANCE of the message is returned, which is not null.

It seems to me that proto3 for java is not implemented correctly?

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jun 27, 2016

The doc is wrong. The default value for message fields is implementation dependent and in most implementations it's the default instance.

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jul 22, 2016

The documentation has been updated.

@xfxyjwf xfxyjwf closed this as completed Jul 22, 2016
adellahlou pushed a commit to adellahlou/protobuf that referenced this issue Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants