From d5a34551d595a348eb6234b9cf295a584a5cb1d6 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sat, 11 Apr 2015 23:56:41 +0200 Subject: Fix potential null pointer access in IndexDiffFilter Change-Id: I39c2ea6b3090d7028cc1e246af6e3cc4e7bc70c2 Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'org.eclipse.jgit') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java index 3ef3d97916..42725bc767 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java @@ -224,7 +224,8 @@ public class IndexDiffFilter extends TreeFilter { // Only one chance left to detect a diff: between index and working // tree. Make use of the WorkingTreeIterator#isModified() method to // avoid computing SHA1 on filesystem content if not really needed. - return wi.isModified(di.getDirCacheEntry(), true, tw.getObjectReader()); + return wi.isModified(di == null ? null : di.getDirCacheEntry(), true, + tw.getObjectReader()); } /** -- cgit v1.2.3 From 11a0dffd16e998959e3145de9c48dbdaf8f9757b Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Fri, 10 Apr 2015 23:53:08 +0200 Subject: Silence resource leak warnings where caller is responsible to close Change-Id: I63a74651689c10426d5f150ab2e027c6b63cab95 Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java | 6 ++++-- org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'org.eclipse.jgit') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java index eecbc224bc..45dd7ee1ac 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java @@ -565,14 +565,16 @@ public class BaseRepositoryBuilder ref = cacheMap.get(location); -- cgit v1.2.3 From eea43de7a4b8c012f8bb0089da0da44da2e8bafa Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 12 Apr 2015 00:43:07 +0200 Subject: Silence unused object warning in MyersDiff Change-Id: I7b6d7be4bb283c1f451bc58f29c71a8082580989 Signed-off-by: Matthias Sohn --- org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java | 1 + 1 file changed, 1 insertion(+) (limited to 'org.eclipse.jgit') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java index 6216fdedb5..9810a6ab2f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java @@ -114,6 +114,7 @@ import org.eclipse.jgit.util.LongList; public class MyersDiff { /** Singleton instance of MyersDiff. */ public static final DiffAlgorithm INSTANCE = new LowLevelDiffAlgorithm() { + @SuppressWarnings("unused") @Override public void diffNonCommon(EditList edits, HashedSequenceComparator cmp, HashedSequence a, -- cgit v1.2.3