On Sat, 7 Mar 2026 03:40:23 GMT, Chris Plummer <[email protected]> wrote:

>> Alex Menkov has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   add colon
>
> src/jdk.jdi/share/classes/com/sun/tools/example/debug/expr/LValue.java line 
> 76:
> 
>> 74:         } catch (InvalidTypeException exc) {
>> 75:             throw new ParseException(
>> 76:                 "Attempt to set value of incorrect type " +
> 
> Even with this fix the exception output does not read well:
> 
> com.sun.tools.example.debug.expr.ParseException: Attempt to set value of 
> incorrect type com.sun.jdi.InvalidTypeException: Can't set an inline type to 
> null 
> 
> There should be some sort of delemeter after "type". The real issue here is 
> that ParseException does not have a constructor that takes a `cause` 
> argument, so it seems to be the policy of any code that throws this exception 
> to just essentially add exc.toString() after the main exception message. I 
> guess since this is the way it is done everywhere, there's no point in 
> changing it for just this one case.

I looked at other exceptions in the class. It's not very consistent, but I see 
2 cases (both in `setValue`) when caught exception is added to the end of new 
exception without delimiter. Added colon there.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30126#discussion_r2907888285

Reply via email to