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

Side by Side Diff: pkg/analysis_server/lib/src/services/refactoring/inline_method.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 | « pkg/analysis_server/lib/src/services/correction/util.dart ('k') | no next file » | 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.refactoring.inline_method; 5 library services.src.refactoring.inline_method;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart' hide Element; 9 import 'package:analysis_server/src/protocol.dart' hide Element;
10 import 'package:analysis_server/src/services/correction/source_range.dart'; 10 import 'package:analysis_server/src/services/correction/source_range.dart';
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 SourceRange nodeRange = rangeNode(node); 756 SourceRange nodeRange = rangeNode(node);
757 if (bodyRange.covers(nodeRange)) { 757 if (bodyRange.covers(nodeRange)) {
758 _addInstanceFieldQualifier(node); 758 _addInstanceFieldQualifier(node);
759 _addParameter(node); 759 _addParameter(node);
760 _addVariable(node); 760 _addVariable(node);
761 } 761 }
762 } 762 }
763 763
764 void _addInstanceFieldQualifier(SimpleIdentifier node) { 764 void _addInstanceFieldQualifier(SimpleIdentifier node) {
765 PropertyAccessorElement accessor = getPropertyAccessorElement(node); 765 PropertyAccessorElement accessor = getPropertyAccessorElement(node);
766 if (isClassFieldAccessorElement(accessor)) { 766 if (isFieldAccessorElement(accessor)) {
767 AstNode qualifier = getNodeQualifier(node); 767 AstNode qualifier = getNodeQualifier(node);
768 if (qualifier == null || qualifier is ThisExpression) { 768 if (qualifier == null || qualifier is ThisExpression) {
769 if (accessor.isStatic) { 769 if (accessor.isStatic) {
770 String className = accessor.enclosingElement.displayName; 770 String className = accessor.enclosingElement.displayName;
771 if (qualifier == null) { 771 if (qualifier == null) {
772 SourceRange qualifierRange = rangeStartLength(node, 0); 772 SourceRange qualifierRange = rangeStartLength(node, 0);
773 result.addStaticFieldQualifier(className, qualifierRange); 773 result.addStaticFieldQualifier(className, qualifierRange);
774 } 774 }
775 } else { 775 } else {
776 SourceRange qualifierRange; 776 SourceRange qualifierRange;
(...skipping 28 matching lines...) Expand all
805 } 805 }
806 806
807 void _addVariable(SimpleIdentifier node) { 807 void _addVariable(SimpleIdentifier node) {
808 VariableElement variableElement = getLocalVariableElement(node); 808 VariableElement variableElement = getLocalVariableElement(node);
809 if (variableElement != null) { 809 if (variableElement != null) {
810 SourceRange nodeRange = rangeNode(node); 810 SourceRange nodeRange = rangeNode(node);
811 result.addVariable(variableElement, nodeRange); 811 result.addVariable(variableElement, nodeRange);
812 } 812 }
813 } 813 }
814 } 814 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698