提交 19bfe92f authored 作者: sylvain-ilm's avatar sylvain-ilm

less calls to getObject()

上级 8ba6c169
......@@ -86,7 +86,8 @@ public class ValueArray extends ValueCollectionBase {
* @throws IllegalArgumentException if <code>item</code> is of the wrong {@link #getComponentType() type}.
*/
public Value append(Value item) {
if (item != ValueNull.INSTANCE && !this.getComponentType().isInstance(item.getObject()))
if (item != ValueNull.INSTANCE && this.getComponentType() != Object.class
&& !this.getComponentType().isInstance(item.getObject()))
throw new IllegalArgumentException(
"Expected component type " + this.getComponentType() + " but got " + item.getClass());
final Value[] res = Arrays.copyOf(this.getList(), this.getList().length + 1);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论