Author: klape
Date: 2013-01-11 16:18:38 -0500 (Fri, 11 Jan 2013)
New Revision: 17232
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
Log:
[JBPAPP-10129] fixing checkstyle errors
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java 2013-01-11
18:56:30 UTC (rev 17231)
+++
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java 2013-01-11
21:18:38 UTC (rev 17232)
@@ -290,11 +290,9 @@
}
}
XmlJavaTypeAdapter xjta =
cls.getAnnotation(XmlJavaTypeAdapter.class);
- if (xjta != null) {
+ if (xjta != null && Utils.getTypeFromXmlAdapter(xjta) !=
null) {
Type t = Utils.getTypeFromXmlAdapter(xjta);
- if (t != null) {
- addType(t);
- }
+ addType(t);
return;
}
} else if (classes.contains(cls)) {
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java 2013-01-11
18:56:30 UTC (rev 17231)
+++
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java 2013-01-11
21:18:38 UTC (rev 17232)
@@ -48,11 +48,8 @@
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.bind.attachment.AttachmentMarshaller;
import javax.xml.bind.attachment.AttachmentUnmarshaller;
import javax.xml.namespace.NamespaceContext;
@@ -373,7 +370,7 @@
} else {
Object o = Utils.getMethodValue(m, elValue);
writeObject(marshaller, writer, new JAXBElement(mname, String.class,
o));
- }
+ }
}
writer.writeEndElement();
writer.flush();
@@ -447,9 +444,9 @@
reader.nextTag();
while (reader.getEventType() == XMLStreamReader.START_ELEMENT) {
QName q = reader.getName();
- String fieldName = q.getLocalPart();
- Field f = Utils.getField(cls, accessType, fieldName);
- if (f != null) {
+ String fieldName = q.getLocalPart();
+ Field f = Utils.getField(cls, accessType, fieldName);
+ if (f != null) {
Type type = f.getGenericType();
f.setAccessible(true);
if (JAXBSchemaInitializer.isArray(type)) {
@@ -461,18 +458,16 @@
o = java.lang.reflect.Array.newInstance(compType,
ret.size());
for (int x = 0; x < ret.size(); x++) {
Array.set(o, x, ret.get(x));
- }
+ }
} else {
o = ret.toArray((Object[]) Array.newInstance(compType,
ret.size()));
- }
}
-
- f.set(obj, o);
- } else {
- Object o = getElementValue(u.unmarshal(reader,
Utils.getFieldType(f)));
- Utils.setFieldValue(f, obj, o);
}
-
+ f.set(obj, o);
+ } else {
+ Object o = getElementValue(u.unmarshal(reader,
Utils.getFieldType(f)));
+ Utils.setFieldValue(f, obj, o);
+ }
} else {
String s = Character.toUpperCase(q.getLocalPart().charAt(0))
+ q.getLocalPart().substring(1);
@@ -507,10 +502,10 @@
Utils.setMethodValue(m, m2, obj, o);
}
}
- }
- return (Exception)obj;
+ }
+ return (Exception)obj;
} catch (Exception e) {
- throw new Fault(new Message("MARSHAL_ERROR", LOG, e.getMessage()),
e);
+ throw new Fault(new Message("MARSHAL_ERROR", LOG, e.getMessage()),
e);
}
}
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-01-11
18:56:30 UTC (rev 17231)
+++
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-01-11
21:18:38 UTC (rev 17232)
@@ -575,7 +575,7 @@
JAXBBeanInfo beanInfo = getBeanInfo(type);
if (beanInfo != null) {
addElement(elementList, beanInfo, new QName(namespace, f.getName()),
isArray(type));
- }
+ }
}
for (Method m : Utils.getGetters(cls, accessType)) {
//map method
@@ -586,7 +586,7 @@
String name = m.getName().substring(idx);
name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
addElement(elementList, beanInfo, new QName(namespace, name),
isArray(type));
- }
+ }
}
if (propertyOrder != null && propertyOrder.length == elementList.size())
{
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-01-11
18:56:30 UTC (rev 17231)
+++
thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-01-11
21:18:38 UTC (rev 17232)
@@ -72,7 +72,8 @@
return fields;
}
- private static Collection<Method> getMethods(Class<?> cls, XmlAccessType
accessType, boolean acceptSetters) {
+ private static Collection<Method> getMethods(Class<?> cls,
+ XmlAccessType accessType, boolean acceptSetters) {
return getMethodsInternal(cls, accessType, acceptSetters);
}
@@ -147,7 +148,9 @@
}
private static boolean isGetter(Method m) {
- if (m.getReturnType() != Void.class && m.getReturnType() != Void.TYPE
&& m.getParameterTypes().length == 0) {
+ if (m.getReturnType() != Void.class
+ && m.getReturnType() != Void.TYPE
+ && m.getParameterTypes().length == 0) {
Method setter = getSetter(m);
if (setter != null) {
return !setter.isAnnotationPresent(XmlTransient.class);
@@ -251,7 +254,8 @@
adapter = f.getType().getAnnotation(XmlJavaTypeAdapter.class);
}
if (adapter == null) {
- XmlJavaTypeAdapters adapters =
f.getDeclaringClass().getPackage().getAnnotation(XmlJavaTypeAdapters.class);
+ XmlJavaTypeAdapters adapters =
+
f.getDeclaringClass().getPackage().getAnnotation(XmlJavaTypeAdapters.class);
if (adapters != null) {
for (XmlJavaTypeAdapter candidate : adapters.value()) {
if (candidate != null &&
candidate.type().equals(f.getType())) {
@@ -274,7 +278,8 @@
adapter = m.getReturnType().getAnnotation(XmlJavaTypeAdapter.class);
}
if (adapter == null) {
- XmlJavaTypeAdapters adapters =
m.getDeclaringClass().getPackage().getAnnotation(XmlJavaTypeAdapters.class);
+ XmlJavaTypeAdapters adapters =
+
m.getDeclaringClass().getPackage().getAnnotation(XmlJavaTypeAdapters.class);
if (adapters != null) {
for (XmlJavaTypeAdapter candidate : adapters.value()) {
if (candidate != null &&
candidate.type().equals(m.getGenericReturnType())) {