Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(873)

Unified Diff: third_party/protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc

Issue 1983203003: Update third_party/protobuf to protobuf-v3.0.0-beta-3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: owners Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc b/third_party/protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc
index ed415eeed9327ee0272f67073038f887941079a4..c22da8d77d4ca62487a3940778d94d615bcae86f 100644
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc
+++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc
@@ -141,7 +141,15 @@ void EnumLiteGenerator::Generate(io::Printer* printer) {
" return value;\n"
"}\n"
"\n"
+ "/**\n"
+ " * @deprecated Use {@link #forNumber(int)} instead.\n"
+ " */\n"
+ "@java.lang.Deprecated\n"
"public static $classname$ valueOf(int value) {\n"
+ " return forNumber(value);\n"
+ "}\n"
+ "\n"
+ "public static $classname$ forNumber(int value) {\n"
" switch (value) {\n",
"classname", descriptor_->name());
printer->Indent();
@@ -169,7 +177,7 @@ void EnumLiteGenerator::Generate(io::Printer* printer) {
" $classname$> internalValueMap =\n"
" new com.google.protobuf.Internal.EnumLiteMap<$classname$>() {\n"
" public $classname$ findValueByNumber(int number) {\n"
- " return $classname$.valueOf(number);\n"
+ " return $classname$.forNumber(number);\n"
" }\n"
" };\n"
"\n",

Powered by Google App Engine
This is Rietveld 408576698