This commit is contained in:
Looly 2020-03-13 18:06:26 +08:00
parent aaee713fad
commit cf842ce474
2 changed files with 3 additions and 1 deletions

View File

@ -12,6 +12,7 @@
### Bug修复
* 【core 】 修复PageUtil第一页语义不明确的问题issue#782@Github
* 【extra 】 修复TemplateFactory引入包导致的问题
* 【core 】 修复ServiceLoaderUtil.loadFirstAvailable问题
-------------------------------------------------------------------------------------------------------------
## 5.2.2

View File

@ -28,7 +28,8 @@ public class ServiceLoaderUtil {
*/
public static <T> T loadFirstAvailable(Class<T> clazz) {
final Iterator<T> iterator = load(clazz).iterator();
if(iterator.hasNext()){
//noinspection WhileLoopReplaceableByForEach
while(iterator.hasNext()){
try {
return iterator.next();
} catch (ServiceConfigurationError e) {