Hmm, I 've done it too fast.

<xsl:template match="Match">
  <xsl:if test="preceding-sibling::Match[
      Class/@name = current()/Class/@name
      and Bug/@pattern = current()/Bug/@pattern
      and (Field/@name = current()/Field/@name
          or Method/@name = current()/Method/@name
          or (not(Method) and not(current()/Method) and not(Field) and
not(current()/Field)))]">
    <xsl:copy-of select="."/>
  </xsl:if>
</xsl:template>

This gives a more complete list (see atteched output)

Le 19/01/2012 13:33, Pascal Sancho a écrit :
> Hi Chris,
> 
> found just one duplication:
> <Match>
>   <Class name="org.apache.fop.afp.AFPPaintingState"/>
>   <Field name="colorConverter"/>
>   <Bug pattern="SE_BAD_FIELD_STORE"/>
> </Match>
> 
> using following template:
> <xsl:template match="Match">
>   <xsl:if test="preceding-sibling::Match[
>       Class/@name = current()/Class/@name
>       and Field/@name = current()/Field/@name
>       and Bug/@pattern = current()/Bug/@pattern]">
>     <xsl:copy-of select="."/>
>   </xsl:if>
> </xsl:template>
> 
> HTH,
> 
> 
> Le 18/01/2012 18:07, Chris Bowditch a écrit :
>> On 18/01/2012 15:51, Glenn Adams wrote:
>>> I recall that someone (Jeremias or Simon?) had mechanically generated 
>>> some exclusions to add to this file. It is possible that duplicates 
>>> got inserted in that process. I know of no reason to retain duplicates.
>>
>> Thanks Glenn. I've removed the duplicates that I noticed initially, but 
>> I can see there are some more. Due to the size of the file, it will 
>> probably require some automated process to remove all the duplicates.
>>
>> Thanks,
>>
>> Chris
>>
>>>
>>> On Wed, Jan 18, 2012 at 6:39 AM, Chris Bowditch 
>>> <bowditch_ch...@hotmail.com <mailto:bowditch_ch...@hotmail.com>> wrote:
>>>
>>>     Hi Fellow Committers,
>>>
>>>     I was reviewing the current set of warnings generated by FindBugs
>>>     and found myself needing to add an extra exclusion. I noticed that
>>>     the exclusions file contains a lot of duplicates, e.g.
>>>
>>>     <Match>
>>>     <Class name="org.apache.fop.render.afp.AFPImageHandlerRawCCITTFax"/>
>>>     <Method name="setAdditionalParameters"/>
>>>     <Bug pattern="BC_UNCONFIRMED_CAST"/>
>>>     </Match>
>>>     <Match>
>>>     <Class name="org.apache.fop.render.afp.AFPImageHandlerRawCCITTFax"/>
>>>     <Method name="setAdditionalParameters"/>
>>>     <Bug pattern="BC_UNCONFIRMED_CAST"/>
>>>     </Match>
>>>
>>>     Does anyone know why the duplicates exist? I confirmed that
>>>     removing the duplicates does not re-introduce any warnings with
>>>     FindBugs 1.3.9.
>>>
>>>     Thanks,
>>>
>>>     Chris
>>>
>>>
>>
> 

