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

javac crashes on a small program

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7
    • tools
    • x86
    • windows_7

      FULL PRODUCT VERSION :
      Reproduced on all recent versions. Tested most recently on 1.6.0_18

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 Enterprise 64-bit

      A DESCRIPTION OF THE PROBLEM :
      // Compiling the following causes a javac crash.

      interface I<T> {}

      interface A<T> extends I<A<A<T>>>{}

      abstract class X {
          abstract <T> T foo(T x, T y);
          void bar(A<Integer> x, A<String> y){
              foo(x, y);
          }
      }

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      compile the program appearing in the description

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Compiler produces an intelligible diagnostic about problematic inheritance hierarchy
      ACTUAL -
      javac consumes huge amounts of processing time and memory and finally crashes.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      interface I<T> {}

      interface A<T> extends I<A<A<T>>>{}

      abstract class X {
          abstract <T> T foo(T x, T y);
          void bar(A<Integer> x, A<String> y){
              foo(x, y);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Write a program that doesn't crash javac.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: