JDK-8093657 : Remove use of internal classes methods from samples
  • Type: Bug
  • Component: javafx
  • Sub-Component: samples
  • Affected Version: 8u60
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-03-03
  • Updated: 2015-06-12
  • Resolved: 2015-04-08
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
8u60Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Description
We need to eliminate the use of internal classes from com.sun.* packages in our shipping samples.

This is required for JDK 9 due to modularity as such programs will no longer run, and is a best practice even now, so this should be done for 8u60 at least for the shipping samples, since we ship as part of the JDK samples bundle.

The following samples violate this:

apps/samples/Modena
apps/samples/3DViewer

Comments
http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/e12a1be5e322 http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/d671cbd2d1de
08-04-2015

OldTestViewer.java still needs to be removed (as in 'hg rm') otherwise it will cause the build to fail when built with a JDK 9 build once the module boundaries are enabled: apps/samples/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/OldTestViewer.java:import com.sun.javafx.geom.Vec3d; The rest looks good to me. +1 after you remove OldTestViewer.java
07-04-2015

+1. The cleanup looks good, and Modena and 3DViewer work (run from artifacts/apps/samples). A minor unused import cleanup if you like before your commit: Modena.java: import java.awt.Graphics;
07-04-2015

Kevin, Chien, thanks for your comments, here is link to updated webrev: http://cr.openjdk.java.net/~ekleyman/RT-40184_2/
07-04-2015

Here is my few minor comments: 1) You can safely delete GeneralTransform3D.java 2) There is a few unused import in Load.java and OldTestViewer that you might want to delete too. 3) I thinking we might want to delete OldTestViewer.java for good. It doesn't seem to be a good sample pattern we want to encourage user to follower in my opinion.
04-04-2015

* The changes to 3DViewer look good to me. Two minor comments, which you may want to address: 1) Several of the new files use wildcard imports. We generally try to avoid these (although for samples we aren't as picky) 2) One of the new files has TABS in it (I note that the original file also has TABS, but that can be fixed separately). * The changes to Modena.jar cause it to fail when run from the built jar file: $ cd apps/samples/Modena $ java -jar dist/Modena.jar ... Caused by: java.lang.NullPointerException at modena.Modena.<clinit>(Modena.java:112) ... 16 more
03-04-2015

Link to webrev: http://cr.openjdk.java.net/~ekleyman/RT-40184/
02-04-2015

Note that similar issues exist in toys and other non-shipping apps, so I will create additional issues for those, but will target them to 9 since they aren't as urgent. SceneBuilder also uses internal packages, so I will file a separate issue for that as well (targeted to 9 since it is out of scope to do it for 8u60).
03-03-2015

Morris might run into a similar issue with RT-37899 so added him as a watcher (and also, Morris owns the samples component).
03-03-2015

./Modena/src/main/java/modena/Modena.java: com.sun.javafx.scene.control.skin.ButtonSkin.class.getResource("caspian/caspian.css").toExternalForm(); ./Modena/src/main/java/modena/Modena.java: com.sun.javafx.scene.control.skin.ButtonSkin.class.getResource("modena/modena.css").toExternalForm(); ./3DViewer/src/main/java/com/javafx/experiments/importers/maya/Loader.java:import com.sun.javafx.geom.Vec3f; ./3DViewer/src/main/java/com/javafx/experiments/importers/max/MaxLoader.java:import com.sun.javafx.scene.transform.TransformUtils; ./3DViewer/src/main/java/com/javafx/experiments/importers/SmoothingGroups.java:import com.sun.javafx.geom.Vec3f; ./3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/SimpleViewerApp.java:import com.sun.javafx.perf.PerformanceTracker; ./3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/OldTestViewer.java:import com.sun.javafx.geom.Vec3d; ./3DViewer/src/main/java/com/javafx/experiments/exporters/javasource/JavaSourceExporter.java:import com.sun.javafx.animation.TickCalculation; ./3DViewer/src/main/java/com/javafx/experiments/exporters/javasource/JavaSourceExporter.java:import com.sun.scenario.animation.NumberTangentInterpolator; ./3DViewer/src/main/java/com/javafx/experiments/exporters/javasource/JavaSourceExporter.java:import com.sun.scenario.animation.SplineInterpolator;
03-03-2015