VRML Script node MultiClassBug

Running a java program from a VRML script node that use multiple classes hang Netscape and CosmoPlayer 2.0

Test page

I have created a test page to check this bug. Push the green box and a event is routed from a touchsensor to a eventIn in the Script node. In the java program a new class is created and a function is executed. This never happend and Netscape hang.

VRML Source code

#VRML V2.0 utf8
Transform {
  children [
    DEF TS TouchSensor { 
    }
    Shape {
      geometry Box {
        size 2 2 2
      }
      appearance Appearance {
        material Material { 
          diffuseColor 0 1 0  # Green
        }   
      }
    }
    DEF S Script {
       url "MultiClassBug.class"
       eventIn SFBool useOtherClass
    }
  ]
}
ROUTE TS.isActive TO S.useOtherClass

Java Source code

import vrml.*;
import vrml.node.*;
import vrml.field.*;

public class MultiClassBug extends Script {

  public void initialize(){
    System.out.println("MultiClassBug Script initialize!");
  }

  public void shutdown(){
    System.out.println("MultiClassBug Script shutdown!");
  }

  public void processEvent(Event e){
    if (e.getName().equals("useOtherClass")){
      OtherClass other = new OtherClass();
      other.hello();
    }
  }

}

class OtherClass {

  public void hello(){
    System.out.println("If this print in the java console then everything is ok!");
  }

}

Anders Reggestad
Sist endret: "Jul 25 1999"