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:
parent
b5121db886
commit
b374a69b2c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user