Fix NPE in MergeabilityCache.getIfPresent
LoadingCache.getIfPresent is explicitly @Nullable. Unfortunately, when it returned null, it was being unboxed to a boolean, causing an NPE. This bug has been around since the mergeability implementation was rewritten, but has likely not been very common because mergeability bits are computed pretty aggressively (if asynchronously). Change-Id: Ie3d8e16db76b28056832c002ab0899072d0ea356
This commit is contained in:
@@ -33,7 +33,7 @@ public interface MergeabilityCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIfPresent(ObjectId commit, Ref intoRef,
|
||||
public Boolean getIfPresent(ObjectId commit, Ref intoRef,
|
||||
SubmitType submitType, String mergeStrategy) {
|
||||
throw new UnsupportedOperationException("Mergeability checking disabled");
|
||||
}
|
||||
@@ -42,6 +42,6 @@ public interface MergeabilityCache {
|
||||
public boolean get(ObjectId commit, Ref intoRef, SubmitType submitType,
|
||||
String mergeStrategy, Branch.NameKey dest, Repository repo, ReviewDb db);
|
||||
|
||||
public boolean getIfPresent(ObjectId commit, Ref intoRef,
|
||||
public Boolean getIfPresent(ObjectId commit, Ref intoRef,
|
||||
SubmitType submitType, String mergeStrategy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user