Re: <AWT Dev> RFR: 8261785: Calling "main" method in anonymous nested class crashes the JVM [v3]

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8261785: Calling "main" method in anonymous nested class crashes the JVM [v3]

Henry Jen-2
> This patch ensure launcher won't crash JVM for the new static Methods from local/anonymous class on MacOS.
>
> As @dholmes-ora pointed out in the analysis, this is a MacOS specific bug when the launcher trying to grab class name to be displayed as the Application name on the menu.
>
> The fix is to not setting name, test shows that GUI java application shows 'bin' as the application name. It's possible for us to set the name to something more friendly, for example, "Java", but I am not sure that should be launcher's responsibility to choose such a default name. It seems to me the consumer of the JAVA_MAIN_CLASS_%d environment variable should be responsible to pick such name in case the environment variable is not set.

Henry Jen has updated the pull request incrementally with one additional commit since the last revision:

  Add copyright and another test case

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2999/files
  - new: https://git.openjdk.java.net/jdk/pull/2999/files/58f197f4..f68b0919

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2999&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2999&range=01-02

  Stats: 30 lines in 2 files changed: 29 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2999.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2999/head:pull/2999

PR: https://git.openjdk.java.net/jdk/pull/2999
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8261785: Calling "main" method in anonymous nested class crashes the JVM [v3]

Sergey Bylokhov-2
On Wed, 17 Mar 2021 00:57:24 GMT, Henry Jen <[hidden email]> wrote:

>> This patch ensure launcher won't crash JVM for the new static Methods from local/anonymous class on MacOS.
>>
>> As @dholmes-ora pointed out in the analysis, this is a MacOS specific bug when the launcher trying to grab class name to be displayed as the Application name on the menu.
>>
>> The fix is to not setting name, test shows that GUI java application shows 'bin' as the application name. It's possible for us to set the name to something more friendly, for example, "Java", but I am not sure that should be launcher's responsibility to choose such a default name. It seems to me the consumer of the JAVA_MAIN_CLASS_%d environment variable should be responsible to pick such name in case the environment variable is not set.
>
> Henry Jen has updated the pull request incrementally with one additional commit since the last revision:
>
>   Add copyright and another test case

Looks fine from the client point of view.

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

Marked as reviewed by serb (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/2999