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

Side by Side Diff: pkg/analysis_server/lib/src/services/correction/util.dart

Issue 525993003: Remove excessive check. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/inline_method.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library services.src.correction.util; 5 library services.src.correction.util;
6 6
7 import 'dart:math'; 7 import 'dart:math';
8 8
9 import 'package:analysis_server/src/protocol.dart' show SourceEdit; 9 import 'package:analysis_server/src/protocol.dart' show SourceEdit;
10 import 'package:analysis_server/src/services/correction/source_range.dart'; 10 import 'package:analysis_server/src/services/correction/source_range.dart';
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 * Checks if the given [Element]'s display name equals to the given name. 412 * Checks if the given [Element]'s display name equals to the given name.
413 */ 413 */
414 bool hasDisplayName(Element element, String name) { 414 bool hasDisplayName(Element element, String name) {
415 if (element == null) { 415 if (element == null) {
416 return false; 416 return false;
417 } 417 }
418 return element.displayName == name; 418 return element.displayName == name;
419 } 419 }
420 420
421 /** 421 /**
422 * Checks if the given [PropertyAccessorElement] is an accessor of a class 422 * Checks if the given [PropertyAccessorElement] is an accessor of a
423 * [FieldElement]. 423 * [FieldElement].
424 */ 424 */
425 bool isClassFieldAccessorElement(PropertyAccessorElement accessor) { 425 bool isFieldAccessorElement(PropertyAccessorElement accessor) {
426 return accessor != null && 426 return accessor != null && accessor.variable is FieldElement;
427 accessor.variable is FieldElement &&
428 accessor.variable.enclosingElement is ClassElement;
429 } 427 }
430 428
431 429
432 /** 430 /**
433 * Checks if given [DartNode] is the left hand side of an assignment, or a 431 * Checks if given [DartNode] is the left hand side of an assignment, or a
434 * declaration of a variable. 432 * declaration of a variable.
435 */ 433 */
436 bool isLeftHandOfAssignment(SimpleIdentifier node) { 434 bool isLeftHandOfAssignment(SimpleIdentifier node) {
437 if (node.inSetterContext()) { 435 if (node.inSetterContext()) {
438 return true; 436 return true;
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 1367
1370 @override 1368 @override
1371 Object visitExpression(Expression node) { 1369 Object visitExpression(Expression node) {
1372 if (node is BinaryExpression && node.operator.type == groupOperatorType) { 1370 if (node is BinaryExpression && node.operator.type == groupOperatorType) {
1373 return super.visitNode(node); 1371 return super.visitNode(node);
1374 } 1372 }
1375 operands.add(node); 1373 operands.add(node);
1376 return null; 1374 return null;
1377 } 1375 }
1378 } 1376 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/inline_method.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698