java parser does not understand .iterator calls

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 0.0.10
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • 2
    • Iteration Wormhole, Iteration X-Ray
    • Not Needed
    • Developer Tools

      Problem Statement/Rationale

      java parser does not understand .iterator calls

      Please be sure to attach relevant logs with any sensitive data redacted.
      How to retrieve logs for: Compass; Shell

      It seems that using

      .find.iterator()

      returns a MongoCursor which does not implement MongoIterable. Because the plugin can not detect what type of operation it's doing, it discards the query.

      Steps to Reproduce

      private MongoCursor<Document> getArtworkByDepartmentAndArtist(String department, String artist) {
          return getCollection().find(Filters.and(
            Filters.eq("Department", department),
            Filters.eq("Artist", artist)
          )).iterator();
        }
      

      Expected Results

      It should detect the query as a FIND_MANY so we run our linters and can generate a query.

      Actual Results

      It's categorised as UNKNOWN.

      Additional Notes

            Assignee:
            Kevin Mas Ruiz
            Reporter:
            Kevin Mas Ruiz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: