#2388: Treat BaseComponent array appends as one. Fixes #2387.

Don't copy formatting of previous element in the array being appended
but instead from the last appended component in the builder.
Otherwise formatting will be overridden in an incorrect way from
legacy text conversions.

Added unit test failed before this change. Now passes.
This commit is contained in:
Mystiflow
2018-03-14 08:51:08 +00:00
committed by md-5
parent 7ee0b6dccb
commit d7eef6ff2e
2 changed files with 21 additions and 1 deletions

View File

@@ -122,11 +122,11 @@ public final class ComponentBuilder
{
Preconditions.checkArgument( components.length != 0, "No components to append" );
BaseComponent previous = current;
for ( BaseComponent component : components )
{
parts.add( current );
BaseComponent previous = current;
current = component.duplicate();
current.copyFormatting( previous, retention, false );
}