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

SpringCache: get("key", Callable) not working with null values

XMLWordPrintable

      Unable to find source-code formatter for language: springcachetest.java. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
       @Test
         public void testGetWithNullValue() {
            assertNull(cache.get("null", () -> null));
         }
      
      Caused by: java.lang.NullPointerException: Null values are not supported!
      

      and

      Unable to find source-code formatter for language: springcachetest.java. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
         @Test
         public void testGetNullValueAfterPutNull() {
            cache.put("key", null);
      
            String result = cache.get("key", () -> "notnull");
      
            assertNull(result);
      
         }
      
      java.lang.ClassCastException: org.infinispan.spring.provider.NullValue cannot be cast to java.lang.String
      

              karestig@redhat.com Katia Aresti
              karestig@redhat.com Katia Aresti
              Diego Lovison Diego Lovison
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: