From: axelcl Date: Mon, 19 Dec 2005 21:57:02 +0000 (+0000) Subject: Fix #1368081: Variable not initialized does not work for array access X-Git-Url: http://secure.phpeclipse.com Fix #1368081: Variable not initialized does not work for array access --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java index 3c7c661..7314c8d 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java @@ -3126,7 +3126,11 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI } else if (token == TokenNameLBRACKET) { if (ref != null && ref instanceof FieldReference) { FieldReference fref = (FieldReference) ref; - addVariableSet(fref.token); + if (!containsVariableSet(fref.token)) { + problemReporter.uninitializedLocalVariable(new String(fref.token), fref.sourceStart(), fref.sourceEnd(), + referenceContext, compilationUnit.compilationResult); + addVariableSet(fref.token); + } } ref = null; getNextToken();