cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject git commit: Squashed commit of the following: This closes #6
Date Tue, 01 Jul 2014 22:51:18 GMT
Repository: cxf
Updated Branches:
  refs/heads/master f6def6a6e -> d21734623


Squashed commit of the following:
This closes #6

commit acdc0ca2cbce406733c238c87a532f641f67c817
Author: Peter Frandsen <pfrandsen@gmail.com>
Date:   Thu Jun 5 18:20:57 2014 +0200

    Update SOAPBindingUtil.java

    Added methods to get list of input and output SOAP headers.
    Issue https://issues.apache.org/jira/browse/CXF-5789

commit 047be6b98589471af544aa8ee47c6cc447924472
Author: Peter Frandsen <pfrandsen@gmail.com>
Date:   Thu Jun 5 13:01:44 2014 +0200

    Update WSIBPValidator.java

    Added check for method signature before call through reflection.
    Run all checks before returning false in case of validation error.

commit e0fc39168c584e683791f88da6b2ea98a5ea3789
Author: Peter Frandsen <pfrandsen@gmail.com>
Date:   Mon Jun 2 18:48:34 2014 +0200

    Update ToolErrorListener.java

    update addError and addWarning to pass message methods they call instead of passing null


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d2173462
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d2173462
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d2173462

Branch: refs/heads/master
Commit: d217346231448c07dcadea6c8c3a9243e0688808
Parents: f6def6a
Author: Daniel Kulp <dkulp@apache.org>
Authored: Tue Jul 1 15:31:23 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Tue Jul 1 18:51:00 2014 -0400

----------------------------------------------------------------------
 .../cxf/binding/soap/SOAPBindingUtil.java       | 26 ++++++++++++++++++++
 .../cxf/tools/common/ToolErrorListener.java     |  4 +--
 .../validator/internal/WSIBPValidator.java      | 15 ++++++-----
 3 files changed, 35 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d2173462/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SOAPBindingUtil.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SOAPBindingUtil.java
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SOAPBindingUtil.java
index 1cda137..23327e8 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SOAPBindingUtil.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SOAPBindingUtil.java
@@ -249,6 +249,19 @@ public final class SOAPBindingUtil {
         return null;
     }
 
+    public static List<SoapHeader> getBindingInputSOAPHeaders(BindingOperation bop)
{
+        List<SoapHeader> headers = new ArrayList<SoapHeader>();
+        BindingInput bindingInput = bop.getBindingInput();
+        if (bindingInput != null) {
+            for (Object obj : bindingInput.getExtensibilityElements()) {
+                if (isSOAPHeader(obj)) {
+                    headers.add(getProxy(SoapHeader.class, obj));
+                }
+            }
+        }
+        return headers;
+    }
+
     public static SoapHeader getBindingOutputSOAPHeader(BindingOperation bop) {
         BindingOutput bindingOutput = bop.getBindingOutput();
         if (bindingOutput != null) {
@@ -262,6 +275,19 @@ public final class SOAPBindingUtil {
         return null;
     }
 
+    public static List<SoapHeader> getBindingOutputSOAPHeaders(BindingOperation bop)
{
+        List<SoapHeader> headers = new ArrayList<SoapHeader>();
+        BindingOutput bindingOutput = bop.getBindingOutput();
+        if (bindingOutput != null) {
+            for (Object obj : bindingOutput.getExtensibilityElements()) {
+                if (isSOAPHeader(obj)) {
+                    headers.add(getProxy(SoapHeader.class, obj));
+                }
+            }
+        }
+        return headers;
+    }
+
     public static SoapBinding getSoapBinding(List<ExtensibilityElement> exts) {
         for (ExtensibilityElement ext : exts) {
             if (isSOAPBinding(ext)) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d2173462/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java
b/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java
index 3815646..aff9015 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java
@@ -49,14 +49,14 @@ public class ToolErrorListener {
     List<ErrorInfo> errors = new LinkedList<ErrorInfo>();
     
     public void addError(String file, int line, int column, String message) {
-        addError(file, line, column, null, null);
+        addError(file, line, column, message, null);
     }
     public void addError(String file, int line, int column, String message, Throwable t)
{
         errors.add(new ErrorInfo(file, line, column, message, t));
     }
 
     public void addWarning(String file, int line, int column, String message) {
-        addWarning(file, line, column, null, null);
+        addWarning(file, line, column, message, null);
     }
     public void addWarning(String file, int line, int column, String message, Throwable t)
{
         if (file != null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d2173462/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
----------------------------------------------------------------------
diff --git a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
index 5e7a33d..cb4a413 100644
--- a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
+++ b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.tools.validator.internal;
 
-import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -55,21 +54,21 @@ public class WSIBPValidator extends AbstractDefinitionValidator {
     }
 
     public boolean isValid() {
+        boolean valid = true;
         for (Method m : getClass().getMethods()) {
-            if (m.getName().startsWith("check") || m.getModifiers() == Member.PUBLIC) {
+            if (m.getName().startsWith("check") && m.getGenericReturnType() == boolean.class
+                    && m.getGenericParameterTypes().length == 0) {
                 try {
-                    Boolean res = (Boolean)m.invoke(this, new Object[] {});
-                    if (!res.booleanValue()) {
-                        return false;
+                    Boolean res = (Boolean) m.invoke(this);
+                    if (!res) {
+                        valid = false;
                     }
                 } catch (Exception e) {
-                    e.printStackTrace();
                     throw new ToolException(e);
                 }
             }
         }
-        return true;
-
+        return valid;
     }
 
     private boolean checkR2716(final BindingOperation bop) {


Mime
View raw message