summaryrefslogtreecommitdiff
path: root/ridljar/com
diff options
context:
space:
mode:
authorKay Ramme <kr@openoffice.org>2001-06-08 13:57:03 +0000
committerKay Ramme <kr@openoffice.org>2001-06-08 13:57:03 +0000
commit9dc628abcdfd91dd3e99e21c48d5371eb680d605 (patch)
tree6a4f2ee6b8aeaf7aed9d9c616c4f7eb93afcee6d /ridljar/com
parent2ad023906439164a10e7e2bbd6ae85f0e8958efe (diff)
fixed method offset for very recursive types (#87872#)
Diffstat (limited to 'ridljar/com')
-rw-r--r--ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java30
1 files changed, 22 insertions, 8 deletions
diff --git a/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java b/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java
index b499a57552ed..2ea80b495d9a 100644
--- a/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java
+++ b/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java
@@ -2,9 +2,9 @@
*
* $RCSfile: TypeDescription.java,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: kr $ $Date: 2001-05-17 12:24:37 $
+ * last change: $Author: kr $ $Date: 2001-06-08 14:57:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -97,7 +97,7 @@ import com.sun.star.lib.uno.typeinfo.TypeInfo;
* methods, which may be changed or moved in the furture, so please
* do not use these methods.
* <p>
- * @version $Revision: 1.9 $ $ $Date: 2001-05-17 12:24:37 $
+ * @version $Revision: 1.10 $ $ $Date: 2001-06-08 14:57:03 $
* @author Kay Ramme
* @since UDK2.0
*/
@@ -447,6 +447,8 @@ public class TypeDescription implements ITypeDescription {
}
static public TypeDescription getTypeDescription(TypeInfo typeInfo, Class zClass) {
+ if(DEBUG) System.err.println("TypeDescription.getTypeDescription:" + typeInfo + " " + zClass);
+
TypeDescription typeDescription = null;
if(typeInfo == null || !typeInfo.isInterface())
@@ -577,6 +579,20 @@ public class TypeDescription implements ITypeDescription {
protected ITypeDescription _componentType;
+ private int calcMethodOffset(Class zClass) {
+ int offset = 3;
+
+ if(zClass != com.sun.star.uno.XInterface.class) {
+ Method methods[] = zClass.getMethods();
+
+ for(int i = 0; i < methods.length; ++ i)
+ if((methods[i].getModifiers() & Modifier.STATIC) == 0)
+ ++ offset;
+ }
+
+ return offset;
+ }
+
private void _initByClass(Class zClass) {
__cyclicTypes.put(zClass.getName(), this);
@@ -600,6 +616,8 @@ public class TypeDescription implements ITypeDescription {
_arrayTypeName = "[L" + _class.getName() + ";";
+ _offset = calcMethodOffset(zClass);
+
Class interfaces[] = _class.getInterfaces();
if(interfaces.length > 0)
_superType = getTypeDescription(interfaces[0]); // uno only supports single inheritance
@@ -699,11 +717,7 @@ public class TypeDescription implements ITypeDescription {
_offset = 3;
}
else {
- if(_superType != null) {
- _superType._initMethodTypeInfos();
-
- superOffset = _superType._offset;
- }
+ superOffset = _superType._offset;
TypeInfo typeInfos[] = __getTypeInfos(_class);
Method methods[] = _class.getMethods();