Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 289315 - Ctrl-2 + L to trigger quick fix causes NPE if the method returns an array (Mobile projects only) (follow up to Bug 288060)
Summary: Ctrl-2 + L to trigger quick fix causes NPE if the method returns an array (Mo...
Status: RESOLVED DUPLICATE of bug 288060
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-14 01:52 EDT by Christian CLA
Modified: 2009-09-15 05:37 EDT (History)
2 users (show)

See Also:


Attachments
A sample stacktrace as visible in the logfile (5.61 KB, text/plain)
2009-09-14 01:53 EDT, Christian CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian CLA 2009-09-14 01:52:22 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)
Build Identifier: Eclipse 3.5

I created this follow up to #288060 because they are not able to fix it themselves since it is located in the JDT framework. Unfortunately I could not reassign the Bug so I created this replacement and link to it.

The Quick-Fix obtained by Ctrl-1 or Ctrl-2, L (and as well for class fields)
foes not work if the resulting field/variable would be an array type. This is
caused by a NPE for which the stacktrace is attached. Moreover this bug also happens for several other Quick-Fix selections like changing a Method by adding a parameter etc. The error always has in common the topmost few lines in the stacktrace.

Reproducible: Always

Steps to Reproduce:
1. Create a new empty MTJ project
2. Add a class with the following methods:
public class TestClass {
    public int[] test() {
        return null;
    }

    public void test2() {
        this.test();
    }
}
3. Set the cursor to "this.test();" and press Ctrl-2 and then L
4. Nothing happens, but a stacktrace will appear in the .log file of the
workspace. However this shortcut works fine for the same class if contained in
a normal JavaSE project.
Comment 1 Christian CLA 2009-09-14 01:53:18 EDT
Created attachment 147072 [details]
A sample stacktrace as visible in the logfile
Comment 2 Olivier Thomann CLA 2009-09-14 06:48:48 EDT
Move to JDT/UI
Comment 3 Markus Keller CLA 2009-09-15 05:37:18 EDT
I've taken bug 288060 to JDT/UI, so this is a dup now.

*** This bug has been marked as a duplicate of bug 288060 ***