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

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