소스 검색

* only make clone method accessible once if needed

git-svn-id: branches/jvmbackend@18821 -
Jonas Maebe 14 년 전
부모
커밋
336420ef46
1개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  1. 6 5
      rtl/java/jtvar.inc

+ 6 - 5
rtl/java/jtvar.inc

@@ -30,12 +30,13 @@
                 owningClass:=owningClass.getSuperClass;
             end;
           until assigned(fCloneMethod);
+          { required to enable calling methods of non-public classes (e.g. a
+            record type defined in the implementation of a unit) -- can cause
+            security exceptions if the security manager doesn't allow this
+            though... }
+          if not fCloneMethod.isAccessible then
+            fCloneMethod.setAccessible(true);
         end;
-      { required to enable calling methods of non-public classes (e.g. a record
-        type defined in the implementation of a unit -- can cause security
-        exceptions if the security manager doesn't allow this though... }
-      if not fCloneMethod.isAccessible then
-        fCloneMethod.setAccessible(true);
       { return a copy of the record/shortstring/set/... }
       result:=fCloneMethod.invoke(fInstanceToClone,[]);
     end;