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

Use wildcard instead of Object for hasId predicates

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.5.7, 3.6.5
    • None
    • process
    • None

    Description

      From both GraphTraversal and __, the hasId(P) steps specify a P<Object>. Common predicates, such as within, propagate the generic type from their own arguments, so that this produces a compile-time error:

      Collection<String> ids = ...
      g.V().hasId(P.within(ids))
      

      I believe that without loss of safety, the signature in both locations could be changed to P<?>, making the typical case of "here's a collection of IDs of known type" work smoothly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chrylis Christopher Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: