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

Unified Diff: pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Issue 1764743002: Ignore not ClassDeclaration target of an unknown method invocation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/correction/fix_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index dc66c4507cf10a21a13bc34615905fef6e3bb430..a33d280fe75cd346087c593f82cef1cadc3ab2d0 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -1990,13 +1990,17 @@ class FixProcessor {
}
ClassElement targetClassElement = targetType.element as ClassElement;
targetElement = targetClassElement;
- // may be static
+ // prepare target ClassDeclaration
+ AstNode targetTypeNode = getParsedClassElementNode(targetClassElement);
+ if (targetTypeNode is! ClassDeclaration) {
+ return;
+ }
+ ClassDeclaration targetClassNode = targetTypeNode;
+ // maybe static
if (target is Identifier) {
staticModifier = target.bestElement.kind == ElementKind.CLASS;
}
// prepare insert offset
- ClassDeclaration targetClassNode =
- getParsedClassElementNode(targetClassElement);
prefix = ' ';
insertOffset = targetClassNode.end - 1;
if (targetClassNode.members.isEmpty) {
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698