Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-1552

Invalid conversions for Option instances returned from custom repository methods

    XMLWordPrintable

    Details

      Description

      This commit has introduced one critical issue which prevents repository methods returning Vavr Option type from working properly. By removing these 3 lines of code

      if (method.getReturnType().isInstance(result)) {
          return result;
      }
      

      from the QueryExecutionResultHandler.postProcessInvocationResult(…) method that method no longer returns Option<T> as expected. It returns Some(Some<T>) or Some(None) instead.

      There's another unwrapOptional(…) method which could do the job but it only works with Java 8 Optional type and not Vavr Option.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              olivergierke Oliver Drotbohm
              Reporter:
              ojecborec ojecborec
              Last updater:
              Mark Paluch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: