import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.paint.Color;
import javafx.scene.shape.Sphere;
import javafx.scene.shape.Shape3D;

public class SphereBug extends Application {
   
   public void start(Stage stage) {
      int meshdiv = Integer.MAX_VALUE /  div ; 
      Shape3D cylinder = new Sphere(1e-323,meshdiv);
      Group root = new Group(cylinder);
      Scene scene = new Scene(root, 640, 480, Color.BEIGE);
      stage.setScene(scene);
      stage.show();
   }
   static int div; 
   final static String oomearg = "--oome";

   public static void main(String args[]){
      /*static*/ div = 1; 
      String expected = NegativeArraySizeException.class.getName();
      if ((args.length > 0) && args[0].equals(oomearg)) {
         div  = 200000 ; // Integer.parseInt(args[1]) ; 
         expected = OutOfMemoryError.class.getName();
         System.out.println("div");
      }
      System.out.println("We are expecting: "+expected);
      launch(args);
   }
}
