The clone method on arrays should be strongly typed

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 5.0
    • Affects Version/s: 1.3.0, 1.4.0
    • Component/s: tools
    • b26
    • generic
    • generic

      As part of JSR-14 (generics), covariant returns were added to the language. The JSR-14 expert group therefore recommends that the clone method on arrays should return an object of the "correct" type, so than casting is no longer required to copy an array:

          int[] original = ...;
          int[] copy = original.clone();

            Assignee:
            Neal Gafter (Inactive)
            Reporter:
            Josh Bloch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: