tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r450654 - in /incubator/tuscany/java/sca/kernel/spi/src: main/java/org/apache/tuscany/spi/databinding/ main/java/org/apache/tuscany/spi/databinding/extension/ test/java/org/apache/tuscany/spi/databinding/extension/
Date Thu, 28 Sep 2006 00:51:50 GMT
Author: rfeng
Date: Wed Sep 27 17:51:49 2006
New Revision: 450654

URL: http://svn.apache.org/viewvc?view=rev&rev=450654
Log:
Fix checkstyle warnings

Modified:
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBindingRegistry.java
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataPipe.java
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/TransformerRegistry.java
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DOMHelper.java
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtension.java
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverter.java
    incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/DOMHelperTestCase.java
    incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtensionTestCase.java
    incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverterTestCase.java

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBindingRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBindingRegistry.java?view=diff&rev=450654&r1=450653&r2=450654
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBindingRegistry.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBindingRegistry.java Wed Sep 27 17:51:49 2006
@@ -50,7 +50,8 @@
      * Introspect the java class to figure out what DataType supports it
      * 
      * @param javaType The java class or interface
-     * @return A DataType representing the java type or null if no databinding recognizes the java type
+     * @return A DataType representing the java type or null if no databinding
+     *         recognizes the java type
      */
     DataType introspectType(Class<?> javaType);
 
@@ -58,7 +59,8 @@
      * Introspect the value to figure out the corresponding DataType
      * 
      * @param value The object value
