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

Side by Side Diff: pkg/analyzer/lib/src/generated/package.dart

Issue 2577943003: Use AnalysisOptions.signature as a way to check compatibility. (Closed)
Patch Set: Created 4 years 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 | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/sdk.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.generated.package; 5 library analyzer.src.generated.package;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/exception/exception.dart'; 9 import 'package:analyzer/exception/exception.dart';
10 import 'package:analyzer/file_system/file_system.dart'; 10 import 'package:analyzer/file_system/file_system.dart';
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 /** 151 /**
152 * Initialize a newly create package description to describe the package with 152 * Initialize a newly create package description to describe the package with
153 * the given [id] that is being analyzed against the given [sdk] using the 153 * the given [id] that is being analyzed against the given [sdk] using the
154 * given [options]. 154 * given [options].
155 */ 155 */
156 PackageDescription(this.id, this.sdk, this.options); 156 PackageDescription(this.id, this.sdk, this.options);
157 157
158 @override 158 @override
159 int get hashCode { 159 int get hashCode {
160 int hashCode = 0; 160 int hashCode = 0;
161 for (int value in options.encodeCrossContextOptions()) { 161 for (int value in options.signature) {
162 hashCode = JenkinsSmiHash.combine(hashCode, value); 162 hashCode = JenkinsSmiHash.combine(hashCode, value);
163 } 163 }
164 hashCode = JenkinsSmiHash.combine(hashCode, id.hashCode); 164 hashCode = JenkinsSmiHash.combine(hashCode, id.hashCode);
165 hashCode = JenkinsSmiHash.combine(hashCode, sdk.hashCode); 165 hashCode = JenkinsSmiHash.combine(hashCode, sdk.hashCode);
166 return JenkinsSmiHash.finish(hashCode); 166 return JenkinsSmiHash.finish(hashCode);
167 } 167 }
168 168
169 @override 169 @override
170 bool operator ==(Object other) { 170 bool operator ==(Object other) {
171 return other is PackageDescription && 171 return other is PackageDescription &&
172 other.sdk == sdk && 172 other.sdk == sdk &&
173 AnalysisOptions.crossContextOptionsEqual( 173 AnalysisOptions.signaturesEqual(
174 other.options.encodeCrossContextOptions(), 174 other.options.signature, options.signature) &&
175 options.encodeCrossContextOptions()) &&
176 other.id == id; 175 other.id == id;
177 } 176 }
178 } 177 }
179 178
180 /** 179 /**
181 * Manages the contexts in which each package is analyzed. 180 * Manages the contexts in which each package is analyzed.
182 */ 181 */
183 class PackageManager { 182 class PackageManager {
184 /** 183 /**
185 * The resource provider used to access the file system. 184 * The resource provider used to access the file system.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 finder.transitiveDependenciesFor(packageMap, packagePath); 233 finder.transitiveDependenciesFor(packageMap, packagePath);
235 StringBuffer buffer = new StringBuffer(); 234 StringBuffer buffer = new StringBuffer();
236 buffer.write(packagePath); 235 buffer.write(packagePath);
237 for (String dependency in dependencies) { 236 for (String dependency in dependencies) {
238 buffer.write(';'); 237 buffer.write(';');
239 buffer.write(dependency); 238 buffer.write(dependency);
240 } 239 }
241 return buffer.toString(); 240 return buffer.toString();
242 } 241 }
243 } 242 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698