summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-03-29 18:37:49 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-03-29 18:37:49 +0000
commit4fef5f61f57dcdfd675cc59f536b342f17a85d4e (patch)
treef888c248ce88e161f26a78f0674f7cc40f72bdec /branches/sca-java-1.x/modules
parent0ce0c3f2641bd2f013b3183d8a12e821327192ec (diff)
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
Diffstat (limited to 'branches/sca-java-1.x/modules')
-rw-r--r--branches/sca-java-1.x/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java32
1 files changed, 22 insertions, 10 deletions
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;
}