This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Compile error with TreeSet
- To: edgar at villanueva dot com
- Subject: Re: Compile error with TreeSet
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Thu, 15 Feb 2001 17:02:04 +1300
- CC: "'java at gcc dot gnu dot org'" <java at gcc dot gnu dot org>, java-patches at gcc dot gnu dot org
- References: <3A8B0B4C.572D9103@villanueva.com>
Edgar Villanueva wrote:
> ojects/gcc/build/i686-pc-linux-gnu/libjava java/util/TreeSet.java
> java/util/TreeSet.java: In class `java.util.TreeSet':
> java/util/TreeSet.java: In method `java.util.TreeSet.clone()':
> java/util/TreeSet.java:163: Can't access protected method
> `java.lang.Object.clone' from `java.util.TreeSet'.
> copy.map = (TreeMap) map.clone();
> ^
> 1 error
> ma
Oops.
regards
[ bryce ]
2001-02-15 Bryce McKinlay <bryce@albatross.co.nz>
* java/util/TreeSet.java (clone): Call TreeMap.clone(), not
Object.clone().
Index: TreeSet.java
===================================================================
RCS file: /cvs/gcc/egcs/libjava/java/util/TreeSet.java,v
retrieving revision 1.1
diff -u -r1.1 TreeSet.java
--- TreeSet.java 2001/02/14 04:44:21 1.1
+++ TreeSet.java 2001/02/15 03:51:56
@@ -158,14 +158,7 @@
public Object clone()
{
TreeSet copy = new TreeSet();
- try
- {
- copy.map = (TreeMap) map.clone();
- }
- catch (CloneNotSupportedException ex)
- {
- }
-
+ copy.map = (SortedMap) ((TreeMap) map).clone();
return copy;
}