From afebe7880dea9e5243467f5113a7ebfa65f3c079 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 16 Nov 2011 20:54:40 +0100 Subject: [PATCH 1/2] [findBugs] Prefer short-cut logic as it's more performant Change-Id: I64577f8fd19ee0d2d407479cc70e521adc367f37 Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/storage/dfs/DfsReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java index 02077a99a..5d3f9a935 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java @@ -688,7 +688,7 @@ int inflate(DfsPackFile pack, long position, byte[] dstbuf, for (;;) { dstoff = block.inflate(inf, position, dstbuf, dstoff); - if (headerOnly & dstoff == dstbuf.length) + if (headerOnly && dstoff == dstbuf.length) return dstoff; if (inf.needsInput()) { position += block.remaining(position); From c0780bcb99de9195301ffdc2fcb16837161be5a4 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 16 Nov 2011 20:47:12 +0100 Subject: [PATCH 2/2] [findBugs] Silence returning null for StringUtils.toBooleanOrNull() As the method name and its javadoc clearly state that this method can return null we can ignore this FindBugs warning. Change-Id: I366435e26eda5d910f5d1a907db51f08efd4bb8c Signed-off-by: Matthias Sohn --- org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml b/org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml index 073f3da9d..b8f300740 100644 --- a/org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml +++ b/org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml @@ -45,4 +45,11 @@ + + + + + + +