Bug 395229 - [introduce indirection] NPE when introducing indirection on a method in a subclass
Summary: [introduce indirection] NPE when introducing indirection on a method in a sub...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 283962 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-27 19:49 EST by Milos Gligoric CLA
Modified: 2023-05-29 15:47 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Gligoric CLA 2012-11-27 19:49:25 EST
Steps to reproduce:
1. Invoke "Introduce Indirection" on 'f'
2. NPE is thrown (see part of the log below)

class IntroduceIndirectionBug2 extends C<Integer> { // <<< The type parameter
                                                    // cannot be Object
    // Invoke "Introduce Indirection" on 'f'
    void f(Integer i1) {
    }
}

class C<T> {
    void f(T t1) {
    }

    void g() {
        C.this.f(null);
    }
}

(Thanks to Yilong Li for helping with the bug report.)

java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring.findMethodBindingInHierarchy(IntroduceIndirectionRefactoring.java:1087)
	at org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring.checkFinalConditions(IntroduceIndirectionRefactoring.java:549)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:85)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121)
	at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 1 Martin Mathew CLA 2012-12-12 06:44:52 EST
The issue is reproducible using I20121210-0800.

Looks like the bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=283962 was trying to address the same issue.
Comment 2 Dani Megert CLA 2012-12-12 08:19:38 EST
*** Bug 283962 has been marked as a duplicate of this bug. ***
Comment 3 Eclipse Genie CLA 2019-05-20 19:37:32 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Dani Megert CLA 2019-05-30 10:19:20 EDT
Still an issue with 4.11 M3.
Comment 5 Dani Megert CLA 2019-05-30 10:24:29 EDT
(In reply to Dani Megert from comment #4)
> Still an issue with 4.11 M3.
and 4.12 M3.
Comment 6 Eclipse Genie CLA 2021-05-20 05:43:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Eclipse Genie CLA 2023-05-29 15:47:37 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.