On Tue, 16 Jun 2026 17:22:17 GMT, Stuart Marks <[email protected]> wrote:

>> Ashay Rane has updated the pull request with a new target base due to a 
>> merge or a rebase. The incremental webrev excludes the unrelated changes 
>> brought in by the merge/rebase. The pull request contains three additional 
>> commits since the last revision:
>> 
>>  - Address PR comments
>>  - Merge branch 'main' into JDK-8386509-localized-exceptions
>>  - Only create exception objects if we're going to throw them
>>    
>>    Every time an exception object is created, the constructor calls
>>    `fillInStackTrace()`, which has to walk the call stack to record every
>>    frame.  This is expensive, and it's also unnecessary if the exception is
>>    never thrown.  There are a few instances in various parts of the JDK
>>    libraries where we create an exception in the dominator block but don't
>>    always throw it.  This patch fixes those cases so that if the exception
>>    is not going to be thrown, it is never created in the first place.
>
> src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/exec/ExecTerminalProvider.java
>  line 2:
> 
>> 1: /*
>> 2:  * Copyright (c) 2022, 2026, the original author(s).
> 
> @lahodaj You probably need to assess the change here and to AbstractPty.java 
> to determine whether there is any interaction with the upstream JLine project.

Hm, while we can do changes to the JDK's copy of JLine (e.g. here and 
`AbstractPty`), it is better to not to them unless there's a strong reason, as 
it make future merges more complicated. And esp. for things that are not 
covered by tests, there's always a risk that they may be lost on the merges.

Maybe this could be brought to https://github.com/jline/jline3, and when it is 
included there, it will be adopted by one of the future JLine upgrades (we 
usually update to a new version of JLine once in a while)?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31487#discussion_r3425738833

Reply via email to