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

JCK test throws NPE for method compiled with Escape Analysis

XMLWordPrintable

    • b06
    • x86
    • solaris
    • Verified

        It seems that the following JCK test:
        api/java_util/concurrent/CopyOnWriteArrayList/index.html#CopyOnWriteArrayList[testAddAll1_IndexOutOfBoundsException]
        also fails due to the issue.

        The minimized test throws NPE at line marked (*) with -Xcomp specified since JDK b72:
        -----------------------------------------------------------
        import java.util.*;
        import java.util.concurrent.*;

        public class CopyOnWriteArrayListTest {
            public static void main(String argv[]) {
                CopyOnWriteArrayListTest test = new CopyOnWriteArrayListTest();
                test.testRemove1_IndexOutOfBounds();
                test.testAddAll1_IndexOutOfBoundsException();
            }

            public void testRemove1_IndexOutOfBounds() {
                CopyOnWriteArrayList c = new CopyOnWriteArrayList();
            }

            public void testAddAll1_IndexOutOfBoundsException() {
                try {
                    CopyOnWriteArrayList c = new CopyOnWriteArrayList();
                    c.addAll(-1, new LinkedList()); // (*)
                } catch (IndexOutOfBoundsException e) {
                }
            }
        }
        -----------------------------------------------------------
        *** (#3 of 3): 2009-10-26 10:12:14 PDT ###@###.###

              kvn Vladimir Kozlov
              kvn Vladimir Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: