Uploaded image for project: 'Beehive'
  1. Beehive
  2. BEEHIVE-957

Validation on AnnotationMemberTypes.Date is allowing invalid value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0
    • 1.0.1
    • Controls
    • None
    • Windows JDK 1.5 03

    Description

      This compiles, but I don't think it should ...

      An annotation definition with a member:
      ===============================
      @AnnotationMemberTypes.Date(format="yyyy-MM-dd", minValue="2005-01-31", maxValue="2005-12-31")
      String date();

      And a annotation instance of:
      =======================

      @ConstrainedProperties.Properties(
      ...
      date="2005-09-30x",
      ....
      )

      Retriving the member value at runtime returns: 2005-09-30x as a String and fails to parse at runtime. I do get a compilation error if the basic format is not correct. For example using date="2005/09/30x".

      It would also be helpful if the error messages indicate what the current value and parse format is. The current error generation is:
      error("Value assigned to a date property is not in the specified format.");

      maybe something like ... error("Value:"+ value + " assigned to a date property is not in the specified format:"+format);

      Attachments

        1. BEEHIVE-957.diff
          5 kB
          Chad Schoettger

        Activity

          People

            Unassigned Unassigned
            dread David Read
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: