File tree 4 files changed +0
-45
lines changed
main/java/com/google/protobuf
test/java/com/google/protobuf
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(
109
109
"Detected incompatible Protobuf Gencode/Runtime versions when loading %s: gencode %s,"
110
110
+ " runtime %s. Runtime version cannot be older than the linked gencode version." ,
111
111
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 ));
118
112
}
119
113
120
114
// 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() {
146
146
+ " testing.Foo" );
147
147
}
148
148
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
-
166
149
@ Test
167
150
public void versionValidation_gencodeOneMajorVersionOlderWarning () {
168
151
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):
118
118
'foo.proto' ,
119
119
)
120
120
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
-
137
121
def test_gencode_one_major_version_older_warning (self ):
138
122
with self .assertWarnsRegex (
139
123
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(
108
108
f' { location } : gencode { gen_version } runtime { version } . Runtime version'
109
109
f' cannot be older than the linked gencode version. { error_prompt } '
110
110
)
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
- )
117
111
118
112
if gen_suffix != SUFFIX :
119
113
_ReportVersionError (
You can’t perform that action at this time.
0 commit comments