提交 90388e47 编写于 作者: S stonio 提交者: Stephane Nicoll

Replace size() check with isEmpty()

Closes gh-1333
上级 d7eabeae
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -57,7 +57,7 @@ final class CollectionToObjectConverter implements ConditionalGenericConverter {
return source;
}
Collection<?> sourceCollection = (Collection<?>) source;
if (sourceCollection.size() == 0) {
if (sourceCollection.isEmpty()) {
return null;
}
Object firstElement = sourceCollection.iterator().next();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册