From 4fef5f61f57dcdfd675cc59f536b342f17a85d4e Mon Sep 17 00:00:00 2001 From: slaws Date: Sun, 29 Mar 2009 18:37:49 +0000 Subject: TUSCANY-2931 - update operation matching to be based on operation name. Add a complex type based interface back into to the test case. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@759742 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/interfacedef/impl/InterfaceImpl.java | 32 +++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'branches/sca-java-1.x/modules') diff --git a/branches/sca-java-1.x/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java b/branches/sca-java-1.x/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java index 23f1eec8cf..38ae3f11d4 100644 --- a/branches/sca-java-1.x/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java +++ b/branches/sca-java-1.x/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java @@ -189,13 +189,19 @@ public class InterfaceImpl implements Interface { public void resetInterfaceInputTypes(Interface newInterface){ for (int i = 0; i < getOperations().size(); i++) { - // TODO - same operation order is assumed. How to really - // find the right operation when we know that the - // data types will be different + // only remote interfaces only have a data type model defined + // and in this case operations cannot be overloaded so match + // operations by name Operation oldOperation = getOperations().get(i); - Operation newOperation = newInterface.getOperations().get(i); + Operation newOperation = null; - if (!oldOperation.getName().equals(newOperation.getName())){ + for (Operation tmpOperation : newInterface.getOperations()){ + if (tmpOperation.getName().equals(oldOperation.getName())){ + newOperation = tmpOperation; + } + } + + if (newOperation == null){ break; } @@ -212,13 +218,19 @@ public class InterfaceImpl implements Interface { public void resetInterfaceOutputTypes(Interface newInterface){ for (int i = 0; i < getOperations().size(); i++) { - // TODO - same operation order is assumed. How to really - // find the right operation when we know that the - // data types will be different + // only remote interfaces only have a data type model defined + // and in this case operations cannot be overloaded so match + // operations by name Operation oldOperation = getOperations().get(i); - Operation newOperation = newInterface.getOperations().get(i); + Operation newOperation = null; + + for (Operation tmpOperation : newInterface.getOperations()){ + if (tmpOperation.getName().equals(oldOperation.getName())){ + newOperation = tmpOperation; + } + } - if (!oldOperation.getName().equals(newOperation.getName())){ + if (newOperation == null){ break; } -- cgit v1.2.3