DisplayTag
  1. DisplayTag
  2. DISPL-288

TableTotalDecorator ClassCastException

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: Decorators
    • Labels:
      None
    • Application server:
      Tomcat 5.5

      Description

      On line 168 of org.displaytag.decorator.TotalTableDecorator it attempts to cast the decoratedObject to a List. Instead it should cast it to a Collection.

        Activity

        Hide
        Nicholas Neuberger added a comment -
        I would like this to be fixed.

        I am willing to fix the issue, if needed. It looks like a minor change.

        Just trying to help: sf.net id: nneuberger

        I'm on a few sf.net projects and would like to help at least sending a patch. Your thoughts....Anyone.
        Show
        Nicholas Neuberger added a comment - I would like this to be fixed. I am willing to fix the issue, if needed. It looks like a minor change. Just trying to help: sf.net id: nneuberger I'm on a few sf.net projects and would like to help at least sending a patch. Your thoughts....Anyone.
        Hide
        Francesco Tinti added a comment -
        simply change casting in TotalTableDecorator.java line 169 with:
        if (getViewIndex() == ((Collection) getDecoratedObject()).size() - 1)
        Show
        Francesco Tinti added a comment - simply change casting in TotalTableDecorator.java line 169 with: if (getViewIndex() == ((Collection) getDecoratedObject()).size() - 1)
        Hide
        Hiugong Gwok added a comment -
        Change to Collection is not enough, it should also use instanceof to test getDecoratedObject() for Set, Map, etc.
        Set, Map is not Collection.
        Show
        Hiugong Gwok added a comment - Change to Collection is not enough, it should also use instanceof to test getDecoratedObject() for Set, Map, etc. Set, Map is not Collection.
        Hide
        Dirk Abicht added a comment -
        Dito:
        ClassCastException occurs also with an Array in decorated object.
        Show
        Dirk Abicht added a comment - Dito: ClassCastException occurs also with an Array in decorated object.

          People

          • Reporter:
            Chris Widhelm
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: