code: public static JavacTrees instance(JavaCompiler.CompilationTask task) {
          if (!(task instanceof BasicJavacTask))
              throw new IllegalArgumentException();
          return instance(((BasicJavacTask)task).getContext());
      }
docs: called reflectively from Trees.instance(CompilationTask task)