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

[lworld] A primitive class that implements Cloneable is tolerated by javac

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • tools
    • generic
    • generic

      The following code compiles fine:

      public primitive class X implements Cloneable {
          public static void main(String [] args) {
          }
      }

      but when run fails with:
      Error: LinkageError occurred while loading main class X
      java.lang.ClassFormatError: class: X - Inline Types do not support Cloneable


      JEP 401 states:

      (Possibly) The class does not implement Cloneable or declare a clone() method.

      Javac implements the latter clause but not the former.


            sadayapalam Srikanth Adayapalam (Inactive)
            sadayapalam Srikanth Adayapalam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: