Uploaded image for project: 'Spring Rich Client Project'
  1. Spring Rich Client Project
  2. RCP-121

Wrong BaseTableModel order creation causes java.lang.IllegalArgumentException in BeanTableModel

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Fedora Core 3
      JDK 1.4.2_08

      Description

      The constructor:
      public BaseTableModel(List rows)

      { setRows(rows); createColumnInfo(); }

      is creating the ColumnsInfo before BeanTableModel to set its message attribute, so BeanTableModel.createColumnNames() is thrown java.lang.IllegalArgumentException:

      java.lang.IllegalArgumentException: [Assertion failed] - this argument is required; it cannot be null
      at org.springframework.util.Assert.notNull(Assert.java:90)
      at org.springframework.util.Assert.notNull(Assert.java:102)
      at org.springframework.richclient.table.BeanTableModel.createColumnNames(BeanTableModel.java:85)
      at org.springframework.richclient.table.BaseTableModel.createColumnInfo(BaseTableModel.java:72)
      at org.springframework.richclient.table.BeanTableModel.createColumnInfo(BeanTableModel.java:77)
      at org.springframework.richclient.table.BaseTableModel.<init>(BaseTableModel.java:44)
      at org.springframework.richclient.table.BaseTableModel.<init>(BaseTableModel.java:39)
      at org.springframework.richclient.table.BeanTableModel.<init>(BeanTableModel.java:49)
      at com.wplex.common.client.ui.BaseTableModel.<init>(BaseTableModel.java:30)

      Some code:

      public abstract class BaseTableModel extends BeanTableModel
      {
      public BaseTableModel(ValueObject vo, MessageSource messageSource)

      { super(vo.getClass(), messageSource); }

      }
      public class CompanyTableModel extends BaseTableModel
      {
      /**

      • @param messageSource
        */
        public CompanyTableModel(MessageSource messageSource) { super(new CompanyVO(), messageSource); }

        }

      Startup:
      new CompanyTableModel((MessageSource) setApplicationContext().getBean("messageSource"))); //$NON-NLS-1$
      Where MessageSource is not null!

      The createColumnInfo() invocation should be removed from BaseTableModel(List rows) constructor and callers of this constructor should be reviewed to avoid possible bugs.

      Thanks,

      Mauro.

        Attachments

          Activity

            People

            • Assignee:
              pdbruycker Peter De Bruycker
              Reporter:
              mransolin Mauro Ransolin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: