diff options
author | Jisi Liu <liujisi@google.com> | 2017-10-18 15:33:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-18 15:33:31 -0700 |
commit | ca6187d5e76fee30d29d07a2c620421b90244bdd (patch) | |
tree | 2adc1c2bd1ad37c66a9c48ab3b89107c4b46f72e /src/google | |
parent | 3d6cc0e74b788b4a807d3d6d66694609870f37bb (diff) | |
parent | f9b81690f56b8153cbe8b4523ed2b4338c69fd47 (diff) | |
download | protobuf-ca6187d5e76fee30d29d07a2c620421b90244bdd.tar.gz protobuf-ca6187d5e76fee30d29d07a2c620421b90244bdd.tar.bz2 protobuf-ca6187d5e76fee30d29d07a2c620421b90244bdd.zip |
Merge pull request #3578 from pherl/filedeprecation
Add @Deprecated annotation support for proto file.
Diffstat (limited to 'src/google')
-rw-r--r-- | src/google/protobuf/compiler/java/java_file.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/java/java_file.cc b/src/google/protobuf/compiler/java/java_file.cc index 2d5465ba..21133a15 100644 --- a/src/google/protobuf/compiler/java/java_file.cc +++ b/src/google/protobuf/compiler/java/java_file.cc @@ -248,9 +248,12 @@ void FileGenerator::Generate(io::Printer* printer) { PrintGeneratedAnnotation( printer, '$', options_.annotate_code ? classname_ + ".java.pb.meta" : ""); printer->Print( - "public final class $classname$ {\n" + "$deprecation$public final class $classname$ {\n" " private $ctor$() {}\n", - "classname", classname_, "ctor", classname_); + "deprecation", file_->options().deprecated() ? + "@java.lang.Deprecated " : "", + "classname", classname_, + "ctor", classname_); printer->Annotate("classname", file_->name()); printer->Indent(); |