1 Reply Latest reply: Jun 19, 2011 8:40 PM by 869899 RSS

    javax.tools.JavaCompiler

    863823
      Is a call to:
      javax.tools.ToolProvider.getSystemJavaCompiler.run()
      thread-safe? Is this platform-dependent? The documentation is silent about this (as usual when it comes to thread-safety).

      (Apologies if this is the wrong forum; cannot find one for javax.tools.)

      MC
        • 1. Re: javax.tools.JavaCompiler
          869899
          This is a Lazily loaded static object.
          The call to getSystemJavaCompiler() is also static and just uses that standard Class.newInstance() method to return a completely new instance of the compilerClass.
          There is nothing not thread safe about this, but if you keep and share that new instance later it won't be.