cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r516103 [3/11] - in /incubator/cxf/trunk: ./ common/common/src/test/java/org/apache/cxf/common/annotation/ common/common/src/test/java/org/apache/cxf/common/classloader/ common/common/src/test/java/org/apache/cxf/common/commands/ common/com...
Date Thu, 08 Mar 2007 17:15:05 GMT
Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeInfo.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeInfo.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeInfo.java Thu Mar  8 09:14:44 2007
@@ -38,8 +38,9 @@
      * Override from parent in order to check for IgnoreProperty annotation.
      */
     protected void mapProperty(PropertyDescriptor pd) {
-        if (isIgnored(pd))
+        if (isIgnored(pd)) {
             return; // do not map ignored properties
+        }
 
         String name = pd.getName();
         if (isAttribute(pd)) {
@@ -52,12 +53,14 @@
     @Override
     protected boolean registerType(PropertyDescriptor desc) {
         XmlAttribute att = desc.getReadMethod().getAnnotation(XmlAttribute.class);
-        if (att != null && att.type() != Type.class)
+        if (att != null && att.type() != Type.class) {
             return false;
+        }
 
         XmlElement el = desc.getReadMethod().getAnnotation(XmlElement.class);
-        if (el != null && el.type() != Type.class)
-            return false;
+        if (el != null && el.type() != Type.class) {
+            return false;            
+        }
 
         return super.registerType(desc);
     }
@@ -95,20 +98,24 @@
         if (isAttribute(desc)) {
             XmlAttribute att = desc.getReadMethod().getAnnotation(XmlAttribute.class);
             name = att.name();
-            if (att.namespace().length() > 0)
-                ns = att.namespace();
+            if (att.namespace().length() > 0) {
+                ns = att.namespace();                
+            }
         } else if (isAnnotatedElement(desc)) {
             XmlElement att = desc.getReadMethod().getAnnotation(XmlElement.class);
             name = att.name();
-            if (att.namespace().length() > 0)
+            if (att.namespace().length() > 0) {
                 ns = att.namespace();
+            }
         }
 
-        if (name == null || name.length() == 0)
+        if (name == null || name.length() == 0) {
             name = desc.getName();
+        }
 
-        if (ns == null || ns.length() == 0)
+        if (ns == null || ns.length() == 0) {
             ns = NamespaceHelper.makeNamespaceFromClassName(getTypeClass().getName(), "http");
+        }
 
         return new QName(ns, name);
     }
@@ -117,8 +124,7 @@
         PropertyDescriptor desc = getPropertyDescriptorFromMappedName(name);
 
         if (isAnnotatedElement(desc)) {
-            XmlElement att = desc.getReadMethod().getAnnotation(XmlElement.class);
-            return att.nillable();
+            return desc.getReadMethod().getAnnotation(XmlElement.class).nillable();
         } else {
             return super.isNillable(name);
         }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java Thu Mar  8 09:14:44 2007
@@ -24,7 +24,6 @@
 import org.apache.cxf.aegis.util.XmlConstants;
 import org.apache.cxf.aegis.xml.MessageReader;
 import org.apache.cxf.aegis.xml.MessageWriter;
-import org.apache.cxf.binding.soap.SoapConstants;
 import org.jdom.Attribute;
 import org.jdom.Element;
 import org.jdom.Namespace;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/IgnoreProperty.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/IgnoreProperty.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/IgnoreProperty.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/IgnoreProperty.java Thu Mar  8 09:14:44 2007
@@ -32,7 +32,6 @@
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.METHOD)
-public @interface IgnoreProperty
-{
+public @interface IgnoreProperty {
 
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java Thu Mar  8 09:14:44 2007
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.aegis.type.java5;
 
 import java.beans.PropertyDescriptor;
@@ -31,8 +49,9 @@
 
             XmlParamType xmlParam = getXmlParamAnnotation(m, index);
             if (xmlParam != null) {
-                if (xmlParam.type() != Type.class)
+                if (xmlParam.type() != Type.class) {
                     info.setType(xmlParam.type());
+                }
 
                 info.setTypeName(createQName(m.getParameterTypes()[index], xmlParam.name(), xmlParam
                     .namespace()));
@@ -49,13 +68,15 @@
                 info.setGenericType(genericReturnType);
             }
             info.setTypeClass(m.getReturnType());
-            if (m.getParameterAnnotations() != null && m.getAnnotations().length > 0)
+            if (m.getParameterAnnotations() != null && m.getAnnotations().length > 0) {
                 info.setAnnotations(m.getAnnotations());
+            }
 
             XmlReturnType xmlParam = m.getAnnotation(XmlReturnType.class);
             if (xmlParam != null) {
-                if (xmlParam.type() != Type.class)
+                if (xmlParam.type() != Type.class) {
                     info.setType(xmlParam.type());
+                }
 
                 info.setTypeName(createQName(m.getReturnType(), xmlParam.name(), xmlParam.namespace()));
             }
@@ -65,9 +86,11 @@
     }
 
     public XmlParamType getXmlParamAnnotation(Method m, int index) {
-        if (m.getParameterAnnotations() == null || m.getParameterAnnotations().length <= index
-            || m.getParameterAnnotations()[index] == null)
+        if (m.getParameterAnnotations() == null
+            || m.getParameterAnnotations().length <= index
+            || m.getParameterAnnotations()[index] == null) {
             return null;
+        }
 
         Annotation[] annotations = m.getParameterAnnotations()[index];
 
@@ -162,9 +185,7 @@
 
             if (type.getActualTypeArguments()[index] instanceof Class) {
                 paramClass = (Class)type.getActualTypeArguments()[index];
-            }
-
-            else if (type.getActualTypeArguments()[index] instanceof WildcardType) {
+            } else if (type.getActualTypeArguments()[index] instanceof WildcardType) {
                 WildcardType wildcardType = (WildcardType)type.getActualTypeArguments()[index];
 
                 if (wildcardType.getUpperBounds()[index] instanceof Class) {
@@ -182,8 +203,9 @@
     @Override
     public Type createDefaultType(TypeClassInfo info) {
         QName typeName = info.getTypeName();
-        if (typeName == null)
+        if (typeName == null) {
             typeName = createQName(info.getTypeClass());
+        }
 
         AnnotatedTypeInfo typeInfo = new AnnotatedTypeInfo(getTypeMapping(), info.getTypeClass(), typeName
             .getNamespaceURI());
@@ -234,11 +256,13 @@
 
     private QName createQName(Class typeClass, String name, String ns) {
         String clsName = typeClass.getName();
-        if (name == null || name.length() == 0)
+        if (name == null || name.length() == 0) {
             name = ServiceUtils.makeServiceNameFromClassName(typeClass);
+        }
 
-        if (ns == null || ns.length() == 0)
+        if (ns == null || ns.length() == 0) {
             ns = NamespaceHelper.makeNamespaceFromClassName(clsName, "http");
+        }
 
         return new QName(ns, name);
     }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java Thu Mar  8 09:14:44 2007
@@ -35,12 +35,12 @@
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  */
 public abstract class AbstractXOPType extends Type {
-    public final static String XOP_NS = "http://www.w3.org/2004/08/xop/include";
-    public final static String XML_MIME_NS = "http://www.w3.org/2004/11/xmlmime";
+    public static final String XOP_NS = "http://www.w3.org/2004/08/xop/include";
+    public static final String XML_MIME_NS = "http://www.w3.org/2004/11/xmlmime";
 
-    public final static QName XOP_INCLUDE = new QName(XOP_NS, "Include");
-    public final static QName XOP_HREF = new QName("href");
-    public final static QName XML_MIME_TYPE = new QName(XML_MIME_NS, "mimeType");
+    public static final QName XOP_INCLUDE = new QName(XOP_NS, "Include");
+    public static final QName XOP_HREF = new QName("href");
+    public static final QName XML_MIME_TYPE = new QName(XML_MIME_NS, "mimeType");
 
     public AbstractXOPType() {
     }
@@ -61,7 +61,8 @@
         return o;
     }
 
-    public Object readInclude(String type, MessageReader reader, Context context) throws DatabindingException {
+    public Object readInclude(String type, MessageReader reader,
+                              Context context) throws DatabindingException {
         String href = reader.getAttributeReader(XOP_HREF).getValue();
 
         Attachment att = AttachmentUtil.getAttachment(href, context.getAttachments());
@@ -80,7 +81,8 @@
     protected abstract Object readAttachment(Attachment att, Context context) throws IOException;
 
     @Override
-    public void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException {
+    public void writeObject(Object object, MessageWriter writer,
+                            Context context) throws DatabindingException {
         Collection<Attachment> attachments = context.getAttachments();
         if (attachments == null) {
             attachments = new ArrayList<Attachment>();

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AttachmentUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AttachmentUtil.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AttachmentUtil.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AttachmentUtil.java Thu Mar  8 09:14:44 2007
@@ -33,7 +33,11 @@
 import org.apache.cxf.attachment.AttachmentImpl;
 import org.apache.cxf.message.Attachment;
 
-public class AttachmentUtil {
+public final class AttachmentUtil {
+    private AttachmentUtil() {
+        //utility class
+    }
+    
     public static String createContentID(String ns) {
         String uid = UID.generate();
         try {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/ByteArrayType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/ByteArrayType.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/ByteArrayType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/ByteArrayType.java Thu Mar  8 09:14:44 2007
@@ -68,9 +68,10 @@
         try {
             final byte[] buffer = new byte[8096];
 
-            int n = 0;
-            while (-1 != (n = input.read(buffer))) {
+            int n = input.read(buffer);
+            while (-1 != n) {
                 output.write(buffer, 0, n);
+                n = input.read(buffer);
             }
         } finally {
             output.close();

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/DocumentType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/DocumentType.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/DocumentType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/DocumentType.java Thu Mar  8 09:14:44 2007
@@ -70,7 +70,8 @@
     }
 
     @Override
-    public void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException {
+    public void writeObject(Object object, MessageWriter writer,
+                            Context context) throws DatabindingException {
         Document doc = (Document)object;
 
         try {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/JDOMDocumentType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/JDOMDocumentType.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/JDOMDocumentType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/JDOMDocumentType.java Thu Mar  8 09:14:44 2007
@@ -63,7 +63,8 @@
     }
 
     @Override
-    public void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException {
+    public void writeObject(Object object, MessageWriter writer,
+                            Context context) throws DatabindingException {
         Document doc = (Document)object;
 
         try {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/JDOMElementType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/JDOMElementType.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/JDOMElementType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/JDOMElementType.java Thu Mar  8 09:14:44 2007
@@ -63,7 +63,8 @@
     }
 
     @Override
-    public void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException {
+    public void writeObject(Object object, MessageWriter writer,
+                            Context context) throws DatabindingException {
         Element el = (Element)object;
 
         try {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/SourceType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/SourceType.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/SourceType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/SourceType.java Thu Mar  8 09:14:44 2007
@@ -68,7 +68,8 @@
     }
 
     @Override
-    public void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException {
+    public void writeObject(Object object, MessageWriter writer,
+                            Context context) throws DatabindingException {
         try {
             if (object == null) {
                 return;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/XMLStreamReaderType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/XMLStreamReaderType.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/XMLStreamReaderType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/XMLStreamReaderType.java Thu Mar  8 09:14:44 2007
@@ -46,7 +46,9 @@
     }
 
     @Override
-    public void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException {
+    public void writeObject(Object object,
+                            MessageWriter writer,
+                            Context context) throws DatabindingException {
         XMLStreamReader reader = (XMLStreamReader)object;
 
         try {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/Base64.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/Base64.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/Base64.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/Base64.java Thu Mar  8 09:14:44 2007
@@ -22,7 +22,7 @@
 /**
  * @author TAMURA Kent &lt;kent@trl.ibm.co.jp&gt;
  */
-public class Base64 {
+public final class Base64 {
     private static final char[] S_BASE64CHAR = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
                                                 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
                                                 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
@@ -41,6 +41,10 @@
         }
     }
 
+    private Base64() {
+        //utility
+    }
+    
     private static int decode0(char[] ibuf, byte[] obuf, int wp) {
         int outlen = 3;
         if (ibuf[3] == S_BASE64PAD) {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/CachedOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/CachedOutputStream.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/CachedOutputStream.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/CachedOutputStream.java Thu Mar  8 09:14:44 2007
@@ -34,9 +34,9 @@
 public class CachedOutputStream extends OutputStream {
     private OutputStream currentStream;
     private int threshold;
-    private int totalLength = 0;
-    private boolean inmem = false;
-    private File tempFile = null;
+    private int totalLength;
+    private boolean inmem;
+    private File tempFile;
     private File outputDir;
 
     public CachedOutputStream(int threshold, File outputDir) throws IOException {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/FastStack.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/FastStack.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/FastStack.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/FastStack.java Thu Mar  8 09:14:44 2007
@@ -26,7 +26,7 @@
         add(o);
     }
 
-    public Object pop() {
+    public T pop() {
         if (empty()) {
             throw new EmptyStackException();
         }
@@ -38,7 +38,7 @@
         return size() == 0;
     }
 
-    public Object peek() {
+    public T peek() {
         if (empty()) {
             throw new EmptyStackException();
         }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/JavaUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/JavaUtils.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/JavaUtils.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/JavaUtils.java Thu Mar  8 09:14:44 2007
@@ -1,18 +1,21 @@
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ /**
+  * Licensed to the Apache Software Foundation (ASF) under one
+  * or more contributor license agreements. See the NOTICE file
+  * distributed with this work for additional information
+  * regarding copyright ownership. The ASF licenses this file
+  * to you under the Apache License, Version 2.0 (the
+  * "License"); you may not use this file except in compliance
+  * with the License. You may obtain a copy of the License at
+  *
+  * http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing,
+  * software distributed under the License is distributed on an
+  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  * KIND, either express or implied. See the License for the
+  * specific language governing permissions and limitations
+  * under the License.
+  */
 package org.apache.cxf.aegis.util;
 
 import java.text.Collator;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java Thu Mar  8 09:14:44 2007
@@ -1,20 +1,21 @@
-/*
- * This file contains software licensed under the Aapache License:
- * 
- * Copyright 2001-2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ /**
+  * Licensed to the Apache Software Foundation (ASF) under one
+  * or more contributor license agreements. See the NOTICE file
+  * distributed with this work for additional information
+  * regarding copyright ownership. The ASF licenses this file
+  * to you under the Apache License, Version 2.0 (the
+  * "License"); you may not use this file except in compliance
+  * with the License. You may obtain a copy of the License at
+  *
+  * http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing,
+  * software distributed under the License is distributed on an
+  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  * KIND, either express or implied. See the License for the
+  * specific language governing permissions and limitations
+  * under the License.
+  */
 package org.apache.cxf.aegis.util;
 
 import java.net.MalformedURLException;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/STAXUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/STAXUtils.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/STAXUtils.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/STAXUtils.java Thu Mar  8 09:14:44 2007
@@ -57,17 +57,21 @@
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  * @since Oct 26, 2004
  */
-public class STAXUtils {
+public final class STAXUtils {
     private static final String XML_NS = "http://www.w3.org/2000/xmlns/";
 
-    private final static Log logger = LogFactory.getLog(STAXUtils.class);
+    private static final Log LOG = LogFactory.getLog(STAXUtils.class);
 
-    private final static XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
-    private final static XMLOutputFactory xmlOututFactory = XMLOutputFactory.newInstance();
+    private static final XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
+    private static final XMLOutputFactory xmlOututFactory = XMLOutputFactory.newInstance();
+    
+    private static final Map<String, Object> factories = new HashMap<String, Object>();
     private static boolean inFactoryConfigured;
 
-    private final static Map<String, Object> factories = new HashMap<String, Object>();
 
+    private STAXUtils() {
+        //utility class
+    }
     /**
      * Returns true if currently at the start of an element, otherwise move
      * forwards to the next element start and return true, otherwise false is
@@ -291,7 +295,7 @@
         }
 
         String decUri = writer.getNamespaceContext().getNamespaceURI(prefix);
-        boolean declareNamespace = (decUri == null || !decUri.equals(ns));
+        boolean declareNamespace = decUri == null || !decUri.equals(ns);
 
         if (ns == null || ns.length() == 0) {
             writer.writeStartElement(localName);
@@ -311,13 +315,13 @@
                 name = name.substring(prefixIndex + 1);
             }
 
-            if (attrPrefix.equals("xmlns")) {
+            if ("xmlns".equals(attrPrefix)) {
                 writer.writeNamespace(name, attr.getNodeValue());
                 if (name.equals(prefix) && attr.getNodeValue().equals(ns)) {
                     declareNamespace = false;
                 }
             } else {
-                if (name.equals("xmlns") && attrPrefix.equals("")) {
+                if ("xmlns".equals(name) && "".equals(attrPrefix)) {
                     writer.writeNamespace("", attr.getNodeValue());
                     if (attr.getNodeValue().equals(ns)) {
                         declareNamespace = false;
@@ -341,7 +345,9 @@
         writer.writeEndElement();
     }
 
-    public static void writeNode(Node n, XMLStreamWriter writer, boolean repairing) throws XMLStreamException {
+    public static void writeNode(Node n,
+                                 XMLStreamWriter writer,
+                                 boolean repairing) throws XMLStreamException {
         if (n instanceof Element) {
             writeElement((Element)n, writer, repairing);
         } else if (n instanceof Text) {
@@ -642,7 +648,7 @@
             factoryClass = ClassLoaderUtils.loadClass(factory, ctx.getClass());
             return factoryClass.newInstance();
         } catch (Exception e) {
-            logger.error("Can't create factory for class : " + factory, e);
+            LOG.error("Can't create factory for class : " + factory, e);
             throw new DatabindingException("Can't create factory for class : " + factory);
         }
     }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/ServiceUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/ServiceUtils.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/ServiceUtils.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/ServiceUtils.java Thu Mar  8 09:14:44 2007
@@ -27,7 +27,7 @@
  * 
  * @author Arjen Poutsma
  */
-public class ServiceUtils {
+public final class ServiceUtils {
     private ServiceUtils() {
 
     }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/UID.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/UID.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/UID.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/UID.java Thu Mar  8 09:14:44 2007
@@ -23,10 +23,14 @@
 /**
  * @author Hani Suleiman Date: Jun 10, 2005 Time: 3:20:28 PM
  */
-public class UID {
+public final class UID {
     private static int counter;
     private static Random random = new Random(System.currentTimeMillis());
 
+    private UID() {
+        //utility
+    }
+    
     public static String generate() {
         return String.valueOf(System.currentTimeMillis()) + counter++ + random.nextInt();
     }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateFormat.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateFormat.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateFormat.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateFormat.java Thu Mar  8 09:14:44 2007
@@ -1,17 +1,20 @@
-/*
- * Copyright 2003, 2004  The Apache Software Foundation
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.cxf.aegis.util.date;
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateTimeFormat.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateTimeFormat.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateTimeFormat.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateTimeFormat.java Thu Mar  8 09:14:44 2007
@@ -1,17 +1,20 @@
-/*
- * Copyright 2003, 2004  The Apache Software Foundation
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.cxf.aegis.util.date;
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsTimeFormat.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsTimeFormat.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsTimeFormat.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsTimeFormat.java Thu Mar  8 09:14:44 2007
@@ -1,17 +1,20 @@
-/*
- * Copyright 2003, 2004  The Apache Software Foundation
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.cxf.aegis.util.date;
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/jdom/StaxBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/jdom/StaxBuilder.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/jdom/StaxBuilder.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/jdom/StaxBuilder.java Thu Mar  8 09:14:44 2007
@@ -89,51 +89,43 @@
      * Map that contains conversion from textual attribute types StAX uses, to
      * int values JDOM uses.
      */
-    final static HashMap<String, Integer> attrTypes = new HashMap<String, Integer>(32);
+    private static final Map<String, Integer> ATTR_TYPES = new HashMap<String, Integer>(32);
     static {
-        attrTypes.put("CDATA", new Integer(Attribute.CDATA_TYPE));
-        attrTypes.put("cdata", new Integer(Attribute.CDATA_TYPE));
-        attrTypes.put("ID", new Integer(Attribute.ID_TYPE));
-        attrTypes.put("id", new Integer(Attribute.ID_TYPE));
-        attrTypes.put("IDREF", new Integer(Attribute.IDREF_TYPE));
-        attrTypes.put("idref", new Integer(Attribute.IDREF_TYPE));
-        attrTypes.put("IDREFS", new Integer(Attribute.IDREFS_TYPE));
-        attrTypes.put("idrefs", new Integer(Attribute.IDREFS_TYPE));
-        attrTypes.put("ENTITY", new Integer(Attribute.ENTITY_TYPE));
-        attrTypes.put("entity", new Integer(Attribute.ENTITY_TYPE));
-        attrTypes.put("ENTITIES", new Integer(Attribute.ENTITIES_TYPE));
-        attrTypes.put("entities", new Integer(Attribute.ENTITIES_TYPE));
-        attrTypes.put("NMTOKEN", new Integer(Attribute.NMTOKEN_TYPE));
-        attrTypes.put("nmtoken", new Integer(Attribute.NMTOKEN_TYPE));
-        attrTypes.put("NMTOKENS", new Integer(Attribute.NMTOKENS_TYPE));
-        attrTypes.put("nmtokens", new Integer(Attribute.NMTOKENS_TYPE));
-        attrTypes.put("NOTATION", new Integer(Attribute.NOTATION_TYPE));
-        attrTypes.put("notation", new Integer(Attribute.NOTATION_TYPE));
-        attrTypes.put("ENUMERATED", new Integer(Attribute.ENUMERATED_TYPE));
-        attrTypes.put("enumerated", new Integer(Attribute.ENUMERATED_TYPE));
+        ATTR_TYPES.put("CDATA", new Integer(Attribute.CDATA_TYPE));
+        ATTR_TYPES.put("cdata", new Integer(Attribute.CDATA_TYPE));
+        ATTR_TYPES.put("ID", new Integer(Attribute.ID_TYPE));
+        ATTR_TYPES.put("id", new Integer(Attribute.ID_TYPE));
+        ATTR_TYPES.put("IDREF", new Integer(Attribute.IDREF_TYPE));
+        ATTR_TYPES.put("idref", new Integer(Attribute.IDREF_TYPE));
+        ATTR_TYPES.put("IDREFS", new Integer(Attribute.IDREFS_TYPE));
+        ATTR_TYPES.put("idrefs", new Integer(Attribute.IDREFS_TYPE));
+        ATTR_TYPES.put("ENTITY", new Integer(Attribute.ENTITY_TYPE));
+        ATTR_TYPES.put("entity", new Integer(Attribute.ENTITY_TYPE));
+        ATTR_TYPES.put("ENTITIES", new Integer(Attribute.ENTITIES_TYPE));
+        ATTR_TYPES.put("entities", new Integer(Attribute.ENTITIES_TYPE));
+        ATTR_TYPES.put("NMTOKEN", new Integer(Attribute.NMTOKEN_TYPE));
+        ATTR_TYPES.put("nmtoken", new Integer(Attribute.NMTOKEN_TYPE));
+        ATTR_TYPES.put("NMTOKENS", new Integer(Attribute.NMTOKENS_TYPE));
+        ATTR_TYPES.put("nmtokens", new Integer(Attribute.NMTOKENS_TYPE));
+        ATTR_TYPES.put("NOTATION", new Integer(Attribute.NOTATION_TYPE));
+        ATTR_TYPES.put("notation", new Integer(Attribute.NOTATION_TYPE));
+        ATTR_TYPES.put("ENUMERATED", new Integer(Attribute.ENUMERATED_TYPE));
+        ATTR_TYPES.put("enumerated", new Integer(Attribute.ENUMERATED_TYPE));
     }
 
-    /** The factory for creating new JDOM objects */
-    private JDOMFactory factory = null;
-
-    private XMLInputFactory xifactory;
-
     /**
      * Whether ignorable white space should be ignored, ie not added in the
      * resulting JDOM tree. If true, it will be ignored; if false, it will be
      * added in the tree. Default value if false.
      */
-    protected boolean cfgIgnoreWS = false;
+    protected boolean cfgIgnoreWS;
 
-    private Map additionalNamespaces = null;
+    /** The factory for creating new JDOM objects */
+    private JDOMFactory factory;
 
-    public Map getAdditionalNamespaces() {
-        return additionalNamespaces;
-    }
+    private XMLInputFactory xifactory;
 
-    public void setAdditionalNamespaces(Map additionalNamespaces) {
-        this.additionalNamespaces = additionalNamespaces;
-    }
+    private Map additionalNamespaces;
 
     /**
      * Default constructor.
@@ -151,6 +143,14 @@
         this.xifactory = xifactory;
     }
 
+    public Map getAdditionalNamespaces() {
+        return additionalNamespaces;
+    }
+
+    public void setAdditionalNamespaces(Map additionalNamespaces) {
+        this.additionalNamespaces = additionalNamespaces;
+    }
+
     /*
      * This sets a custom JDOMFactory for the builder. Use this to build the
      * tree with your own subclasses of the JDOM classes. @param factory <code>JDOMFactory</code>
@@ -290,9 +290,9 @@
                 child = f.processingInstruction(r.getPITarget(), r.getPIData());
                 break;
 
-            case XMLStreamConstants.START_ELEMENT:
-                // Ok, need to add a new element and simulate recursion
+            case XMLStreamConstants.START_ELEMENT: 
             {
+                // Ok, need to add a new element and simulate recursion
                 Element newElem = null;
                 String nsURI = r.getNamespaceURI();
                 String elemPrefix = r.getPrefix(); // needed for special
@@ -333,19 +333,21 @@
                 }
 
                 // Any declared namespaces?
-                for (int i = 0, len = r.getNamespaceCount(); i < len; ++i) {
+                int i;
+                int len;
+                for (i = 0, len = r.getNamespaceCount(); i < len; ++i) {
                     String prefix = r.getNamespacePrefix(i);
                     Namespace ns = Namespace.getNamespace(prefix, r.getNamespaceURI(i));
                     // JDOM has special handling for element's "own" ns:
                     if (prefix != null && prefix.equals(elemPrefix)) {
-                        ; // already set by when it was constructed...
+                        // already set by when it was constructed...
                     } else {
                         f.addNamespaceDeclaration(newElem, ns);
                     }
                 }
 
                 // And then the attributes:
-                for (int i = 0, len = r.getAttributeCount(); i < len; ++i) {
+                for (i = 0, len = r.getAttributeCount(); i < len; ++i) {
                     String prefix = r.getAttributePrefix(i);
                     Namespace ns;
 
@@ -421,9 +423,9 @@
 
     private static int resolveAttrType(String typeStr) {
         if (typeStr != null && typeStr.length() > 0) {
-            Integer I = attrTypes.get(typeStr);
-            if (I != null) {
-                return I.intValue();
+            Integer i = ATTR_TYPES.get(typeStr);
+            if (i != null) {
+                return i.intValue();
             }
         }
         return Attribute.UNDECLARED_TYPE;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/DOMStreamReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/DOMStreamReader.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/DOMStreamReader.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/DOMStreamReader.java Thu Mar  8 09:14:44 2007
@@ -49,16 +49,11 @@
      *     
      */
     public static class ElementFrame {
-        public ElementFrame(Object element, ElementFrame parent) {
-            this.element = element;
-            this.parent = parent;
-        }
-
         Object element;
 
-        boolean started = false;
+        boolean started;
 
-        boolean ended = false;
+        boolean ended;
 
         int currentChild = -1;
 
@@ -73,6 +68,13 @@
         List<Object> allAttributes;
 
         final ElementFrame parent;
+        
+        public ElementFrame(Object element, ElementFrame parent) {
+            this.element = element;
+            this.parent = parent;
+        }
+
+
     }
 
     /**
@@ -81,7 +83,6 @@
     public DOMStreamReader(ElementFrame frame) {
         this.frame = frame;
         frames.push(this.frame);
-        newFrame(frame);
     }
 
     protected ElementFrame getCurrentFrame() {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/DepthXMLStreamReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/DepthXMLStreamReader.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/DepthXMLStreamReader.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/DepthXMLStreamReader.java Thu Mar  8 09:14:44 2007
@@ -34,7 +34,7 @@
 public class DepthXMLStreamReader implements XMLStreamReader {
     XMLStreamReader reader;
 
-    private int depth = 0;
+    private int depth;
 
     public DepthXMLStreamReader(XMLStreamReader reader) {
         this.reader = reader;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/FragmentStreamReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/FragmentStreamReader.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/FragmentStreamReader.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/FragmentStreamReader.java Thu Mar  8 09:14:44 2007
@@ -27,10 +27,10 @@
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  */
 public class FragmentStreamReader extends DepthXMLStreamReader {
-    private boolean startDoc = false;
-    private boolean startElement = false;
+    private boolean startDoc;
+    private boolean startElement;
     private boolean middle = true;
-    private boolean endDoc = false;
+    private boolean endDoc;
 
     private int depth;
     private int current = -1;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamReader.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamReader.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamReader.java Thu Mar  8 09:14:44 2007
@@ -45,36 +45,11 @@
  * @author <a href="mailto:tsztelak@gmail.com">Tomasz Sztelak</a>
  */
 public class JDOMStreamReader extends DOMStreamReader {
-    public static String toStaxType(int jdom) {
-        switch (jdom) {
-        case Attribute.CDATA_TYPE:
-            return "CDATA";
-        case Attribute.ID_TYPE:
-            return "ID";
-        case Attribute.IDREF_TYPE:
-            return "IDREF";
-        case Attribute.IDREFS_TYPE:
-            return "IDREFS";
-        case Attribute.ENTITY_TYPE:
-            return "ENTITY";
-        case Attribute.ENTITIES_TYPE:
-            return "ENTITIES";
-        case Attribute.ENUMERATED_TYPE:
-            return "ENUMERATED";
-        case Attribute.NMTOKEN_TYPE:
-            return "NMTOKEN";
-        case Attribute.NMTOKENS_TYPE:
-            return "NMTOKENS";
-        case Attribute.NOTATION_TYPE:
-            return "NOTATION";
-        default:
-            return null;
-        }
-    }
 
     private Content content;
 
-    private FastStack<Map> namespaceStack = new FastStack<Map>();
+    private FastStack<Map<String, Namespace>> namespaceStack
+        = new FastStack<Map<String, Namespace>>();
 
     private List<Namespace> namespaces = new ArrayList<Namespace>();
 
@@ -92,6 +67,52 @@
         setupNamespaces(element);
     }
 
+    /**
+     * @param document
+     */
+    public JDOMStreamReader(Document document) {
+        this(document.getRootElement());
+    }
+
+    public static String toStaxType(int jdom) {
+        String val;
+        switch (jdom) {
+        case Attribute.CDATA_TYPE:
+            val = "CDATA";
+            break;
+        case Attribute.ID_TYPE:
+            val = "ID";
+            break;
+        case Attribute.IDREF_TYPE:
+            val = "IDREF";
+            break;
+        case Attribute.IDREFS_TYPE:
+            val = "IDREFS";
+            break;
+        case Attribute.ENTITY_TYPE:
+            val = "ENTITY";
+            break;
+        case Attribute.ENTITIES_TYPE:
+            val = "ENTITIES";
+            break;
+        case Attribute.ENUMERATED_TYPE:
+            val = "ENUMERATED";
+            break;
+        case Attribute.NMTOKEN_TYPE:
+            val = "NMTOKEN";
+            break;
+        case Attribute.NMTOKENS_TYPE:
+            val = "NMTOKENS";
+            break;
+        case Attribute.NOTATION_TYPE:
+            val = "NOTATION";
+            break;
+        default:
+            val = null;
+        }
+        return val;
+    }
+
     private void setupNamespaces(Element element) {
         namespaceContext.setElement(element);
 
@@ -141,9 +162,9 @@
 
     private String getDeclaredURI(String string) {
         for (int i = namespaceStack.size() - 1; i == 0; i--) {
-            Map namespaces = namespaceStack.get(i);
+            Map<String, Namespace> nmspaces = namespaceStack.get(i);
 
-            Namespace dec = (Namespace)namespaces.get(string);
+            Namespace dec = nmspaces.get(string);
 
             if (dec != null) {
                 return dec.getURI();
@@ -160,13 +181,6 @@
         }
     }
 
-    /**
-     * @param document
-     */
-    public JDOMStreamReader(Document document) {
-        this(document.getRootElement());
-    }
-
     public Element getCurrentElement() {
         return (Element)getCurrentFrame().element;
     }
@@ -274,7 +288,7 @@
     }
 
     public String getText() {
-        return (content).getValue();
+        return content.getValue();
     }
 
     public char[] getTextCharacters() {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamWriter.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamWriter.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamWriter.java Thu Mar  8 09:14:44 2007
@@ -66,9 +66,9 @@
             }
         }
 
-        JDOMNamespaceContext context = new JDOMNamespaceContext();
-        context.setElement(element);
-        this.context = context;
+        JDOMNamespaceContext ctx = new JDOMNamespaceContext();
+        ctx.setElement(element);
+        this.context = ctx;
 
         currentNode = element;
     }
@@ -186,8 +186,8 @@
     public void setDefaultNamespace(String arg0) throws XMLStreamException {
     }
 
-    public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
-        this.context = context;
+    public void setNamespaceContext(NamespaceContext ctx) throws XMLStreamException {
+        this.context = ctx;
     }
 
     public NamespaceContext getNamespaceContext() {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CDOMStreamReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CDOMStreamReader.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CDOMStreamReader.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CDOMStreamReader.java Thu Mar  8 09:14:44 2007
@@ -48,8 +48,10 @@
      */
     public W3CDOMStreamReader(Element element) {
         super(new ElementFrame(element, null));
+        newFrame(getCurrentFrame());
 
         this.document = element.getOwnerDocument();
+        
     }
 
     /**
@@ -66,7 +68,7 @@
      * collection.
      */
     @Override
-    protected void newFrame(ElementFrame frame) {
+    protected final void newFrame(ElementFrame frame) {
         Element element = getCurrentElement();
         frame.uris = new ArrayList<String>();
         frame.prefixes = new ArrayList<String>();
@@ -97,10 +99,10 @@
                     prefix = "";
                 }
 
-                if (name != null && name.equals("xmlns")) {
+                if (name != null && "xmlns".equals(name)) {
                     frame.uris.add(value);
                     frame.prefixes.add("");
-                } else if (prefix.length() > 0 && prefix.equals("xmlns")) {
+                } else if (prefix.length() > 0 && "xmlns".equals(prefix)) {
                     frame.uris.add(value);
                     frame.prefixes.add(localName);
                 } else if (name.startsWith("xmlns:")) {
@@ -119,7 +121,7 @@
         super.endElement();
     }
 
-    Element getCurrentElement() {
+    final Element getCurrentElement() {
         return (Element)getCurrentFrame().element;
     }
 
@@ -226,8 +228,7 @@
 
     public String getAttributeLocalName(int i) {
         Attr attr = getAttribute(i);
-        String name = getLocalName(attr);
-        return name;
+        return getLocalName(attr);
     }
 
     public String getAttributePrefix(int i) {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CDOMStreamWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CDOMStreamWriter.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CDOMStreamWriter.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CDOMStreamWriter.java Thu Mar  8 09:14:44 2007
@@ -40,10 +40,6 @@
     private NamespaceContext context;
     private Map properties = Collections.EMPTY_MAP;
 
-    public void setProperties(Map properties) {
-        this.properties = properties;
-    }
-
     public W3CDOMStreamWriter() throws ParserConfigurationException {
         this(DocumentBuilderFactory.newInstance().newDocumentBuilder());
     }
@@ -52,8 +48,12 @@
         document = builder.newDocument();
     }
 
-    public W3CDOMStreamWriter(Document document) {
-        this.document = document;
+    public W3CDOMStreamWriter(Document doc) {
+        this.document = doc;
+    }
+
+    public void setProperties(Map properties) {
+        this.properties = properties;
     }
 
     public Document getDocument() {
@@ -72,9 +72,9 @@
             document.appendChild(element);
         }
 
-        W3CNamespaceContext context = new W3CNamespaceContext();
-        context.setElement(element);
-        this.context = context;
+        W3CNamespaceContext ctx = new W3CNamespaceContext();
+        ctx.setElement(element);
+        this.context = ctx;
 
         currentNode = element;
     }
@@ -203,8 +203,8 @@
     public void setDefaultNamespace(String arg0) throws XMLStreamException {
     }
 
-    public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
-        this.context = context;
+    public void setNamespaceContext(NamespaceContext ctx) throws XMLStreamException {
+        this.context = ctx;
     }
 
     public NamespaceContext getNamespaceContext() {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CNamespaceContext.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CNamespaceContext.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CNamespaceContext.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/W3CNamespaceContext.java Thu Mar  8 09:14:44 2007
@@ -73,7 +73,7 @@
                 String val = a.getValue();
                 if (val != null && val.equals(uri)) {
                     String name = a.getNodeName();
-                    if (name.equals("xmlns")) {
+                    if ("xmlns".equals(name)) {
                         return "";
                     } else {
                         return name.substring(6);
@@ -105,7 +105,7 @@
         return currentNode;
     }
 
-    public void setElement(Element currentNode) {
-        this.currentNode = currentNode;
+    public void setElement(Element cn) {
+        this.currentNode = cn;
     }
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/AbstractMessageReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/AbstractMessageReader.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/AbstractMessageReader.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/AbstractMessageReader.java Thu Mar  8 09:14:44 2007
@@ -85,7 +85,7 @@
      */
     public long getValueAsLong() {
         if (getValue() == null) {
-            return 0l;
+            return 0L;
         }
 
         return Long.parseLong(getValue());

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/MessageReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/MessageReader.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/MessageReader.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/MessageReader.java Thu Mar  8 09:14:44 2007
@@ -28,49 +28,50 @@
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  */
 public interface MessageReader {
-    public String getValue();
+    
+    String getValue();
 
-    public boolean isXsiNil();
+    boolean isXsiNil();
 
-    public int getValueAsInt();
+    int getValueAsInt();
 
-    public long getValueAsLong();
+    long getValueAsLong();
 
-    public double getValueAsDouble();
+    double getValueAsDouble();
 
-    public float getValueAsFloat();
+    float getValueAsFloat();
 
-    public boolean getValueAsBoolean();
+    boolean getValueAsBoolean();
 
-    public char getValueAsCharacter();
+    char getValueAsCharacter();
 
-    public MessageReader getAttributeReader(QName qName);
+    MessageReader getAttributeReader(QName qName);
 
-    public boolean hasMoreAttributeReaders();
+    boolean hasMoreAttributeReaders();
 
-    public MessageReader getNextAttributeReader();
+    MessageReader getNextAttributeReader();
 
-    public boolean hasMoreElementReaders();
+    boolean hasMoreElementReaders();
 
-    public MessageReader getNextElementReader();
+    MessageReader getNextElementReader();
 
-    public QName getName();
+    QName getName();
 
     /**
      * Get the local name of the element this reader represents.
      * 
      * @return Local Name
      */
-    public String getLocalName();
+    String getLocalName();
 
     /**
      * @return Namespace
      */
-    public String getNamespace();
+    String getNamespace();
 
-    public String getNamespaceForPrefix(String prefix);
+    String getNamespaceForPrefix(String prefix);
 
-    public XMLStreamReader getXMLStreamReader();
+    XMLStreamReader getXMLStreamReader();
 
-    public void readToEnd();
+    void readToEnd();
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMReader.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMReader.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMReader.java Thu Mar  8 09:14:44 2007
@@ -33,8 +33,8 @@
 
 public class JDOMReader extends AbstractMessageReader implements MessageReader {
     private Element element;
-    private int currentChild = 0;
-    private int currentAttribute = 0;
+    private int currentChild;
+    private int currentAttribute;
     private List elements;
     private QName qname;
 
@@ -52,7 +52,7 @@
     }
 
     public boolean hasMoreElementReaders() {
-        return (currentChild < elements.size());
+        return currentChild < elements.size();
     }
 
     public MessageReader getNextElementReader() {
@@ -81,7 +81,7 @@
     }
 
     public boolean hasMoreAttributeReaders() {
-        return (currentAttribute < element.getAttributes().size());
+        return currentAttribute < element.getAttributes().size();
     }
 
     public MessageReader getAttributeReader(QName attName) {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/AttributeWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/AttributeWriter.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/AttributeWriter.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/AttributeWriter.java Thu Mar  8 09:14:44 2007
@@ -57,11 +57,11 @@
         }
     }
 
-    public MessageWriter getAttributeWriter(String name) {
+    public MessageWriter getAttributeWriter(String nm) {
         throw new IllegalStateException();
     }
 
-    public MessageWriter getAttributeWriter(String name, String namespace) {
+    public MessageWriter getAttributeWriter(String nm, String ns) {
         throw new IllegalStateException();
     }
 
@@ -69,11 +69,11 @@
         throw new IllegalStateException();
     }
 
-    public MessageWriter getElementWriter(String name) {
+    public MessageWriter getElementWriter(String nm) {
         throw new IllegalStateException();
     }
 
-    public MessageWriter getElementWriter(String name, String namespace) {
+    public MessageWriter getElementWriter(String nm, String ns) {
         throw new IllegalStateException();
     }
 
@@ -81,11 +81,11 @@
         throw new IllegalStateException();
     }
 
-    public String getPrefixForNamespace(String namespace) {
+    public String getPrefixForNamespace(String ns) {
         throw new IllegalStateException();
     }
 
-    public String getPrefixForNamespace(String namespace, String hint) {
+    public String getPrefixForNamespace(String ns, String hint) {
         throw new IllegalStateException();
     }
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java Thu Mar  8 09:14:44 2007
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.aegis.xml.stax;
 
 import java.io.InputStream;
@@ -21,10 +39,7 @@
  * 
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  */
-public class ElementReader
-    extends AbstractMessageReader
-    implements MessageReader
-{
+public class ElementReader extends AbstractMessageReader implements MessageReader {
     private static final Pattern QNAME_PATTERN = Pattern.compile("([^:]+):([^:]+)");
 
     private DepthXMLStreamReader root;
@@ -37,21 +52,20 @@
 
     private QName xsiType;
 
-    private boolean hasCheckedChildren = false;
+    private boolean hasCheckedChildren;
+
+    private boolean hasChildren;
 
-    private boolean hasChildren = false;
-    
     private String namespace;
 
     private int depth;
 
-    private int currentAttribute = 0;
+    private int currentAttribute;
 
     /**
      * @param root
      */
-    public ElementReader(DepthXMLStreamReader root)
-    {
+    public ElementReader(DepthXMLStreamReader root) {
         this.root = root;
         this.localName = root.getLocalName();
         this.name = root.getName();
@@ -62,8 +76,7 @@
         depth = root.getDepth();
     }
 
-    public ElementReader(XMLStreamReader reader)
-    {
+    public ElementReader(XMLStreamReader reader) {
         this(new DepthXMLStreamReader(reader));
     }
 
@@ -71,8 +84,7 @@
      * @param is
      * @throws XMLStreamException
      */
-    public ElementReader(InputStream is) throws XMLStreamException
-    {
+    public ElementReader(InputStream is) throws XMLStreamException {
         // XMLInputFactory factory = XMLInputFactory.newInstance();
         // XMLStreamReader xmlReader = factory.createXMLStreamReader(is);
         XMLStreamReader xmlReader = STAXUtils.createXMLStreamReader(is, null, null);
@@ -89,22 +101,17 @@
         depth = root.getDepth();
     }
 
-    private void extractXsiType()
-    {
+    private void extractXsiType() {
         /*
          * We're making a conscious choice here -- garbage in == garbate out.
          */
         String xsiTypeQname = root.getAttributeValue(XmlConstants.XSI_NS, "type");
-        if (xsiTypeQname != null)
-        {
+        if (xsiTypeQname != null) {
             Matcher m = QNAME_PATTERN.matcher(xsiTypeQname);
-            if (m.matches())
-            {
+            if (m.matches()) {
                 NamespaceContext nc = root.getNamespaceContext();
                 this.xsiType = new QName(nc.getNamespaceURI(m.group(1)), m.group(2), m.group(1));
-            }
-            else
-            {
+            } else {
                 this.xsiType = new QName(this.namespace, xsiTypeQname, "");
             }
         }
@@ -113,51 +120,42 @@
     /**
      * @see org.codehaus.xfire.aegis.MessageReader#getValue()
      */
-    public String getValue()
-    {
-        if (value == null) 
-        {
-            try
-            {
+    public String getValue() {
+        if (value == null) {
+            try {
                 value = root.getElementText();
 
-                while (checkHasMoreChildReaders()) {}
-            }
-            catch (XMLStreamException e)
-            {
+                while (checkHasMoreChildReaders()) {
+                    //TODO - busy wait
+                }
+            } catch (XMLStreamException e) {
                 throw new DatabindingException("Could not read XML stream.", e);
             }
         }
         return value.trim();
     }
 
-    public String getValue(String ns, String attr)
-    {
+    public String getValue(String ns, String attr) {
         return root.getAttributeValue(ns, attr);
     }
 
-    public boolean hasMoreElementReaders()
-    {
+    public boolean hasMoreElementReaders() {
         // Check to see if we checked before,
         // so we don't mess up the stream position.
-        if (!hasCheckedChildren)
+        if (!hasCheckedChildren) {
             checkHasMoreChildReaders();
+        }
 
         return hasChildren;
     }
 
-    private boolean checkHasMoreChildReaders()
-    {
-        try
-        {
+    private boolean checkHasMoreChildReaders() {
+        try {
             int event = root.getEventType();
-            while (root.hasNext())
-            {
-                switch (event)
-                {
+            while (root.hasNext()) {
+                switch (event) {
                 case XMLStreamReader.START_ELEMENT:
-                    if (root.getDepth() > depth)
-                    {
+                    if (root.getDepth() > depth) {
                         hasCheckedChildren = true;
                         hasChildren = true;
 
@@ -165,13 +163,11 @@
                     }
                     break;
                 case XMLStreamReader.END_ELEMENT:
-                    if (root.getDepth() <= depth + 1)
-                    {
+                    if (root.getDepth() <= depth + 1) {
                         hasCheckedChildren = true;
                         hasChildren = false;
 
-                        if (root.hasNext())
-                        {
+                        if (root.hasNext()) {
                             root.next();
                         }
                         return false;
@@ -186,83 +182,75 @@
                     break;
                 }
 
-                if (root.hasNext())
+                if (root.hasNext()) {
                     event = root.next();
+                }
             }
 
             hasCheckedChildren = true;
             hasChildren = false;
             return false;
-        }
-        catch (XMLStreamException e)
-        {
+        } catch (XMLStreamException e) {
             throw new DatabindingException("Error parsing document.", e);
         }
     }
 
-    public MessageReader getNextElementReader()
-    {
-        if (!hasCheckedChildren)
+    public MessageReader getNextElementReader() {
+        if (!hasCheckedChildren) {
             checkHasMoreChildReaders();
+        }
 
-        if (!hasChildren)
+        if (!hasChildren) {
             return null;
+        }
 
         hasCheckedChildren = false;
 
         return new ElementReader(root);
     }
 
-    public QName getName()
-    {
+    public QName getName() {
         return name;
     }
 
-    public String getLocalName()
-    {
+    public String getLocalName() {
         return localName;
     }
 
-    public String getNamespace()
-    {
+    public String getNamespace() {
         return namespace;
     }
 
-    public QName getXsiType()
-    {
+    public QName getXsiType() {
         return xsiType;
     }
 
-    public XMLStreamReader getXMLStreamReader()
-    {
+    public XMLStreamReader getXMLStreamReader() {
         return root;
     }
 
-    public boolean hasMoreAttributeReaders()
-    {
-        if (!root.isStartElement())
+    public boolean hasMoreAttributeReaders() {
+        if (!root.isStartElement()) {
             return false;
+        }
 
         return currentAttribute < root.getAttributeCount();
     }
 
-    public MessageReader getAttributeReader(QName qName)
-    {
+    public MessageReader getAttributeReader(QName qName) {
         return new AttributeReader(qName, root.getAttributeValue(qName.getNamespaceURI(), qName
-                .getLocalPart()));
+            .getLocalPart()));
     }
 
-    public MessageReader getNextAttributeReader()
-    {
+    public MessageReader getNextAttributeReader() {
         MessageReader reader = new AttributeReader(root.getAttributeName(currentAttribute), root
-                .getAttributeValue(currentAttribute));
+            .getAttributeValue(currentAttribute));
         currentAttribute++;
 
         return reader;
     }
 
-    public String getNamespaceForPrefix(String prefix)
-    {
+    public String getNamespaceForPrefix(String prefix) {
         return root.getNamespaceURI(prefix);
     }
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementWriter.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementWriter.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementWriter.java Thu Mar  8 09:14:44 2007
@@ -135,12 +135,12 @@
     /**
      * @see org.apache.cxf.aegis.xml.MessageWriter#getWriter(java.lang.String)
      */
-    public MessageWriter getElementWriter(String name) {
-        return new ElementWriter(writer, name, namespace);
+    public MessageWriter getElementWriter(String nm) {
+        return new ElementWriter(writer, nm, namespace);
     }
 
-    public MessageWriter getElementWriter(String name, String ns) {
-        return new ElementWriter(writer, name, ns);
+    public MessageWriter getElementWriter(String nm, String ns) {
+        return new ElementWriter(writer, nm, ns);
     }
 
     public MessageWriter getElementWriter(QName qname) {
@@ -167,27 +167,27 @@
         return writer;
     }
 
-    public MessageWriter getAttributeWriter(String name) {
-        return new AttributeWriter(writer, name, namespace);
+    public MessageWriter getAttributeWriter(String nm) {
+        return new AttributeWriter(writer, nm, namespace);
     }
 
-    public MessageWriter getAttributeWriter(String name, String namespace) {
-        return new AttributeWriter(writer, name, namespace);
+    public MessageWriter getAttributeWriter(String nm, String ns) {
+        return new AttributeWriter(writer, nm, ns);
     }
 
     public MessageWriter getAttributeWriter(QName qname) {
         return new AttributeWriter(writer, qname.getLocalPart(), qname.getNamespaceURI());
     }
 
-    public String getPrefixForNamespace(String namespace) {
+    public String getPrefixForNamespace(String ns) {
         try {
-            String prefix = writer.getPrefix(namespace);
+            String pfx = writer.getPrefix(ns);
 
-            if (prefix == null) {
-                prefix = NamespaceHelper.getUniquePrefix(writer);
+            if (pfx == null) {
+                pfx = NamespaceHelper.getUniquePrefix(writer);
 
-                writer.setPrefix(prefix, namespace);
-                writer.writeNamespace(prefix, namespace);
+                writer.setPrefix(pfx, ns);
+                writer.writeNamespace(pfx, ns);
             }
 
             return prefix;
@@ -196,25 +196,25 @@
         }
     }
 
-    public String getPrefixForNamespace(String namespace, String hint) {
+    public String getPrefixForNamespace(String ns, String hint) {
         try {
-            String prefix = writer.getPrefix(namespace);
+            String pfx = writer.getPrefix(ns);
 
-            if (prefix == null) {
-                String ns = writer.getNamespaceContext().getNamespaceURI(hint);
-                if (ns == null) {
-                    prefix = hint;
-                } else if (ns.equals(namespace)) {
-                    return prefix;
+            if (pfx == null) {
+                String ns2 = writer.getNamespaceContext().getNamespaceURI(hint);
+                if (ns2 == null) {
+                    pfx = hint;
+                } else if (ns2.equals(ns)) {
+                    return pfx;
                 } else {
-                    prefix = NamespaceHelper.getUniquePrefix(writer);
+                    pfx = NamespaceHelper.getUniquePrefix(writer);
                 }
 
-                writer.setPrefix(prefix, namespace);
-                writer.writeNamespace(prefix, namespace);
+                writer.setPrefix(pfx, ns);
+                writer.writeNamespace(pfx, ns);
             }
 
-            return prefix;
+            return pfx;
         } catch (XMLStreamException e) {
             throw new DatabindingException("Error writing document.", e);
         }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java Thu Mar  8 09:14:44 2007
@@ -48,17 +48,15 @@
 import org.apache.cxf.wsdl.WSDLManager;
 import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
 import org.apache.cxf.wsdl11.WSDLManagerImpl;
+import org.junit.Before;
 
 public abstract class AbstractAegisTest extends AbstractCXFTest {
     protected LocalTransportFactory localTransport;
 
-    private Bus bus;
 
-    @Override
+    @Before
     public void setUp() throws Exception {
-        super.setUp();
-        
-        bus = getBus();
+        super.setUpBus();
         
         SoapBindingFactory bindingFactory = new SoapBindingFactory();
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/Book.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/Book.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/Book.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/Book.java Thu Mar  8 09:14:44 2007
@@ -18,39 +18,32 @@
  */
 package org.apache.cxf.aegis.client;
 
-public class Book
-{
+public class Book {
     private String title;
     private String isbn;
     private String author;
-  
-    public String getIsbn()
-    {
+
+    public String getIsbn() {
         return isbn;
     }
 
-    public void setIsbn(String isbn)
-    {
+    public void setIsbn(String isbn) {
         this.isbn = isbn;
     }
 
-    public String getTitle()
-    {
+    public String getTitle() {
         return title;
     }
 
-    public void setTitle(String title)
-    {
+    public void setTitle(String title) {
         this.title = title;
     }
- 
-    public String getAuthor()
-    {
+
+    public String getAuthor() {
         return author;
     }
 
-    public void setAuthor(String author)
-    {
+    public void setAuthor(String author) {
         this.author = author;
     }
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookDynamicClient.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookDynamicClient.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookDynamicClient.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookDynamicClient.java Thu Mar  8 09:14:44 2007
@@ -32,8 +32,12 @@
 import org.apache.cxf.endpoint.ClientImpl;
 import org.apache.cxf.service.Service;
 
-public class BookDynamicClient {
+public final class BookDynamicClient {
     static final String ENCODED_NS = Soap11.getInstance().getSoapEncodingStyle();
+    
+    private BookDynamicClient() {
+        //utility class
+    }
 
     public static void main(String args[]) {
         // String serviceURL = "http://localhost:8080/BookService";

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookService.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookService.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookService.java Thu Mar  8 09:14:44 2007
@@ -18,13 +18,12 @@
  */
 package org.apache.cxf.aegis.client;
 
-public interface BookService
-{
-    public Book[] getBooks();
+public interface BookService {
+    Book[] getBooks();
     
-    public Book findBook(String isbn);
+    Book findBook(String isbn);
     
-    public void addBook(Book book);
+    void addBook(Book book);
     
-    public void addBooks(Book[] books);
- }
+    void addBooks(Book[] books);
+}

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookServiceImpl.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookServiceImpl.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/BookServiceImpl.java Thu Mar  8 09:14:44 2007
@@ -44,8 +44,9 @@
     public Book findBook(String isbn) {
         for (int i = 0; i < allBooks.size(); i++) {
             Book book = allBooks.get(i);
-            if (isbn.equals(book.getIsbn()))
+            if (isbn.equals(book.getIsbn())) {
                 return book;
+            }
         }
 
         return null;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/Echo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/Echo.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/Echo.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/Echo.java Thu Mar  8 09:14:44 2007
@@ -19,13 +19,13 @@
 package org.apache.cxf.aegis.client;
 
 import javax.jws.WebParam;
-import javax.jws.WebService;
 import javax.jws.WebParam.Mode;
+import javax.jws.WebService;
 import javax.xml.ws.Holder;
 
 @WebService
-public interface Echo
-{
-    public String echo(String text,
-                       @WebParam(mode=Mode.OUT) Holder<String> textAgain);
+public interface Echo {
+    String echo(String text,
+                @WebParam(mode = Mode.OUT)
+                Holder<String> textAgain);
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/EchoImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/EchoImpl.java?view=diff&rev=516103&r1=516102&r2=516103
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/EchoImpl.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/client/EchoImpl.java Thu Mar  8 09:14:44 2007
@@ -20,8 +20,7 @@
 
 import javax.xml.ws.Holder;
 
-public class EchoImpl implements Echo
-{
+public class EchoImpl implements Echo {
     public String echo(String text, Holder<String> textAgain) {
         textAgain.value = "header2";
         return text;



Mime
View raw message