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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/sdk/DirectoryBasedDartSdk.java

Issue 595513003: Version 1.7.0-dev.3.3 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/context/AnalysisContextFactory.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/sdk/DirectoryBasedDartSdk.java
===================================================================
--- editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/sdk/DirectoryBasedDartSdk.java (revision 40542)
+++ editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/sdk/DirectoryBasedDartSdk.java (working copy)
@@ -103,6 +103,12 @@
private LibraryMap libraryMap;
/**
+ * The default SDK, or {@code null} if the default SDK either has not yet been created or cannot
+ * be created for some reason.
+ */
+ private static DirectoryBasedDartSdk DEFAULT_SDK;
+
+ /**
* The name of the directory within the SDK directory that contains executables.
*/
private static final String BIN_DIRECTORY_NAME = "bin"; //$NON-NLS-1$
@@ -212,11 +218,14 @@
* @return the default Dart SDK
*/
public static DirectoryBasedDartSdk getDefaultSdk() {
- File sdkDirectory = getDefaultSdkDirectory();
- if (sdkDirectory == null) {
- return null;
+ if (DEFAULT_SDK == null) {
+ File sdkDirectory = getDefaultSdkDirectory();
+ if (sdkDirectory == null) {
+ return null;
+ }
+ DEFAULT_SDK = new DirectoryBasedDartSdk(sdkDirectory);
}
- return new DirectoryBasedDartSdk(sdkDirectory);
+ return DEFAULT_SDK;
}
/**
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/context/AnalysisContextFactory.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698