RFR: 8339332: Clean up the java launcher code

Jaikiran Pai jpai at openjdk.org
Thu Sep 12 06:54:05 UTC 2024


On Thu, 12 Sep 2024 06:39:59 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Aside: we do an awful lot of Java code execution in the launcher these days before we even get to load the real main class. I have to wonder how all this affects startup?

In addition to regular regression testing, I also ran existing internal startup benchmarks against this change. I noticed no observable regression or improvement with these changes.

> src/java.base/share/classes/sun/launcher/LauncherHelper.java line 607:
> 
>> 605:         if (mainAttrs == null) {
>> 606:             abort(null, "java.launcher.jar.error3", jarname);
>> 607:         }
> 
> Why do we no longer need a null check?

The null check is still done, but it's now done before calling this private method. It's done here https://github.com/openjdk/jdk/pull/20929/files/abc3100078c2ab522054d1074d1cdc53c2879388#diff-108a3a3e3c2d108c8c7f19ea498f641413b7c9239ecd2975a6c27d904c2ba226R848

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20929#issuecomment-2345411767
PR Review Comment: https://git.openjdk.org/jdk/pull/20929#discussion_r1756234772


More information about the core-libs-dev mailing list