cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [12/12] cxf git commit: Fix unnecessary else's and static refs in databindings
Date Fri, 04 Aug 2017 16:07:35 GMT
Fix unnecessary else's and static refs in databindings


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

Branch: refs/heads/master
Commit: 2a6144f5600160e285d6dda35b1355a8995f388a
Parents: 4bb53de
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Aug 4 10:30:05 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Aug 4 10:40:44 2017 -0400

----------------------------------------------------------------------
 .../java/org/apache/cxf/aegis/AegisContext.java |  6 +--
 .../apache/cxf/aegis/DatabindingException.java  |  7 ++-
 .../cxf/aegis/databinding/AegisDatabinding.java |  3 +-
 .../aegis/databinding/XMLStreamDataReader.java  |  5 +-
 .../org/apache/cxf/aegis/type/TypeUtil.java     | 21 ++++----
 .../apache/cxf/aegis/type/XMLTypeCreator.java   | 12 ++---
 .../apache/cxf/aegis/type/basic/BeanType.java   |  3 +-
 .../cxf/aegis/type/basic/BeanTypeInfo.java      |  3 +-
 .../type/basic/InterfaceInvocationHandler.java  |  8 ++-
 .../apache/cxf/aegis/type/basic/ObjectType.java |  5 +-
 .../cxf/aegis/type/java5/AnnotatedTypeInfo.java |  6 +--
 .../apache/cxf/aegis/type/java5/EnumType.java   |  2 +-
 .../cxf/aegis/type/java5/Java5TypeCreator.java  | 55 +++++++++-----------
 .../apache/cxf/aegis/util/NamespaceHelper.java  |  9 ++--
 .../aegis/util/stax/JDOMNamespaceContext.java   |  3 +-
 .../aegis/util/stax/W3CNamespaceContext.java    |  3 +-
 .../cxf/aegis/xml/stax/ElementReader.java       |  7 +--
 .../cxf/aegis/xml/stax/ElementWriter.java       |  7 ++-
 .../aegis/inheritance/InheritanceService.java   |  4 +-
 .../cxf/aegis/inheritance/ws1/impl/WS1Impl.java |  3 +-
 .../aegis/type/encoded/SoapArrayTypeTest.java   |  8 +--
 .../apache/cxf/aegis/xml/stax/ReaderTest.java   |  3 +-
 .../apache/cxf/jaxb/JAXBContextInitializer.java |  3 +-
 .../org/apache/cxf/jaxb/JAXBEncoderDecoder.java | 21 +++-----
 .../apache/cxf/jaxb/JAXBSchemaInitializer.java  |  6 +--
 .../org/apache/cxf/jaxb/JAXBWrapperHelper.java  |  3 +-
 .../apache/cxf/jaxb/WrapperHelperCompiler.java  |  3 +-
 .../attachment/JAXBAttachmentMarshaller.java    |  6 +--
 .../org/apache/cxf/jaxb/io/DataReaderImpl.java  | 23 ++++----
 .../org/apache/cxf/jaxb/io/DataWriterImpl.java  |  6 +--
 30 files changed, 106 insertions(+), 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java
index 4f9711f..d942881 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java
@@ -179,9 +179,8 @@ public class AegisContext {
     public AegisType getRootType(Class<?> clazz) {
         if (rootClasses.contains(clazz)) {
             return typeMapping.getType(clazz);
-        } else {
-            return null;
         }
+        return null;
     }
 
     /**
@@ -193,9 +192,8 @@ public class AegisContext {
     public AegisType getRootType(QName schemaTypeName) {
         if (rootTypeQNames.contains(schemaTypeName)) {
             return typeMapping.getType(schemaTypeName);
-        } else {
-            return null;
         }
+        return null;
     }
 
     private Set<Class<?>> rootMappableClasses() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/DatabindingException.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/DatabindingException.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/DatabindingException.java
index 0ec0a2b..f4d95ba 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/DatabindingException.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/DatabindingException.java
@@ -70,11 +70,10 @@ public class DatabindingException extends RuntimeException {
     public String getMessage() {
         if (getCause() == null || getCause() == this) {
             return getActualMessage();
-        } else {
-            return getActualMessage() + ". Nested exception is "
-                   + getCause().getClass().getName() + ": "
-                   + getCause().getMessage();
         }
+        return getActualMessage() + ". Nested exception is "
+               + getCause().getClass().getName() + ": "
+               + getCause().getMessage();
     }
 
     public String getActualMessage() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
index ba6b3d0..27a801a 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
@@ -486,9 +486,8 @@ public class AegisDatabinding extends AbstractDataBinding {
                         String message = ex.getMessage();
                         if (expected.equals(message)) {
                             continue;
-                        } else {
-                            throw ex;
                         }
+                        throw ex;
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
index e75136a..f37ac9c 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
@@ -49,10 +49,9 @@ public class XMLStreamDataReader implements DataReader<XMLStreamReader> {
             if (type == null) {
                 type = databinding.getType(part);
                 return reader.read(input, type);
-            } else {
-                ArrayType arrayType = (ArrayType) type;
-                return reader.readFlatArray(input, arrayType, part.getConcreteName());
             }
+            ArrayType arrayType = (ArrayType) type;
+            return reader.readFlatArray(input, arrayType, part.getConcreteName());
 
         } catch (Exception e) {
             throw new Fault(e);

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
index 69df9b9..47842fb 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
@@ -79,18 +79,16 @@ public final class TypeUtil {
                          + "\" was specified, but no corresponding AegisType was registered; defaulting to "
                          + baseType.getSchemaType());
                 return baseType;
-            } else {
-                LOG.warning("xsi:type=\"" + overrideName
-                         + "\" was specified, but no corresponding AegisType was registered; no default.");
-                return null;
             }
-        } else {
-            if (baseType == null) {
-                LOG.warning("xsi:type absent, and no type available for "
-                         + xsr.getName());
-            }
-            return baseType;
+            LOG.warning("xsi:type=\"" + overrideName
+                     + "\" was specified, but no corresponding AegisType was registered; no default.");
+            return null;
         }
+        if (baseType == null) {
+            LOG.warning("xsi:type absent, and no type available for "
+                     + xsr.getName());
+        }
+        return baseType;
     }
 
     /**
@@ -174,9 +172,8 @@ public final class TypeUtil {
                                               java.lang.reflect.Type reflectType) {
         if (reflectType == null) {
             return getWriteTypeStandalone(globalContext, value, (AegisType)null);
-        } else {
-            return globalContext.getTypeMapping().getTypeCreator().createType(reflectType);
         }
+        return globalContext.getTypeMapping().getTypeCreator().createType(reflectType);
 
 
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
index 5b6812f..e304bf4 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
@@ -233,9 +233,8 @@ public class XMLTypeCreator extends AbstractTypeCreator {
         Element mapping = findMapping(javaType);
         if (mapping != null) {
             return super.isEnum(javaType);
-        } else {
-            return nextCreator.isEnum(javaType);
         }
+        return nextCreator.isEnum(javaType);
     }
 
     @Override
@@ -243,9 +242,8 @@ public class XMLTypeCreator extends AbstractTypeCreator {
         Element mapping = findMapping(info.getType());
         if (mapping != null) {
             return super.createEnumType(info);
-        } else {
-            return nextCreator.createEnumType(info);
         }
+        return nextCreator.createEnumType(info);
     }
 
     @Override
@@ -406,9 +404,8 @@ public class XMLTypeCreator extends AbstractTypeCreator {
             type.setTypeMapping(getTypeMapping());
 
             return type;
-        } else {
-            return nextCreator.createDefaultType(info);
         }
+        return nextCreator.createDefaultType(info);
     }
 
     @Override
@@ -640,9 +637,8 @@ public class XMLTypeCreator extends AbstractTypeCreator {
             }
 
             return loadComponentClass(className);
-        } else {
-            return loadComponentClass(componentType);
         }
+        return loadComponentClass(componentType);
     }
 
     private Class<?> loadComponentClass(String componentType) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
index f5090f7..e37cbc9 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
@@ -611,9 +611,8 @@ public class BeanType extends AegisType {
                 this.info.setExtension(true);
             }
             return superType;
-        } else {
-            return null;
         }
+        return null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java
index f1ccc63..8215095 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java
@@ -237,9 +237,8 @@ public class BeanTypeInfo {
     protected QName createMappedName(PropertyDescriptor desc, boolean qualified) {
         if (qualified) {
             return new QName(getDefaultNamespace(), desc.getName());
-        } else {
-            return new QName(null, desc.getName());
         }
+        return new QName(null, desc.getName());
     }
 
     public void mapAttribute(String property, QName mappedName) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/InterfaceInvocationHandler.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/InterfaceInvocationHandler.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/InterfaceInvocationHandler.java
index 0874942..69de06f 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/InterfaceInvocationHandler.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/InterfaceInvocationHandler.java
@@ -145,13 +145,11 @@ class InterfaceInvocationHandler implements InvocationHandler {
             if (!Character.isUpperCase(methodName.charAt(firstCharacter + 1))) {
                 return Character.toLowerCase(methodName.charAt(firstCharacter))
                        + methodName.substring(firstCharacter + 1);
-            } else {
-                return methodName.substring(3);
             }
-        } else {
-            return Character.toLowerCase(methodName.charAt(firstCharacter))
-                   + methodName.substring(firstCharacter + 1);
+            return methodName.substring(3);
         }
+        return Character.toLowerCase(methodName.charAt(firstCharacter))
+               + methodName.substring(firstCharacter + 1);
     }
 
     protected Integer proxyHashCode(Object proxy) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
index 0eefc78..bedc5cb 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
@@ -130,10 +130,9 @@ public class ObjectType extends AegisType {
 
         if (-1 == colon) {
             return new QName(reader.getNamespace(), typeName);
-        } else {
-            return new QName(reader.getNamespaceForPrefix(typeName.substring(0, colon)), typeName
-                .substring(colon + 1));
         }
+        return new QName(reader.getNamespaceForPrefix(typeName.substring(0, colon)), typeName
+            .substring(colon + 1));
     }
 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeInfo.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeInfo.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeInfo.java
index a978bee..b92a485 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeInfo.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeInfo.java
@@ -88,9 +88,8 @@ public class AnnotatedTypeInfo extends BeanTypeInfo {
         QName name = createQName(desc);
         if (!qualify) {
             return new QName(null, name.getLocalPart());
-        } else {
-            return name;
         }
+        return name;
     }
 
     protected QName createQName(PropertyDescriptor desc) {
@@ -157,9 +156,8 @@ public class AnnotatedTypeInfo extends BeanTypeInfo {
         PropertyDescriptor desc = getPropertyDescriptorFromMappedName(name);
         if (annotationReader.isElement(desc.getReadMethod())) {
             return annotationReader.isNillable(desc.getReadMethod());
-        } else {
-            return super.isNillable(name);
         }
+        return super.isNillable(name);
     }
 
     public int getMinOccurs(QName name) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
index 91a4eb2..6d32f45 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
@@ -43,7 +43,7 @@ public class EnumType extends AegisType {
     @Override
     public void writeObject(Object object, MessageWriter writer, Context context) {
         // match the reader.
-        writer.writeValue(getValue((Enum<?>)object));
+        writer.writeValue(getValue(object));
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
index 3c74b87..26a5c69 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
@@ -62,9 +62,8 @@ public class Java5TypeCreator extends AbstractTypeCreator {
         }
         if (AegisType.class.isAssignableFrom(c)) {
             return c.asSubclass(AegisType.class);
-        } else {
-            throw new DatabindingException("Invalid Aegis type annotation to non-type class" + c);
         }
+        throw new DatabindingException("Invalid Aegis type annotation to non-type class" + c);
     }
 
     @Override
@@ -90,32 +89,31 @@ public class Java5TypeCreator extends AbstractTypeCreator {
                                              annotationReader.getParamNamespace(m, index)));
             }
             return info;
+        }
+        Type genericReturnType = m.getGenericReturnType();
+        TypeClassInfo info;
+        if (genericReturnType instanceof Class) {
+            info = nextCreator.createClassInfo(m, index);
         } else {
-            Type genericReturnType = m.getGenericReturnType();
-            TypeClassInfo info;
-            if (genericReturnType instanceof Class) {
-                info = nextCreator.createClassInfo(m, index);
-            } else {
-                info = new TypeClassInfo();
-                info.setDescription("method " + m.getName() + " parameter " + index);
-                info.setType(genericReturnType);
-            }
+            info = new TypeClassInfo();
+            info.setDescription("method " + m.getName() + " parameter " + index);
+            info.setType(genericReturnType);
+        }
 
-            if (m.getParameterAnnotations() != null && m.getAnnotations().length > 0) {
-                info.setAnnotations(m.getAnnotations());
-            }
+        if (m.getParameterAnnotations() != null && m.getAnnotations().length > 0) {
+            info.setAnnotations(m.getAnnotations());
+        }
 
-            info.setAegisTypeClass(castToAegisTypeClass(annotationReader.getReturnType(m)));
-            String returnName = annotationReader.getReturnTypeName(m);
-            if (returnName != null) {
-                info.setTypeName(createQName(m.getReturnType(),
-                                             genericReturnType,
-                                             returnName,
-                                             annotationReader.getReturnNamespace(m)));
+        info.setAegisTypeClass(castToAegisTypeClass(annotationReader.getReturnType(m)));
+        String returnName = annotationReader.getReturnTypeName(m);
+        if (returnName != null) {
+            info.setTypeName(createQName(m.getReturnType(),
+                                         genericReturnType,
+                                         returnName,
+                                         annotationReader.getReturnNamespace(m)));
 
-            }
-            return info;
         }
+        return info;
     }
 
     /*
@@ -140,9 +138,8 @@ public class Java5TypeCreator extends AbstractTypeCreator {
 
         if (componentType != null) {
             return createCollectionTypeFromGeneric(info);
-        } else {
-            return nextCreator.createCollectionType(info);
         }
+        return nextCreator.createCollectionType(info);
     }
 
     // should be called 'collection'
@@ -216,12 +213,10 @@ public class Java5TypeCreator extends AbstractTypeCreator {
                 // we really aren't prepared to deal with multiple upper bounds,
                 // so we just look at the first one.
                 return wildcardType.getUpperBounds()[0];
-            } else {
-                return paramType; // take our chances.
             }
-        } else {
-            return null;
+            return paramType; // take our chances.
         }
+        return null;
     }
 
     protected Type getComponentTypeForMap(Type genericType, Map<String, Type> pm, boolean key) {
@@ -254,7 +249,7 @@ public class Java5TypeCreator extends AbstractTypeCreator {
             if (Map.class.equals(pt.getRawType())) {
                 return types[key ? 0 : 1];
             }
-            return findMapGenericTypes((Class<?>)pt.getRawType(), pm, key);
+            return findMapGenericTypes(pt.getRawType(), pm, key);
         } else if (cls instanceof Class) {
             Class<?> c = (Class<?>)cls;
             if (Map.class.isAssignableFrom(c)) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java
index 31bc3b1..d873b7e 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java
@@ -318,12 +318,11 @@ public final class NamespaceHelper {
         int index = value.indexOf(':');
         if (index == -1) {
             return new QName(nc.getNamespaceURI(""), value, "");
-        } else {
-            String prefix = value.substring(0, index);
-            String localName = value.substring(index + 1);
-            String ns = nc.getNamespaceURI(prefix);
-            return new QName(ns, localName, prefix);
         }
+        String prefix = value.substring(0, index);
+        String localName = value.substring(index + 1);
+        String ns = nc.getNamespaceURI(prefix);
+        return new QName(ns, localName, prefix);
     }
 
     public static QName createQName(Element e, String value, String defaultNamespace) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMNamespaceContext.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMNamespaceContext.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMNamespaceContext.java
index ac903b9..a97712e 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMNamespaceContext.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMNamespaceContext.java
@@ -74,9 +74,8 @@ public class JDOMNamespaceContext implements NamespaceContext {
 
         if (element.getParentElement() != null) {
             return rawGetPrefix(element.getParentElement(), namespaceURI);
-        } else {
-            return null;
         }
+        return null;
     }
 
     static void rawGetPrefixes(Element element, String namespaceURI, List<String> prefixes) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CNamespaceContext.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CNamespaceContext.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CNamespaceContext.java
index 369504f..37a0dea 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CNamespaceContext.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CNamespaceContext.java
@@ -75,9 +75,8 @@ public class W3CNamespaceContext implements NamespaceContext {
                     String name = a.getNodeName();
                     if ("xmlns".equals(name)) {
                         return "";
-                    } else {
-                        return name.substring(6);
                     }
+                    return name.substring(6);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java
index a19d7ae..133cb4c 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java
@@ -24,6 +24,7 @@ import java.util.regex.Pattern;
 
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
@@ -151,7 +152,7 @@ public class ElementReader extends AbstractMessageReader {
             int event = root.getEventType();
             while (root.hasNext()) {
                 switch (event) {
-                case XMLStreamReader.START_ELEMENT:
+                case XMLStreamConstants.START_ELEMENT:
                     if (root.getDepth() > depth) {
                         hasCheckedChildren = true;
                         hasChildren = true;
@@ -159,7 +160,7 @@ public class ElementReader extends AbstractMessageReader {
                         return true;
                     }
                     break;
-                case XMLStreamReader.END_ELEMENT:
+                case XMLStreamConstants.END_ELEMENT:
                     if (root.getDepth() < depth) {
                         hasCheckedChildren = true;
                         hasChildren = false;
@@ -170,7 +171,7 @@ public class ElementReader extends AbstractMessageReader {
                         return false;
                     }
                     break;
-                case XMLStreamReader.END_DOCUMENT:
+                case XMLStreamConstants.END_DOCUMENT:
                     // We should never get here...
                     hasCheckedChildren = true;
                     hasChildren = false;

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementWriter.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementWriter.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementWriter.java
index 3574ae3..ef0150b 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementWriter.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementWriter.java
@@ -154,11 +154,10 @@ public class ElementWriter extends AbstractMessageWriter {
          */
         if ("".equals(qname.getPrefix())) {
             return new ElementWriter(writer, qname.getLocalPart(), qname.getNamespaceURI());
-        } else {
-            return new ElementWriter(writer, qname.getLocalPart(),
-                                     qname.getNamespaceURI(),
-                                     qname.getPrefix());
         }
+        return new ElementWriter(writer, qname.getLocalPart(),
+                                 qname.getNamespaceURI(),
+                                 qname.getPrefix());
     }
 
     public String getNamespace() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/InheritanceService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/InheritanceService.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/InheritanceService.java
index 129e28f..1bc780d 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/InheritanceService.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/InheritanceService.java
@@ -21,6 +21,8 @@
  */
 package org.apache.cxf.aegis.inheritance;
 
+import org.junit.Assert;
+
 public class InheritanceService {
     public AbstractUser getEmployee() {
         Employee e = new Employee();
@@ -31,6 +33,6 @@ public class InheritanceService {
     }
 
     public void receiveUser(AbstractUser user) {
-        InheritancePOJOTest.assertTrue(user instanceof Employee);
+        Assert.assertTrue(user instanceof Employee);
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ws1/impl/WS1Impl.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ws1/impl/WS1Impl.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ws1/impl/WS1Impl.java
index 803fd31..8a1d2f5 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ws1/impl/WS1Impl.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ws1/impl/WS1Impl.java
@@ -112,9 +112,8 @@ public class WS1Impl implements WS1 {
             throw new WS1ExtendedException("WS1 extended exception",
                                              20, 30,
                                              new SimpleBean());
-        } else {
-            throw new WS1Exception("WS1 base exception", 10);
         }
+        throw new WS1Exception("WS1 base exception", 10);
     }
 
     public Map<?, ?> echoRawMap(Map<?, ?> rawMap) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
index f39ffff..f332d50 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
@@ -175,13 +175,13 @@ public class SoapArrayTypeTest extends AbstractEncodedTest {
         ElementReader reader = new ElementReader(getClass().getResourceAsStream("arrayStructs.xml"));
         Address[] addresses = (Address[]) createArrayType(Address[].class).readObject(reader, context);
         reader.getXMLStreamReader().close();
-        StructTypeTest.validateShippingAddress(addresses[0]);
-        StructTypeTest.validateBillingAddress(addresses[1]);
+        AbstractEncodedTest.validateShippingAddress(addresses[0]);
+        AbstractEncodedTest.validateBillingAddress(addresses[1]);
 
         // round trip tests
         addresses = readWriteReadRef("arrayStructs.xml", Address[].class);
-        StructTypeTest.validateShippingAddress(addresses[0]);
-        StructTypeTest.validateBillingAddress(addresses[1]);
+        AbstractEncodedTest.validateShippingAddress(addresses[0]);
+        AbstractEncodedTest.validateBillingAddress(addresses[1]);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/xml/stax/ReaderTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/xml/stax/ReaderTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/xml/stax/ReaderTest.java
index 8e228a4..95132a8 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/xml/stax/ReaderTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/xml/stax/ReaderTest.java
@@ -19,6 +19,7 @@
 package org.apache.cxf.aegis.xml.stax;
 
 import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
@@ -47,7 +48,7 @@ public class ReaderTest extends AbstractCXFTest {
          */
         XMLStreamReader reader = StaxUtils.createXMLStreamReader(getResourceAsStream(resource), null);
 
-        while (reader.getEventType() != XMLStreamReader.START_ELEMENT) {
+        while (reader.getEventType() != XMLStreamConstants.START_ELEMENT) {
             reader.next();
         }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
----------------------------------------------------------------------
diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
index a727bf4..3fb0041 100644
--- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
+++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
@@ -449,9 +449,8 @@ class JAXBContextInitializer extends ServiceModelVisitor {
         if (accessType == XmlAccessType.NONE
             || accessType == XmlAccessType.PROPERTY) {
             return checkJaxbAnnotation(field.getAnnotations());
-        } else {
-            return true;
         }
+        return true;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
----------------------------------------------------------------------
diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
index 7770526..f39b18d 100644
--- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
+++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
@@ -266,9 +266,8 @@ public final class JAXBEncoderDecoder {
                 Message faultMessage = new Message("MARSHAL_ERROR", LOG, marshalEx.getLinkedException()
                     .getMessage());
                 throw new Fault(faultMessage, ex);
-            } else {
-                throw new Fault(new Message("MARSHAL_ERROR", LOG, ex.getMessage()), ex);
             }
+            throw new Fault(new Message("MARSHAL_ERROR", LOG, ex.getMessage()), ex);
         }
     }
     @SuppressWarnings({ "unchecked", "rawtypes" })
@@ -312,9 +311,8 @@ public final class JAXBEncoderDecoder {
                 Message faultMessage = new Message("MARSHAL_ERROR", LOG, marshalEx.getLinkedException()
                     .getMessage());
                 throw new Fault(faultMessage, ex);
-            } else {
-                throw new Fault(new Message("MARSHAL_ERROR", LOG, ex.getMessage()), ex);
             }
+            throw new Fault(new Message("MARSHAL_ERROR", LOG, ex.getMessage()), ex);
         }
 
     }
@@ -346,9 +344,8 @@ public final class JAXBEncoderDecoder {
                 Message faultMessage = new Message("MARSHAL_ERROR", LOG, marshalEx.getLinkedException()
                     .getMessage());
                 throw new Fault(faultMessage, ex);
-            } else {
-                throw new Fault(new Message("MARSHAL_ERROR", LOG, ex.getMessage()), ex);
             }
+            throw new Fault(new Message("MARSHAL_ERROR", LOG, ex.getMessage()), ex);
         }
 
     }
@@ -526,7 +523,7 @@ public final class JAXBEncoderDecoder {
 
             XmlAccessType accessType = Utils.getXmlAccessType(cls);
             reader.nextTag();
-            while (reader.getEventType() == XMLStreamReader.START_ELEMENT) {
+            while (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
                 QName q = reader.getName();
                 String fieldName = q.getLocalPart();
                 Field f = Utils.getField(cls, accessType, fieldName);
@@ -598,7 +595,7 @@ public final class JAXBEncoderDecoder {
                         }
                     }
                 }
-                if (reader.getEventType() == XMLStreamReader.END_ELEMENT && q.equals(reader.getName())) {
+                if (reader.getEventType() == XMLStreamConstants.END_ELEMENT && q.equals(reader.getName())) {
                     reader.next();
                 }
             }
@@ -906,10 +903,9 @@ public final class JAXBEncoderDecoder {
                 if (unmarshalEx.getLinkedException() != null) {
                     throw new Fault(new Message("UNMARSHAL_ERROR", LOG,
                                             unmarshalEx.getLinkedException().getMessage()), ex);
-                } else {
-                    throw new Fault(new Message("UNMARSHAL_ERROR", LOG,
-                                                unmarshalEx.getMessage()), ex);
                 }
+                throw new Fault(new Message("UNMARSHAL_ERROR", LOG,
+                                            unmarshalEx.getMessage()), ex);
             }
             throw new Fault(new Message("UNMARSHAL_ERROR", LOG, ex.getMessage()), ex);
         }
