Menu

#20 Classloader.checkOptionalCycle seems buggy

v1.0 (example)
closed-fixed
3
2008-12-01
2007-05-08
No

For your attention.

ClazzLoader.checkOptionalCycle (rev 694) has code:

for (var k = 0; k < ts[i].parents.length; k++) {
//log ("updating parent ::" + ts[i].parents[k].name);
ClazzLoader.updateNode (ts[i].parents[k]);
}

I don't know what is it, but it seems buggy. updateNode can change ts[i] and this will break cycle.

I use modified for only synchronous calls ClassLoader.js and sometimes Firebug tells "ts[i] don't have properties", but all work fine.

Discussion

  • Anonymous

    Anonymous - 2007-05-08
    • priority: 5 --> 3
     
  • Nobody/Anonymous

    Logged In: NO

    Could you explain more about your "synchronous calls", or give us some snippets for this bug.

     
  • Anonymous

    Anonymous - 2007-05-08
     
  • Anonymous

    Anonymous - 2007-05-08

    Logged In: YES
    user_id=1787911
    Originator: YES

    I did change little ClazzLoader.loadScript function:
    I use mozilla's XUL, and head.appendChild(script) not works.
    I make synchronous XMLHTTP Reqest and after that manually call script onLoad function.

    See file.diff.

    I mean this modification mustn't change checkOptionalCycle logic.
    File Added: 1.diff

     
  • Zhou Renjian

    Zhou Renjian - 2007-05-08

    Logged In: YES
    user_id=1702895
    Originator: NO

    Hi brainsponger,

    If you would like to load classes using XMLHttpRequest in synchronous mode, why not using

    ClazzLoader.setLoadingMode ("xhr");

    The ClassLoader will loading *.js as expected. But ClassLoader do freezes UI for some seconds.

    And if you want to loading *.js asynchronously, you may set

    ClazzLoader.setLoadingMode ("xhr.async");

    Regards

     
  • Anonymous

    Anonymous - 2007-05-10

    Logged In: YES
    user_id=1787911
    Originator: YES

    Thanks for advice.

    But...

    You change object from for condition in cycle body.
    Don't do it (at least in JavaScript).

     
  • Anonymous

    Anonymous - 2007-05-15

    Logged In: YES
    user_id=1787911
    Originator: YES

    With correct ClazzLoader using with ClazzLoader.setLoadingMode ("xhr") error remains.

     
  • Zhou Renjian

    Zhou Renjian - 2007-12-12

    Logged In: YES
    user_id=1702895
    Originator: NO

    Some other bugs of ClassLoader are fixed.
    So this bug is considered as fixed after 1.0.0 release.

     
  • Zhou Renjian

    Zhou Renjian - 2007-12-12
    • status: open --> open-fixed
     
  • Zhou Renjian

    Zhou Renjian - 2008-12-01
    • status: open-fixed --> closed-fixed
     
  • Zhou Renjian

    Zhou Renjian - 2008-12-01

    Java2Script 2.0.0 was released

     

Log in to post a comment.