Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1504

MutationListener doesn't provide property key on property additions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Done
    • 3.1.4, 3.2.2
    • 3.1.7
    • process
    • None

    Description

      The signatures for MutationListener property changes look like this:

      • public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues);
      • public void edgePropertyChanged(final Edge element, final Property oldValue, final Object setValue);
      • public void vertexPropertyPropertyChanged(final VertexProperty element, final Property oldValue, final Object setValue);

      These methods are used when a property is added and when a property is changed. See usage in AddPropertyStep. When a vertex property is added, the oldValue is null, so there is no way for the listener to get the String key of the added property.

      I can think of a few options here, all of which would be breaking changes:

      1. Pass a non-null Property as the oldValue that has the property key but a null property value. The listener would get the property value from setValue.
      2. Add a final String key to the signatures above.
      3. Change the setValue to be final Property setValue so that the key can be gathered from the new value.
      4. Add new methods on MutationListener for vertexPropertyAdded(), edgePropertyAdded(), and vertexPropertyPropertyAdded().

      Attachments

        Issue Links

          Activity

            People

              spmallette Stephen Mallette
              pluradj Jason Plurad
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: