diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-09-01 23:00:21 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-09-01 23:00:21 +0000 |
commit | 1ec8932a224de7f9beb078d49ca084b3cf1c7301 (patch) | |
tree | 9d2e52f601a9f9977db826bd4e4ef34e936d1ecf /sca-java-2.x/trunk/modules | |
parent | 9e655ea762bca07a52b9e3e2226d0b24c75415ca (diff) |
Optimze the method looping
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@991750 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r-- | sca-java-2.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/sca-java-2.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java b/sca-java-2.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java index 01a3c1813c..23f133b0a2 100644 --- a/sca-java-2.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java +++ b/sca-java-2.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java @@ -21,9 +21,7 @@ package org.apache.tuscany.sca.core.databinding.processor; import java.lang.annotation.Annotation; import java.lang.reflect.Method; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; @@ -66,26 +64,17 @@ public class DataBindingJavaInterfaceProcessor implements JavaInterfaceVisitor { wrapperStyle = dataBinding.wrapped(); } - Map<String, Operation> opMap = new HashMap<String, Operation>(); for (Operation op : javaInterface.getOperations()) { - opMap.put(op.getName(), op); + JavaOperation operation = (JavaOperation) op; // In the case of @WebMethod, the method name can be different from the operation name - if (op instanceof JavaOperation) { - opMap.put(((JavaOperation)op).getJavaMethod().getName(), op); - } + if (dataBindingId != null) { op.setDataBinding(dataBindingId); op.setWrapperStyle(wrapperStyle); } - } - for (Method method : clazz.getMethods()) { - if (method.getDeclaringClass() == Object.class) { - continue; - } - Operation operation = opMap.get(method.getName()); - if (operation == null) { // @WebMethod exclude=true - continue; - } + + Method method = operation.getJavaMethod(); + DataBinding methodDataBinding = clazz.getAnnotation(DataBinding.class); if (methodDataBinding == null) { methodDataBinding = dataBinding; |