cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: ArrayIndexOOB in o.a.c.c.serializers.util.Namespaces
Date Wed, 20 Oct 2004 16:19:08 GMT

Pier, I was referring to something similar
in the serializer thread.

cheers
--
Torsten

> The problem occurs here (line marked with *):
> 
>     public String[][] commit() {
>         int size = this.depth - this.last;
>         String result[][] = new String[size][2];
>         int k = 0;
>         for (int x = this.last; x < this.depth; x++) {
> *           result[k][NAMESPACE_PREFIX] = this.pre[x];
> 
> 
> 
> For debugging, I added some logging to the push() and pop() methods.
> This is the result (the number at the end of the line is the current
> Namespaces.last field):
> 
> 
> [...]
>         push [i18n] 4
>           push [xsp] 4
>             push [input] 4
>               push [xspdoc] 4
>                 push [esql] 4
>                   push [xsp-vvz-e] 4
>                     push [tree] 4
>                     pop  [tree] 3
>                   pop  [xsp-vvz-e] 2
>                 pop  [esql] 1
>               pop  [xspdoc] 0
>             pop  [input] -1
>           pop  [xsp] -2
>         pop  [i18n] -3
>       pop  [vvz] -4
> [...]
> 
> 
> Apparently this.last is increased on push, but not decreased on pop
> which leads to a negative array index. Any ideas what goes wrong?

Mime
View raw message