aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzhongwei2012-11-21 02:38:42 (EST)
committerzzhongwei2012-11-21 02:43:15 (EST)
commita059a7bb9787c1810fb31b3f20c1bd1817a12d02 (patch)
tree09302d1be31d77819a8f0797e3d7ef22cf29f724
parentad8faaf586933ac5fead3426e4f413659f3c584f (diff)
downloadorg.eclipse.pdt-a059a7bb9787c1810fb31b3f20c1bd1817a12d02.zip
org.eclipse.pdt-a059a7bb9787c1810fb31b3f20c1bd1817a12d02.tar.gz
org.eclipse.pdt-a059a7bb9787c1810fb31b3f20c1bd1817a12d02.tar.bz2
394736: Incorrect warning with static variables
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394736
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/typeinference/VariableDeclarationSearcher.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/typeinference/VariableDeclarationSearcher.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/typeinference/VariableDeclarationSearcher.java
index e6b896c..7436816 100644
--- a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/typeinference/VariableDeclarationSearcher.java
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/typeinference/VariableDeclarationSearcher.java
@@ -244,6 +244,20 @@ public class VariableDeclarationSearcher extends ContextFinder {
String variableName = ((SimpleReference) key).getName();
getScope().addDeclaration(variableName, foreachStatement);
}
+ } else if (node instanceof StaticStatement) {
+ StaticStatement staticStatement = (StaticStatement) node;
+ // Collection<? extends Expression> expressions =
+ // staticStatement.getExpressions();
+ for (Expression variable : staticStatement.getExpressions()) {
+ if (variable instanceof VariableReference) {
+ VariableReference varReference = (VariableReference) variable;
+ getScope().addDeclaration(varReference.getName(),
+ staticStatement);
+ }
+ }
+ // VariableReference varReference =
+ // staticStatement.getExpressions();
+ // getScope().addDeclaration(varReference.getName(), clause);
}
postProcess(node);