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

ConcurrentMapFactory does not allow use of V8 maps with Sun JDK 6

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 5.1.6.FINAL
    • Fix Version/s: 5.2.0.Alpha4, 5.2.0.Final
    • Component/s: None
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      The implementation in ConcurrentMapFactory checks for existance of a Sun JVM private class. But although a Sun JDK/JRE 6 is used, the check fails (wrong class com.sun.unsafe.Unsafe instead of sun.misc.Unsafe).

      Sould use sun.misc.Unsafe

         static {
            boolean sunIncompatibleJvm;
            boolean jdk8;
            boolean allowExperimentalMap = Boolean.getBoolean("infinispan.unsafe.allow_jdk8_chm");
       
            try {
               Class.forName("com.sun.unsafe.Unsafe");
               sunIncompatibleJvm = false;
            } catch (ClassNotFoundException e) {
               sunIncompatibleJvm = true;
            }
            
            try {
               Class.forName("java.util.concurrent.atomic.LongAdder");
               jdk8 = true;
            } catch (ClassNotFoundException e) {
               jdk8 = false;
            }
       
            if (jdk8 || sunIncompatibleJvm || !allowExperimentalMap)
               MAP_CREATOR = new JdkConcurrentMapCreator();
            else
               MAP_CREATOR = new BackportedV8ConcurrentMapCreator();
         }
      

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            snazy Robert Stupp added a comment -

            Hi,
            would it be possible to add a fix for 5.1.7, too?

            Show
            snazy Robert Stupp added a comment - Hi, would it be possible to add a fix for 5.1.7, too?
            Hide
            galder.zamarreno Galder Zamarreño added a comment -

            @Robert, we're only fixing critical stuff in 5.1 and this issue is not really causing any malfunctioning. If anything, it's just avoiding the use of what's considered still 'unsafe'. So, most likely we won't fix this in 5.1.x.

            Show
            galder.zamarreno Galder Zamarreño added a comment - @Robert, we're only fixing critical stuff in 5.1 and this issue is not really causing any malfunctioning. If anything, it's just avoiding the use of what's considered still 'unsafe'. So, most likely we won't fix this in 5.1.x.

              People

              • Assignee:
                galder.zamarreno Galder Zamarreño
                Reporter:
                snazy Robert Stupp
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development