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:
Robin Rosenberg 2012-06-06 02:32:43 +02:00
parent 86e4859576
commit 130925b879
1 changed files with 5 additions and 5 deletions

View File

@ -957,7 +957,7 @@ private void checkConnectivity() throws IOException {
final ObjectWalk ow = new ObjectWalk(db); final ObjectWalk ow = new ObjectWalk(db);
ow.setRetainBody(false); ow.setRetainBody(false);
if (checkReferencedIsReachable) { if (baseObjects != null) {
ow.sort(RevSort.TOPO); ow.sort(RevSort.TOPO);
if (!baseObjects.isEmpty()) if (!baseObjects.isEmpty())
ow.sort(RevSort.BOUNDARY, true); ow.sort(RevSort.BOUNDARY, true);
@ -974,7 +974,7 @@ private void checkConnectivity() throws IOException {
RevObject o = ow.parseAny(have); RevObject o = ow.parseAny(have);
ow.markUninteresting(o); ow.markUninteresting(o);
if (checkReferencedIsReachable && !baseObjects.isEmpty()) { if (baseObjects != null && !baseObjects.isEmpty()) {
o = ow.peel(o); o = ow.peel(o);
if (o instanceof RevCommit) if (o instanceof RevCommit)
o = ((RevCommit) o).getTree(); o = ((RevCommit) o).getTree();
@ -985,7 +985,7 @@ private void checkConnectivity() throws IOException {
RevCommit c; RevCommit c;
while ((c = ow.next()) != null) { while ((c = ow.next()) != null) {
if (checkReferencedIsReachable // if (providedObjects != null //
&& !c.has(RevFlag.UNINTERESTING) // && !c.has(RevFlag.UNINTERESTING) //
&& !providedObjects.contains(c)) && !providedObjects.contains(c))
throw new MissingObjectException(c, Constants.TYPE_COMMIT); throw new MissingObjectException(c, Constants.TYPE_COMMIT);
@ -996,7 +996,7 @@ private void checkConnectivity() throws IOException {
if (o.has(RevFlag.UNINTERESTING)) if (o.has(RevFlag.UNINTERESTING))
continue; continue;
if (checkReferencedIsReachable) { if (providedObjects != null) {
if (providedObjects.contains(o)) if (providedObjects.contains(o))
continue; continue;
else else
@ -1007,7 +1007,7 @@ private void checkConnectivity() throws IOException {
throw new MissingObjectException(o, Constants.TYPE_BLOB); throw new MissingObjectException(o, Constants.TYPE_BLOB);
} }
if (checkReferencedIsReachable) { if (baseObjects != null) {
for (ObjectId id : baseObjects) { for (ObjectId id : baseObjects) {
o = ow.parseAny(id); o = ow.parseAny(id);
if (!o.has(RevFlag.UNINTERESTING)) if (!o.has(RevFlag.UNINTERESTING))