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()
|
public BaseComponent[] create()
|
||||||
{
|
{
|
||||||
parts.add( current );
|
BaseComponent[] result = parts.toArray( new BaseComponent[ parts.size() + 1 ] );
|
||||||
return parts.toArray( new BaseComponent[ parts.size() ] );
|
result[parts.size()] = current;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum FormatRetention
|
public static enum FormatRetention
|
||||||
|
Loading…
Reference in New Issue
Block a user