Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-461

MappedConstructor potentially throws NullPointerException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.0.2
    • Component/s: Mapping
    • Labels:
      None

      Description

      The constructor of MappedConstructor accesses the PersistentEntity constructor unguarded to iterate over it's parameters. This results in a NullPointerException. Generally instantiating a MappedConstructor with a PersistentEntity not owning a PersistenceConstructor is invalid as this essentially means we have an ambiguity in constructors (multiple constructors taking arguments without one explicitly selected through @PersistenceConstructor. This indicates the class currently inspected actually either needs to be mapped correctly or a custom converter applied when reading. Thus we should reject the PersistentEntity throwing a MappingException indicating potential ways to solve the problem.

        Attachments

          Activity

            People

            • Assignee:
              olivergierke Oliver Gierke
              Reporter:
              olivergierke Oliver Gierke
              Last updater:
              Trevor Marshall
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: