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

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

Issue 498763003: Initial 'Extract Method' refactoring implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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
Index: pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart b/pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart
index d83ea87486a3fe7e8af766306417ae4613cbc315..f73f73204f41ed80d9d7ab318a028b975b68e23f 100644
--- a/pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart
+++ b/pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart
@@ -51,16 +51,9 @@ class StatementAnalyzer extends SelectionAnalyzer {
RefactoringStatus get status => _status;
/**
- * Records fatal error with given message.
- */
- void invalidSelection(String message) {
- invalidSelection2(message, null);
- }
-
- /**
* Records fatal error with given message and [Location].
*/
- void invalidSelection2(String message, Location context) {
+ void invalidSelection(String message, [Location context]) {
_status.addFatalError(message, context);
reset();
}
@@ -187,8 +180,9 @@ class StatementAnalyzer extends SelectionAnalyzer {
AstNode firstNode = nodes[0];
SourceRange rangeBeforeFirstNode = rangeStartStart(selection, firstNode);
if (_hasTokens(rangeBeforeFirstNode)) {
- invalidSelection2(
- "The beginning of the selection contains characters that do not belong to a statement.",
+ invalidSelection(
+ "The beginning of the selection contains characters that "
+ "do not belong to a statement.",
new Location.fromUnit(unit, rangeBeforeFirstNode));
}
}
@@ -197,8 +191,9 @@ class StatementAnalyzer extends SelectionAnalyzer {
AstNode lastNode = nodes.last;
SourceRange rangeAfterLastNode = rangeEndEnd(lastNode, selection);
if (_hasTokens(rangeAfterLastNode)) {
- invalidSelection2(
- "The end of the selection contains characters that do not belong to a statement.",
+ invalidSelection(
+ "The end of the selection contains characters that "
+ "do not belong to a statement.",
new Location.fromUnit(unit, rangeAfterLastNode));
}
}

Powered by Google App Engine
This is Rietveld 408576698