static {
   IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.exitAfterAllProblems();
   ProblemReporter problemReporter =
       new ProblemReporter(policy, new CompilerOptions(), new DefaultProblemFactory());
   CompilationResult result = new CompilationResult(CharOperation.NO_CHAR, 0, 0, 0);
   FakeUnit = new CompilationUnitDeclaration(problemReporter, result, 0);
 }
  public HierarchyResolver(
      INameEnvironment nameEnvironment,
      Map settings,
      HierarchyBuilder builder,
      IProblemFactory problemFactory) {
    // create a problem handler with the 'exit after all problems' handling policy
    this.options = new CompilerOptions(settings);
    IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.exitAfterAllProblems();
    ProblemReporter problemReporter = new ProblemReporter(policy, this.options, problemFactory);

    LookupEnvironment environment =
        new LookupEnvironment(this, this.options, problemReporter, nameEnvironment);
    environment.mayTolerateMissingType = true;
    setEnvironment(environment, builder);
  }