Browse Source

* mark FpcBitSet as implementing JLCloneable so it can be cloned,
and add clone() method that calls inherited clone so that in case
of reflection lookup it will be found in this class rather than
getting an exception and having to search the parent class (will
be used in threadvar implementation)

git-svn-id: branches/jvmbackend@18809 -

Jonas Maebe 14 years ago
parent
commit
44f074ebaa
2 changed files with 8 additions and 1 deletions
  1. 5 0
      rtl/java/jset.inc
  2. 3 1
      rtl/java/jseth.inc

+ 5 - 0
rtl/java/jset.inc

@@ -14,6 +14,11 @@
 
  **********************************************************************}
 
+   function FpcBitSet.clone: JLObject;
+     begin
+       result:=inherited;
+     end;
+
 
   function FpcBitSet.add(elem: jint): FpcBitSet;
     begin

+ 3 - 1
rtl/java/jseth.inc

@@ -18,7 +18,9 @@ type
   { Adds support for a "base" value that is used as lower bound for the set's
     contents }
 
-  FpcBitSet = class sealed (JUBitSet)
+  FpcBitSet = class sealed (JUBitSet,JLCloneable)
+    { so we can look it up in this class rather than only in the parent }
+    function clone: JLObject;override;
     function add(elem: jint): FpcBitSet;
     function addAll(s: FpcBitSet): FpcBitSet;
     function remove(elem: jint): FpcBitSet;