Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1854

What's the point of requiring IConverters to be superclasses of the objects they convert?

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4-M3
    • 1.4-RC1
    • wicket
    • None

    Description

      I'm trying to write a converter for my Entity classes; but am baffled by the seemingly useless requirement that the converter should extend the class of the object it's supposed to convert.

      Why can't I just write a converter which is a plain class that implement IConverter? Why must this check exist?

      The issue is about this code:

      wicket/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java:437:

      if (!converter.getClass().isAssignableFrom(objectClass))

      { throw new IllegalArgumentException("converter can not convert " + objectClass.getName() + " to string"); }

      Attachments

        Activity

          People

            jcompagner Johan Compagner
            lhunath Maarten Billemont
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: