xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z...@apache.org
Subject cvs commit: xml-xmlbeans/v2/test/cases/marshal/com/mytest MyException.java YourClass.java
Date Mon, 19 Apr 2004 06:30:36 GMT
zieg        2004/04/18 23:30:36

  Modified:    v2/src/marshal/org/apache/xmlbeans/impl/marshal/util
                        ReflectionUtils.java
               v2/test/cases/marshal doc.xml
               v2/test/cases/marshal/com/mytest YourClass.java
  Added:       v2/test/cases/marshal/com/mytest MyException.java
  Log:
  better handling of user exceptions from bean methods
  
  Revision  Changes    Path
  1.5       +2 -2      xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/util/ReflectionUtils.java
  
  Index: ReflectionUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/util/ReflectionUtils.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ReflectionUtils.java	25 Mar 2004 03:19:28 -0000	1.4
  +++ ReflectionUtils.java	19 Apr 2004 06:30:36 -0000	1.5
  @@ -48,8 +48,8 @@
           catch (IllegalArgumentException e) {
               throw new XmlException(e);
           }
  -        catch (InvocationTargetException e) {
  -            throw new XmlException(e);
  +        catch (InvocationTargetException ite) {
  +            throw new XmlException(ite.getTargetException());
           }
       }
   
  
  
  
  1.15      +1 -1      xml-xmlbeans/v2/test/cases/marshal/doc.xml
  
  Index: doc.xml
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/cases/marshal/doc.xml,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- doc.xml	13 Mar 2004 03:46:57 -0000	1.14
  +++ doc.xml	19 Apr 2004 06:30:36 -0000	1.15
  @@ -4,7 +4,7 @@
       xmlns:My="java:com.mytest"
       xmlns:n1="java:com.mytest">
   
  -    <My:Myelt ignore="someval" My:Attrib="4444.123456789">
  +    <My:Myelt ignore="someval" My:Attrib="-4444.123456789">
           <My:MyFloat>111111165.34</My:MyFloat>
           <My:MyClass xsi:type="My:MySubClass">
               <My:Myatt xsi:type="xsd:token">inner-str</My:Myatt>
  
  
  
  1.19      +4 -0      xml-xmlbeans/v2/test/cases/marshal/com/mytest/YourClass.java
  
  Index: YourClass.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/cases/marshal/com/mytest/YourClass.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- YourClass.java	14 Apr 2004 23:03:51 -0000	1.18
  +++ YourClass.java	19 Apr 2004 06:30:36 -0000	1.19
  @@ -164,12 +164,16 @@
        *  @xsdgen:attribute.name Attrib
        */
       public float getAttrib()
  +        throws MyException
       {
           return attrib;
       }
   
       public void setAttrib(float attrib)
  +        throws MyException
       {
  +//        if (attrib < 0.001f)
  +//           throw new MyException("too small: " + attrib);
           this.attrib = attrib;
       }
   
  
  
  
  1.1                  xml-xmlbeans/v2/test/cases/marshal/com/mytest/MyException.java
  
  Index: MyException.java
  ===================================================================
  /*   Copyright 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.
   */
  
  package com.mytest;
  
  public class MyException
      extends Exception
  {
      public MyException()
      {
      }
  
      public MyException(String s)
      {
          super(s);
      }
  
      public MyException(String s, Throwable throwable)
      {
          super(s, throwable);
      }
  
      public MyException(Throwable throwable)
      {
          super(throwable);
      }
  }
  
  
  

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


Mime
View raw message