Search code examples
btrace

why I can not create new object in Btrace unsafe mode?


In Btrace UserGuide(https://kenai.com/projects/btrace/pages/UserGuide ) it refers 'BTrace Restrictions' , and also refers in unsafe mode no ‘BTrace Restrictions’

BTrace Restrictions can not create new objects. can not create new arrays. can not throw exceptions. ... ...

Supported Arguments unsafe - do not check for btrace restrictions violations (true/false)

in my btrace shell, I already set -Dcom.sun.btrace.unsafe=true,but even can't create new object, why?


Solution

  • You need to mark the script itself for unsafe execution by using @BTrace(unsafe=true)