Author: dgeraskov
Date: 2009-05-22 02:13:42 -0400 (Fri, 22 May 2009)
New Revision: 15396
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryInputModel.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4357
Changed to guarantee that new instance of array will be returned.
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryInputModel.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryInputModel.java 2009-05-21
18:30:48 UTC (rev 15395)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryInputModel.java 2009-05-22
06:13:42 UTC (rev 15396)
@@ -60,7 +60,9 @@
/** return a copy of the parameters currently in this model */
public ConsoleQueryParameter[] getQueryParametersForQuery() {
- return ignoreParameters ? new ConsoleQueryParameter[0] : getQueryParameters();
+ //pass 0-size array to guarantee Collection.toArray(T[]) will return new Array
instance
+ return ignoreParameters ? new ConsoleQueryParameter[0]
+ : parameters.toArray(new ConsoleQueryParameter[0]);
}
public QueryInputModel getCopyForQuery() {