File tree Expand file tree Collapse file tree 4 files changed +0
-45
lines changed
main/java/com/google/protobuf
test/java/com/google/protobuf Expand file tree Collapse file tree 4 files changed +0
-45
lines changed Original file line number Diff line number Diff line change @@ -109,12 +109,6 @@ private static void validateProtobufGencodeVersionImpl(
109109 "Detected incompatible Protobuf Gencode/Runtime versions when loading %s: gencode %s,"
110110 + " runtime %s. Runtime version cannot be older than the linked gencode version." ,
111111 location , gencodeVersionString , VERSION_STRING ));
112- } else if (MINOR > minor || PATCH > patch ) {
113- logger .warning (
114- String .format (
115- " Protobuf gencode version %s is older than the runtime version %s at %s. Please"
116- + " avoid checked-in Protobuf gencode that can be obsolete." ,
117- gencodeVersionString , VERSION_STRING , location ));
118112 }
119113
120114 // Check that runtime version suffix is the same as the gencode version suffix.
Original file line number Diff line number Diff line change @@ -146,23 +146,6 @@ public void versionValidation_differentVesionSuffixDisallowed() {
146146 + " testing.Foo" );
147147 }
148148
149- @ Test
150- public void versionValidation_warnOlderGencodeVersion () {
151- TestUtil .TestLogHandler logHandler = new TestUtil .TestLogHandler ();
152- Logger logger = Logger .getLogger (RuntimeVersion .class .getName ());
153- logger .addHandler (logHandler );
154- RuntimeVersion .validateProtobufGencodeVersion (
155- RuntimeVersion .DOMAIN ,
156- RuntimeVersion .MAJOR ,
157- RuntimeVersion .MINOR - 1 ,
158- RuntimeVersion .PATCH ,
159- RuntimeVersion .SUFFIX ,
160- "dummy" );
161- assertThat (logHandler .getStoredLogRecords ()).hasSize (1 );
162- assertThat (logHandler .getStoredLogRecords ().get (0 ).getMessage ())
163- .contains ("Please avoid checked-in Protobuf gencode that can be obsolete." );
164- }
165-
166149 @ Test
167150 public void versionValidation_gencodeOneMajorVersionOlderWarning () {
168151 TestUtil .TestLogHandler logHandler = new TestUtil .TestLogHandler ();
Original file line number Diff line number Diff line change @@ -118,22 +118,6 @@ def test_different_suffix_disallowed(self):
118118 'foo.proto' ,
119119 )
120120
121- def test_gencode_older_than_runtime_version_warning (self ):
122- with self .assertWarnsRegex (
123- Warning ,
124- expected_regex = (
125- 'Please avoid checked-in Protobuf gencode that can be obsolete.'
126- ),
127- ):
128- runtime_version .ValidateProtobufRuntimeVersion (
129- runtime_version .DOMAIN ,
130- runtime_version .MAJOR ,
131- runtime_version .MINOR - 1 ,
132- runtime_version .PATCH ,
133- runtime_version .SUFFIX ,
134- 'foo.proto' ,
135- )
136-
137121 def test_gencode_one_major_version_older_warning (self ):
138122 with self .assertWarnsRegex (
139123 Warning , expected_regex = 'is exactly one major version older'
Original file line number Diff line number Diff line change @@ -108,12 +108,6 @@ def ValidateProtobufRuntimeVersion(
108108 f' { location } : gencode { gen_version } runtime { version } . Runtime version'
109109 f' cannot be older than the linked gencode version. { error_prompt } '
110110 )
111- elif MINOR > gen_minor or PATCH > gen_patch :
112- warnings .warn (
113- 'Protobuf gencode version %s is older than the runtime version %s at'
114- ' %s. Please avoid checked-in Protobuf gencode that can be obsolete.'
115- % (gen_version , version , location )
116- )
117111
118112 if gen_suffix != SUFFIX :
119113 _ReportVersionError (
You can’t perform that action at this time.
0 commit comments