-- 
Pascal
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
  <Match>
      <Class name="java.net.URLClassLoader"/>
      <!--Neither method nor field-->
      <Bug pattern="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.afp.AFPPaintingState"/>
      <Field name="colorConverter"/>
      <Bug pattern="SE_BAD_FIELD_STORE"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.hyphenation.ByteVector"/>
      <Method name="&lt;init&gt;"/>
      <Bug pattern="EI_EXPOSE_REP2"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.hyphenation.CharVector"/>
      <Method name="&lt;init&gt;"/>
      <Bug pattern="EI_EXPOSE_REP2"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.pdf.StreamCacheFactory"/>
      <Method name="getInstance"/>
      <Bug pattern="LI_LAZY_INIT_STATIC"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fo.properties.NumberProperty"/>
      <Method name="&lt;init&gt;"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fo.properties.NumberProperty"/>
      <Method name="&lt;init&gt;"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fonts.CIDSubset"/>
      <Method name="mapSubsetChar"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fonts.base14.Helvetica"/>
      <Method name="&lt;clinit&gt;"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fonts.base14.HelveticaBold"/>
      <Method name="&lt;clinit&gt;"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fonts.base14.HelveticaBoldOblique"/>
      <Method name="&lt;clinit&gt;"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fonts.base14.HelveticaOblique"/>
      <Method name="&lt;clinit&gt;"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fonts.base14.TimesBold"/>
      <Method name="&lt;clinit&gt;"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fonts.base14.TimesBoldItalic"/>
      <Method name="&lt;clinit&gt;"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fonts.base14.TimesItalic"/>
      <Method name="&lt;clinit&gt;"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fonts.base14.TimesRoman"/>
      <Method name="&lt;clinit&gt;"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.render.ps.PSDocumentHandler"/>
      <Method name="startPage"/>
      <Bug pattern="DM_NUMBER_CTOR"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fo.flow.Footnote"/>
      <Method name="addChildNode"/>
      <Bug pattern="BC_UNCONFIRMED_CAST"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fo.flow.ListItem"/>
      <Method name="addChildNode"/>
      <Bug pattern="BC_UNCONFIRMED_CAST"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fo.flow.ListItem"/>
      <Method name="addChildNode"/>
      <Bug pattern="BC_UNCONFIRMED_CAST"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fo.pagination.PageSequence"/>
      <Method name="addChildNode"/>
      <Bug pattern="BC_UNCONFIRMED_CAST"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fo.pagination.PageSequence"/>
      <Method name="addChildNode"/>
      <Bug pattern="BC_UNCONFIRMED_CAST"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.pdf.PDFFactory"/>
      <Method name="makeFont"/>
      <Bug pattern="BC_UNCONFIRMED_CAST"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.render.afp.AFPImageHandlerRawCCITTFax"/>
      <Method name="setAdditionalParameters"/>
      <Bug pattern="BC_UNCONFIRMED_CAST"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.fo.FOText"/>
      <Method name="isWordChar"/>
      <Bug pattern="DB_DUPLICATE_SWITCH_CLAUSES"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.layoutmgr.inline.AlignmentContext"/>
      <Method name="&lt;init&gt;"/>
      <Bug pattern="DB_DUPLICATE_SWITCH_CLAUSES"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.tools.anttasks.Fop"/>
      <Method name="execute"/>
      <Bug pattern="DB_DUPLICATE_SWITCH_CLAUSES"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.layoutmgr.AbstractBreaker"/>
      <Method name="justifyBoxes"/>
      <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.layoutmgr.BlockContainerLayoutManager"/>
      <Method name="getNextKnuthElements"/>
      <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.layoutmgr.inline.ContentLayoutManager"/>
      <Method name="fillArea"/>
      <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer"/>
      <Method name="addChild"/>
      <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun"/>
      <Method name="addCloseGroupMark"/>
      <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.render.awt.viewer.ImageProxyPanel"/>
      <Method name="paintComponent"/>
      <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.render.pcl.PCLGenerator"/>
      <Method name="paintBitmap"/>
      <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.layoutmgr.BlockLevelLayoutManager"/>
      <!--Neither method nor field-->
      <Bug pattern="RI_REDUNDANT_INTERFACES"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator"/>
      <!--Neither method nor field-->
      <Bug pattern="RI_REDUNDANT_INTERFACES"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator"/>
      <!--Neither method nor field-->
      <Bug pattern="RI_REDUNDANT_INTERFACES"/>
   </Match>
  <Match>
      <Class name="org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator"/>
      <!--Neither method nor field-->
      <Bug pattern="RI_REDUNDANT_INTERFACES"/>
   </Match>
</FindBugsFilter>

Reply via email to