-     * @return A DataType representing the value or null if no databinding recognizes the value
+     * @return A DataType representing the value or null if no databinding
+     *         recognizes the value
      */
     DataType introspectType(Object value);
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataPipe.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataPipe.java?view=diff&rev=450654&r1=450653&r2=450654
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataPipe.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataPipe.java Wed Sep 27 17:51:49 2006
@@ -27,16 +27,18 @@
 public interface DataPipe<S, R> extends Transformer {
 
     /**
-     * Returns a sink (for example, java.io.OutputStream, java.io.Writer or org.xml.sax.ContentHandler) to
-     * receive data pushed by the source
+     * Returns a sink (for example, java.io.OutputStream, java.io.Writer or org.xml.sax.ContentHandler) to receive data
+     * pushed by the source
+     * 
      * @return The sink to consume data
      */
-     S getSink();
-    
+    S getSink();
+
     /**
      * Returns the data populated by the sink
+     * 
      * @return
      */
-     R getResult();
-    
+    R getResult();
+
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/TransformerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/TransformerRegistry.java?view=diff&rev=450654&r1=450653&r2=450654
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/TransformerRegistry.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/TransformerRegistry.java Wed Sep 27 17:51:49 2006
@@ -22,46 +22,54 @@
 
 /**
  * Registry for data transformers
- *
  */
 public interface TransformerRegistry {
     /**
      * Register a transformer
+     * 
      * @param sourceDataBinding
      * @param targetDataBinding
      * @param weight
      * @param transformer
      */
-     void registerTransformer(String sourceDataBinding, String targetDataBinding, int weight, Transformer transformer);
+    void registerTransformer(String sourceDataBinding,
+                             String targetDataBinding,
+                             int weight,
+                             Transformer transformer);
 
     /**
      * Register a transformer
+     * 
      * @param transformer
      */
-     void registerTransformer(Transformer transformer);
+    void registerTransformer(Transformer transformer);
 
     /**
      * Unregister a transformer
+     * 
      * @param sourceDataBinding
      * @param targetDataBinding
      * @return
      */
-     boolean unregisterTransformer(String sourceDataBinding, String targetDataBinding);
+    boolean unregisterTransformer(String sourceDataBinding, String targetDataBinding);
 
     /**
-     * Get the direct Transformer which can transform data from source type to result type
+     * Get the direct Transformer which can transform data from source type to
+     * result type
      * 
      * @param sourceDataBinding
      * @param targetDataBinding
      * @return
      */
-     Transformer getTransformer(String sourceDataBinding, String targetDataBinding);
+    Transformer getTransformer(String sourceDataBinding, String targetDataBinding);
 
     /**
-     * Get the a chain of Transformers which can transform data from source type to result type
+     * Get the a chain of Transformers which can transform data from source type
+     * to result type
+     * 
      * @param sourceDataBinding
      * @param targetDataBinding
      * @return
      */
-     List<Transformer> getTransformerChain(String sourceDataBinding, String targetDataBinding);
+    List<Transformer> getTransformerChain(String sourceDataBinding, String targetDataBinding);
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DOMHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DOMHelper.java?view=diff&rev=450654&r1=450653&r2=450654
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DOMHelper.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DOMHelper.java Wed Sep 27 17:51:49 2006
@@ -30,9 +30,9 @@
  * Helper for DOM
  */
 public final class DOMHelper {
-    private final static DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+    private static final DocumentBuilderFactory FACTORY = DocumentBuilderFactory.newInstance();
     static {
-        factory.setNamespaceAware(true);
+        FACTORY.setNamespaceAware(true);
     }
 
     private DOMHelper() {
@@ -43,7 +43,7 @@
     }
 
     public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException {
-        return factory.newDocumentBuilder();
+        return FACTORY.newDocumentBuilder();
     }
 
     public static QName getQName(Node node) {
@@ -51,15 +51,17 @@
         if (ns == null) {
             ns = "";
         }
-        // node.getLocalName() will return null if it is created using DOM Level 1 method 
+        // node.getLocalName() will return null if it is created using DOM Level
+        // 1 method
         // such as createElement()
         return new QName(ns, node.getNodeName());
     }
-    
+
     public static Element createElement(Document document, QName name) {
         String prefix = name.getPrefix();
         String qname =
-                (prefix != null && prefix.length() > 0) ? prefix + ":" + name.getLocalPart() : name.getLocalPart();
+            (prefix != null && prefix.length() > 0) ? prefix + ":" + name.getLocalPart() : name
+                .getLocalPart();
         return document.createElementNS(name.getNamespaceURI(), qname);
     }
 

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java?view=diff&rev=450654&r1=450653&r2=450654
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java Wed Sep 27 17:51:49 2006
@@ -34,14 +34,16 @@
 public abstract class DataBindingExtension implements DataBinding {
     protected DataBindingRegistry registry;
 
-    protected Class<?> baseType = null;
+    protected Class<?> baseType;
 
-    protected String name = null;
+    protected String name;
 
     /**
-     * Create a databinding with the base java type whose name will be used as the name of the databinding
+     * Create a databinding with the base java type whose name will be used as
+     * the name of the databinding
      * 
-     * @param baseType The base java class or interface representing the databinding, for example, org.w3c.dom.Node
+     * @param baseType The base java class or interface representing the
+     *            databinding, for example, org.w3c.dom.Node
      */
     protected DataBindingExtension(Class<?> baseType) {
         this(baseType.getName(), baseType);
@@ -51,7 +53,8 @@
      * Create a databinding with the name and base java type
      * 
      * @param name The name of the databinding
-     * @param baseType The base java class or interface representing the databinding, for example, org.w3c.dom.Node
+     * @param baseType The base java class or interface representing the
+     *            databinding, for example, org.w3c.dom.Node
      */
     protected DataBindingExtension(String name, Class<?> baseType) {
         this.name = name;

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtension.java?view=diff&rev=450654&r1=450653&r2=450654
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtension.java Wed Sep 27 17:51:49 2006
@@ -37,14 +37,6 @@
 public class SimpleTypeMapperExtension extends XSDDataTypeConverter implements SimpleTypeMapper {
     public static final Map<Class, String> JAVA2XML = new HashMap<Class, String>();
 
-    private static final String[] typeNames =
-            { "string", "boolean", "double", "float", "int", "integer", "long", "short", "byte", "decimal",
-                    "base64Binary", "hexBinary", "anySimpleType", "anyType", "any", "QName", "dateTime", "date",
-                    "time", "normalizedString", "token", "unsignedLong", "unsignedInt", "unsignedShort",
-                    "unsignedByte", "positiveInteger", "negativeInteger", "nonNegativeInteger", "nonPositiveInteger",
-                    "gYearMonth", "gMonthDay", "gYear", "gMonth", "gDay", "duration", "Name", "NCName", "NMTOKEN",
-                    "NMTOKENS", "NOTATION", "ENTITY", "ENTITIES", "IDREF", "IDREFS", "anyURI", "language", "ID" };
-
     public static final String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
 
     public static final Map<String, Class> XML2JAVA = new HashMap<String, Class>();
@@ -141,12 +133,21 @@
 
     public static final QName XSD_YEARMONTH = new QName(URI_2001_SCHEMA_XSD, "gYearMonth");
 
+    private static final String[] XSD_TYPE_NAMES =
+        {"string", "boolean", "double", "float", "int", "integer", "long", "short", "byte", "decimal",
+         "base64Binary", "hexBinary", "anySimpleType", "anyType", "any", "QName", "dateTime", "date", "time",
+         "normalizedString", "token", "unsignedLong", "unsignedInt", "unsignedShort", "unsignedByte",
+         "positiveInteger", "negativeInteger", "nonNegativeInteger", "nonPositiveInteger", "gYearMonth",
+         "gMonthDay", "gYear", "gMonth", "gDay", "duration", "Name", "NCName", "NMTOKEN", "NMTOKENS",
+         "NOTATION", "ENTITY", "ENTITIES", "IDREF", "IDREFS", "anyURI", "language", "ID"};
+
     static {
-        for (String type : typeNames) {
+        for (String type : XSD_TYPE_NAMES) {
             TypeInfo simpleType = new TypeInfo(new QName(URI_2001_SCHEMA_XSD, type), true, null);
             XSD_SIMPLE_TYPES.put(type, simpleType);
         }
     }
+    
     static {
         JAVA2XML.put(boolean.class, "boolean");
         JAVA2XML.put(byte.class, "byte");
@@ -205,7 +206,8 @@
         XML2JAVA.put("gYearMonth", javax.xml.datatype.XMLGregorianCalendar.class);
         XML2JAVA.put("gMonthDay", javax.xml.datatype.XMLGregorianCalendar.class);
         XML2JAVA.put("anySimpleType", java.lang.Object.class); // For elements
-        // XML2JAVA.put("anySimpleType", java.lang.String.class); // For attributes
+        // XML2JAVA.put("anySimpleType", java.lang.String.class); // For
+        // attributes
         XML2JAVA.put("duration", javax.xml.datatype.Duration.class);
         XML2JAVA.put("NOTATION", javax.xml.namespace.QName.class);
     }
@@ -256,8 +258,10 @@
          * <li>xsd:time --- javax.xml.datatype.XMLGregorianCalendar
          * <li>xsd:date --- javax.xml.datatype.XMLGregorianCalendar
          * <li>xsd:g* --- javax.xml.datatype.XMLGregorianCalendar
-         * <li>xsd:anySimpleType (for xsd:element of this type)a java.lang.Object
-         * <li>xsd:anySimpleType (for xsd:attribute of this type) java.lang.String
+         * <li>xsd:anySimpleType (for xsd:element of this type)a
+         * java.lang.Object
+         * <li>xsd:anySimpleType (for xsd:attribute of this type)
+         * java.lang.String
          * <li>xsd:duration javax.xml.datatype.Duration
          * <li>xsd:NOTATION javax.xml.namespace.QName
          * </ul>
@@ -265,7 +269,7 @@
 
         TypeInfo baseType = simpleType;
         while (baseType.getBaseType() != null) {
-            baseType = (TypeInfo) baseType.getBaseType();
+            baseType = (TypeInfo)baseType.getBaseType();
         }
         QName type = baseType.getQName();
         if (type.equals(XSD_STRING)) {
@@ -312,11 +316,13 @@
             return parseBase64Binary(value);
         } else if (type.equals(XSD_QNAME)) {
             NamespaceContext namespaceContext =
-                    (NamespaceContext) ((context != null) ? context.getMetadata().get(NamespaceContext.class) : null);
+                (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class)
+                    : null);
             return parseQName(value, namespaceContext);
         } else if (type.equals(XSD_NOTATION)) {
             NamespaceContext namespaceContext =
-                    (NamespaceContext) ((context != null) ? context.getMetadata().get(NamespaceContext.class) : null);
+                (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class)
+                    : null);
             return parseQName(value, namespaceContext);
         } else if (type.equals(XSD_YEAR)) {
             return factory.newXMLGregorianCalendar(value);
@@ -336,8 +342,8 @@
     @SuppressWarnings("deprecation")
     private XMLGregorianCalendar toXMLGregorianCalendar(Date date) {
         GregorianCalendar c =
-                new GregorianCalendar(date.getYear(), date.getMonth(), date.getDate(), date.getHours(), date
-                        .getMinutes(), date.getSeconds());
+            new GregorianCalendar(date.getYear(), date.getMonth(), date.getDate(), date.getHours(), date
+                .getMinutes(), date.getSeconds());
         return factory.newXMLGregorianCalendar(c);
     }
 
@@ -348,29 +354,30 @@
     public String toXMLLiteral(TypeInfo simpleType, Object obj, TransformationContext context) {
         if (obj instanceof Float || obj instanceof Double) {
             if (obj instanceof Float) {
-                return printDouble(((Float) obj).floatValue());
+                return printDouble(((Float)obj).floatValue());
             } else {
-                return printDouble(((Double) obj).doubleValue());
+                return printDouble(((Double)obj).doubleValue());
             }
         } else if (obj instanceof GregorianCalendar) {
-            GregorianCalendar calendar = (GregorianCalendar) obj;
+            GregorianCalendar calendar = (GregorianCalendar)obj;
             return toXMLGregorianCalendar(calendar).toXMLFormat();
         } else if (obj instanceof Date) {
-            return toXMLGregorianCalendar((Date) obj).toXMLFormat();
+            return toXMLGregorianCalendar((Date)obj).toXMLFormat();
         } else if (obj instanceof XMLGregorianCalendar) {
-            return ((XMLGregorianCalendar) obj).toXMLFormat();
+            return ((XMLGregorianCalendar)obj).toXMLFormat();
         } else if (obj instanceof byte[]) {
             if (simpleType.getQName().equals(XSD_BASE64)) {
-                return printBase64Binary((byte[]) obj);
+                return printBase64Binary((byte[])obj);
             } else if (simpleType.getQName().equals(XSD_HEXBIN)) {
-                return printHexBinary((byte[]) obj);
+                return printHexBinary((byte[])obj);
             }
         } else if (obj instanceof QName) {
             NamespaceContext namespaceContext =
-                    (NamespaceContext) ((context != null) ? context.getMetadata().get(NamespaceContext.class) : null);
-            return printQName((QName) obj, namespaceContext);
+                (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class)
+                    : null);
+            return printQName((QName)obj, namespaceContext);
         }
         return obj.toString();
     }
 
-}
\ No newline at end of file
+}

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverter.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverter.java?view=diff&rev=450654&r1=450653&r2=450654
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverter.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverter.java Wed Sep 27 17:51:49 2006
@@ -41,23 +41,28 @@
  * Utility class for XSD data type conversions
  */
 public class XSDDataTypeConverter {
-    public static class Base64Binary {
+    public static final class Base64Binary {
         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', 'k', 'l', 'm',
-                        'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5',
-                        '6', '7', '8', '9', '+', '/' };
+            {'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', 'k', 'l',
+             'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4',
+             '5', '6', '7', '8', '9', '+', '/'};
 
         private static final char S_BASE64PAD = '=';
 
         private static final byte[] S_DECODETABLE = new byte[128];
 
         static {
-            for (int i = 0; i < S_DECODETABLE.length; i++)
+            for (int i = 0; i < S_DECODETABLE.length; i++) {
                 S_DECODETABLE[i] = Byte.MAX_VALUE; // 127
-            for (int i = 0; i < S_BASE64CHAR.length; i++)
+            }
+            for (int i = 0; i < S_BASE64CHAR.length; i++) {
                 // 0 to 63
-                S_DECODETABLE[S_BASE64CHAR[i]] = (byte) i;
+                S_DECODETABLE[S_BASE64CHAR[i]] = (byte)i;
+            }
+        }
+
+        private Base64Binary() {
         }
 
         /**
@@ -80,7 +85,7 @@
             }
             if (obufcount == obuf.length) {
                 return obuf;
-            }    
+            }
             byte[] ret = new byte[obufcount];
             System.arraycopy(obuf, 0, ret, 0, obufcount);
             return ret;
@@ -126,7 +131,7 @@
             }
             if (obufcount == obuf.length) {
                 return obuf;
-            }    
+            }
             byte[] ret = new byte[obufcount];
             System.arraycopy(obuf, 0, ret, 0, obufcount);
             return ret;
@@ -157,29 +162,29 @@
             int outlen = 3;
             if (ibuf[3] == S_BASE64PAD) {
                 outlen = 2;
-            }    
+            }
             if (ibuf[2] == S_BASE64PAD) {
                 outlen = 1;
-            }    
+            }
             int b0 = S_DECODETABLE[ibuf[0]];
             int b1 = S_DECODETABLE[ibuf[1]];
             int b2 = S_DECODETABLE[ibuf[2]];
             int b3 = S_DECODETABLE[ibuf[3]];
             switch (outlen) {
-            case 1:
-                obuf[wp] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
-                return 1;
-            case 2:
-                obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
-                obuf[wp] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
-                return 2;
-            case 3:
-                obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
-                obuf[wp++] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
-                obuf[wp] = (byte) (b2 << 6 & 0xc0 | b3 & 0x3f);
-                return 3;
-            default:
-                throw new IllegalArgumentException("The character sequence is not base64 encoded.");
+                case 1:
+                    obuf[wp] = (byte)(b0 << 2 & 0xfc | b1 >> 4 & 0x3);
+                    return 1;
+                case 2:
+                    obuf[wp++] = (byte)(b0 << 2 & 0xfc | b1 >> 4 & 0x3);
+                    obuf[wp] = (byte)(b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
+                    return 2;
+                case 3:
+                    obuf[wp++] = (byte)(b0 << 2 & 0xfc | b1 >> 4 & 0x3);
+                    obuf[wp++] = (byte)(b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
+                    obuf[wp] = (byte)(b2 << 6 & 0xc0 | b3 & 0x3f);
+                    return 3;
+                default:
+                    throw new IllegalArgumentException("The character sequence is not base64 encoded.");
             }
         }
 
@@ -196,13 +201,15 @@
         public static String encode(byte[] data, int off, int len) {
             if (len <= 0) {
                 return "";
-            }    
+            }
             char[] out = new char[len / 3 * 4 + 4];
             int rindex = off;
             int windex = 0;
             int rest = len - off;
             while (rest >= 3) {
-                int i = ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8) + (data[rindex + 2] & 0xff);
+                int i =
+                    ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8)
+                        + (data[rindex + 2] & 0xff);
                 out[windex++] = S_BASE64CHAR[i >> 18];
                 out[windex++] = S_BASE64CHAR[(i >> 12) & 0x3f];
                 out[windex++] = S_BASE64CHAR[(i >> 6) & 0x3f];
@@ -227,55 +234,61 @@
         }
 
         /**
-         * Outputs base64 representation of the specified byte array to a byte stream.
+         * Outputs base64 representation of the specified byte array to a byte
+         * stream.
          */
         public static void encode(byte[] data, int off, int len, OutputStream ostream) throws IOException {
             if (len <= 0) {
                 return;
-            }    
+            }
             byte[] out = new byte[4];
             int rindex = off;
             int rest = len - off;
             while (rest >= 3) {
-                int i = ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8) + (data[rindex + 2] & 0xff);
-                out[0] = (byte) S_BASE64CHAR[i >> 18];
-                out[1] = (byte) S_BASE64CHAR[(i >> 12) & 0x3f];
-                out[2] = (byte) S_BASE64CHAR[(i >> 6) & 0x3f];
-                out[3] = (byte) S_BASE64CHAR[i & 0x3f];
+                int i =
+                    ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8)
+                        + (data[rindex + 2] & 0xff);
+                out[0] = (byte)S_BASE64CHAR[i >> 18];
+                out[1] = (byte)S_BASE64CHAR[(i >> 12) & 0x3f];
+                out[2] = (byte)S_BASE64CHAR[(i >> 6) & 0x3f];
+                out[3] = (byte)S_BASE64CHAR[i & 0x3f];
                 ostream.write(out, 0, 4);
                 rindex += 3;
                 rest -= 3;
             }
             if (rest == 1) {
                 int i = data[rindex] & 0xff;
-                out[0] = (byte) S_BASE64CHAR[i >> 2];
-                out[1] = (byte) S_BASE64CHAR[(i << 4) & 0x3f];
-                out[2] = (byte) S_BASE64PAD;
-                out[3] = (byte) S_BASE64PAD;
+                out[0] = (byte)S_BASE64CHAR[i >> 2];
+                out[1] = (byte)S_BASE64CHAR[(i << 4) & 0x3f];
+                out[2] = (byte)S_BASE64PAD;
+                out[3] = (byte)S_BASE64PAD;
                 ostream.write(out, 0, 4);
             } else if (rest == 2) {
                 int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
-                out[0] = (byte) S_BASE64CHAR[i >> 10];
-                out[1] = (byte) S_BASE64CHAR[(i >> 4) & 0x3f];
-                out[2] = (byte) S_BASE64CHAR[(i << 2) & 0x3f];
-                out[3] = (byte) S_BASE64PAD;
+                out[0] = (byte)S_BASE64CHAR[i >> 10];
+                out[1] = (byte)S_BASE64CHAR[(i >> 4) & 0x3f];
+                out[2] = (byte)S_BASE64CHAR[(i << 2) & 0x3f];
+                out[3] = (byte)S_BASE64PAD;
                 ostream.write(out, 0, 4);
             }
         }
 
         /**
-         * Outputs base64 representation of the specified byte array to a character stream.
+         * Outputs base64 representation of the specified byte array to a
+         * character stream.
          */
         public static void encode(byte[] data, int off, int len, Writer writer) throws IOException {
             if (len <= 0) {
                 return;
-            }    
+            }
             char[] out = new char[4];
             int rindex = off;
             int rest = len - off;
             int output = 0;
             while (rest >= 3) {
-                int i = ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8) + (data[rindex + 2] & 0xff);
+                int i =
+                    ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8)
+                        + (data[rindex + 2] & 0xff);
                 out[0] = S_BASE64CHAR[i >> 18];
                 out[1] = S_BASE64CHAR[(i >> 12) & 0x3f];
                 out[2] = S_BASE64CHAR[(i >> 6) & 0x3f];
@@ -286,7 +299,7 @@
                 output += 4;
                 if (output % 76 == 0) {
                     writer.write("\n");
-                }    
+                }
             }
             if (rest == 1) {
                 int i = data[rindex] & 0xff;
@@ -311,7 +324,10 @@
      * Utility class for xs:hexbinary.
      * </p>
      */
-    public static class HexBinary {
+    public static final class HexBinary {
+        private HexBinary() {
+        }
+
         /**
          * Converts the string <code>pValue</code> into an array of hex bytes.
          */
@@ -321,25 +337,26 @@
             }
             byte[] result = new byte[pValue.length() / 2];
             int j = 0;
-            for (int i = 0; i < pValue.length();) {
+            int i = 0;
+            while (i < pValue.length()) {
                 byte b;
                 char c = pValue.charAt(i++);
                 char d = pValue.charAt(i++);
                 if (c >= '0' && c <= '9') {
-                    b = (byte) ((c - '0') << 4);
+                    b = (byte)((c - '0') << 4);
                 } else if (c >= 'A' && c <= 'F') {
-                    b = (byte) ((c - 'A' + 10) << 4);
+                    b = (byte)((c - 'A' + 10) << 4);
                 } else if (c >= 'a' && c <= 'f') {
-                    b = (byte) ((c - 'a' + 10) << 4);
+                    b = (byte)((c - 'a' + 10) << 4);
                 } else {
                     throw new IllegalArgumentException("Invalid hex digit: " + c);
                 }
                 if (d >= '0' && d <= '9') {
-                    b += (byte) (d - '0');
+                    b += (byte)(d - '0');
                 } else if (d >= 'A' && d <= 'F') {
-                    b += (byte) (d - 'A' + 10);
+                    b += (byte)(d - 'A' + 10);
                 } else if (d >= 'a' && d <= 'f') {
-                    b += (byte) (d - 'a' + 10);
+                    b += (byte)(d - 'a' + 10);
                 } else {
                     throw new IllegalArgumentException("Invalid hex digit: " + d);
                 }
@@ -355,17 +372,17 @@
             StringBuffer result = new StringBuffer();
             for (int i = 0; i < pHexBinary.length; i++) {
                 byte b = pHexBinary[i];
-                byte c = (byte) ((b & 0xf0) >> 4);
+                byte c = (byte)((b & 0xf0) >> 4);
                 if (c <= 9) {
-                    result.append((char) ('0' + c));
+                    result.append((char)('0' + c));
                 } else {
-                    result.append((char) ('A' + c - 10));
+                    result.append((char)('A' + c - 10));
                 }
-                c = (byte) (b & 0x0f);
+                c = (byte)(b & 0x0f);
                 if (c <= 9) {
-                    result.append((char) ('0' + c));
+                    result.append((char)('0' + c));
                 } else {
-                    result.append((char) ('A' + c - 10));
+                    result.append((char)('A' + c - 10));
                 }
             }
             return result.toString();
@@ -394,10 +411,9 @@
 
     /**
      * <p>
-     * An instance of {@link java.text.Format}, which may be used to parse and format <code>xs:dateTime</code>
-     * values.
+     * An instance of {@link java.text.Format}, which may be used to parse and
+     * format <code>xs:dateTime</code> values.
      * </p>
-     * 
      */
     public static class XSDDateTimeFormat extends Format {
         private static final long serialVersionUID = -1148332471737068969L;
@@ -431,7 +447,7 @@
             assert pBuffer != null : "The StringBuffer argument must not be null.";
             assert pPos != null : "The FieldPosition argument must not be null.";
 
-            Calendar cal = (Calendar) pCalendar;
+            Calendar cal = (Calendar)pCalendar;
             if (parseDate) {
                 int year = cal.get(Calendar.YEAR);
                 if (year < 0) {
@@ -508,7 +524,9 @@
 
             boolean isMinus = false;
             StringBuffer digits = new StringBuffer();
-            int year, month, mday;
+            int year = 0;
+            int month = 0;
+            int mday = 0;
             if (parseDate) {
                 // Sign
                 if (offset < length) {
@@ -568,7 +586,10 @@
                 year = month = mday = 0;
             }
 
-            int hour, minute, second, millis;
+            int hour = 0;
+            int minute = 0;
+            int second = 0;
+            int millis = 0;
             if (parseTime) {
                 offset = parseInt(pString, offset, digits);
                 if (digits.length() != 2) {
@@ -666,7 +687,7 @@
         }
     }
 
-    private static final long MAX_UNSIGNED_INT = (((long) Integer.MAX_VALUE) * 2) + 1;
+    private static final long MAX_UNSIGNED_INT = (((long)Integer.MAX_VALUE) * 2) + 1;
 
     private static final int MAX_UNSIGNED_SHORT = Short.MAX_VALUE * 2 + 1;
 
@@ -689,10 +710,10 @@
     public Calendar parseDate(String value) {
         XSDDateFormat format = new XSDDateFormat();
         ParsePosition pos = new ParsePosition(0);
-        Calendar cal = (Calendar) format.parseObject(value, pos);
+        Calendar cal = (Calendar)format.parseObject(value, pos);
         if (cal == null) {
             throw new IllegalArgumentException("Failed to parse date " + value + " at:"
-                    + value.substring(pos.getErrorIndex()));
+                                               + value.substring(pos.getErrorIndex()));
         }
         return cal;
     }
@@ -700,10 +721,10 @@
     public Calendar parseDateTime(String value) {
         XSDDateTimeFormat format = new XSDDateTimeFormat();
         ParsePosition pos = new ParsePosition(0);
-        Calendar cal = (Calendar) format.parseObject(value, pos);
+        Calendar cal = (Calendar)format.parseObject(value, pos);
         if (cal == null) {
             throw new IllegalArgumentException("Failed to parse dateTime " + value + " at:"
-                    + value.substring(pos.getErrorIndex()));
+                                               + value.substring(pos.getErrorIndex()));
         }
         return cal;
     }
@@ -765,23 +786,26 @@
         String uri;
         String localName;
         switch (offset) {
-        case -1:
-            localName = value;
-            uri = context.getNamespaceURI("");
-            if (uri == null) {
-                // Should not happen, indicates an error in the NamespaceContext implementation
-                throw new IllegalArgumentException("The default prefix is not bound.");
-            }
-            break;
-        case 0:
-            throw new IllegalArgumentException("Default prefix must be indicated by not using a colon: " + value);
-        default:
-            String prefix = value.substring(0, offset);
-            localName = value.substring(offset + 1);
-            uri = context.getNamespaceURI(prefix);
-            if (uri == null) {
-                throw new IllegalArgumentException("The prefix " + prefix + " is not bound.");
-            }
+            case -1:
+                localName = value;
+                uri = context.getNamespaceURI("");
+                if (uri == null) {
+                    // Should not happen, indicates an error in the
+                    // NamespaceContext
+                    // implementation
+                    throw new IllegalArgumentException("The default prefix is not bound.");
+                }
+                break;
+            case 0:
+                throw new IllegalArgumentException("Default prefix must be indicated by not using a colon: "
+                                                   + value);
+            default:
+                String prefix = value.substring(0, offset);
+                localName = value.substring(offset + 1);
+                uri = context.getNamespaceURI(prefix);
+                if (uri == null) {
+                    throw new IllegalArgumentException("The prefix " + prefix + " is not bound.");
+                }
         }
         return new QName(uri, localName);
     }
@@ -797,10 +821,10 @@
     public Calendar parseTime(String value) {
         XSDTimeFormat format = new XSDTimeFormat();
         ParsePosition pos = new ParsePosition(0);
-        Calendar cal = (Calendar) format.parseObject(value, pos);
+        Calendar cal = (Calendar)format.parseObject(value, pos);
         if (cal == null) {
             throw new IllegalArgumentException("Failed to parse time " + value + " at:"
-                    + value.substring(pos.getErrorIndex()));
+                                               + value.substring(pos.getErrorIndex()));
         }
         return cal;
     }
@@ -808,11 +832,12 @@
     public long parseUnsignedInt(String value) {
         long l = Long.parseLong(value);
         if (l < 0) {
-            throw new IllegalArgumentException("Failed to parse UnsignedInt " + value + ": result is negative");
+            throw new IllegalArgumentException("Failed to parse UnsignedInt " + value
+                                               + ": result is negative");
         }
         if (l > MAX_UNSIGNED_INT) {
             throw new IllegalArgumentException("Failed to parse UnsignedInt " + value
-                    + ": result exceeds maximum value " + MAX_UNSIGNED_INT);
+                                               + ": result exceeds maximum value " + MAX_UNSIGNED_INT);
         }
         return l;
     }
@@ -820,11 +845,12 @@
     public int parseUnsignedShort(String value) {
         int i = Integer.parseInt(value);
         if (i < 0) {
-            throw new IllegalArgumentException("Failed to parse UnsignedShort " + value + ": result is negative");
+            throw new IllegalArgumentException("Failed to parse UnsignedShort " + value
+                                               + ": result is negative");
         }
         if (i > MAX_UNSIGNED_SHORT) {
             throw new IllegalArgumentException("Failed to parse UnsignedShort " + value
-                    + ": result exceeds maximum value " + MAX_UNSIGNED_SHORT);
+                                               + ": result exceeds maximum value " + MAX_UNSIGNED_SHORT);
         }
         return i;
     }
@@ -888,7 +914,8 @@
     public String printQName(QName value, NamespaceContext context) {
         String prefix = context.getPrefix(value.getNamespaceURI());
         if (prefix == null) {
-            throw new IllegalArgumentException("The namespace URI " + value.getNamespaceURI() + " is not bound.");
+            throw new IllegalArgumentException("The namespace URI " + value.getNamespaceURI()
+                                               + " is not bound.");
         } else if (XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) {
             return value.getLocalPart();
         } else {

Modified: incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/DOMHelperTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/DOMHelperTestCase.java?view=diff&rev=450654&r1=450653&r2=450654
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/DOMHelperTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/DOMHelperTestCase.java Wed Sep 27 17:51:49 2006
@@ -31,7 +31,7 @@
  * 
  */
 public class DOMHelperTestCase extends TestCase {
-    private QName FOO_NAME = new QName("http://foo", "foo");
+    private static final QName FOO_NAME = new QName("http://foo", "foo");
 
     /**
      * @see junit.framework.TestCase#setUp()

Modified: incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtensionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtensionTestCase.java?view=diff&rev=450654&r1=450653&r2=450654
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtensionTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtensionTestCase.java Wed Sep 27 17:51:49 2006
@@ -35,40 +35,40 @@
  */
 public class SimpleTypeMapperExtensionTestCase extends TestCase {
 
-    private static final Map<String, Object> sampleValues = new HashMap<String, Object>();
+    private static final Map<String, Object> SAMPLE_VALUES = new HashMap<String, Object>();
 
     static {
-        sampleValues.put("anyURI", "http://www.w3.com");
-        sampleValues.put("boolean", new String[] { "true", "false", "1", "0" });
-        sampleValues.put("byte", new String[] { "-128", "127" });
-        sampleValues.put("date", new String[] { "2004-03-15", "2002-09-24-06:00" });
-        sampleValues.put("dateTime", "2003-12-25T08:30:00");
-        sampleValues.put("decimal", "3.1415292");
-        sampleValues.put("double", new String[] { "3.1415292", "INF", "NaN" });
-        sampleValues.put("duration", new String[] { "P8M3DT7H33M2S", "P5Y2M10DT15H" });
-        sampleValues.put("float", new String[] { "3.1415292", "INF", "NaN" });
-        sampleValues.put("gDay", "---11");
-        sampleValues.put("gMonth", "--02--");
-        sampleValues.put("gMonthDay", "--02-14");
-        sampleValues.put("gYear", "1999");
-        sampleValues.put("gYearMonth", "1972-08");
-        sampleValues.put("ID", "id-102");
-        sampleValues.put("IDREF", "id-102");
-        sampleValues.put("IDREFS", "id-102 id-103 id-100");
-        sampleValues.put("int", "77");
-        sampleValues.put("integer", "77");
-        sampleValues.put("long", "214");
-        sampleValues.put("negativeInteger", "-123");
-        sampleValues.put("nonNegativeInteger", "2");
-        sampleValues.put("nonPositiveInteger", "0");
-        sampleValues.put("positiveInteger", "500");
-        sampleValues.put("short", "476");
-        sampleValues.put("string", "Joeseph");
-        sampleValues.put("time", "13:02:00");
-        sampleValues.put("base64Binary", "TWFu");
-        sampleValues.put("hexBinary", "2CDB5F");
-        sampleValues.put("QName", "f:foo");
-        sampleValues.put("NOTATION", "f:bar");
+        SAMPLE_VALUES.put("anyURI", "http://www.w3.com");
+        SAMPLE_VALUES.put("boolean", new String[] {"true", "false", "1", "0"});
+        SAMPLE_VALUES.put("byte", new String[] {"-128", "127"});
+        SAMPLE_VALUES.put("date", new String[] {"2004-03-15", "2002-09-24-06:00"});
+        SAMPLE_VALUES.put("dateTime", "2003-12-25T08:30:00");
+        SAMPLE_VALUES.put("decimal", "3.1415292");
+        SAMPLE_VALUES.put("double", new String[] {"3.1415292", "INF", "NaN"});
+        SAMPLE_VALUES.put("duration", new String[] {"P8M3DT7H33M2S", "P5Y2M10DT15H"});
+        SAMPLE_VALUES.put("float", new String[] {"3.1415292", "INF", "NaN"});
+        SAMPLE_VALUES.put("gDay", "---11");
+        SAMPLE_VALUES.put("gMonth", "--02--");
+        SAMPLE_VALUES.put("gMonthDay", "--02-14");
+        SAMPLE_VALUES.put("gYear", "1999");
+        SAMPLE_VALUES.put("gYearMonth", "1972-08");
+        SAMPLE_VALUES.put("ID", "id-102");
+        SAMPLE_VALUES.put("IDREF", "id-102");
+        SAMPLE_VALUES.put("IDREFS", "id-102 id-103 id-100");
+        SAMPLE_VALUES.put("int", "77");
+        SAMPLE_VALUES.put("integer", "77");
+        SAMPLE_VALUES.put("long", "214");
+        SAMPLE_VALUES.put("negativeInteger", "-123");
+        SAMPLE_VALUES.put("nonNegativeInteger", "2");
+        SAMPLE_VALUES.put("nonPositiveInteger", "0");
+        SAMPLE_VALUES.put("positiveInteger", "500");
+        SAMPLE_VALUES.put("short", "476");
+        SAMPLE_VALUES.put("string", "Joeseph");
+        SAMPLE_VALUES.put("time", "13:02:00");
+        SAMPLE_VALUES.put("base64Binary", "TWFu");
+        SAMPLE_VALUES.put("hexBinary", "2CDB5F");
+        SAMPLE_VALUES.put("QName", "f:foo");
+        SAMPLE_VALUES.put("NOTATION", "f:bar");
     }
 
     /**
@@ -84,27 +84,30 @@
         Map<Class<?>, Object> metaData = new HashMap<Class<?>, Object>();
         EasyMock.expect(context.getMetadata()).andReturn(metaData).anyTimes();
         EasyMock.replay(context);
-        
+
         NamespaceContext namespaceContext = EasyMock.createMock(NamespaceContext.class);
-        EasyMock.expect(namespaceContext.getNamespaceURI(EasyMock.eq("f"))).andReturn("http://foo").anyTimes();
+        EasyMock.expect(namespaceContext.getNamespaceURI(EasyMock.eq("f"))).andReturn("http://foo")
+            .anyTimes();
         EasyMock.expect(namespaceContext.getPrefix(EasyMock.eq("http://foo"))).andReturn("f").anyTimes();
         EasyMock.replay(namespaceContext);
         context.getMetadata().put(NamespaceContext.class, namespaceContext);
         for (TypeInfo simpleType : SimpleTypeMapperExtension.XSD_SIMPLE_TYPES.values()) {
             String name = simpleType.getQName().getLocalPart();
-            Object value = sampleValues.get(name);
+            Object value = SAMPLE_VALUES.get(name);
             if (value instanceof String[]) {
-                for (String s : (String[]) value) {
+                for (String s : (String[])value) {
                     Object obj = extension.toJavaObject(simpleType, s, context);
                     String str = extension.toXMLLiteral(simpleType, obj, context);
                     assertNotNull(str);
-                    // assertTrue("[" + name + "] " + s + " " + str, str.contains((String) s));
+                    // assertTrue("[" + name + "] " + s + " " + str,
+                    // str.contains((String) s));
                 }
             } else if (value instanceof String) {
-                Object obj = extension.toJavaObject(simpleType, (String) value, context);
+                Object obj = extension.toJavaObject(simpleType, (String)value, context);
                 String str = extension.toXMLLiteral(simpleType, obj, context);
                 assertNotNull(str);
-                // assertTrue("[" + name + "] " + value + " " + str, str.contains((String) value));
+                // assertTrue("[" + name + "] " + value + " " + str,
+                // str.contains((String) value));
             }
         }
     }

Modified: incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverterTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverterTestCase.java?view=diff&rev=450654&r1=450653&r2=450654
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverterTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverterTestCase.java Wed Sep 27 17:51:49 2006
@@ -20,10 +20,9 @@
 package org.apache.tuscany.spi.databinding.extension;
 
 import java.math.BigInteger;
+import java.util.Calendar;
 import java.util.GregorianCalendar;
 
-import org.apache.tuscany.spi.databinding.extension.XSDDataTypeConverter;
-
 import junit.framework.TestCase;
 
 /**
@@ -41,21 +40,21 @@
     public void testConvert() throws Exception {
         XSDDataTypeConverter c = new XSDDataTypeConverter();
         assertEquals("123", c.parseAnySimpleType(c.printAnySimpleType("123")));
-        assertEquals(true, c.parseBoolean((c.printBoolean(true))));
-        assertEquals(false, c.parseBoolean((c.printBoolean(false))));
-        assertEquals(123.0, c.parseDouble((c.printDouble(123.0))));
-        assertEquals(123.0f, c.parseFloat((c.printFloat(123.0f))));
-        assertEquals(64, c.parseByte((c.printByte((byte) 64))));
-        assertEquals(123, c.parseInt((c.printInt(123))));
-        assertEquals(new BigInteger("123456"), c.parseInteger((c.printInteger(new BigInteger("123456")))));
-        assertEquals(123456l, c.parseLong((c.printLong(123456l))));
-        assertEquals((short) 123, c.parseShort((c.printShort((short) 123))));
-        
-        GregorianCalendar calendar = new GregorianCalendar();
+        assertEquals(true, c.parseBoolean(c.printBoolean(true)));
+        assertEquals(false, c.parseBoolean(c.printBoolean(false)));
+        assertEquals(123.0, c.parseDouble(c.printDouble(123.0)));
+        assertEquals(123.0f, c.parseFloat(c.printFloat(123.0f)));
+        assertEquals(64, c.parseByte(c.printByte((byte)64)));
+        assertEquals(123, c.parseInt(c.printInt(123)));
+        assertEquals(new BigInteger("123456"), c.parseInteger(c.printInteger(new BigInteger("123456"))));
+        assertEquals(123456L, c.parseLong(c.printLong(123456L)));
+        assertEquals((short)123, c.parseShort(c.printShort((short)123)));
+
+        Calendar calendar = new GregorianCalendar();
         String s = c.printDate(calendar);
-        calendar = (GregorianCalendar) c.parseDate(s);
+        calendar = (GregorianCalendar)c.parseDate(s);
         assertEquals(s, c.printDate(calendar));
-        
+
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message