Skip to content
Permalink
Browse files
Added assertion as suggested in JENKINS-22767.
  • Loading branch information
jglick committed Dec 29, 2014
1 parent bacca38 commit 1078e6b68fcdce7bf3db459fc0074aca0625bbba
@@ -468,7 +468,8 @@ protected synchronized R load(File dataDir, Index editInPlace) {
Index copy = editInPlace!=null ? editInPlace : new Index(index);

BuildReference<R> ref = createReference(r);
copy.byNumber.put(getNumberOf(r),ref);
BuildReference<R> old = copy.byNumber.put(getNumberOf(r), ref);
assert old == null || old.get() == null : "tried to overwrite " + old + " with " + ref;

if (editInPlace==null) index = copy;

@@ -66,7 +66,7 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

BuildReference that = (BuildReference) o;
BuildReference<?> that = (BuildReference) o;
return id.equals(that.id);

}
@@ -76,6 +76,11 @@ public int hashCode() {
return id.hashCode();
}

@Override public String toString() {
R r = get();
return r != null ? r.toString() : id;
}

/**
* An abstraction of {@link Reference}.
* @since 1.548

0 comments on commit 1078e6b

Please sign in to comment.