Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-13

PlanningEntityDescriptor does not support write-only properties

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 5.4.0.Final
    • None
    • optaplanner-core
    • None

    Description

      The following code:

                  Method propertyGetter = propertyDescriptor.getReadMethod();
                  if (propertyGetter.isAnnotationPresent(PlanningVariable.class)) {
      

      in method processPropertyAnnotations() assumes that properties always have getters. However, the method getReadMethod() might indeed return null if the property is write-only, as explained in the JavaBeans(TM) Specification 1.01 Final Release. A null-check should therefore be added in order to prevent NullPointerExceptions.

      Attachments

        Issue Links

          Activity

            People

              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              scedric_jira Cédric Schaller (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 5 minutes
                  5m
                  Remaining:
                  Remaining Estimate - 5 minutes
                  5m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified