| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.sdk; | 5 library analyzer.src.generated.sdk; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 205 |
| 206 /** | 206 /** |
| 207 * Initialize a newly created SDK description to describe an SDK based on the | 207 * Initialize a newly created SDK description to describe an SDK based on the |
| 208 * files or directories at the given [paths] that is analyzed using the given | 208 * files or directories at the given [paths] that is analyzed using the given |
| 209 * [options]. | 209 * [options]. |
| 210 */ | 210 */ |
| 211 SdkDescription(this.paths, this.options); | 211 SdkDescription(this.paths, this.options); |
| 212 | 212 |
| 213 @override | 213 @override |
| 214 int get hashCode { | 214 int get hashCode { |
| 215 int hashCode = options.encodeCrossContextOptions(); | 215 int hashCode = 0; |
| 216 for (int value in options.encodeCrossContextOptions()) { |
| 217 hashCode = JenkinsSmiHash.combine(hashCode, value); |
| 218 } |
| 216 for (String path in paths) { | 219 for (String path in paths) { |
| 217 hashCode = JenkinsSmiHash.combine(hashCode, path.hashCode); | 220 hashCode = JenkinsSmiHash.combine(hashCode, path.hashCode); |
| 218 } | 221 } |
| 219 return JenkinsSmiHash.finish(hashCode); | 222 return JenkinsSmiHash.finish(hashCode); |
| 220 } | 223 } |
| 221 | 224 |
| 222 @override | 225 @override |
| 223 bool operator ==(Object other) { | 226 bool operator ==(Object other) { |
| 224 if (other is SdkDescription) { | 227 if (other is SdkDescription) { |
| 225 if (options.encodeCrossContextOptions() != | 228 if (!AnalysisOptions.crossContextOptionsEqual( |
| 226 other.options.encodeCrossContextOptions()) { | 229 options.encodeCrossContextOptions(), |
| 230 other.options.encodeCrossContextOptions())) { |
| 227 return false; | 231 return false; |
| 228 } | 232 } |
| 229 int length = paths.length; | 233 int length = paths.length; |
| 230 if (other.paths.length != length) { | 234 if (other.paths.length != length) { |
| 231 return false; | 235 return false; |
| 232 } | 236 } |
| 233 for (int i = 0; i < length; i++) { | 237 for (int i = 0; i < length; i++) { |
| 234 if (other.paths[i] != paths[i]) { | 238 if (other.paths[i] != paths[i]) { |
| 235 return false; | 239 return false; |
| 236 } | 240 } |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 _platformsToPatchPaths[platforms] = paths; | 663 _platformsToPatchPaths[platforms] = paths; |
| 660 } | 664 } |
| 661 | 665 |
| 662 /** | 666 /** |
| 663 * Record that this library can be run on the VM. | 667 * Record that this library can be run on the VM. |
| 664 */ | 668 */ |
| 665 void setVmLibrary() { | 669 void setVmLibrary() { |
| 666 _platforms |= VM_PLATFORM; | 670 _platforms |= VM_PLATFORM; |
| 667 } | 671 } |
| 668 } | 672 } |
| OLD | NEW |