Issue 323 in protobuf: Add SupprrssWarnings to generated Java code

374 views
Skip to first unread message

prot...@googlecode.com

unread,
Aug 19, 2011, 8:18:00 PM8/19/11
to prot...@googlegroups.com
Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 323 by matt...@douglasstribe.com: Add SupprrssWarnings to
generated Java code
http://code.google.com/p/protobuf/issues/detail?id=323

The generated Java code for protocol buffers has many warning if compiled
in a project set to a high warning level. It would be convenient if all
classes generated by protocol buffers were tagged with
@SuppressWarnings(value="all")


prot...@googlecode.com

unread,
Dec 28, 2011, 11:10:44 AM12/28/11
to prot...@googlegroups.com

Comment #1 on issue 323 by jer...@gustie.com: Add SupprrssWarnings to

For Java 6+ targeted code, an @javax.annotation.Generated annotation should
also be added with the date and an identifier (e.g. "com.google.protobuf")
to help static analysis tools identify the generated code.

prot...@googlecode.com

unread,
Nov 23, 2012, 2:56:01 AM11/23/12
to prot...@googlegroups.com

Comment #2 on issue 323 by kalita.d...@gmail.com: Add SupprrssWarnings to
Or maybe if we can marked as generated
like adding some marker annotation
@javax.annotation.Generated (but this is only valid from 1.6+)

prot...@googlecode.com

unread,
Aug 7, 2013, 11:37:57 PM8/7/13
to prot...@googlegroups.com

Comment #3 on issue 323 by geilife...@gmail.com: Add SupprrssWarnings to
how to add @SuppressWarnings(value="all") to java file, auto.....

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

prot...@googlecode.com

unread,
Oct 17, 2013, 2:51:20 PM10/17/13
to prot...@googlegroups.com

Comment #4 on issue 323 by mellowaredev: Add SupprrssWarnings to generated
Java code
http://code.google.com/p/protobuf/issues/detail?id=323

This would be huge. I will end up having to write some post processor to
add this to the code and I would prefer not to.

prot...@googlecode.com

unread,
Dec 19, 2013, 11:12:31 AM12/19/13
to prot...@googlegroups.com

Comment #5 on issue 323 by mellowaredev: Add SupprrssWarnings to generated
Java code
http://code.google.com/p/protobuf/issues/detail?id=323

Preferable something like this...

import javax.annotation.Generated;

@Generated(value="protoc", date="2013-12-19T12:33:56+00:00",
comments="Generated by the Google Protocol Buffer compiler.")
@SuppressWarnings({"PMD", "all"})

prot...@googlecode.com

unread,
Oct 9, 2014, 9:27:15 PM10/9/14
to prot...@googlegroups.com
Updates:
Status: Duplicate
Owner: xiaof...@google.com

Comment #6 on issue 323 by xiaof...@google.com: Add SupprrssWarnings to
generated Java code
https://code.google.com/p/protobuf/issues/detail?id=323

Using the annotation "javax.annotation.Generated" seems to be the right
approach. There is a duplicate issue on github:
https://github.com/google/protobuf/issues/42
Reply all
Reply to author
Forward
0 new messages