Uploaded image for project: 'Kite SDK (READ-ONLY)'
  1. Kite SDK (READ-ONLY)
  2. KITE-1093

getFirstRecord throw IllegalStateException

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.0.0
    • Fix Version/s: None
    • Component/s: Morphlines Module
    • Labels:
      None

      Description

      Hi,

      In my project I created some test by morphline test framework and I found that getFirstRecord method thrown an IllegalStateException in case Collector has multiple Record:

      Extract code from kite/kite-morphlines/kite-morphlines-core/src/test/java/org/kitesdk/morphline/api/Collector.java:

      ...
      public Record getFirstRecord() {
      if (records.size() != 1)

      { throw new IllegalStateException(); }
      if (records.get(0) == null) { throw new IllegalStateException(); }

      return records.get(0);
      }
      ...

      Possible patch:

      • if (records.size() != 1) {
        + if (records.size() < 1) {

      Best regards

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              fpirola Fabio
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: