Integrated: 8365620: Using enhanced switch in MethodHandleDesc

2025-08-31 Thread Shaojin Wen
a668f437 Author:Shaojin Wen URL: https://git.openjdk.org/jdk/commit/a668f437e481d02cbb82d4f40dd14ec3a6036399 Stats: 26 lines in 1 file changed: 0 ins; 14 del; 12 mod 8365620: Using enhanced switch in MethodHandleDesc Reviewed-by: liach - PR: https://git.openjdk.org

Re: RFR: 8365620: Using enhanced switch in MethodHandleDesc

2025-08-30 Thread David Alayachew
On Sun, 31 Aug 2025 03:24:37 GMT, Chen Liang wrote: > Hi @davidalayachew, I think what @wenshao tries to do here is to preserve > behavioral parity before and after the migrations. You are indeed correct > that listing the constants explicitly would allow us to fail with a compile > error when

Re: RFR: 8365620: Using enhanced switch in MethodHandleDesc

2025-08-30 Thread Chen Liang
On Thu, 14 Aug 2025 04:49:28 GMT, Shaojin Wen wrote: > In MethodHandleDesc, the `ofField` method uses enhanced switch, while the > `of` and `ofMethod` methods use traditional switch. The same class should > have a unified style. Hi @davidalayachew, I think what @wenshao tries to do here is to

Re: RFR: 8365620: Using enhanced switch in MethodHandleDesc

2025-08-30 Thread David Alayachew
Wait, I am confused why you are leaving the default clause in there? Isn't it to your benefit to replace the default clause and include each value explicitly? On Sat, Aug 30, 2025, 12:26 PM Chen Liang wrote: > On Thu, 14 Aug 2025 04:49:28 GMT, Shaojin Wen wrote: > > > In MethodHandleDesc, the `

Re: RFR: 8365620: Using enhanced switch in MethodHandleDesc

2025-08-30 Thread Chen Liang
On Thu, 14 Aug 2025 04:49:28 GMT, Shaojin Wen wrote: > In MethodHandleDesc, the `ofField` method uses enhanced switch, while the > `of` and `ofMethod` methods use traditional switch. The same class should > have a unified style. Sure, let's go ahead with this. - Marked as reviewe

Re: RFR: 8365620: Using enhanced switch in MethodHandleDesc

2025-08-15 Thread ExE Boss
On Fri, 15 Aug 2025 06:57:14 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java line >> 123: >> >>> 121: case VIRTUAL, SPECIAL, INTERFACE_VIRTUAL, >>> INTERFACE_SPECIAL, INTERFACE_STATIC, STATIC, CONSTRUCTOR >>> 122:

Re: RFR: 8365620: Using enhanced switch in MethodHandleDesc

2025-08-15 Thread Shaojin Wen
On Fri, 15 Aug 2025 03:08:36 GMT, Chen Liang wrote: >> In MethodHandleDesc, the `ofField` method uses enhanced switch, while the >> `of` and `ofMethod` methods use traditional switch. The same class should >> have a unified style. > > src/java.base/share/classes/java/lang/constant/MethodHandleD

RFR: 8365620: Using enhanced switch in MethodHandleDesc

2025-08-15 Thread Shaojin Wen
In MethodHandleDesc, the `ofField` method uses enhanced switch, while the `of` and `ofMethod` methods use traditional switch. The same class should have a unified style. - Commit messages: - from @liach - enhanced switch Changes: https://git.openjdk.org/jdk/pull/26769/files Web

Re: RFR: 8365620: Using enhanced switch in MethodHandleDesc

2025-08-15 Thread Chen Liang
On Thu, 14 Aug 2025 04:49:28 GMT, Shaojin Wen wrote: > In MethodHandleDesc, the `ofField` method uses enhanced switch, while the > `of` and `ofMethod` methods use traditional switch. The same class should > have a unified style. src/java.base/share/classes/java/lang/constant/MethodHandleDesc.j

Re: Using enhanced switch in MethodHandleDesc

2025-08-14 Thread Chen Liang
Forwarding to the main list, forgot to reply all. On Thu, Aug 14, 2025 at 10:12 PM Chen Liang wrote: > Hello wenshao, I think this is a reasonable enhancement. > > In addition, you can review the switch in jdk.internal.constant as well. I > find there is a traditional switch in ConstantUtils.ski

Using enhanced switch in MethodHandleDesc

2025-08-14 Thread wenshao
In MethodHandleDesc, the ofField method uses enhanced switch, while the of and ofMethod methods use traditional switch. The same class should have a unified style. https://github.com/openjdk/jdk/pull/26769 I have submitted a draft Pull Request and wou