1 Reply Latest reply on Dec 4, 2008 5:19 PM by Dan Allen

    Possible ConvertertChain.java bug .

    Francisco Jose Peredo Noguez Master

      Hi!
      Today, just for the fun of it, I ran Findbugs over the latest Seam code in trunk, this is the first bug it detected that I believe it is worth of mentioning here:


      In ConvertertChain.java, comparing the getClass() with the converter parameter, will that ever be equal? I think not... what was the intention here?:


       public boolean containsConverterType(Converter converter) {
            // TODO Improve this
            for (Converter c : converters) {
               if (c.getClass().equals(converter)) {  <-- HERE!
                  return true;
               }
            }
            return false;
         }
      




      Should I submit a JIRA with a patch like this?:




       public boolean containsConverterType(Converter converter) {
            // TODO Improve this
            for (Converter c : converters) {
               if (c.getClass().equals(converter.getClass())) {  <-- FIXED?
                  return true;
               }
            }
            return false;
         }
      



      Regards,