Uploaded image for project: 'Spring XD'
  1. Spring XD
  2. XD-2825

SCS - Verify/Fix AbstractKryoMultitypeCodec implementation

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Story
    • Status: Done
    • Minor
    • Resolution: Complete
    • 1.1 GA
    • 1.2.1, 2.x
    • Runtime
    • None

    Description

      This apparently is not tested or used internally, but I expect it to fail having tried a similar approach to derive the class of a generic type in a different situation. This method does not always work due to type erasure http://stackoverflow.com/questions/3403909/get-generic-type-of-class-at-runtime. We need to verify if this is working, if not fix it. The API may require it, so possibly UnsupportedOperationException...

      /**
         * Infers the type from this class's generic type argument
         * @param kryo
         * @param input
         * @return
       */
      protected T doDeserialize(Kryo kryo, Input input) {
      	Class<T> type = (Class<T>) (
      				(ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[0];
      		return doDeserialize(kryo, input, type);
      }
      

      Attachments

        Activity

          People

            dturanski David Turanski
            dturanski David Turanski
            Archiver:
            tmarshall Trevor Marshall

            Dates

              Created:
              Updated:
              Resolved:
              Archived: