Bug 520646 - NullPointerException in ExtractLocalVariableRefactoring.collectModifications
Summary: NullPointerException in ExtractLocalVariableRefactoring.collectModifications
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: Next   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-07 19:52 EDT by EPP Error Reports CLA
Modified: 2020-09-04 15:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description EPP Error Reports CLA 2017-08-07 19:52:06 EDT
The following problem was reported via the automated error reporting:

Message: Internal Error
java.lang.NullPointerException: null
    at org.eclipse.cdt.internal.ui.refactoring.extractlocalvariable.ExtractLocalVariableRefactoring.collectModifications(ExtractLocalVariableRefactoring.java:257)
    at org.eclipse.cdt.internal.ui.refactoring.CRefactoring.checkFinalConditions(CRefactoring.java:123)
    at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
    at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:119)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
    at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:86)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)



Bundles:
| org.eclipse.cdt.ui | 6.1.0.201703062208 | 6.1.0.201703062208 |
| org.eclipse.core.resources | 3.11.1.v20161107-2032 | 3.11.1.v20161107-2032 |
| org.eclipse.jface | 3.12.2.v20170113-2113 | 3.12.2.v20170113-2113 |
| org.eclipse.ltk.core.refactoring | 3.7.0.v20160419-0705 | 3.7.0.v20160419-0705 |
| org.eclipse.ltk.ui.refactoring | 3.8.0.v20160518-1817 | 3.8.0.v20160518-1817 |

Operating Systems:
| Linux | 4.10.0 | 4.10.0 |


The above information is a snapshot of the collected data. Visit https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/problems/59823672e4b05728f8e8f20a for the latest data.

Thank you for your assistance.
 Your friendly error-reports-inbox.


Created on behalf of zeratul976@xxxxxx.xxx
Comment 1 Nathan Ridge CLA 2017-08-07 19:53:07 EDT
Inspecting the code a bit, it looks like the variable 'declInsertPoint' must be null. It's computed by getParentStatement(), which can return null.
Comment 2 Nathan Ridge CLA 2017-08-07 19:53:42 EDT
A testcase would probably be helpful to understand the problem better.