]> source.dussan.org Git - jgit.git/commitdiff
Revert "[findBugs] Silence DM_STRING_CTOR on PacketLineIn" 70/1870/1
authorShawn O. Pearce <spearce@spearce.org>
Mon, 8 Nov 2010 23:34:47 +0000 (15:34 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 8 Nov 2010 23:34:47 +0000 (15:34 -0800)
This reverts commit 1e510ec20e0391010419b17e9a9095ad54941d3c.

Instead work around the warning by defining our constant by
constructing it through a StringBuilder.

Change-Id: If139509e769d649609c62eff359ebaea5dd286b2
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
CC: Matthias Sohn <matthias.sohn@sap.com>
CC: Chris Aniszczyk <caniszczyk@gmail.com>
org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml
org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java

index f93c8f3027d3a0db0766cabb12be2ddb4751d6a9..948308e778df14dd97311afdbd4c112f184342d2 100644 (file)
        <Class name="org.eclipse.jgit.util.TemporaryBuffer$BlockInputStream" />
        <Bug pattern="UR_UNINIT_READ" />
      </Match>
-
-       <!-- Silence invoke inefficient String constructor, we do not want to pool
-               here -->
-     <Match>
-       <Class name="org.eclipse.jgit.transport.PacketLineIn" />
-       <Method name="&lt;clinit&gt;" />
-       <Bug pattern="DM_STRING_CTOR" />
-     </Match>
 </FindBugsFilter>
index 3821d696ed81a75c42e1807cbc0e621dc6e9e6e5..d3264d5f23d7e2c8011486aff59a930a749ce08e 100644 (file)
@@ -57,7 +57,8 @@ import org.eclipse.jgit.util.IO;
 import org.eclipse.jgit.util.RawParseUtils;
 
 class PacketLineIn {
-       static final String END = new String("") /* must not string pool */;
+       /* must not string pool */
+       static final String END = new StringBuilder(0).toString();
 
        static enum AckNackResult {
                /** NAK */