OLD | NEW |
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
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 = options.encodeCrossContextOptions(); | 160 int hashCode = 0; |
| 161 for (int value in options.encodeCrossContextOptions()) { |
| 162 hashCode = JenkinsSmiHash.combine(hashCode, value); |
| 163 } |
161 hashCode = JenkinsSmiHash.combine(hashCode, id.hashCode); | 164 hashCode = JenkinsSmiHash.combine(hashCode, id.hashCode); |
162 hashCode = JenkinsSmiHash.combine(hashCode, sdk.hashCode); | 165 hashCode = JenkinsSmiHash.combine(hashCode, sdk.hashCode); |
163 return JenkinsSmiHash.finish(hashCode); | 166 return JenkinsSmiHash.finish(hashCode); |
164 } | 167 } |
165 | 168 |
166 @override | 169 @override |
167 bool operator ==(Object other) { | 170 bool operator ==(Object other) { |
168 return other is PackageDescription && | 171 return other is PackageDescription && |
169 other.sdk == sdk && | 172 other.sdk == sdk && |
170 other.options.encodeCrossContextOptions() == | 173 AnalysisOptions.crossContextOptionsEqual( |
171 options.encodeCrossContextOptions() && | 174 other.options.encodeCrossContextOptions(), |
| 175 options.encodeCrossContextOptions()) && |
172 other.id == id; | 176 other.id == id; |
173 } | 177 } |
174 } | 178 } |
175 | 179 |
176 /** | 180 /** |
177 * Manages the contexts in which each package is analyzed. | 181 * Manages the contexts in which each package is analyzed. |
178 */ | 182 */ |
179 class PackageManager { | 183 class PackageManager { |
180 /** | 184 /** |
181 * The resource provider used to access the file system. | 185 * The resource provider used to access the file system. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 finder.transitiveDependenciesFor(packageMap, packagePath); | 234 finder.transitiveDependenciesFor(packageMap, packagePath); |
231 StringBuffer buffer = new StringBuffer(); | 235 StringBuffer buffer = new StringBuffer(); |
232 buffer.write(packagePath); | 236 buffer.write(packagePath); |
233 for (String dependency in dependencies) { | 237 for (String dependency in dependencies) { |
234 buffer.write(';'); | 238 buffer.write(';'); |
235 buffer.write(dependency); | 239 buffer.write(dependency); |
236 } | 240 } |
237 return buffer.toString(); | 241 return buffer.toString(); |
238 } | 242 } |
239 } | 243 } |
OLD | NEW |