Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6474056

Calling setImageURL with an invalid image file closes the splash screen

    Details

    • Subcomponent:
    • Resolved In Build:
      b03
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      Calling SplashScreen.setImageURL with an invalid image file throws IOException as documented, but it closes the splash screen too. After this, SplashScreen.getSplashScreen returns null. This is reproducible on all platforms with the latest mustang build.

      setImageURL should not close the splash screen or this should be documented in the setImageURL method documentation.

      To reproduce:

      Run the following code passing -splash:<image path> in command line to show the splash screen, and also provide an invalid image file URL as a command line option. Passing any non-image file URL will be enough.
      Wait for sometime, the splash screen will appear and the setImageURL method will be called with the argument supplied. If the splash screen closes and 'SplashScreen: null' appears in the command window, bug is reproduced.

      import java.awt.SplashScreen;
      import java.net.URL;
      import java.io.IOException;

      public class SplashScreenTest {
              public static void main(String[] args) {
                      try {
                              SplashScreen ss = SplashScreen.getSplashScreen();
                              if (ss != null) {
                                      try {
                                              ss.setImageURL(new URL(args[0]));
                                      } catch (IOException ioe) {
                                              ioe.printStackTrace();
                                      }
                                      Thread.sleep(3000);
                                      System.out.println("SplashScreen: " + SplashScreen.getSplashScreen());
                              }
                      } catch (Exception e) {
                              e.printStackTrace();
                      }
              }
      }

        Attachments

          Activity

            People

            • Assignee:
              anthony Anthony Petrov (Inactive)
              Reporter:
              gramachasunw Girish Ramachandran (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: