Something strange. I added this to SameAPI.apply:
def apply(a: Source, b: Source): Boolean = {
val hashesEqual = a.apiHash == b.apiHash
val hashesNotEmpty = (a.hash.length > 0 && b.hash.length > 0)
val apiEqual = apply(a.api, b.api)
val res = hashesEqual && hashesNotEmpty && apiEqual
if (!res) {
println("Not equal. %s %s %s" format (hashesEqual, hashesNotEmpty, apiEqual))
println("Api hashes: a1: %d, a2: %d, b1: %d, b2: %d" format (
xsbt.api.HashAPI(a.api),
xsbt.api.HashAPI(a.api),
xsbt.api.HashAPI(b.api),
xsbt.api.HashAPI(b.api)
))
}
res
}
[info] Compiling 1 Scala source to /data/git/opensource/xsbt/main/target/classes...
[warn] there were 10 deprecation warnings; re-run with -deprecation for details
[warn] there were 1 unchecked warnings; re-run with -unchecked for details
[warn] two warnings found
Not equal. false true true
Api hashes: a1: -461092469, a2: -461092469, b1: -461092469, b2: -461092469
[info] Compiling 32 Scala sources to /data/git/opensource/xsbt/main/target/classes...
That means that for this case the stored apiHash and api disagreed. Any idea what that could be?