RFR: 8333775: Small improvement to outputStream auto-indentation mode [v2]

Inigo Mediavilla Saiz duke at openjdk.org
Thu Jun 20 11:39:23 UTC 2024


On Mon, 10 Jun 2024 10:34:50 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Almost trivial enhancement.
>> 
>> [JDK-8333211](https://bugs.openjdk.org/browse/JDK-8333211) added automatic indentation. Some changes to complement that:
>> 
>> - let outputStream::set_autoindent() return the old value for later restoration
>> - add an RAII object to enable autoindent and restore the old state when leaving.
>
> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
> 
>   feedback johann

@tstuefe I was wondering if you think that it would make sense to include an `auto_indent` field in the `streamIndentor` object, rather than having a `StreamAutoIndentor` ? 

The reason why I'm suggesting that is that I cannot think of a valid case where I'd want to use the `streamIndentor` with `auto_indent` disabled.

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

PR Comment: https://git.openjdk.org/jdk/pull/19592#issuecomment-2180460210


More information about the hotspot-dev mailing list