Author: akazakov
Date: 2009-09-29 05:26:55 -0400 (Tue, 29 Sep 2009)
New Revision: 17785
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java
Log:
return empty List instead of null
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java 2009-09-28
23:49:44 UTC (rev 17784)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java 2009-09-29
09:26:55 UTC (rev 17785)
@@ -206,14 +206,11 @@
* @return All var/value that can be used in node and null if can't find anyone.
*/
public static List<Var> findAllVars(Node node, ELParserFactory factory) {
- ArrayList<Var> vars = null;
+ ArrayList<Var> vars = new ArrayList<Var>();
Node parentNode = node;
while(parentNode!=null) {
Var var = findVar(parentNode, factory);
if(var!=null) {
- if(vars == null) {
- vars = new ArrayList<Var>();
- }
vars.add(0, var);
}
parentNode = parentNode.getParentNode();
Show replies by date