Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361045

Summary: [move static members] Refactoring: move static method results in java.lang.NullPointerException
Product: [Eclipse Project] JDT Reporter: Dmitry Vyazelenko <vyazelenko>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, raksha.vasisht, remy.suen
Version: 3.7.1Keywords: needinfo
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Full stacktrace with exception none

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.