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

Unified Diff: pkg/analysis_server/lib/src/generated_protocol.dart

Issue 625413002: Remove special list behavior in analysis server protocol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months 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 | « pkg/analysis_server/lib/src/edit/edit_domain.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/generated_protocol.dart
diff --git a/pkg/analysis_server/lib/src/generated_protocol.dart b/pkg/analysis_server/lib/src/generated_protocol.dart
index 6a4a19d8ae56a90f1876f40ef1100f27c3224913..e8fc6ddb51186bccceedcc6c68bead12cae4c93e 100644
--- a/pkg/analysis_server/lib/src/generated_protocol.dart
+++ b/pkg/analysis_server/lib/src/generated_protocol.dart
@@ -2798,11 +2798,7 @@ class SearchGetTypeHierarchyResult implements HasToJson {
*/
List<TypeHierarchyItem> hierarchyItems;
- SearchGetTypeHierarchyResult({this.hierarchyItems}) {
- if (hierarchyItems == null) {
- hierarchyItems = <TypeHierarchyItem>[];
- }
- }
+ SearchGetTypeHierarchyResult({this.hierarchyItems});
factory SearchGetTypeHierarchyResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2812,8 +2808,6 @@ class SearchGetTypeHierarchyResult implements HasToJson {
List<TypeHierarchyItem> hierarchyItems;
if (json.containsKey("hierarchyItems")) {
hierarchyItems = jsonDecoder._decodeList(jsonPath + ".hierarchyItems", json["hierarchyItems"], (String jsonPath, Object json) => new TypeHierarchyItem.fromJson(jsonDecoder, jsonPath, json));
- } else {
- hierarchyItems = <TypeHierarchyItem>[];
}
return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems);
} else {
@@ -2828,7 +2822,7 @@ class SearchGetTypeHierarchyResult implements HasToJson {
Map<String, dynamic> toJson() {
Map<String, dynamic> result = {};
- if (hierarchyItems.isNotEmpty) {
+ if (hierarchyItems != null) {
result["hierarchyItems"] = hierarchyItems.map((TypeHierarchyItem value) => value.toJson()).toList();
}
return result;
@@ -3633,11 +3627,7 @@ class EditGetRefactoringResult implements HasToJson {
*/
List<String> potentialEdits;
- EditGetRefactoringResult(this.initialProblems, this.optionsProblems, this.finalProblems, {this.feedback, this.change, this.potentialEdits}) {
- if (potentialEdits == null) {
- potentialEdits = <String>[];
- }
- }
+ EditGetRefactoringResult(this.initialProblems, this.optionsProblems, this.finalProblems, {this.feedback, this.change, this.potentialEdits});
factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3673,8 +3663,6 @@ class EditGetRefactoringResult implements HasToJson {
List<String> potentialEdits;
if (json.containsKey("potentialEdits")) {
potentialEdits = jsonDecoder._decodeList(jsonPath + ".potentialEdits", json["potentialEdits"], jsonDecoder._decodeString);
- } else {
- potentialEdits = <String>[];
}
return new EditGetRefactoringResult(initialProblems, optionsProblems, finalProblems, feedback: feedback, change: change, potentialEdits: potentialEdits);
} else {
@@ -3698,7 +3686,7 @@ class EditGetRefactoringResult implements HasToJson {
if (change != null) {
result["change"] = change.toJson();
}
- if (potentialEdits.isNotEmpty) {
+ if (potentialEdits != null) {
result["potentialEdits"] = potentialEdits;
}
return result;
@@ -4383,11 +4371,7 @@ class ExecutionLaunchDataParams implements HasToJson {
*/
List<String> referencedFiles;
- ExecutionLaunchDataParams(this.file, {this.kind, this.referencedFiles}) {
- if (referencedFiles == null) {
- referencedFiles = <String>[];
- }
- }
+ ExecutionLaunchDataParams(this.file, {this.kind, this.referencedFiles});
factory ExecutionLaunchDataParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4407,8 +4391,6 @@ class ExecutionLaunchDataParams implements HasToJson {
List<String> referencedFiles;
if (json.containsKey("referencedFiles")) {
referencedFiles = jsonDecoder._decodeList(jsonPath + ".referencedFiles", json["referencedFiles"], jsonDecoder._decodeString);
- } else {
- referencedFiles = <String>[];
}
return new ExecutionLaunchDataParams(file, kind: kind, referencedFiles: referencedFiles);
} else {
@@ -4427,7 +4409,7 @@ class ExecutionLaunchDataParams implements HasToJson {
if (kind != null) {
result["kind"] = kind.toJson();
}
- if (referencedFiles.isNotEmpty) {
+ if (referencedFiles != null) {
result["referencedFiles"] = referencedFiles;
}
return result;
@@ -5365,14 +5347,7 @@ class CompletionSuggestion implements HasToJson {
*/
String parameterType;
- CompletionSuggestion(this.kind, this.relevance, this.completion, this.selectionOffset, this.selectionLength, this.isDeprecated, this.isPotential, {this.docSummary, this.docComplete, this.declaringType, this.element, this.returnType, this.parameterNames, this.parameterTypes, this.requiredParameterCount, this.positionalParameterCount, this.parameterName, this.parameterType}) {
- if (parameterNames == null) {
- parameterNames = <String>[];
- }
- if (parameterTypes == null) {
- parameterTypes = <String>[];
- }
- }
+ CompletionSuggestion(this.kind, this.relevance, this.completion, this.selectionOffset, this.selectionLength, this.isDeprecated, this.isPotential, {this.docSummary, this.docComplete, this.declaringType, this.element, this.returnType, this.parameterNames, this.parameterTypes, this.requiredParameterCount, this.positionalParameterCount, this.parameterName, this.parameterType});
factory CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -5444,14 +5419,10 @@ class CompletionSuggestion implements HasToJson {
List<String> parameterNames;
if (json.containsKey("parameterNames")) {
parameterNames = jsonDecoder._decodeList(jsonPath + ".parameterNames", json["parameterNames"], jsonDecoder._decodeString);
- } else {
- parameterNames = <String>[];
}
List<String> parameterTypes;
if (json.containsKey("parameterTypes")) {
parameterTypes = jsonDecoder._decodeList(jsonPath + ".parameterTypes", json["parameterTypes"], jsonDecoder._decodeString);
- } else {
- parameterTypes = <String>[];
}
int requiredParameterCount;
if (json.containsKey("requiredParameterCount")) {
@@ -5499,10 +5470,10 @@ class CompletionSuggestion implements HasToJson {
if (returnType != null) {
result["returnType"] = returnType;
}
- if (parameterNames.isNotEmpty) {
+ if (parameterNames != null) {
result["parameterNames"] = parameterNames;
}
- if (parameterTypes.isNotEmpty) {
+ if (parameterTypes != null) {
result["parameterTypes"] = parameterTypes;
}
if (requiredParameterCount != null) {
@@ -7442,11 +7413,7 @@ class Outline implements HasToJson {
*/
List<Outline> children;
- Outline(this.element, this.offset, this.length, {this.children}) {
- if (children == null) {
- children = <Outline>[];
- }
- }
+ Outline(this.element, this.offset, this.length, {this.children});
factory Outline.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -7474,8 +7441,6 @@ class Outline implements HasToJson {
List<Outline> children;
if (json.containsKey("children")) {
children = jsonDecoder._decodeList(jsonPath + ".children", json["children"], (String jsonPath, Object json) => new Outline.fromJson(jsonDecoder, jsonPath, json));
- } else {
- children = <Outline>[];
}
return new Outline(element, offset, length, children: children);
} else {
@@ -7488,7 +7453,7 @@ class Outline implements HasToJson {
result["element"] = element.toJson();
result["offset"] = offset;
result["length"] = length;
- if (children.isNotEmpty) {
+ if (children != null) {
result["children"] = children.map((Outline value) => value.toJson()).toList();
}
return result;
@@ -7554,11 +7519,7 @@ class Override implements HasToJson {
*/
List<OverriddenMember> interfaceMembers;
- Override(this.offset, this.length, {this.superclassMember, this.interfaceMembers}) {
- if (interfaceMembers == null) {
- interfaceMembers = <OverriddenMember>[];
- }
- }
+ Override(this.offset, this.length, {this.superclassMember, this.interfaceMembers});
factory Override.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -7584,8 +7545,6 @@ class Override implements HasToJson {
List<OverriddenMember> interfaceMembers;
if (json.containsKey("interfaceMembers")) {
interfaceMembers = jsonDecoder._decodeList(jsonPath + ".interfaceMembers", json["interfaceMembers"], (String jsonPath, Object json) => new OverriddenMember.fromJson(jsonDecoder, jsonPath, json));
- } else {
- interfaceMembers = <OverriddenMember>[];
}
return new Override(offset, length, superclassMember: superclassMember, interfaceMembers: interfaceMembers);
} else {
@@ -7600,7 +7559,7 @@ class Override implements HasToJson {
if (superclassMember != null) {
result["superclassMember"] = superclassMember.toJson();
}
- if (interfaceMembers.isNotEmpty) {
+ if (interfaceMembers != null) {
result["interfaceMembers"] = interfaceMembers.map((OverriddenMember value) => value.toJson()).toList();
}
return result;
« no previous file with comments | « pkg/analysis_server/lib/src/edit/edit_domain.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698