#5 Infinite loop in AttributesImpl

closed-rejected
nobody
5
2001-07-29
2001-07-13
No

Reported by Tancred Linholm 2001-06-15:

The following code yields an infinite loop (SAX2pre2)
with sun
JDK-1.3beta1 on Linux & Jbuilder 4.

AttributesImpl a = new AttributesImpl( attrs );
a.addAttribute("","","_3dm:edit","CDATA",opStr);

where attrs is an AttributesImpl object with no
attributes set.

The code seems to do go bye-bye in ensureCapacity()

// AttributesImpl.java - default implementation of
Attributes.
// Written by David Megginson, sax@megginson.com
// NO WARRANTY! This class is in the public domain.
// $Id: AttributesImpl.java,v 1.3 2000/12/28 20:35:20
david Exp $

...

private void ensureCapacity (int n) {
if (n <= 0) {
return;
}
int max;
if (data == null || data.length == 0) {
max = 25;
}
else if (data.length >= n * 5) {
return; <----------------------Gets stuck here
}

Discussion

  • Anonymous - 2001-07-14

    Logged In: YES
    user_id=44117

    a 'return' getting stuck is a
    JVM or debugger problem ...

     
  • Anonymous - 2001-07-29
    • status: open --> open-rejected
     
  • Anonymous - 2001-07-29
    • status: open-rejected --> closed-rejected
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks