Do not change ComponentBuilder's contents when calling create()

This allows continuing to use ComponentBuilder after create() has been called.
This commit is contained in:
Brokkonaut 2016-07-20 23:53:03 +02:00 committed by md_5
parent b5121db886
commit b374a69b2c

View File

@ -242,8 +242,9 @@ public class ComponentBuilder
*/
public BaseComponent[] create()
{
parts.add( current );
return parts.toArray( new BaseComponent[ parts.size() ] );
BaseComponent[] result = parts.toArray( new BaseComponent[ parts.size() + 1 ] );
result[parts.size()] = current;
return result;
}
public static enum FormatRetention