Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-16217

(7.2.z) ISPN-9705/ HHH-12457 - SpringCache Put null value and get(key, clazz) IllegalStateException

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate Issue
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      SpringCacheTest.java
      
      public void testPutNullError() {
            //when//then
            cache.put("key", null);
       
            cache.get("key", String.class);
         }
      

      We get

      java.lang.IllegalStateException: Cached value is not of required type [java.lang.String]: org.infinispan.spring.provider.NullValue@76f7d241
      

      JavaDoc for this method states this method does not make difference between cached null and null value.

      Note: This variant of

      {@code get}

      does not allow for differentiating

      between a cached

      {@code null}

      value and no cache entry found at all.

      Use the standard

      {@link #get(Object)}

      variant for that purpose instead.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  spyrkob Bartosz Spyrko
                  Reporter:
                  spyrkob Bartosz Spyrko
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: