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

Side by Side Diff: pkg/analysis_server/lib/src/computer/computer_overrides.dart

Issue 1151573011: Issue 23332. Don't compute overrides for static members. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/notification_overrides_test.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 computer.overrides; 5 library computer.overrides;
6 6
7 import 'package:analysis_server/src/collections.dart'; 7 import 'package:analysis_server/src/collections.dart';
8 import 'package:analysis_server/src/protocol_server.dart'; 8 import 'package:analysis_server/src/protocol_server.dart';
9 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/element.dart' as engine; 10 import 'package:analyzer/src/generated/element.dart' as engine;
(...skipping 11 matching lines...) Expand all
22 22
23 /** 23 /**
24 * Returns the computed occurrences, not `null`. 24 * Returns the computed occurrences, not `null`.
25 */ 25 */
26 List<Override> compute() { 26 List<Override> compute() {
27 for (CompilationUnitMember unitMember in _unit.declarations) { 27 for (CompilationUnitMember unitMember in _unit.declarations) {
28 if (unitMember is ClassDeclaration) { 28 if (unitMember is ClassDeclaration) {
29 _currentClass = unitMember.element; 29 _currentClass = unitMember.element;
30 for (ClassMember classMember in unitMember.members) { 30 for (ClassMember classMember in unitMember.members) {
31 if (classMember is MethodDeclaration) { 31 if (classMember is MethodDeclaration) {
32 if (classMember.isStatic) {
33 continue;
34 }
32 SimpleIdentifier nameNode = classMember.name; 35 SimpleIdentifier nameNode = classMember.name;
33 _addOverride(nameNode.offset, nameNode.length, nameNode.name); 36 _addOverride(nameNode.offset, nameNode.length, nameNode.name);
34 } 37 }
35 if (classMember is FieldDeclaration) { 38 if (classMember is FieldDeclaration) {
39 if (classMember.isStatic) {
40 continue;
41 }
36 List<VariableDeclaration> fields = classMember.fields.variables; 42 List<VariableDeclaration> fields = classMember.fields.variables;
37 for (VariableDeclaration field in fields) { 43 for (VariableDeclaration field in fields) {
38 SimpleIdentifier nameNode = field.name; 44 SimpleIdentifier nameNode = field.name;
39 _addOverride(nameNode.offset, nameNode.length, nameNode.name); 45 _addOverride(nameNode.offset, nameNode.length, nameNode.name);
40 } 46 }
41 } 47 }
42 } 48 }
43 } 49 }
44 } 50 }
45 return _overrides; 51 return _overrides;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 120 }
115 // setter 121 // setter
116 member = classElement.lookUpSetter(name + '=', library); 122 member = classElement.lookUpSetter(name + '=', library);
117 if (member != null) { 123 if (member != null) {
118 return member; 124 return member;
119 } 125 }
120 // not found 126 // not found
121 return null; 127 return null;
122 } 128 }
123 } 129 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/notification_overrides_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698