From 505460390d081d50dadd157c86cb47994bb8d38c Mon Sep 17 00:00:00 2001 From: axelcl Date: Mon, 19 Dec 2005 21:57:02 +0000 Subject: [PATCH] Fix #1368081: Variable not initialized does not work for array access --- .../phpdt/internal/compiler/parser/Parser.java | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) 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(); -- 1.7.1