Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1254

Code can't be compiled against a regular JRE: Object.clone() override has a different return type

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.6.1
    • Fix Version/s: 0.8
    • Component/s: JavaME - Compiler
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      Code generator produces 2 methods to clone objects: "clone" and "deepCopy", with the exact same implementation.

      The "clone()" methods is conflicting with the regular Object.clone() method of the standard Java platform. Its return type is different (type of the object, instead of just Object).
      (http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html#clone())

      This prevent the code from being compiled by the regular java compiler.

      This is not it's finality, but it is really useful to produce intermediate libraries as JAR files.
      Using only RAPC (BlackBerry's JDE compiler), we would have to include source code directly.

      Attached patch preserves the strongly typed signature of deepCopy(), but turn back clone()'s return type to Object.

        Attachments

        1. Patch.patch
          0.6 kB
          Raphaël B.
        2. thrift-1254.patch
          0.7 kB
          Bryan Duxbury

          Activity

            People

            • Assignee:
              bryanduxbury Bryan Duxbury
              Reporter:
              rbartement Raphaël B.
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: