Source:
<code>private void parseWants() throws IOException { AsyncRevObjectQueue q = walk.parseAny(wantIds, true); try { List<RevCommit> checkReachable = null; Set<ObjectId> reachableFrom = null; RevObject obj; <START> Set<ObjectId> tips = null; <END> while ((obj = q.next()) != null) { if (!advertised.contains(obj)) { switch (requestPolicy) { case ADVERTISED: default: throw new PackProtocolException(MessageFormat.format( JGitText.get().wantNotValid, obj)); case REACHABLE_COMMIT: if (!(obj instanceof RevCommit)) { throw new PackProtocolException(MessageFormat.format( JGitText.get().wantNotValid, obj)); } if (checkReachable == null) { checkReachable = new ArrayList<RevCommit>(); reachableFrom = advertised; } checkReachable.add((RevCommit) obj); break; case TIP: if (tips == null) tips = refIdSet(db.getAllRefs().values()); if (!tips.contains(obj)) throw new PackProtocolException(MessageFormat.format( JGitText.get().wantNotValid, obj)); break; case REACHABLE_COMMIT_TIP: if (!(obj instanceof RevCommit)) { throw new PackProtocolException(MessageFormat.format( JGitText.get().wantNotValid, obj)); } if (checkReachable == null) { checkReachable = new ArrayList<RevCommit>(); reachableFrom = refIdSet(db.getAllRefs().values()); } checkReachable.add((RevCommit) obj); break; case ANY: break; } } want(obj); if (!(obj instanceof RevCommit)) obj.add(SATISFIED); if (obj instanceof RevTag) { obj = walk.peel(obj); if (obj instanceof RevCommit) want(obj); } } if (checkReachable != null) checkNotAdvertisedWants(checkReachable, reachableFrom); wantIds.clear(); } catch (MissingObjectException notFound) { ObjectId id = notFound.getObjectId(); throw new PackProtocolException(MessageFormat.format( JGitText.get().wantNotValid, id.name()), notFound); } finally { q.release(); } }</code><technical_language>nit: declare RevObject obj immediately loop in middle of new Sets initialize null</technical_language>

Target:
private void parseWants() throws IOException { AsyncRevObjectQueue q = walk.parseAny(wantIds, true); try { List<RevCommit> checkReachable = null; Set<ObjectId> reachableFrom = null; Set<ObjectId> tips = null; RevObject obj; while ((obj = q.next()) != null) { if (!advertised.contains(obj)) { switch (requestPolicy) { case ADVERTISED: default: throw new PackProtocolException(MessageFormat.format( JGitText.get().wantNotValid, obj)); case REACHABLE_COMMIT: if (!(obj instanceof RevCommit)) { throw new PackProtocolException(MessageFormat.format( JGitText.get().wantNotValid, obj)); } if (checkReachable == null) { checkReachable = new ArrayList<RevCommit>(); reachableFrom = advertised; } checkReachable.add((RevCommit) obj); break; case TIP: if (tips == null) tips = refIdSet(db.getAllRefs().values()); if (!tips.contains(obj)) throw new PackProtocolException(MessageFormat.format( JGitText.get().wantNotValid, obj)); break; case REACHABLE_COMMIT_TIP: if (!(obj instanceof RevCommit)) { throw new PackProtocolException(MessageFormat.format( JGitText.get().wantNotValid, obj)); } if (checkReachable == null) { checkReachable = new ArrayList<RevCommit>(); reachableFrom = refIdSet(db.getAllRefs().values()); } checkReachable.add((RevCommit) obj); break; case ANY: break; } } want(obj); if (!(obj instanceof RevCommit)) obj.add(SATISFIED); if (obj instanceof RevTag) { obj = walk.peel(obj); if (obj instanceof RevCommit) want(obj); } } if (checkReachable != null) checkNotAdvertisedWants(checkReachable, reachableFrom); wantIds.clear(); } catch (MissingObjectException notFound) { ObjectId id = notFound.getObjectId(); throw new PackProtocolException(MessageFormat.format( JGitText.get().wantNotValid, id.name()), notFound); } finally { q.release(); } }