protocolbuffers / protobuf

Protocol Buffers - Google's data interchange format
http://protobuf.dev
Other
65.44k stars 15.46k forks source link

protobuf compiler creates deprecated code #9088

Closed jonathanl-telenav closed 2 years ago

jonathanl-telenav commented 3 years ago

What version of protobuf and what language are you using? Version: proto3, 3.11.4 Language: Java

What operating system (Linux, Windows, ...) and version?

MacOS 11.6

What runtime / compiler are you using (e.g., python version or gcc version)

Java 16

What did you do?

Steps to reproduce the behavior:

  1. Go to https://cl1p.net/microservicegrcpmessage
  2. Examine lines 48 and 49

To reproduce from scratch:

  1. Install https://github.com/Telenav/kivakit by instructions
  2. Switch to branch feature/microservice-grpc
  3. Build with kivakit-build.sh
  4. Examine the generated files in kivakit-extensions/kivakit-microservice/target

What did you expect to see

No warnings when compiling compiled .proto file

What did you see instead?

/Users/jonathan/Workspaces/kivakit-1.1/feature/kivakit-extensions/kivakit-microservice/target/generated-sources/protobuf/java/com/telenav/kivakit/microservice/grpc/MicroserviceGrpcMessage.java:49:59 java: com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner in com.google.protobuf.Descriptors.FileDescriptor has been deprecated

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment

No.

fowles commented 3 years ago

3.11.4 is a very old release. Does this repro on 3.18.1 ?

jonathanl-telenav commented 3 years ago

It seems to. Do you see it with this flag use on the maven compiler plugin?

 <compilerArgument>-Xlint:deprecation</compilerArgument>
deannagarcia commented 2 years ago

I can reproduce this, but it's working as intended. You can see that deprecated method here. We still use it in our code but we deprecated it because other users shouldn't use that. While it would be optimal if we cleaned up our code to not use this deprecated code, I don't see it happening soon as it would require a pretty big rewrite.