Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-7766

TypeConverterDelegatingAdvancedCache not boxing values in compute functions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 9.1.0.Final
    • 9.0.0.Final
    • Core
    • None
    • Hide

      Using one of the compute functions with a StorageType.BINARY will throw an exception:

      17:39:15.839 [http-nio-8080-exec-2] ERROR o.i.i.i.InvocationContextInterceptor - ISPN000136: Error executing command PutKeyValueCommand, writing keys [WrappedByteArray{bytes=0xDEADBEEFDEADBEEFDEADBEEF, hashCode=-522367038}]
      java.lang.IllegalArgumentException: Size of Class class com.my.ValueClass cannot be determined using given entry size calculator :class org.infinispan.container.entries.PrimitiveEntrySizeCalculator
      
      Show
      Using one of the compute functions with a StorageType.BINARY will throw an exception: 17:39:15.839 [http-nio-8080-exec-2] ERROR o.i.i.i.InvocationContextInterceptor - ISPN000136: Error executing command PutKeyValueCommand, writing keys [WrappedByteArray{bytes=0xDEADBEEFDEADBEEFDEADBEEF, hashCode=-522367038}] java.lang.IllegalArgumentException: Size of Class class com.my.ValueClass cannot be determined using given entry size calculator : class org.infinispan.container.entries.PrimitiveEntrySizeCalculator

      TypeConverterDelegatingAdvancedCache does not seem to box values when using compute(), computeIfAbsent() or computeIfPresent(). I think convertFunction() should include a boxValue() call.

      It boxes the key, but not the value, see here: https://github.com/infinispan/infinispan/blob/faf0a83c05449e7e5b874f859acadfe2241cd04f/core/src/main/java/org/infinispan/cache/impl/TypeConverterDelegatingAdvancedCache.java#L101

              karestig@redhat.com Katia Aresti
              miken123-1 Mike Noordermeer (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: