{"thread":{"id":"19181","subject":"[JGIT PATCH 2/7] Silence FindBugs \"dubious use of GC\" in PackFile.mmap","startedAt":"2009-05-04T23:30:42Z","lastAt":"2009-05-06T11:18:54Z","messageCount":8,"participants":["Shawn O. Pearce","Sohn, Matthias"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"113015","messageId":"1241479848-20687-1-git-send-email-spearce@spearce.org","threadId":"19181","inReplyTo":null,"subject":"[JGIT PATCH 1/7] Fix FindBugs exclude filter to work on UNIX platforms","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-04T23:30:42Z","receivedAt":"2009-05-04T23:30:42Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n org.spearce.jgit/.fbprefs |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/org.spearce.jgit/.fbprefs b/org.spearce.jgit/.fbprefs\nindex e97968b..d6f94c3 100644\n--- a/org.spearce.jgit/.fbprefs\n+++ b/org.spearce.jgit/.fbprefs\n@@ -119,7 +119,7 @@ detectorWrongMapIterator=WrongMapIterator|true\n detectorXMLFactoryBypass=XMLFactoryBypass|true\n detector_threshold=2\n effort=default\n-excludefilter0=findBugs\\\\FindBugsExcludeFilter.xml\n+excludefilter0=findBugs/FindBugsExcludeFilter.xml\n filter_settings=Medium|BAD_PRACTICE,CORRECTNESS,MT_CORRECTNESS,PERFORMANCE,STYLE|false\n filter_settings_neg=MALICIOUS_CODE,NOISE,I18N,SECURITY,EXPERIMENTAL|\n run_at_full_build=true\n-- \n1.6.3.rc4.206.g03e16\n"},{"id":"113012","messageId":"1241479848-20687-2-git-send-email-spearce@spearce.org","threadId":"19181","inReplyTo":"1241479848-20687-1-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 2/7] Silence FindBugs \"dubious use of GC\" in PackFile.mmap","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-04T23:30:43Z","receivedAt":"2009-05-04T23:30:43Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../findBugs/FindBugsExcludeFilter.xml             |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/org.spearce.jgit/findBugs/FindBugsExcludeFilter.xml b/org.spearce.jgit/findBugs/FindBugsExcludeFilter.xml\nindex 526eb01..2af9348 100644\n--- a/org.spearce.jgit/findBugs/FindBugsExcludeFilter.xml\n+++ b/org.spearce.jgit/findBugs/FindBugsExcludeFilter.xml\n@@ -6,4 +6,13 @@\n        <Method name=\"refreshPackedRefs\" />\n        <Bug pattern=\"DM_STRING_CTOR\" />\n      </Match>\n+\n+     <!-- Silence PackFile.mmap calls GC, we need to force it to remove stale\n+          memory mapped segments if the JVM heap is out of address space.\n+       -->\n+     <Match>\n+       <Class name=\"org.spearce.jgit.lib.PackFile\" />\n+       <Method name=\"mmap\" />\n+       <Bug pattern=\"DM_GC\" />\n+     </Match>\n </FindBugsFilter>\n-- \n1.6.3.rc4.206.g03e16\n"},{"id":"113013","messageId":"1241479848-20687-3-git-send-email-spearce@spearce.org","threadId":"19181","inReplyTo":"1241479848-20687-2-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 3/7] Fix FindBugs String == is bad form","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-04T23:30:44Z","receivedAt":"2009-05-04T23:30:44Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"We only used \"a == b\" to test for both values == null, as we can't\nuse a.equalsIgnoreCase if a is null.  Instead test for that null\ncase, and fall through for everything else.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../src/org/spearce/jgit/lib/RepositoryConfig.java |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\nindex 87fc254..cb287ee 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n@@ -1102,7 +1102,7 @@ boolean match(final String aBase, final String aExtendedBase,\n \t\t}\n \n \t\tprivate static boolean eq(final String a, final String b) {\n-\t\t\tif (a == b)\n+\t\t\tif (a == null && b == null)\n \t\t\t\treturn true;\n \t\t\tif (a == null || b == null)\n \t\t\t\treturn false;\n-- \n1.6.3.rc4.206.g03e16\n"},{"id":"113018","messageId":"1241479848-20687-4-git-send-email-spearce@spearce.org","threadId":"19181","inReplyTo":"1241479848-20687-3-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 4/7] Fix FindBugs load known null value","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-04T23:30:45Z","receivedAt":"2009-05-04T23:30:45Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"We know its null, so use the null constant instead of the null\nvariable here.  Either way is pretty clear to the reader, but\nthis form makes FindBugs be quiet.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../src/org/spearce/jgit/lib/ObjectDirectory.java  |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java\nindex bcbdbb0..d3c43da 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java\n@@ -314,9 +314,8 @@ private static boolean inList(final PackFile[] list, final PackFile pack) {\n \n \tprivate PackFile[] packs() {\n \t\tPackFile[] r = packList.get();\n-\t\tif (r == null) {\n-\t\t\tr = scanPacks(r);\n-\t\t}\n+\t\tif (r == null)\n+\t\t\tr = scanPacks(null);\n \t\treturn r;\n \t}\n \n-- \n1.6.3.rc4.206.g03e16\n"},{"id":"113016","messageId":"1241479848-20687-5-git-send-email-spearce@spearce.org","threadId":"19181","inReplyTo":"1241479848-20687-4-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 5/7] FindBugs: Fix use of byte[].toString() in error messages","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-04T23:30:46Z","receivedAt":"2009-05-04T23:30:46Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"We meant to use typeString here, not encodedTypeString, as we want\na human-readable string form of the object type for display into\nan exception message.  FindBugs caught us using a byte[] here and\nnot a string, resulting in a useless portion of the message text.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../src/org/spearce/jgit/transport/IndexPack.java  |    2 +-\n .../jgit/transport/WalkFetchConnection.java        |    4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java b/org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java\nindex 7881124..b2bcbb7 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java\n@@ -744,7 +744,7 @@ private void verifySafeObject(final AnyObjectId id, final int type,\n \t\t\t\tobjCheck.check(type, data);\n \t\t\t} catch (CorruptObjectException e) {\n \t\t\t\tthrow new IOException(\"Invalid \"\n-\t\t\t\t\t\t+ Constants.encodedTypeString(type) + \" \" + id.name()\n+\t\t\t\t\t\t+ Constants.typeString(type) + \" \" + id.name()\n \t\t\t\t\t\t+ \":\" + e.getMessage());\n \t\t\t}\n \t\t}\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkFetchConnection.java b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkFetchConnection.java\nindex 06b2c87..4d14305 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkFetchConnection.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkFetchConnection.java\n@@ -602,7 +602,7 @@ private void verifyLooseObject(final AnyObjectId id, final byte[] compressed)\n \t\tif (!AnyObjectId.equals(id, idBuffer)) {\n \t\t\tthrow new TransportException(\"Incorrect hash for \" + id.name()\n \t\t\t\t\t+ \"; computed \" + idBuffer.name() + \" as a \"\n-\t\t\t\t\t+ Constants.encodedTypeString(uol.getType()) + \" from \"\n+\t\t\t\t\t+ Constants.typeString(uol.getType()) + \" from \"\n \t\t\t\t\t+ compressed.length + \" bytes.\");\n \t\t}\n \t\tif (objCheck != null) {\n@@ -610,7 +610,7 @@ private void verifyLooseObject(final AnyObjectId id, final byte[] compressed)\n \t\t\t\tobjCheck.check(uol.getType(), uol.getCachedBytes());\n \t\t\t} catch (CorruptObjectException e) {\n \t\t\t\tthrow new TransportException(\"Invalid \"\n-\t\t\t\t\t\t+ Constants.encodedTypeString(uol.getType()) + \" \"\n+\t\t\t\t\t\t+ Constants.typeString(uol.getType()) + \" \"\n \t\t\t\t\t\t+ id.name() + \":\" + e.getMessage());\n \t\t\t}\n \t\t}\n-- \n1.6.3.rc4.206.g03e16\n"},{"id":"113014","messageId":"1241479848-20687-6-git-send-email-spearce@spearce.org","threadId":"19181","inReplyTo":"1241479848-20687-5-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 6/7] Make TransportLocal.StreamRewritingThread static","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-04T23:30:47Z","receivedAt":"2009-05-04T23:30:47Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"This thread doesn't need access to the outer instance.\n\nNoticed by FindBugs.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../org/spearce/jgit/transport/TransportLocal.java |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java\nindex dae8951..cffdba1 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java\n@@ -363,7 +363,7 @@ public void close() {\n \t\t}\n \t}\n \n-\tclass StreamRewritingThread extends Thread {\n+\tstatic class StreamRewritingThread extends Thread {\n \t\tprivate final InputStream in;\n \n \t\tStreamRewritingThread(final String cmd, final InputStream in) {\n-- \n1.6.3.rc4.206.g03e16\n"},{"id":"113017","messageId":"1241479848-20687-7-git-send-email-spearce@spearce.org","threadId":"19181","inReplyTo":"1241479848-20687-6-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 7/7] FindBugs: Disable clone() idiom tests","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-04T23:30:48Z","receivedAt":"2009-05-04T23:30:48Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"We tend not to implement Cloneable, but instead define our own\nform of clone() on objects that we want to permit making clones\nof.  This is because Cloneable is a rather poor interface in\nthe JVM with its implicit field copying, but the method name\nis the right name for us.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n org.spearce.jgit/.fbprefs |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/org.spearce.jgit/.fbprefs b/org.spearce.jgit/.fbprefs\nindex d6f94c3..81a0767 100644\n--- a/org.spearce.jgit/.fbprefs\n+++ b/org.spearce.jgit/.fbprefs\n@@ -1,5 +1,5 @@\n #FindBugs User Preferences\n-#Mon May 04 20:17:32 CEST 2009\n+#Mon May 04 16:24:13 PDT 2009\n detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true\n detectorBadAppletConstructor=BadAppletConstructor|false\n detectorBadResultSetAccess=BadResultSetAccess|true\n@@ -10,7 +10,7 @@ detectorBooleanReturnNull=BooleanReturnNull|true\n detectorCallToUnsupportedMethod=CallToUnsupportedMethod|true\n detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true\n detectorCheckTypeQualifiers=CheckTypeQualifiers|true\n-detectorCloneIdiom=CloneIdiom|true\n+detectorCloneIdiom=CloneIdiom|false\n detectorComparatorIdiom=ComparatorIdiom|true\n detectorConfusedInheritance=ConfusedInheritance|true\n detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true\n-- \n1.6.3.rc4.206.g03e16\n"},{"id":"113078","messageId":"366BBB1215D0AB4B8A153AF047A28780030C8A5C@dewdfe18.wdf.sap.corp","threadId":"19181","inReplyTo":"1241479848-20687-1-git-send-email-spearce@spearce.org","subject":"RE: [JGIT PATCH 1/7] Fix FindBugs exclude filter to work on UNIX platforms","fromName":"Sohn, Matthias","fromEmail":"matthias.sohn@sap.com","sentAt":"2009-05-06T11:18:54Z","receivedAt":"2009-05-06T11:18:54Z","isPatch":true,"sender":{"key":"matthias.sohn@sap.com","avatar":"https://gravatar.com/avatar/88bbb2733bcb977ec2d2cc1916ba8a70d6d41432c146bb8dab4f7f802261194e?d=mp&s=160"},"body":"Shawn O. Pearce [mailto:spearce@spearce.org] wrote:\n> Subject: [JGIT PATCH 1/7] Fix FindBugs exclude filter to work on UNIX\n> platforms\nThanks, I missed this. I reported this problem to FindBugs :\nhttps://sourceforge.net/tracker/index.php?func=detail&aid=2787728&group_id=96405&atid=614693\n\n--\nMatthias\n"}]}