You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2006/09/01 22:10:15 UTC

svn commit: r439450 - in /webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding: i18n/resource.properties utils/ConverterUtil.java

Author: dims
Date: Fri Sep  1 13:10:14 2006
New Revision: 439450

URL: http://svn.apache.org/viewvc?rev=439450&view=rev
Log:
Fix for AXIS2-1055 - Enumeration: Unhandled exception in generated code

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/i18n/resource.properties
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/i18n/resource.properties?rev=439450&r1=439449&r2=439450&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/i18n/resource.properties Fri Sep  1 13:10:14 2006
@@ -15,3 +15,4 @@
 ################## Converter Util #################################################
 converter.cannotGenerate=Cannot generate object for {0}
 converter.cannotConvert=No way to convert {0}
+converter.cannotParse=Unable to parse ''{0}''
\ No newline at end of file

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?rev=439450&r1=439449&r2=439450&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java Fri Sep  1 13:10:14 2006
@@ -293,7 +293,7 @@
     }
 
     public static javax.activation.DataHandler convertToBase64Binary(String s)
-            throws Exception {
+            {
         // reusing the byteArrayDataSource from the Axiom classes
         ByteArrayDataSource byteArrayDataSource = new ByteArrayDataSource(
                 Base64.decode(s)
@@ -302,7 +302,7 @@
     }
 
     public static javax.activation.DataHandler convertToDataHandler(String s)
-            throws Exception {
+            {
         return convertToBase64Binary(s);
     }
 
@@ -453,8 +453,13 @@
         return new IDRefs(s);
     }
 
-    public static URI convertToAnyURI(String s) throws Exception {
-        return new URI(s);
+    public static URI convertToAnyURI(String s) {
+        try {
+            return new URI(s);
+        } catch (URI.MalformedURIException e) {
+            throw new ObjectConversionException(
+                    ADBMessages.getMessage("converter.cannotParse", s), e);
+        }
     }
 
     public static BigInteger convertToInteger(String s) {
@@ -465,7 +470,7 @@
         return convertToInteger(s);
     }
 
-    public static byte convertToByte(String s) throws Exception {
+    public static byte convertToByte(String s) {
         return Byte.parseByte(s);
     }
 
@@ -475,9 +480,8 @@
      *
      * @param source
      * @return Returns Calendar.
-     * @throws Exception
      */
-    public static Calendar convertToDateTime(String source) throws Exception {
+    public static Calendar convertToDateTime(String source) {
         Calendar calendar = Calendar.getInstance();
         SimpleDateFormat zulu =
                 new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
@@ -724,7 +728,7 @@
      * but that returns an *immutable* list !!!!!
      *
      * @param array
-     * @return
+     * @return list
      */
     public static List toList(Object[] array) {
         if (array == null) {
@@ -741,7 +745,7 @@
     /**
      * Converts the given datahandler to a string
      *
-     * @return
+     * @return string
      */
     public static String getStringFromDatahandler(DataHandler dataHandler) {
         try {
@@ -760,7 +764,7 @@
      *
      * @param clazz
      * @param value
-     * @return
+     * @return object
      */
     public static Object getObjectForClass(Class clazz, String value) {
         //first see whether this class has a constructor that can



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