Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8228866

ConcurrentSkipListSet.add presents nondeterministic results

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
      java version "1.8.0_151"
      Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
      Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      The following sample program presents different results when executed multiple times.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile above program
      2. Run it using Oracle HotSpot java

      ACTUAL -
      Sometimes true, sometimes ClassCastException.

      ---------- BEGIN SOURCE ----------
      public class A {
         public static void main(String args[]) {
            ConcurrentSkipListSet concurrentSkipListSet = new ConcurrentSkipListSet();
            System.out.println(concurrentSkipListSet.add(new Object()));
         }
      }
      ---------- END SOURCE ----------

      FREQUENCY : often


            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: