diff options
author | vrubezhny | 2013-12-25 14:25:44 +0000 |
---|---|---|
committer | vrubezhny | 2013-12-25 14:33:33 +0000 |
commit | f5edc8181a7dc8eaee28a8b044ee7e0c9736c3da (patch) | |
tree | 8e413d18407da8d5ce138e7a12634a3cfbfddd37 | |
parent | 895f804aa0c4b8873aa485d02256321ba486d32f (diff) | |
download | webtools.maps-f5edc8181a7dc8eaee28a8b044ee7e0c9736c3da.tar.gz webtools.maps-f5edc8181a7dc8eaee28a8b044ee7e0c9736c3da.tar.xz webtools.maps-f5edc8181a7dc8eaee28a8b044ee7e0c9736c3da.zip |
Bug 424647 - NPE in org.eclipse.wst.jsdt.internal.ui.text.correction.ASTResolving.getPossibleReferenceBinding
Since the null value is a valid value for FunctionDeclaration.getReturnType2(), the additional check for null is added.
Signed-off-by: vrubezhny <vrubezhny@exadel.com>
2 files changed, 5 insertions, 4 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ASTResolving.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ASTResolving.java index f8d232527..d3a60b823 100644 --- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ASTResolving.java +++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ASTResolving.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -239,7 +239,7 @@ public class ASTResolving { case ASTNode.RETURN_STATEMENT: FunctionDeclaration decl= ASTResolving.findParentMethodDeclaration(parent); if (decl != null && !decl.isConstructor()) { - return decl.getReturnType2().resolveBinding(); + return decl.getReturnType2() != null ? decl.getReturnType2().resolveBinding() : null; } break; case ASTNode.THROW_STATEMENT: diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java index cf9bbcf5e..9400acafc 100644 --- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java +++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -1471,7 +1471,8 @@ public class AdvancedQuickAssistProcessor implements IQuickAssistProcessor { if (declaration == null || declaration.isConstructor()) { return false; } - exprBinding= declaration.getReturnType2().resolveBinding(); + if (declaration.getReturnType2() != null) + exprBinding= declaration.getReturnType2().resolveBinding(); } else if (thenStatement instanceof ExpressionStatement && elseStatement instanceof ExpressionStatement) { Expression inner1= ((ExpressionStatement) thenStatement).getExpression(); Expression inner2= ((ExpressionStatement) elseStatement).getExpression(); |