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

Unified Diff: third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ForceFieldBuildersPreRun.java

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years 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/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ForceFieldBuildersPreRun.java
diff --git a/third_party/protobuf/js/test2.proto b/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ForceFieldBuildersPreRun.java
similarity index 69%
copy from third_party/protobuf/js/test2.proto
copy to third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ForceFieldBuildersPreRun.java
index 44e55effcb47e983729f41a0b95f3e0f20497c05..6a39500ead486e2749ed1a0c368d9852d6656a4a 100644
--- a/third_party/protobuf/js/test2.proto
+++ b/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ForceFieldBuildersPreRun.java
@@ -1,6 +1,6 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
+// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -28,27 +28,22 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-syntax = "proto2";
+package com.google.protobuf.test;
+import com.google.protobuf.*;
-option java_package = "com.google.apps.jspb.proto";
-option java_multiple_files = true;
+/**
+ * A prerun for a test suite that allows running the full protocol buffer
+ * tests in a mode that disables the optimization for not using
+ * {@link RepeatedFieldBuilder} and {@link SingleFieldBuilder} until they are
+ * requested. This allows us to run all the tests through both code paths
+ * and ensures that both code paths produce identical results.
+ *
+ * @author jonp@google.com (Jon Perlow)
+ */
+public class ForceFieldBuildersPreRun implements Runnable {
-package jspb.test;
-
-message TestExtensionsMessage {
- optional int32 intfield = 1;
- extensions 100 to max;
-}
-
-message ExtensionMessage {
- extend TestExtensionsMessage {
- optional ExtensionMessage ext_field = 100;
+ //@Override (Java 1.6 override semantics, but we must support 1.5)
+ public void run() {
+ // GeneratedMessage.enableAlwaysUseFieldBuildersForTesting();
}
- optional string ext1 = 1;
-}
-
-// Floating extensions are only supported when generating a _lib.js library.
-extend TestExtensionsMessage {
- optional ExtensionMessage floating_msg_field = 101;
- optional string floating_str_field = 102;
}

Powered by Google App Engine
This is Rietveld 408576698