harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Spark Shen <smallsmallor...@gmail.com>
Subject [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception
Date Wed, 20 Sep 2006 01:18:40 GMT
Hi :
Following is the discussion about JIRA 1492, shall we discuss it here?

public class SubMapTest extends TestCase {
    public void testSubclass() {
        HashMap map = new HashMap();
        map.put("a", "a");
        SubMap map2 = new SubMap(map);  // Harmony will throw an 
unexpected exception here.
    }
}

class SubMap<K, V> extends HashMap<K, V> {

    public V put(K key, V value) {
        throw new RuntimeException();
    }
}


 >Nathan Beyer
 >Harmony's behavior may be different in this case, but I'm not sure I 
would consider this a valid issue. What's a real use case for this type 
of sub-classing?
[ Show » <http://issues.apache.org/jira/browse/HARMONY-1492> ]
Nathan Beyer 
<http://issues.apache.org/jira/secure/ViewProfile.jspa?name=nbeyer> 
[18/Sep/06 08:41 PM] Harmony's behavior may be different in this case, 
but I'm not sure I would consider this a valid issue. What's a real use 
case for this type of sub-classing?

<http://issues.apache.org/jira/secure/ViewProfile.jspa?name=spark+shen>>Spark 
Shen
 >What if change the RuntimeException to UnsupportedOperationException?
[ Show » <http://issues.apache.org/jira/browse/HARMONY-1492> ]
spark shen 
<http://issues.apache.org/jira/secure/ViewProfile.jspa?name=spark+shen> 
[18/Sep/06 08:48 PM] What if change the RuntimeException to 
UnsupportedOperationException?

 >Alexey Petrenko
 >I'm not sure that this is a valid issue to.
 >As far as I understood the issue is that Harmony calls put method in 
constructor while RI does not. Right?

 >If so I do not see any issue here.

-- 
Spark Shen
China Software Development Lab, IBM


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message