XStream
  1. XStream
  2. XSTR-538

CGLIBEnhancedConverter throws a new ConversionException

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Component/s: Converters
    • Labels:
      None

      Description

      CGLIBEnhancedConverter , line 84 says

      if (callbacks.length > 1)

      { throw new ConversionException("Cannot handle CGLIB enhanced proxies with multiple callbacks"); }

      if (callbacks.length > 1) throws an ConversionException, but if you inspect the callbacks object you can see that this object contains two elements and the problem is that the second of these elements is null!. It's doesn't sense.

      So my solution is

      if (callbacks.length > 1) {
      callbacks = new Callback[]

      {callbacks[0]}

      ; // because callbacks[0] has a valid value and callbacks[1] = null
      //throw new ConversionException("Cannot handle CGLIB enhanced proxies with multiple callbacks");
      }

      this works fine to me, but i don't know if this solution resolves the real problem.

      I think that solution is not add a null element to callbacks object. The next line 82 could be revised to resolve the problem.

      Callback[] callbacks = hasFactory ? ((Factory)source).getCallbacks() : getCallbacks(source);

      thanks

        Issue Links

          People

          • Assignee:
            Jörg Schaible
            Reporter:
            deejeyman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: