#1264 Singleton error trace

go4 Sun 24 Oct 2010

singleton error trace

const class Main{
  static Void main(){
      s:=MyObj.cur
  }
}

const class MyObj{
  static const MyObj cur:=MyObj()

  private new make(){
    throw MyErr("this is my error")
  }
}

const class MyErr:Err{
  new make(Str m):super(m){}
}

a not clearly error trace:

sys::Err: java.lang.ExceptionInInitializerError
  Temp_0::Main.main (/D:/Temp/fan/Temp.fan:3)
  java.lang.reflect.Method.invoke (Unknown)
  fan.sys.Method.invoke (Method.java:536)
  fan.sys.Method$MethodFunc.callList (Method.java:182)
  fan.sys.Method.callList (Method.java:147)
  fanx.tools.Fan.callMain (Fan.java:135)
  fanx.tools.Fan.executeFile (Fan.java:88)
  fanx.tools.Fan.execute (Fan.java:34)
  fanx.tools.Fan.run (Fan.java:236)
  fanx.tools.Fan.main (Fan.java:274)

brian Mon 25 Oct 2010

That is just the JVM does things - it is not super great at reporting exceptions in initializers. Although the fact that these days you get something is way better than it used to be in the old days.

go4 Tue 26 Oct 2010

Thanks for your troubles.I appreciate your help very much.

Login or Signup to reply.