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

Side by Side Diff: pkg/analyzer/lib/src/generated/ast.dart

Issue 685993004: Clean up logging uses (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.ast; 8 library engine.ast;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 String message; 794 String message;
795 if (leftHandSide == null) { 795 if (leftHandSide == null) {
796 if (rightHandSide == null) { 796 if (rightHandSide == null) {
797 message = "Both the left-hand and right-hand sides are null"; 797 message = "Both the left-hand and right-hand sides are null";
798 } else { 798 } else {
799 message = "The left-hand size is null"; 799 message = "The left-hand size is null";
800 } 800 }
801 } else { 801 } else {
802 message = "The right-hand size is null"; 802 message = "The right-hand size is null";
803 } 803 }
804 AnalysisEngine.instance.logger.logError2(message, new JavaException(messag e)); 804 AnalysisEngine.instance.logger.logError(
805 message,
806 new CaughtException(new AnalysisException(message), null));
805 } 807 }
806 this._leftHandSide = becomeParentOf(leftHandSide); 808 this._leftHandSide = becomeParentOf(leftHandSide);
807 this._rightHandSide = becomeParentOf(rightHandSide); 809 this._rightHandSide = becomeParentOf(rightHandSide);
808 } 810 }
809 811
810 @override 812 @override
811 accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this); 813 accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this);
812 814
813 @override 815 @override
814 Token get beginToken => _leftHandSide.beginToken; 816 Token get beginToken => _leftHandSide.beginToken;
(...skipping 11621 matching lines...) Expand 10 before | Expand all | Expand 10 after
12436 * @return the element that was found 12438 * @return the element that was found
12437 */ 12439 */
12438 AstNode searchWithin(AstNode node) { 12440 AstNode searchWithin(AstNode node) {
12439 if (node == null) { 12441 if (node == null) {
12440 return null; 12442 return null;
12441 } 12443 }
12442 try { 12444 try {
12443 node.accept(this); 12445 node.accept(this);
12444 } on NodeLocator_NodeFoundException catch (exception) { 12446 } on NodeLocator_NodeFoundException catch (exception) {
12445 // A node with the right source position was found. 12447 // A node with the right source position was found.
12446 } catch (exception) { 12448 } catch (exception, stackTrace) {
12447 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset ($_startOffset - $_endOffset)", exception); 12449 AnalysisEngine.instance.logger.logInformation(
12450 "Unable to locate element at offset ($_startOffset - $_endOffset)",
12451 new CaughtException(exception, stackTrace));
12448 return null; 12452 return null;
12449 } 12453 }
12450 return _foundNode; 12454 return _foundNode;
12451 } 12455 }
12452 12456
12453 @override 12457 @override
12454 Object visitNode(AstNode node) { 12458 Object visitNode(AstNode node) {
12455 int start = node.offset; 12459 int start = node.offset;
12456 int end = start + node.length; 12460 int end = start + node.length;
12457 if (end < _startOffset) { 12461 if (end < _startOffset) {
12458 return null; 12462 return null;
12459 } 12463 }
12460 if (start > _endOffset) { 12464 if (start > _endOffset) {
12461 return null; 12465 return null;
12462 } 12466 }
12463 try { 12467 try {
12464 node.visitChildren(this); 12468 node.visitChildren(this);
12465 } on NodeLocator_NodeFoundException catch (exception) { 12469 } on NodeLocator_NodeFoundException catch (exception) {
12466 throw exception; 12470 rethrow;
12467 } catch (exception) { 12471 } catch (exception, stackTrace) {
12468 // Ignore the exception and proceed in order to visit the rest of the stru cture. 12472 // Ignore the exception and proceed in order to visit the rest of the stru cture.
12469 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra versing an AST structure.", exception); 12473 AnalysisEngine.instance.logger.logInformation(
12474 "Exception caught while traversing an AST structure.",
12475 new CaughtException(exception, stackTrace));
12470 } 12476 }
12471 if (start <= _startOffset && _endOffset <= end) { 12477 if (start <= _startOffset && _endOffset <= end) {
12472 _foundNode = node; 12478 _foundNode = node;
12473 throw new NodeLocator_NodeFoundException(); 12479 throw new NodeLocator_NodeFoundException();
12474 } 12480 }
12475 return null; 12481 return null;
12476 } 12482 }
12477 } 12483 }
12478 12484
12479 /** 12485 /**
(...skipping 3965 matching lines...) Expand 10 before | Expand all | Expand 10 after
16445 * Return the given element if it is valid, or report the problem and return ` null` if it is 16451 * Return the given element if it is valid, or report the problem and return ` null` if it is
16446 * not appropriate. 16452 * not appropriate.
16447 * 16453 *
16448 * @param parent the parent of the element, used for reporting when there is a problem 16454 * @param parent the parent of the element, used for reporting when there is a problem
16449 * @param isValid `true` if the element is appropriate 16455 * @param isValid `true` if the element is appropriate
16450 * @param element the element to be associated with this identifier 16456 * @param element the element to be associated with this identifier
16451 * @return the element to be associated with this identifier 16457 * @return the element to be associated with this identifier
16452 */ 16458 */
16453 Element _returnOrReportElement(AstNode parent, bool isValid, Element element) { 16459 Element _returnOrReportElement(AstNode parent, bool isValid, Element element) {
16454 if (!isValid) { 16460 if (!isValid) {
16455 AnalysisEngine.instance.logger.logInformation2("Internal error: attempting to set the name of a ${parent.runtimeType} to a ${element.runtimeType}", new Ja vaException()); 16461 AnalysisEngine.instance.logger.logInformation(
16462 "Internal error: attempting to set the name of a ${parent.runtimeType} to a ${element.runtimeType}",
16463 new CaughtException(new AnalysisException(), null));
16456 return null; 16464 return null;
16457 } 16465 }
16458 return element; 16466 return element;
16459 } 16467 }
16460 16468
16461 /** 16469 /**
16462 * Return the given element if it is an appropriate element based on the paren t of this 16470 * Return the given element if it is an appropriate element based on the paren t of this
16463 * identifier, or `null` if it is not appropriate. 16471 * identifier, or `null` if it is not appropriate.
16464 * 16472 *
16465 * @param element the element to be associated with this identifier 16473 * @param element the element to be associated with this identifier
(...skipping 3779 matching lines...) Expand 10 before | Expand all | Expand 10 after
20245 _elements[index] = node; 20253 _elements[index] = node;
20246 } 20254 }
20247 void clear() { 20255 void clear() {
20248 _elements = <E> []; 20256 _elements = <E> [];
20249 } 20257 }
20250 int get length => _elements.length; 20258 int get length => _elements.length;
20251 void set length(int value) { 20259 void set length(int value) {
20252 throw new UnsupportedError("Cannot resize NodeList."); 20260 throw new UnsupportedError("Cannot resize NodeList.");
20253 } 20261 }
20254 } 20262 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/services/index/store/split_store_test.dart ('k') | pkg/analyzer/lib/src/generated/element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698