@NoWarning("NP_") static ArrayList<Ideas_2009_05_20> removeDuplicates_FalsePositive(final ArrayList<Ideas_2009_05_20> list){
  final ArrayList<Ideas_2009_05_20> results=new ArrayList<Ideas_2009_05_20>();
  final ArrayList<String> sections=new ArrayList<String>();
  while (list.size() > 0) {
    final Ideas_2009_05_20 specification=list.remove(0);
    final Iterator<Ideas_2009_05_20> iterator=list.iterator();
    while (iterator.hasNext()) {
      final Ideas_2009_05_20 other=iterator.next();
      if (specification.equals(other)) {
        final String[] otherSections=other.getSections();
        if (null != sections) {
          sections.addAll(Arrays.asList(otherSections));
        }
        iterator.remove();
      }
    }
    final Ideas_2009_05_20 merged=mergeInSections(specification,sections);
    results.add(merged);
    sections.clear();
  }
  return results;
}

@ NoWarning ( "NP_" ) static ArrayList < Ideas_2009_05_20 > removeDuplicates_FalsePositive ( final ArrayList < Ideas_2009_05_20 > list ) { final ArrayList < Ideas_2009_05_20 > results = new ArrayList < Ideas_2009_05_20 > ( ) ; final ArrayList < String > sections = new ArrayList < String > ( ) ; while ( list . size ( ) > 0 ) { final Ideas_2009_05_20 specification = list . remove ( 0 ) ; final Iterator < Ideas_2009_05_20 > iterator = list . iterator ( ) ; while ( iterator . hasNext ( ) ) { final Ideas_2009_05_20 other = iterator . next ( ) ; if ( specification . equals ( other ) ) { final String [ ] otherSections = other . getSections ( ) ; if ( null != sections ) { sections . addAll ( Arrays . asList ( otherSections ) ) ; } iterator . remove ( ) ; } } final Ideas_2009_05_20 merged = mergeInSections ( specification , sections ) ; results . add ( merged ) ; sections . clear ( ) ; } return results ; }
from ant 1 . 5 . 2 , org . apache . tools . ant . taskdefs . optional . extension . specification reported as a findbugs false positive in " accurate interprocedural null - dereference analysis for java " , mangala gowri nanda and saurabh sinha , icse 2009
