Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361045 - [move static members] Refactoring: move static method results in java.lang.NullPointerException
Summary: [move static members] Refactoring: move static method results in java.lang.Nu...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2011-10-15 07:15 EDT by Dmitry Vyazelenko CLA
Modified: 2011-11-08 11:46 EST (History)
4 users (show)

See Also:


Attachments
Full stacktrace with exception (5.76 KB, text/plain)
2011-10-15 07:17 EDT, Dmitry Vyazelenko CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Vyazelenko CLA 2011-10-15 07:15:59 EDT
Build Identifier: M20110909-1335

Attempt to move static method to another class via Refactor->Move fails with NullPointerException.

The exception happens on some classes but not always.


Reproducible: Sometimes

Steps to Reproduce:
1. Select static method is one class
2. Go to Refactor->Move and select destination class
3. Click OK
Comment 1 Dmitry Vyazelenko CLA 2011-10-15 07:17:45 EDT
Created attachment 205246 [details]
Full stacktrace with exception

Stacktrace added.
Comment 2 Remy Suen CLA 2011-10-17 07:58:32 EDT
Java tooling bugs go to JDT, not Platform IDE.
Comment 3 Dani Megert CLA 2011-10-17 09:00:24 EDT
This works fine for me using Juno M2. Can you provide a test case?
Comment 4 Raksha Vasisht CLA 2011-10-24 11:46:35 EDT
Ping.
Comment 5 Dmitry Vyazelenko CLA 2011-10-25 13:00:51 EDT
I'm very busy at the moment. Will try to look into test case over weekend!
Comment 6 Dani Megert CLA 2011-11-08 02:15:22 EST
Please reopen if you have more details.
Comment 7 Deepak Azad CLA 2011-11-08 11:46:56 EST
Interesting part of the exception

Caused by: java.lang.NullPointerException
    at org.eclipse.jdt.internal.corext.refactoring.structure.MoveStaticMembersProcessor.checkInitialConditions(MoveStaticMembersProcessor.java:334)
    at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkInitialConditions(ProcessorBasedRefactoring.java:203)
    at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)

However, I don't how we can get an NPE on MoveStaticMembersProcessor.java:334, nor I can reproduce the problem.

Please reopen if you have more details e.g. a code snippet to reproduce the problem.