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

StyleSheet.getImageURL() should call connect() before requesting content length

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P2 P2
    • fx1.2
    • None
    • javafx

      Due to bug in JRE (6804950) calling getContentLength() on previously unused CachedJarURLConnection() will cause network request even if jar is really cached. This will be fixed in JRE but as this noticeably harm performance i'd suggest to workaround this ASAP in the FX runtime.
      It will also help to improve startup performance for user who uses older versions of JRE.

      The fix is simple - call connect() or getContentType() before calling getContentLength().

      To give you an example:
        SimpleVideoPlayer demo makes 11 (!) calls to getContentLength() before.
        And this usually happens on EDT causing lags.

            dgrieve David Grieve
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: