Skip to content

Commit

Permalink
Merge pull request #606 from smarter/bport-extraHash-fix
Browse files Browse the repository at this point in the history
[1.2.x] Fix the extraHash used when reading a V1 file
  • Loading branch information
jvican authored Oct 11, 2018
2 parents b62282b + 71ce7ec commit ea73630
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ final class ProtobufReaders(mapper: ReadMapper, currentVersion: schema.Version)
val name = analyzedClass.name
val api = mkLazy(analyzedClass.api.read(fromCompanions, ExpectedCompanionsInAnalyzedClass))
val apiHash = analyzedClass.apiHash
// Default on api hash to avoid issues when comparing hashes from two different analysis formats
val extraHash = if (currentVersion == schema.Version.V1) apiHash else analyzedClass.extraHash
// Default to 0 to avoid issues when comparing hashes from two different analysis formats
val extraHash = if (currentVersion == schema.Version.V1) 0 else analyzedClass.extraHash
val nameHashes = analyzedClass.nameHashes.toZincArray(fromNameHash)
val hasMacro = analyzedClass.hasMacro
AnalyzedClass.of(compilationTimestamp, name, api, apiHash, nameHashes, hasMacro, extraHash)
Expand Down

0 comments on commit ea73630

Please sign in to comment.