diff options
author | Kay Ramme <kr@openoffice.org> | 2001-04-04 12:41:41 +0000 |
---|---|---|
committer | Kay Ramme <kr@openoffice.org> | 2001-04-04 12:41:41 +0000 |
commit | 25f2334ac012161a6e42639b316c658810f9d46a (patch) | |
tree | 5e4a572ba33bb34ce6dbbe3dc4ab7b0ad16dafc9 /ridljar | |
parent | 9acc2fd165722dd0fb4ade43ab114f4653352954 (diff) |
correctly unrole and role arraynish parameter (#85533#)
Diffstat (limited to 'ridljar')
-rw-r--r-- | ridljar/com/sun/star/lib/uno/typedesc/MethodDescription.java | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/ridljar/com/sun/star/lib/uno/typedesc/MethodDescription.java b/ridljar/com/sun/star/lib/uno/typedesc/MethodDescription.java index 300033c6b1ff..8c0a9bc3bd46 100644 --- a/ridljar/com/sun/star/lib/uno/typedesc/MethodDescription.java +++ b/ridljar/com/sun/star/lib/uno/typedesc/MethodDescription.java @@ -2,9 +2,9 @@ * * $RCSfile: MethodDescription.java,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: kr $ $Date: 2000-12-22 10:44:15 $ + * last change: $Author: kr $ $Date: 2001-04-04 13:41:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -180,11 +180,22 @@ public class MethodDescription { // see if the typeinfo says, that the parameter is an interface // and the parameter is not assignable to xinterface (mapping of xinterface to java.lang.Object) // set the parameter to class of xinterface, cause it must be assignable + int arrayNesting = 0; + while(parameterClass.isArray()) { + ++ arrayNesting; + + parameterClass = parameterClass.getComponentType(); + } + if(typeInfo.isInterface() && !parameterClass.isInterface()) - if(parameterClass.isArray()) - typeDescription = __xInterfaceArray; - else - typeDescription = __xInterface; + for(int i = 0; i < arrayNesting; ++ i) { + try { + typeDescription = TypeDescription.getTypeDescription("[]" + typeDescription.getTypeName()); + } + catch(ClassNotFoundException classNotFoundException) { // this could never happen, but anyway... + throw new RuntimeException(classNotFoundException.toString()); + } + } } else // this is an out parameter, and must not be passed typeDescription = null; @@ -203,11 +214,24 @@ public class MethodDescription { // see if the typeinfo says, that the parameter is an interface // and the parameter is not assignable to xinterface (mapping of xinterface to java.lang.Object) // set the parameter to class of xinterface, cause it must be assignable + int arrayNesting = 0; + while(parameterClass.isArray()) { + ++ arrayNesting; + + parameterClass = parameterClass.getComponentType(); + } + if(typeInfo.isInterface() && !parameterClass.isInterface()) { - if(parameterClass.getComponentType().isArray()) - typeDescription = __xInterfaceArrayArray; - else - typeDescription = __xInterfaceArray; + typeDescription = __xInterface; + + for(int i = 0; i < arrayNesting; ++ i) { + try { + typeDescription = TypeDescription.getTypeDescription("[]" + typeDescription.getTypeName()); + } + catch(ClassNotFoundException classNotFoundException) { // this could never happen, but anyway... + throw new RuntimeException(classNotFoundException.toString()); + } + } } } else // this is not an out parameter |