2
0
Эх сурвалжийг харах

* 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 жил өмнө
parent
commit
44f074ebaa

+ 5 - 0
rtl/java/jset.inc

@@ -14,6 +14,11 @@
 
 
  **********************************************************************}
  **********************************************************************}
 
 
+   function FpcBitSet.clone: JLObject;
+     begin
+       result:=inherited;
+     end;
+
 
 
   function FpcBitSet.add(elem: jint): FpcBitSet;
   function FpcBitSet.add(elem: jint): FpcBitSet;
     begin
     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
   { Adds support for a "base" value that is used as lower bound for the set's
     contents }
     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 add(elem: jint): FpcBitSet;
     function addAll(s: FpcBitSet): FpcBitSet;
     function addAll(s: FpcBitSet): FpcBitSet;
     function remove(elem: jint): FpcBitSet;
     function remove(elem: jint): FpcBitSet;