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

Generics insufficiently strict on property()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.9
    • Fix Version/s: 3.5.0
    • Component/s: process
    • Labels:
      None

      Description

      The method

      GraphTraversal<S, E> property(final VertexProperty.Cardinality cardinality, final Object key, final Object value, final Object... keyValues)
      

      can be applied to any "current traversal location", whether that's a vertex or an edge. However, if this particular signature is applied to an edge with either (inclusive) cardinality or keyValues specified, it produces a ClassCastException when evaluated at AddPropertyStep.java:151. I understand entirely that multi-properties may not be supported on edges, but inadvertently adding single should, if an error, produce a compile-time error instead of a runtime ClassCastException. (At a minimum, a useful runtime exception should be thrown to indicate the semantic problem.)

        Attachments

          Activity

            People

            • Assignee:
              spmallette Stephen Mallette
              Reporter:
              chrylis Christopher Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: