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

Side by Side Diff: pkg/analyzer_experimental/lib/src/generated/sdk_io.dart

Issue 16611004: Improve java2dart code style - relax 'don't reference variable name in its initializer'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 library engine.sdk.io; 3 library engine.sdk.io;
4 import 'dart:io'; 4 import 'dart:io';
5 import 'java_core.dart'; 5 import 'java_core.dart';
6 import 'java_io.dart'; 6 import 'java_io.dart';
7 import 'java_engine.dart'; 7 import 'java_engine.dart';
8 import 'java_engine_io.dart'; 8 import 'java_engine_io.dart';
9 import 'source_io.dart'; 9 import 'source_io.dart';
10 import 'error.dart'; 10 import 'error.dart';
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 /** 166 /**
167 * Initialize a newly created SDK to represent the Dart SDK installed in the g iven directory. 167 * Initialize a newly created SDK to represent the Dart SDK installed in the g iven directory.
168 * @param sdkDirectory the directory containing the SDK 168 * @param sdkDirectory the directory containing the SDK
169 */ 169 */
170 DirectoryBasedDartSdk(JavaFile sdkDirectory) { 170 DirectoryBasedDartSdk(JavaFile sdkDirectory) {
171 this._sdkDirectory = sdkDirectory.getAbsoluteFile(); 171 this._sdkDirectory = sdkDirectory.getAbsoluteFile();
172 initializeSdk(); 172 initializeSdk();
173 initializeLibraryMap(); 173 initializeLibraryMap();
174 _analysisContext = new AnalysisContextImpl(); 174 _analysisContext = new AnalysisContextImpl();
175 _analysisContext.sourceFactory = new SourceFactory.con2([new DartUriResolver (this)]); 175 _analysisContext.sourceFactory = new SourceFactory.con2([new DartUriResolver (this)]);
176 List<String> uris2 = uris; 176 List<String> uris = this.uris;
177 ChangeSet changeSet = new ChangeSet(); 177 ChangeSet changeSet = new ChangeSet();
178 for (String uri in uris2) { 178 for (String uri in uris) {
179 changeSet.added(_analysisContext.sourceFactory.forUri(uri)); 179 changeSet.added(_analysisContext.sourceFactory.forUri(uri));
180 } 180 }
181 _analysisContext.applyChanges(changeSet); 181 _analysisContext.applyChanges(changeSet);
182 } 182 }
183 Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri) => new F ileBasedSource.con2(contentCache, new JavaFile.fromUri(uri), kind); 183 Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri) => new F ileBasedSource.con2(contentCache, new JavaFile.fromUri(uri), kind);
184 AnalysisContext get context => _analysisContext; 184 AnalysisContext get context => _analysisContext;
185 185
186 /** 186 /**
187 * Return the file containing the Dartium executable, or {@code null} if it do es not exist. 187 * Return the file containing the Dartium executable, or {@code null} if it do es not exist.
188 * @return the file containing the Dartium executable 188 * @return the file containing the Dartium executable
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 LibraryMap _librariesMap = new LibraryMap(); 450 LibraryMap _librariesMap = new LibraryMap();
451 451
452 /** 452 /**
453 * Return the library map that was populated by visiting the AST structure par sed from the 453 * Return the library map that was populated by visiting the AST structure par sed from the
454 * contents of the libraries file. 454 * contents of the libraries file.
455 * @return the library map describing the contents of the SDK 455 * @return the library map describing the contents of the SDK
456 */ 456 */
457 LibraryMap get librariesMap => _librariesMap; 457 LibraryMap get librariesMap => _librariesMap;
458 Object visitMapLiteralEntry(MapLiteralEntry node) { 458 Object visitMapLiteralEntry(MapLiteralEntry node) {
459 String libraryName = null; 459 String libraryName = null;
460 Expression key2 = node.key; 460 Expression key = node.key;
461 if (key2 is SimpleStringLiteral) { 461 if (key is SimpleStringLiteral) {
462 libraryName = "${_LIBRARY_PREFIX}${((key2 as SimpleStringLiteral)).value}" ; 462 libraryName = "${_LIBRARY_PREFIX}${((key as SimpleStringLiteral)).value}";
463 } 463 }
464 Expression value2 = node.value; 464 Expression value = node.value;
465 if (value2 is InstanceCreationExpression) { 465 if (value is InstanceCreationExpression) {
466 SdkLibraryImpl library = new SdkLibraryImpl(libraryName); 466 SdkLibraryImpl library = new SdkLibraryImpl(libraryName);
467 List<Expression> arguments2 = ((value2 as InstanceCreationExpression)).arg umentList.arguments; 467 List<Expression> arguments = ((value as InstanceCreationExpression)).argum entList.arguments;
468 for (Expression argument in arguments2) { 468 for (Expression argument in arguments) {
469 if (argument is SimpleStringLiteral) { 469 if (argument is SimpleStringLiteral) {
470 library.path = ((argument as SimpleStringLiteral)).value; 470 library.path = ((argument as SimpleStringLiteral)).value;
471 } else if (argument is NamedExpression) { 471 } else if (argument is NamedExpression) {
472 String name2 = ((argument as NamedExpression)).name.label.name; 472 String name = ((argument as NamedExpression)).name.label.name;
473 Expression expression2 = ((argument as NamedExpression)).expression; 473 Expression expression = ((argument as NamedExpression)).expression;
474 if (name2 == _CATEGORY) { 474 if (name == _CATEGORY) {
475 library.category = ((expression2 as SimpleStringLiteral)).value; 475 library.category = ((expression as SimpleStringLiteral)).value;
476 } else if (name2 == _IMPLEMENTATION) { 476 } else if (name == _IMPLEMENTATION) {
477 library.implementation = ((expression2 as BooleanLiteral)).value; 477 library.implementation = ((expression as BooleanLiteral)).value;
478 } else if (name2 == _DOCUMENTED) { 478 } else if (name == _DOCUMENTED) {
479 library.documented = ((expression2 as BooleanLiteral)).value; 479 library.documented = ((expression as BooleanLiteral)).value;
480 } else if (name2 == _PLATFORMS) { 480 } else if (name == _PLATFORMS) {
481 if (expression2 is SimpleIdentifier) { 481 if (expression is SimpleIdentifier) {
482 String identifier = ((expression2 as SimpleIdentifier)).name; 482 String identifier = ((expression as SimpleIdentifier)).name;
483 if (identifier == _VM_PLATFORM) { 483 if (identifier == _VM_PLATFORM) {
484 library.setVmLibrary(); 484 library.setVmLibrary();
485 } else { 485 } else {
486 library.setDart2JsLibrary(); 486 library.setDart2JsLibrary();
487 } 487 }
488 } 488 }
489 } 489 }
490 } 490 }
491 } 491 }
492 _librariesMap.setLibrary(libraryName, library); 492 _librariesMap.setLibrary(libraryName, library);
493 } 493 }
494 return null; 494 return null;
495 } 495 }
496 } 496 }
497 class AnalysisErrorListener_9 implements AnalysisErrorListener { 497 class AnalysisErrorListener_9 implements AnalysisErrorListener {
498 List<bool> foundError; 498 List<bool> foundError;
499 AnalysisErrorListener_9(this.foundError); 499 AnalysisErrorListener_9(this.foundError);
500 void onError(AnalysisError error) { 500 void onError(AnalysisError error) {
501 foundError[0] = true; 501 foundError[0] = true;
502 } 502 }
503 } 503 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/scanner.dart ('k') | pkg/analyzer_experimental/lib/src/generated/source_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698