Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 31444 invoked from network); 9 Oct 2006 08:46:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Oct 2006 08:46:59 -0000 Received: (qmail 53102 invoked by uid 500); 9 Oct 2006 08:46:58 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 53082 invoked by uid 500); 9 Oct 2006 08:46:58 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 53071 invoked by uid 99); 9 Oct 2006 08:46:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Oct 2006 01:46:58 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Oct 2006 01:46:57 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E534B7142D2 for ; Mon, 9 Oct 2006 01:46:20 -0700 (PDT) Message-ID: <672241.1160383580936.JavaMail.root@brutus> Date: Mon, 9 Oct 2006 01:46:20 -0700 (PDT) From: "Leo Li (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Updated: (HARMONY-1770) [classlib][math]BigInteger has an unexpected "protected clone()" method In-Reply-To: <5765130.1160378239602.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-1770?page=all ] Leo Li updated HARMONY-1770: ---------------------------- Attachment: patch.diff Is there someone willing to try this? > [classlib][math]BigInteger has an unexpected "protected clone()" method > ----------------------------------------------------------------------- > > Key: HARMONY-1770 > URL: http://issues.apache.org/jira/browse/HARMONY-1770 > Project: Harmony > Issue Type: Bug > Reporter: Leo Li > Attachments: patch.diff > > > BigInteger have a protected clone() method while as the spec says BigInteger itself does not implement Cloneable. The clone() method just new an instance of itself instead of super().clone.Although it is not public, the Clone() method might lead to side-effect if some Object extends from it and implements Cloneable. > > Here is an testcase: > public class TestCloneable extends TestCase { > public void testClone() > { > MyBigInteger myBigInteger = new MyBigInteger("12345"); > myBigInteger = (MyBigInteger)myBigInteger.clone(); > } > } > class MyBigInteger extends BigInteger implements Cloneable { > public MyBigInteger(String val) { > super(val); > } > > public Object clone() > { > try { > return super.clone(); > } catch (CloneNotSupportedException e) { > return null; > } > } > } > Result: > RI passes. > Harmony Fails. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira