Menu

#13 bug found & solved in wbxml in kXML1.21 and kXML2.x

open
nobody
None
5
2006-08-08
2006-08-08
kranf
No

inside kXML 1.21 inside the file
"org.kxml.wap.WbxmlWriter.java" the loop beginning at
line 119 must be:

for (int i = 0; i < len;) {
idx = (Integer)
attrStartTable.get(attributes.elementAt(i)+"="+attributes.elementAt(i+1));
if (idx != null)
{
buf.write (idx.intValue()); ++i;
} else
{
idx = (Integer)
attrStartTable.get(attributes.elementAt(i));
if(idx == null) {
buf.write (Wbxml.LITERAL);
writeStrT ((String)
attributes.elementAt (i));
} else {
buf.write (idx.intValue());
}
idx = (Integer)
attrValueTable.get(attributes.elementAt(++i));
if(idx == null) {
buf.write (Wbxml.STR_I);
writeStrI (buf, (String)
attributes.elementAt (i));
} else {
buf.write (idx.intValue());
}
}
++i;
}

The same bug appears at a similar location inside kXML
2.x. This should reduce substancially the size of the
generated wbxml file.

See you!

Frank

Discussion

  • Martin Zdila

    Martin Zdila - 2007-05-31

    Logged In: YES
    user_id=1087530
    Originator: NO

    Hello. It seems that there been no activity on kxml 2 project for a longer time. I have fixed WbxmlSerializer in kxml 2.3.0. I've taken inspiration from patch in previous post and accommodated it for kxml 2.3.0. in addition, there is one more fix, as kxml 2 supports multiple codepages. Old code didn't much count that in two codepages can be the same attributeStarts/Values to suppress often codepage switching. So I fixed this issue and generated wbxml is even more smaller.

    Fixed serializer is attached.

    One more thing to improve (TODO) is more effective putting of strings to the string table. For example, if I have 2 attribute values, eg "MySpecialSetting_ip" and "MySpecialSetting_port" then it would be wise to externalize "MySpecialSetting_" string. Serialization should be done then in two phases and after first phase it would be decided if to externalize some string or to just inline it.

     
  • Martin Zdila

    Martin Zdila - 2007-05-31

    Logged In: YES
    user_id=1087530
    Originator: NO

    shit! there is no attachment possible to the comment. creating new issue.

     

Log in to post a comment.