Review Request: 8001533: Java launcher must launch JavaFX applications
mandy.chung at oracle.com
Fri Nov 16 02:42:19 UTC 2012
On 11/15/2012 5:01 PM, David DeHaven wrote:
>> L428-430: is this fallback needed? Would it be better
>> if LauncherHelper.getApplicationClass() always returns
>> a non-null class if the mainClass has been loaded successfully.
>> Looks like this is the case in your implementation.
> Good point, the helper would have aborted by that point. How about I change to NULL_CHECK(appClass) just for safety's sake?
Sounds good to me.
>> The change looks okay to me and I can't spot anything wrong there.
>> L496-517 somewhat duplicates the logic added for FX in the
>> getMainClassFromJar method. Have you considered some refactoring
>> work you could do to simplify the fix since I think once you get
>> the classname of the entry point (either from a JAR or command-line
>> and with and without the static void main method), the logic is
>> essentially the same. To elaborate, I see that FXHelper.launchName
>> L707-725 is needed mainly to give a useful error message. When
>> you find the classname of the entry point, perhaps you can load
>> the class and catch any linkage error and determine if it's caused
>> by the absence of FX runtime and output an appropriate error.
>> If the main class is successfully loaded, then proceed with
>> L496-517 (or something like that). Just an idea you can explore.
> Yes, I do feel that especially in the -jar case there is some repetition. The trouble is the ambiguity of ClassNotFoundException.
> I'll poke at it and see what I can come up with.
More information about the core-libs-dev