commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read ReadContext.java
Date Wed, 06 Oct 2004 20:39:13 GMT
rdonkin     2004/10/06 13:39:13

  Modified:    betwixt/src/java/org/apache/commons/betwixt/io/read
                        ReadContext.java
  Log:
  Fixed some of my sloppy coding :( Fix for issue #30990
  
  Revision  Changes    Path
  1.9       +12 -1     jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read/ReadContext.java
  
  Index: ReadContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read/ReadContext.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ReadContext.java	4 Jul 2004 16:41:16 -0000	1.8
  +++ ReadContext.java	6 Oct 2004 20:39:13 -0000	1.9
  @@ -221,7 +221,18 @@
        * or null if there has been no element mapped 
        */
   	public String getCurrentElement() {
  -		return (String) elementMappingStack.peek();
  +	    String result = null;
  +	    int stackSize = elementMappingStack.size();
  +	    int i = 0;
  +	    while ( i < stackSize ) {
  +	        Object mappedElement = elementMappingStack.peek(i);
  +	        if (mappedElement instanceof String) {
  +	            result  = (String) mappedElement;
  +	            break;
  +	        }
  +	        --i;
  +	    }
  +	    return result;
   	}
   
   	/**
  
  
  

---------------------------------------------------------------------
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