JDK-8168095 : Second image in Ensemble8/Image Creation sample does not load
  • Type: Bug
  • Component: javafx
  • Sub-Component: samples
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-10-17
  • Updated: 2020-01-31
  • Resolved: 2016-10-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u152Fixed 9Fixed
Related Reports
Blocks :  
Description
Running the Graphics2D/Image Creation sample in Ensemble8, the first image  (a 3d-ish box image) loads fine from the jar file, but the second image (a Java banner) does not load from a java.com URL.  Following the URL finds the image still on the server:

http://java.com/images/jv0h.jpg

This happens on both Mac 10.11 and Win10
Comments
Webrev for 8u backport: http://cr.openjdk.java.net/~kcr/Ensemble8/separate/12-8168095/webrev/
24-10-2016

This is part of an aggregate backport request to port Ensemble8 fixes from FX 9 to FX 8u. See JDK-8168611 for details and review.
24-10-2016

Changeset: 337724a7d815 Author: vadim Date: 2016-10-17 23:39 +0300 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/337724a7d815
17-10-2016

If I remove the ), then the patch fixes it... +1 without the ")"...
17-10-2016

Ah, so it was an external change. Thanks for looking into this so quickly! There looks to be an extra ")" in that patch...?
17-10-2016

extra ')' creeped in the patch, will be removed before the push
17-10-2016

This happens because the URL is "301 Moved Permanently" to https. Here's the fix: diff -r 9c7eaf7823e7 apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics2d/images/imagecreation/ImageCreationApp.java --- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics2d/images/imagecreation/ImageCreationApp.java Wed Oct 12 18:35:11 2016 +0300 +++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics2d/images/imagecreation/ImageCreationApp.java Mon Oct 17 21:57:46 2016 +0300 @@ -62,7 +62,7 @@ ImageView sample1 = new ImageView(ICON_48); // load and display a image resource from url - Image JV0H = new Image("http://java.com/images/jv0h.jpg", + Image JV0H = new Image("https://java.com/images/jv0h.jpg"), 400, 100, true, true); ImageView sample2 = new ImageView(JV0H);
17-10-2016