Consistent use of Collection.toArray with zero-sized array argument

Includes consistent use of ClassUtils.toClassArray (as non-null variant)

Issue: SPR-16523
This commit is contained in:
Juergen Hoeller
2018-02-22 11:29:46 +01:00
parent 1ab3f88e82
commit a5cbf5fe24
72 changed files with 208 additions and 233 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -50,7 +50,7 @@ public class ChainedPersistenceExceptionTranslator implements PersistenceExcepti
* Return all registered PersistenceExceptionTranslator delegates (as array).
*/
public final PersistenceExceptionTranslator[] getDelegates() {
return this.delegates.toArray(new PersistenceExceptionTranslator[this.delegates.size()]);
return this.delegates.toArray(new PersistenceExceptionTranslator[0]);
}