commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmi...@apache.org
Subject cvs commit: jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/jdom JDOMNamespaceIterator.java JDOMNodePointer.java
Date Thu, 04 Mar 2004 01:01:27 GMT
dmitri      2004/03/03 17:01:27

  Modified:    jxpath/src/java/org/apache/commons/jxpath/ri/model/jdom
                        JDOMNamespaceIterator.java JDOMNodePointer.java
  Log:
  Resolved compatibility issue with JDOM b10
  
  Revision  Changes    Path
  1.8       +4 -4      jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNamespaceIterator.java
  
  Index: JDOMNamespaceIterator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNamespaceIterator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- JDOMNamespaceIterator.java	29 Feb 2004 14:17:40 -0000	1.7
  +++ JDOMNamespaceIterator.java	4 Mar 2004 01:01:27 -0000	1.8
  @@ -61,9 +61,9 @@
                   prefixes.add(ns.getPrefix());
               }
           }
  -        Element parent = (Element) element.getParent();
  -        if (parent != null) {
  -            collectNamespaces(parent);
  +        Object parent = element.getParent();
  +        if (parent instanceof Element) {
  +            collectNamespaces((Element)parent);
           }
       }
   
  
  
  
  1.14      +9 -5      jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java
  
  Index: JDOMNodePointer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- JDOMNodePointer.java	29 Feb 2004 14:17:40 -0000	1.13
  +++ JDOMNodePointer.java	4 Mar 2004 01:01:27 -0000	1.14
  @@ -467,7 +467,10 @@
       
       private Element nodeParent(Object node) {
           if (node instanceof Element) {
  -            return (Element) ((Element) node).getParent();
  +            Object parent = ((Element) node).getParent();
  +            if (parent instanceof Element) {
  +                return (Element) parent;
  +            }
           }
           else if (node instanceof Text) {
               return (Element) ((Text) node).getParent();
  @@ -623,11 +626,12 @@
   
       private int getRelativePositionByName() {
           if (node instanceof Element) {
  -            Element parent = (Element)((Element) node).getParent();
  -            if (parent == null) {
  +            Object parent = ((Element) node).getParent();
  +            if (!(parent instanceof Element)) {
                   return 1;
               }
  -            List children = parent.getContent();
  +            
  +            List children = ((Element)parent).getContent();
               int count = 0;
               String name = ((Element) node).getQualifiedName();
               for (int i = 0; i < children.size(); i++) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message