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

Unified Diff: lib/generated_message.dart

Issue 106663007: When clearing a field make the field state "does not exist" (Closed) Base URL: https://github.com/dart-lang/dart-protobuf.git@master
Patch Set: Created 7 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
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/generated_message.dart
diff --git a/lib/generated_message.dart b/lib/generated_message.dart
index 538fdfd9df540ae2e09eb329d81173f645ad19a5..cf28f3014c5f2ba119c775cd711d1c67dbcdf029 100644
--- a/lib/generated_message.dart
+++ b/lib/generated_message.dart
@@ -874,18 +874,6 @@ abstract class GeneratedMessage {
void clearField(int tagNumber) {
_fieldValues.remove(tagNumber);
- // Restore the default value for the field.
- // For repeated fields, the default is an empty list.
- // For required/optional fields, the BuilderInfo contains the initializer.
- int fieldType = _getFieldType(tagNumber);
- if ((fieldType & _REPEATED_BIT) != 0) {
- _fieldValues[tagNumber] = new PbList();
- } else {
- var defaultValue = info_.defaultValue(tagNumber);
- if (defaultValue != null) {
- _fieldValues[tagNumber] = defaultValue;
- }
- }
}
bool extensionsAreInitialized() {
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698