You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jk...@apache.org on 2002/03/04 19:47:44 UTC
cvs commit: xml-xalan/java/src/org/apache/xml/utils IntStack.java
jkesselm 02/03/04 10:47:44
Modified: java/src/org/apache/xml/utils IntStack.java
Log:
Bugzilla 6854: Return the stack exception, as documented.
Revision Changes Path
1.6 +21 -3 xml-xalan/java/src/org/apache/xml/utils/IntStack.java
Index: IntStack.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/IntStack.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- IntStack.java 21 Jun 2001 18:52:52 -0000 1.5
+++ IntStack.java 4 Mar 2002 18:47:44 -0000 1.6
@@ -145,7 +145,13 @@
*/
public int peek()
{
- return m_map[m_firstFree - 1];
+ try {
+ return m_map[m_firstFree - 1];
+ }
+ catch (ArrayIndexOutOfBoundsException e)
+ {
+ throw new EmptyStackException();
+ }
}
/**
@@ -157,7 +163,13 @@
*/
public int peek(int n)
{
- return m_map[m_firstFree-(1+n)];
+ try {
+ return m_map[m_firstFree-(1+n)];
+ }
+ catch (ArrayIndexOutOfBoundsException e)
+ {
+ throw new EmptyStackException();
+ }
}
/**
@@ -169,7 +181,13 @@
*/
public void setTop(int val)
{
- m_map[m_firstFree - 1] = val;
+ try {
+ m_map[m_firstFree - 1] = val;
+ }
+ catch (ArrayIndexOutOfBoundsException e)
+ {
+ throw new EmptyStackException();
+ }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org