glyn        02/03/15 02:19:35

  Modified:    java     README axis.properties
               java/docs architecture-guide.html integration-guide.html
                        reference.html
               java/src/org/apache/axis/client Call.java
               java/src/org/apache/axis/encoding
                        DeserializationContextImpl.java
               java/src/org/apache/axis/message MessageElement.java
  Log:
  Add exceptions to MessageElement addChild and setObjectValue precondition
  checks. NB. peculiar coding style forced by the source-code checks.
  
  Also fix change references to 'alpha' to 'beta'.
  
  Revision  Changes    Path
  1.10      +1 -1      xml-axis/java/README
  
  Index: README
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/README,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- README    3 Jan 2002 17:04:27 -0000       1.9
  +++ README    15 Mar 2002 10:19:35 -0000      1.10
  @@ -1,6 +1,6 @@
                Axis (Apache eXtensible Interaction System)
                -------------------------------------------
  -             Alpha 3 Release          December 14, 2001
  +             Beta 1 Release               March 15, 2002
   
   Welcome to Axis!  You'll find documentation in the docs/ directory.
   
  
  
  
  1.4       +1 -1      xml-axis/java/axis.properties
  
  Index: axis.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/axis.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- axis.properties   12 Mar 2002 21:01:51 -0000      1.3
  +++ axis.properties   15 Mar 2002 10:19:35 -0000      1.4
  @@ -1,4 +1,4 @@
  -axis.version=alpha 3
  +axis.version=beta 1
   
   name=axis
   Name=Axis
  
  
  
  1.8       +1 -1      xml-axis/java/docs/architecture-guide.html
  
  Index: architecture-guide.html
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/docs/architecture-guide.html,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- architecture-guide.html   19 Feb 2002 17:38:18 -0000      1.7
  +++ architecture-guide.html   15 Mar 2002 10:19:35 -0000      1.8
  @@ -24,7 +24,7 @@
   Axis Architecture Guide</h1>
   <font face="Lucida Sans"><font color="#CC0000"><font size=+3>Under construction
   ....</font></font></font>
  -<br><i>Post-Alpha 3 Version</i>
  +<br><i>Beta 1 Version</i>
   <br><i>Feedback: <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a></i>
   <h3>
   Contents</h3>
  
  
  
  1.5       +1 -1      xml-axis/java/docs/integration-guide.html
  
  Index: integration-guide.html
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/docs/integration-guide.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- integration-guide.html    22 Feb 2002 14:49:14 -0000      1.4
  +++ integration-guide.html    15 Mar 2002 10:19:35 -0000      1.5
  @@ -24,7 +24,7 @@
   
   <h1>
   Axis System Integration Guide</h1>
  -<i>Alpha 2 Version</i>
  +<i>Beta 1 Version</i>
   <h3>
   Table of Contents</h3>
   <a href="#Introduction">Introduction</a>
  
  
  
  1.2       +1 -1      xml-axis/java/docs/reference.html
  
  Index: reference.html
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/docs/reference.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- reference.html    13 Dec 2001 05:10:57 -0000      1.1
  +++ reference.html    15 Mar 2002 10:19:35 -0000      1.2
  @@ -18,7 +18,7 @@
   <body bgcolor="#ffffff" text="#000000">
   <h1 align="center"><IMG height=96 src="axis.jpg" width=176></h1>
   <h1>Axis Reference Guide</h1>
  -<p><i>Alpha 3 Version</i></p>
  +<p><i>Beta 1 Version</i></p>
   <h3>Table of Contents</h3>
   
   <h2><a name="DeploymentReference"></a>Deployment Reference</h2>
  
  
  
  1.97      +4 -9      xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- Call.java 15 Mar 2002 05:07:11 -0000      1.96
  +++ Call.java 15 Mar 2002 10:19:35 -0000      1.97
  @@ -1564,18 +1564,13 @@
           try {
               body.setEncodingStyle(encodingStyle);
               reqEnv.setEncodingStyle(encodingStyle);
  -        } catch (SOAPException e) {
  -            log.debug( JavaUtils.getMessage("exception00"), e );
  -            throw AxisFault.makeFault(e);
  -        }
   
  -        setRequestMessage(reqMsg);
  +            setRequestMessage(reqMsg);
   
  -        reqEnv.addBodyElement(body);
  -        body.setParent(reqEnv);
  -        reqEnv.setMessageType(Message.REQUEST);
  +            reqEnv.addBodyElement(body);
  +            body.setParent(reqEnv);
  +            reqEnv.setMessageType(Message.REQUEST);
   
  -        try {
               invoke();
           } catch (Exception e) {
               log.debug( JavaUtils.getMessage("exception00"), e );
  
  
  
  1.17      +10 -1     
xml-axis/java/src/org/apache/axis/encoding/DeserializationContextImpl.java
  
  Index: DeserializationContextImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializationContextImpl.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DeserializationContextImpl.java   14 Mar 2002 22:39:15 -0000      1.16
  +++ DeserializationContextImpl.java   15 Mar 2002 10:19:35 -0000      1.17
  @@ -622,7 +622,16 @@
               recorder.newElement(elem);
           }
           
  -        elem.setParent(curElement);
  +        try {
  +            elem.setParent(curElement);
  +        } catch (Exception e) {
  +            /*
  +             * The only checked exception that may be thrown from setParent
  +             * occurs if the parent already has an explicit object value,
  +             * which should never occur during deserialization. An error
  +             * has already been logged, so no-op.
  +             */
  +        }
           curElement = elem;
       }
       
  
  
  
  1.88      +31 -41    xml-axis/java/src/org/apache/axis/message/MessageElement.java
  
  Index: MessageElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- MessageElement.java       14 Mar 2002 21:02:17 -0000      1.87
  +++ MessageElement.java       15 Mar 2002 10:19:35 -0000      1.88
  @@ -301,7 +301,7 @@
       }
   
       public MessageElement getParent() { return parent; }
  -    public void setParent(MessageElement parent) 
  +    public void setParent(MessageElement parent) throws SOAPException
       { 
           this.parent = parent;
           if (parent != null) {
  @@ -315,11 +315,13 @@
        * Note that this method will log a error and no-op if there is
        * a value (set using setObjectValue) in the MessageElement.
        */
  -    public void addChild(MessageElement el)
  +    public void addChild(MessageElement el) throws SOAPException
       {
           if (objectValue != null) {
  -            log.error(JavaUtils.getMessage("valuePresent"));
  -            return;
  +            SOAPException exc = new SOAPException(JavaUtils.
  +                                                  getMessage("valuePresent"));
  +            log.error(JavaUtils.getMessage("valuePresent"), exc);
  +            throw exc;
           }
           if (children == null)
               children = new ArrayList();
  @@ -415,14 +417,18 @@
        * constructed from XML.
        * @param newValue node's value or null.
        */
  -    public void setObjectValue(Object newValue){
  +    public void setObjectValue(Object newValue) throws SOAPException {
           if (children != null && !children.isEmpty()) {
  -            log.error(JavaUtils.getMessage("childPresent"));
  -            return;
  +            SOAPException exc = new SOAPException(JavaUtils.
  +                                                  getMessage("childPresent"));
  +            log.error(JavaUtils.getMessage("childPresent"), exc);
  +            throw exc;
           }
           if (elementRep != null) {
  -            log.error(JavaUtils.getMessage("xmlPresent"));
  -            return;
  +            SOAPException exc = new SOAPException(JavaUtils.
  +                                                  getMessage("xmlPresent"));
  +            log.error(JavaUtils.getMessage("xmlPresent"), exc);
  +            throw exc;
           }
           this.objectValue = newValue;
       }
  @@ -711,56 +717,40 @@
       // JAXM SOAPElement methods...
   
       public SOAPElement addChildElement(Name name) throws SOAPException {
  -        try {
  -            MessageElement child = new MessageElement(name.getURI(),
  -                                                      name.getLocalName());
  -            addChild(child);
  -            return child;
  -        } catch (Throwable t) {
  -            throw new SOAPException(t);
  -        }
  +        MessageElement child = new MessageElement(name.getURI(),
  +                                                  name.getLocalName());
  +        addChild(child);
  +        return child;
       }
   
       public SOAPElement addChildElement(String localName) throws SOAPException {
  -        try {
  -            // Inherit parent's namespace
  -            MessageElement child = new MessageElement(getNamespaceURI(),
  -                                                      localName);
  -            addChild(child);
  -            return child;
  -        } catch (Throwable t) {
  -            throw new SOAPException(t);
  -        }
  +        // Inherit parent's namespace
  +        MessageElement child = new MessageElement(getNamespaceURI(),
  +                                                  localName);
  +        addChild(child);
  +        return child;
       }
   
       public SOAPElement addChildElement(String localName,
                                          String prefix) throws SOAPException {
  -        try {
  -            MessageElement child = new MessageElement(getNamespaceURI(prefix),
  -                                                      localName);
  -            addChild(child);
  -            return child;
  -        } catch (Throwable t) {
  -            throw new SOAPException(t);
  -        }
  +        MessageElement child = new MessageElement(getNamespaceURI(prefix),
  +                                                  localName);
  +        addChild(child);
  +        return child;
       }
   
       public SOAPElement addChildElement(String localName,
                                          String prefix,
                                          String uri) throws SOAPException {
  -        try {
               MessageElement child = new MessageElement(uri, localName);
               child.addNamespaceDeclaration(prefix, uri);
               addChild(child);
               return child;
  -        } catch (Throwable t) {
  -            throw new SOAPException(t);
  -        }
       }
   
       /**
        * The added child must be an instance of MessageElement rather than
  -     * an abitrary SOAPElement otherwise a (wrapped) class cast exception
  +     * an abitrary SOAPElement otherwise a (wrapped) ClassCastException
        * will be thrown.
        */
       public SOAPElement addChildElement(SOAPElement element)
  @@ -768,8 +758,8 @@
           try {
               addChild((MessageElement)element);
               return element;
  -        } catch (Throwable t) {
  -            throw new SOAPException(t);
  +        } catch (ClassCastException e) {
  +            throw new SOAPException(e);
           }
       }
   
  
  
  


Reply via email to