if the name can't be extracted from the reference then use the method
name itself
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/validation/TypeInfoValidator.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/validation/TypeInfoValidator.java
index 74ef653..57fc806 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/validation/TypeInfoValidator.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/validation/TypeInfoValidator.java
@@ -1194,9 +1194,13 @@
final IValueReference reference, IValueReference[] arguments,
final Expression methodNode, IRMethod method) {
if (method.isDeprecated()) {
+ String name = reference.getName();
+ if (name == null || "".equals(name)) {
+ name = method.getName();
+ }
reporter.reportProblem(JavaScriptProblems.DEPRECATED_FUNCTION,
NLS.bind(ValidationMessages.DeprecatedFunction,
- reference.getName()), methodNode.sourceStart(),
+ name), methodNode.sourceStart(),
methodNode.sourceEnd());
}
validateAccessibility(methodNode, reference, method);