diff options
author | Andrey Loskutov <loskutov@gmx.de> | 2015-11-28 00:15:36 +0100 |
---|---|---|
committer | Andrey Loskutov <loskutov@gmx.de> | 2015-12-15 09:07:05 +0100 |
commit | 95b36b397b528f858ef1559da3c33c6cf3d7117b (patch) | |
tree | 60c31678638448c1cbb45c5aa2cd80054ce592a2 /org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java | |
parent | 8179185d11bdf1687dbb6db4c39ae7cde5799d09 (diff) | |
download | jgit-95b36b397b528f858ef1559da3c33c6cf3d7117b.tar.gz jgit-95b36b397b528f858ef1559da3c33c6cf3d7117b.zip |
Null-annotated Ref class and fixed related compiler errors
This change fixes all compiler errors in JGit and replaces possible
NPE's with either appropriate exceptions, avoiding multiple "Nullable
return" method calls or early returning from the method.
Change-Id: I24c8a600ec962d61d5f40abf73eac4203e115240
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java index 1c6b8b7363..dfc3ee4c30 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java @@ -267,6 +267,10 @@ class WalkFetchConnection extends BaseFetchConnection { final HashSet<ObjectId> inWorkQueue = new HashSet<ObjectId>(); for (final Ref r : want) { final ObjectId id = r.getObjectId(); + if (id == null) { + throw new NullPointerException(MessageFormat.format( + JGitText.get().transportProvidedRefWithNoObjectId, r.getName())); + } try { final RevObject obj = revWalk.parseAny(id); if (obj.has(COMPLETE)) |