class Foo {
  public static final boolean CLINIT_RUN;
  static {
    System.err.println("Here we are!");
    CLINIT_RUN = true;
  }
}

class Test implements Runnable {
  // This is the frame that will get PopFrame'd and it should re-execute.
  public void loadAndRun() {
    System.err.println("Start Load And Run");
    System.err.println("CLINIT_RUN " + Foo.CLINIT_RUN);
  }

  @Override
  public void run() {
    loadAndRun();
  }
}


public class Main {
  public static native void popFrame(Thread t);

  public static void main(String[] args) throws Exception {
    System.err.println("Starting main, going to start the target thread\n");
    Thread t = new Thread(new Test());
    t.start();

    // Wait a second, enough for the Test thread to suspend itself.
    Thread.sleep(1000);

    // Uncomment this line and there is a bug.
    popFrame(t);

    Thread.sleep(3000);
    t.resume();
    t.join();

    System.err.println("Foo.CLINIT_RUN " + Foo.CLINIT_RUN);
  }
}
