瀏覽代碼

* 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 年之前
父節點
當前提交
44f074ebaa
共有 2 個文件被更改,包括 8 次插入1 次删除
  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;