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

PlanningEntityDescriptor does not support write-only properties

XMLWordPrintable

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

      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.

            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

              Created:
              Updated:
              Resolved:

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