@@ -1092,9 +1088,8 @@ public final class JAXBEncoderDecoder {
                 javax.xml.bind.UnmarshalException unmarshalEx = (javax.xml.bind.UnmarshalException)ex;
                 throw new Fault(new Message("UNMARSHAL_ERROR", LOG, unmarshalEx.getLinkedException()
                     .getMessage()), ex);
-            } else {
-                throw new Fault(new Message("UNMARSHAL_ERROR", LOG, ex.getMessage()), ex);
             }
+            throw new Fault(new Message("UNMARSHAL_ERROR", LOG, ex.getMessage()), ex);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
----------------------------------------------------------------------
diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
index 97ca0e7..c82520d 100644
--- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
+++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
@@ -98,9 +98,8 @@ class JAXBSchemaInitializer extends ServiceModelVisitor {
         if (cls instanceof Class) {
             if (((Class<?>)cls).isArray()) {
                 return ((Class<?>)cls).getComponentType();
-            } else {
-                return (Class<?>)cls;
             }
+            return (Class<?>)cls;
         } else if (cls instanceof ParameterizedType) {
             for (Type t2 : ((ParameterizedType)cls).getActualTypeArguments()) {
                 return getArrayComponentType(t2);
@@ -117,9 +116,8 @@ class JAXBSchemaInitializer extends ServiceModelVisitor {
         if (cls instanceof Class) {
             if (((Class<?>)cls).isArray()) {
                 return getBeanInfo(((Class<?>)cls).getComponentType());
-            } else {
-                return getBeanInfo((Class<?>)cls);
             }
+            return getBeanInfo((Class<?>)cls);
         } else if (cls instanceof ParameterizedType) {
             for (Type t2 : ((ParameterizedType)cls).getActualTypeArguments()) {
                 return getBeanInfo(t2);

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java
----------------------------------------------------------------------
diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java
index 7546355..7ac8de3 100644
--- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java
+++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java
@@ -57,9 +57,8 @@ public class JAXBWrapperHelper extends AbstractWrapperHelper {
         if ("javax.xml.bind.JAXBElement".equals(method.getReturnType().getCanonicalName())) {
             JAXBElement<?> je = (JAXBElement<?>)method.invoke(in);
             return je == null ? je : je.getValue();
-        } else {
-            return method.invoke(in);
         }
+        return method.invoke(in);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
----------------------------------------------------------------------
diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
index 70613a2..ed9f64f 100644
--- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
+++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
@@ -237,9 +237,8 @@ final class WrapperHelperCompiler extends ASMHelper {
                     && fields[x] == null) {
                     // null placeholder
                     continue;
-                } else {
-                    return false;
                 }
+                return false;
             }
             Class<?> tp = getMethods[x].getReturnType();
             mv.visitVarInsn(Opcodes.ALOAD, 2);

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller.java
----------------------------------------------------------------------
diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller.java
index 40c6156..cdbab79 100644
--- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller.java
+++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller.java
@@ -59,9 +59,8 @@ public class JAXBAttachmentMarshaller extends AttachmentMarshaller {
             atts.add(att);
             lastElementName = new QName(elementNS, elementLocalName);
             return "cid:" + att.getId();
-        } else {
-            return null;
         }
+        return null;
     }
 
     public String addMtomAttachment(DataHandler handler, String elementNS, String elementLocalName) {
@@ -71,9 +70,8 @@ public class JAXBAttachmentMarshaller extends AttachmentMarshaller {
             atts.add(att);
             lastElementName = new QName(elementNS, elementLocalName);
             return "cid:" + att.getId();
-        } else {
-            return null;
         }
+        return null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java
----------------------------------------------------------------------
diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java
index 38e9174..e218de4 100644
--- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java
+++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java
@@ -73,16 +73,15 @@ public class DataReaderImpl<T> extends JAXBDataBase implements DataReader<T> {
             // to do anything, otherwise if not yet handled, then do this 'hack'
             if (origHandler != null && origHandler.handleEvent(event)) {
                 return true;
-            } else {
-                // hack for CXF-3453
-                String msg = event.getMessage();
-                return msg != null
-                    && msg.contains(":Id")
-                    && (msg.startsWith("cvc-type.3.1.1")
-                        || msg.startsWith("cvc-type.3.2.2")
-                        || msg.startsWith("cvc-complex-type.3.1.1")
-                        || msg.startsWith("cvc-complex-type.3.2.2"));
             }
+            // hack for CXF-3453
+            String msg = event.getMessage();
+            return msg != null
+                && msg.contains(":Id")
+                && (msg.startsWith("cvc-type.3.1.1")
+                    || msg.startsWith("cvc-type.3.2.2")
+                    || msg.startsWith("cvc-complex-type.3.1.1")
+                    || msg.startsWith("cvc-complex-type.3.2.2"));
         }
     }
 
@@ -139,9 +138,8 @@ public class DataReaderImpl<T> extends JAXBDataBase implements DataReader<T> {
                 javax.xml.bind.UnmarshalException unmarshalEx = (javax.xml.bind.UnmarshalException)ex;
                 throw new Fault(new Message("UNMARSHAL_ERROR", LOG, unmarshalEx.getLinkedException()
                     .getMessage()), ex);
-            } else {
-                throw new Fault(new Message("UNMARSHAL_ERROR", LOG, ex.getMessage()), ex);
             }
+            throw new Fault(new Message("UNMARSHAL_ERROR", LOG, ex.getMessage()), ex);
         }
     }
 
@@ -205,9 +203,8 @@ public class DataReaderImpl<T> extends JAXBDataBase implements DataReader<T> {
                 if (e.getLinkedException() != null) {
                     throw new Fault(new Message("UNMARSHAL_ERROR", LOG,
                             e.getLinkedException().getMessage()), e);
-                } else {
-                    throw new Fault(new Message("UNMARSHAL_ERROR", LOG, e.getMessage()), e);
                 }
+                throw new Fault(new Message("UNMARSHAL_ERROR", LOG, e.getMessage()), e);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/2a6144f5/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
----------------------------------------------------------------------
diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
index 37555e5..5ca0a36 100644
--- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
+++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
@@ -179,9 +179,8 @@ public class DataWriterImpl<T> extends JAXBDataBase implements DataWriter<T> {
                 Message faultMessage = new Message("MARSHAL_ERROR", LOG, marshalEx.getLinkedException()
                     .getMessage());
                 throw new Fault(faultMessage, ex);
-            } else {
-                throw new Fault(new Message("MARSHAL_ERROR", LOG, ex.getMessage()), ex);
             }
+            throw new Fault(new Message("MARSHAL_ERROR", LOG, ex.getMessage()), ex);
         }
         for (XmlAdapter<?, ?> adapter : databinding.getConfiguredXmlAdapters()) {
             marshaller.setAdapter(adapter);
@@ -307,9 +306,8 @@ public class DataWriterImpl<T> extends JAXBDataBase implements DataWriter<T> {
                 if (e.getLinkedException() != null) {
                     throw new Fault(new Message("MARSHAL_ERROR", LOG,
                             e.getLinkedException().getMessage()), e);
-                } else {
-                    throw new Fault(new Message("MARSHAL_ERROR", LOG, e.getMessage()), e);
                 }
+                throw new Fault(new Message("MARSHAL_ERROR", LOG, e.getMessage()), e);
             }
         }
     }


Mime
View raw message