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

Side by Side Diff: pkg/analysis_server/lib/src/generated_protocol.dart

Issue 496113002: Make RefactoringProblem.location optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // This file has been automatically generated. Please do not edit it manually. 5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script 6 // To regenerate the file, use the script
7 // "pkg/analysis_server/spec/generate_files". 7 // "pkg/analysis_server/spec/generate_files".
8 8
9 part of protocol2; 9 part of protocol2;
10 10
(...skipping 7434 matching lines...) Expand 10 before | Expand all | Expand 10 after
7445 7445
7446 String toJson() => name; 7446 String toJson() => name;
7447 } 7447 }
7448 7448
7449 /** 7449 /**
7450 * RefactoringProblem 7450 * RefactoringProblem
7451 * 7451 *
7452 * { 7452 * {
7453 * "severity": RefactoringProblemSeverity 7453 * "severity": RefactoringProblemSeverity
7454 * "message": String 7454 * "message": String
7455 * "location": Location 7455 * "location": optional Location
7456 * } 7456 * }
7457 */ 7457 */
7458 class RefactoringProblem implements HasToJson { 7458 class RefactoringProblem implements HasToJson {
7459 /** 7459 /**
7460 * The severity of the problem being represented. 7460 * The severity of the problem being represented.
7461 */ 7461 */
7462 RefactoringProblemSeverity severity; 7462 RefactoringProblemSeverity severity;
7463 7463
7464 /** 7464 /**
7465 * A human-readable description of the problem being represented. 7465 * A human-readable description of the problem being represented.
7466 */ 7466 */
7467 String message; 7467 String message;
7468 7468
7469 /** 7469 /**
7470 * The location of the problem being represented. 7470 * The location of the problem being represented. This field is omitted
7471 * unless there is a specific location associated with the problem (such as a
7472 * location where an element being renamed will be shadowed).
7471 */ 7473 */
7472 Location location; 7474 Location location;
7473 7475
7474 RefactoringProblem(this.severity, this.message, this.location); 7476 RefactoringProblem(this.severity, this.message, {this.location});
7475 7477
7476 factory RefactoringProblem.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) { 7478 factory RefactoringProblem.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
7477 if (json == null) { 7479 if (json == null) {
7478 json = {}; 7480 json = {};
7479 } 7481 }
7480 if (json is Map) { 7482 if (json is Map) {
7481 RefactoringProblemSeverity severity; 7483 RefactoringProblemSeverity severity;
7482 if (json.containsKey("severity")) { 7484 if (json.containsKey("severity")) {
7483 severity = new RefactoringProblemSeverity.fromJson(jsonDecoder, jsonPath + ".severity", json["severity"]); 7485 severity = new RefactoringProblemSeverity.fromJson(jsonDecoder, jsonPath + ".severity", json["severity"]);
7484 } else { 7486 } else {
7485 throw jsonDecoder.missingKey(jsonPath, "severity"); 7487 throw jsonDecoder.missingKey(jsonPath, "severity");
7486 } 7488 }
7487 String message; 7489 String message;
7488 if (json.containsKey("message")) { 7490 if (json.containsKey("message")) {
7489 message = jsonDecoder._decodeString(jsonPath + ".message", json["message "]); 7491 message = jsonDecoder._decodeString(jsonPath + ".message", json["message "]);
7490 } else { 7492 } else {
7491 throw jsonDecoder.missingKey(jsonPath, "message"); 7493 throw jsonDecoder.missingKey(jsonPath, "message");
7492 } 7494 }
7493 Location location; 7495 Location location;
7494 if (json.containsKey("location")) { 7496 if (json.containsKey("location")) {
7495 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js on["location"]); 7497 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js on["location"]);
7496 } else {
7497 throw jsonDecoder.missingKey(jsonPath, "location");
7498 } 7498 }
7499 return new RefactoringProblem(severity, message, location); 7499 return new RefactoringProblem(severity, message, location: location);
7500 } else { 7500 } else {
7501 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblem"); 7501 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblem");
7502 } 7502 }
7503 } 7503 }
7504 7504
7505 Map<String, dynamic> toJson() { 7505 Map<String, dynamic> toJson() {
7506 Map<String, dynamic> result = {}; 7506 Map<String, dynamic> result = {};
7507 result["severity"] = severity.toJson(); 7507 result["severity"] = severity.toJson();
7508 result["message"] = message; 7508 result["message"] = message;
7509 result["location"] = location.toJson(); 7509 if (location != null) {
7510 result["location"] = location.toJson();
7511 }
7510 return result; 7512 return result;
7511 } 7513 }
7512 7514
7513 @override 7515 @override
7514 String toString() => JSON.encode(toJson()); 7516 String toString() => JSON.encode(toJson());
7515 7517
7516 @override 7518 @override
7517 bool operator==(other) { 7519 bool operator==(other) {
7518 if (other is RefactoringProblem) { 7520 if (other is RefactoringProblem) {
7519 return severity == other.severity && 7521 return severity == other.severity &&
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
9069 return false; 9071 return false;
9070 } 9072 }
9071 9073
9072 @override 9074 @override
9073 int get hashCode { 9075 int get hashCode {
9074 int hash = 0; 9076 int hash = 0;
9075 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); 9077 hash = _JenkinsSmiHash.combine(hash, newName.hashCode);
9076 return _JenkinsSmiHash.finish(hash); 9078 return _JenkinsSmiHash.finish(hash);
9077 } 9079 }
9078 } 9080 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/test/integration/protocol_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698