On Tue, 18 Apr 2023 13:22:32 GMT, Pavel Rappo <pra...@openjdk.org> wrote:

> Genuine question: what benefits are there in merging the blockContent method 
> with the inlineContent method?
> 

Generally, it seems better to have one method (instead of two) to handle "rich 
text content", when the similarities between the two are greater than the 
differences.

A different way of handling this might be to pull out common code into shared 
methods, but I still think it is better to have one "top-level" `switch` 
statement handling the characters that need appropriate (that is, non-default) 
treatment.

There were also some minor differences in the original two methods in handling 
uncommon situations (like `@`-escapes).  By merging the two methods, we better 
ensure the same behavior where different behavior is not required.

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

PR Comment: https://git.openjdk.org/jdk/pull/13431#issuecomment-1513544290

Reply via email to