| 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;
|
| }
|
|
|