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

Side by Side Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1426943005: Fix null pointer (issue 24790) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/analyzer/test/src/context/context_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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 analyzer.src.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/instrumentation/instrumentation.dart'; 10 import 'package:analyzer/instrumentation/instrumentation.dart';
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 if (sources != null) { 1041 if (sources != null) {
1042 for (Source source in sources) { 1042 for (Source source in sources) {
1043 getCacheEntry(source).setState(HINTS, CacheState.INVALID); 1043 getCacheEntry(source).setState(HINTS, CacheState.INVALID);
1044 } 1044 }
1045 } 1045 }
1046 } 1046 }
1047 1047
1048 @override 1048 @override
1049 bool isClientLibrary(Source librarySource) { 1049 bool isClientLibrary(Source librarySource) {
1050 CacheEntry entry = _cache.get(librarySource); 1050 CacheEntry entry = _cache.get(librarySource);
1051 return _referencesDartHtml(librarySource) && entry.getValue(IS_LAUNCHABLE); 1051 return entry != null &&
1052 _referencesDartHtml(librarySource) &&
1053 entry.getValue(IS_LAUNCHABLE);
1052 } 1054 }
1053 1055
1054 @override 1056 @override
1055 bool isServerLibrary(Source librarySource) { 1057 bool isServerLibrary(Source librarySource) {
1056 CacheEntry entry = _cache.get(librarySource); 1058 CacheEntry entry = _cache.get(librarySource);
1057 return !_referencesDartHtml(librarySource) && entry.getValue(IS_LAUNCHABLE); 1059 return entry != null &&
1060 !_referencesDartHtml(librarySource) &&
1061 entry.getValue(IS_LAUNCHABLE);
1058 } 1062 }
1059 1063
1060 @override 1064 @override
1061 Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor) { 1065 Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor) {
1062 return driver.onResultComputed(descriptor); 1066 return driver.onResultComputed(descriptor);
1063 } 1067 }
1064 1068
1065 @override 1069 @override
1066 CompilationUnit parseCompilationUnit(Source source) { 1070 CompilationUnit parseCompilationUnit(Source source) {
1067 if (!AnalysisEngine.isDartFileName(source.shortName)) { 1071 if (!AnalysisEngine.isDartFileName(source.shortName)) {
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after
2135 DartSdk sdk = factory.dartSdk; 2139 DartSdk sdk = factory.dartSdk;
2136 if (sdk == null) { 2140 if (sdk == null) {
2137 throw new IllegalArgumentException( 2141 throw new IllegalArgumentException(
2138 "The source factory for an SDK analysis context must have a DartUriRes olver"); 2142 "The source factory for an SDK analysis context must have a DartUriRes olver");
2139 } 2143 }
2140 return new AnalysisCache(<CachePartition>[ 2144 return new AnalysisCache(<CachePartition>[
2141 AnalysisEngine.instance.partitionManager_new.forSdk(sdk) 2145 AnalysisEngine.instance.partitionManager_new.forSdk(sdk)
2142 ]); 2146 ]);
2143 } 2147 }
2144 } 2148 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698