Community
Participate
Working Groups
Build 20020305 Test Case: package errors_in; public class A_test802 { public List g() { return null; } public void foo() { g(); } } You get a NPE when trying to resolve the type binding for the expression representing the method call g(). Note that the CU has compile errors java.lang.NullPointerException Stack trace: java/lang/Throwable.<init>()V java/lang/Throwable.<init>(Ljava/lang/String;)V java/lang/NullPointerException.<init>(Ljava/lang/String;)V org/eclipse/jdt/core/dom/DefaultBindingResolver.resolveExpressionType (Lorg/eclipse/jdt/core/dom/Expression;)Lorg/eclipse/jdt/core/dom/ITypeBinding; org/eclipse/jdt/core/dom/Expression.resolveTypeBinding() Lorg/eclipse/jdt/core/dom/ITypeBinding; org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.getReturn Type()Lorg/eclipse/jdt/core/dom/Type; org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.getSig nature(Ljava/lang/String;)Ljava/lang/String; org/eclipse/jdt/internal/ui/refactoring/code/ExtractMethodInputPage.updatePrevie w(Ljava/lang/String;)V org/eclipse/jdt/internal/ui/refactoring/code/ExtractMethodInputPage.textModified (Ljava/lang/String;)V org/eclipse/jdt/internal/ui/refactoring/TextInputWizardPage.setVisible(Z)V org/eclipse/jface/wizard/WizardDialog.showStartingPage()V org/eclipse/jface/wizard/WizardDialog.createContents (Lorg/eclipse/swt/widgets/Composite;)Lorg/eclipse/swt/widgets/Control; org/eclipse/jface/window/Window.create()V org/eclipse/jface/window/Window.open()I org/eclipse/jdt/internal/ui/refactoring/actions/RefactoringStarter.activate (Lorg/eclipse/jdt/internal/corext/refactoring/base/Refactoring;Lorg/eclipse/jdt/ internal/ui/refactoring/RefactoringWizard;Ljava/lang/String;Z)V org/eclipse/jdt/internal/ui/refactoring/actions/TextSelectionBasedRefactoringAct ion.run()V org/eclipse/jdt/internal/ui/refactoring/actions/TextSelectionAction.run (Lorg/eclipse/jface/action/IAction;)V org/eclipse/ui/internal/PluginAction.runWithEvent (Lorg/eclipse/swt/widgets/Event;)V org/eclipse/jface/action/ActionContributionItem.handleWidgetSelection (Lorg/eclipse/swt/widgets/Event;)V org/eclipse/jface/action/ActionContributionItem.handleWidgetEvent (Lorg/eclipse/swt/widgets/Event;)V org/eclipse/jface/action/ActionContributionItem.access$0 (Lorg/eclipse/jface/action/ActionContributionItem;Lorg/eclipse/swt/widgets/Event ;)V org/eclipse/jface/action/ActionContributionItem$ActionListener.handleEvent (Lorg/eclipse/swt/widgets/Event;)V org/eclipse/swt/widgets/EventTable.sendEvent(Lorg/eclipse/swt/widgets/Event;) V org/eclipse/swt/widgets/Widget.notifyListeners (ILorg/eclipse/swt/widgets/Event;)V org/eclipse/swt/widgets/Display.runDeferredEvents()Z org/eclipse/swt/widgets/Display.readAndDispatch()Z org/eclipse/ui/internal/Workbench.runEventLoop()V org/eclipse/ui/internal/Workbench.run(Ljava/lang/Object;)Ljava/lang/Object; org/eclipse/core/internal/boot/InternalBootLoader.run (Ljava/lang/String;Ljava/net/URL;Ljava/lang/String;[Ljava/lang/String;) Ljava/lang/Object; org/eclipse/core/boot/BootLoader.run (Ljava/lang/String;Ljava/net/URL;Ljava/lang/String;[Ljava/lang/String;) Ljava/lang/Object; SlimLauncher.main([Ljava/lang/String;)V
g() was linked to a problem method binding. Then when I tried to get the IMethodBinding corresponding to g() I got null (which is the expected result). Then asking for the return type causes the NPE. Fixed and released in HEAD.