Get rid of warning about possible NullPointerException
Do this by using one of the two references that are dependent of checkReferencedIsReachable. Change-Id: I4f16916c62ed8ea434013925f49fb03fe57b7d7e
This commit is contained in:
parent
86e4859576
commit
130925b879
|
@ -957,7 +957,7 @@ private void checkConnectivity() throws IOException {
|
|||
|
||||
final ObjectWalk ow = new ObjectWalk(db);
|
||||
ow.setRetainBody(false);
|
||||
if (checkReferencedIsReachable) {
|
||||
if (baseObjects != null) {
|
||||
ow.sort(RevSort.TOPO);
|
||||
if (!baseObjects.isEmpty())
|
||||
ow.sort(RevSort.BOUNDARY, true);
|
||||
|
@ -974,7 +974,7 @@ private void checkConnectivity() throws IOException {
|
|||
RevObject o = ow.parseAny(have);
|
||||
ow.markUninteresting(o);
|
||||
|
||||
if (checkReferencedIsReachable && !baseObjects.isEmpty()) {
|
||||
if (baseObjects != null && !baseObjects.isEmpty()) {
|
||||
o = ow.peel(o);
|
||||
if (o instanceof RevCommit)
|
||||
o = ((RevCommit) o).getTree();
|
||||
|
@ -985,7 +985,7 @@ private void checkConnectivity() throws IOException {
|
|||
|
||||
RevCommit c;
|
||||
while ((c = ow.next()) != null) {
|
||||
if (checkReferencedIsReachable //
|
||||
if (providedObjects != null //
|
||||
&& !c.has(RevFlag.UNINTERESTING) //
|
||||
&& !providedObjects.contains(c))
|
||||
throw new MissingObjectException(c, Constants.TYPE_COMMIT);
|
||||
|
@ -996,7 +996,7 @@ private void checkConnectivity() throws IOException {
|
|||
if (o.has(RevFlag.UNINTERESTING))
|
||||
continue;
|
||||
|
||||
if (checkReferencedIsReachable) {
|
||||
if (providedObjects != null) {
|
||||
if (providedObjects.contains(o))
|
||||
continue;
|
||||
else
|
||||
|
@ -1007,7 +1007,7 @@ private void checkConnectivity() throws IOException {
|
|||
throw new MissingObjectException(o, Constants.TYPE_BLOB);
|
||||
}
|
||||
|
||||
if (checkReferencedIsReachable) {
|
||||
if (baseObjects != null) {
|
||||
for (ObjectId id : baseObjects) {
|
||||
o = ow.parseAny(id);
|
||||
if (!o.has(RevFlag.UNINTERESTING))
|
||||
|
|
Loading…
Reference in New Issue