Bug 320530

Summary: NPE trying to extract code into a local variable
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.6Keywords: investigate
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Olivier Thomann CLA 2010-07-21 12:32:01 EDT
Using eclipse.buildId=I20100706-0800
java.version=1.6.0_20-ea
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_CA
Command-line arguments:  -os win32 -ws win32 -arch x86 -console,

I got this exception:
Caused by: java.lang.NullPointerException
at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory$FragmentFactory.createFragment(ASTFragmentFactory.java:181)
at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory$FragmentForSubPartBySourceRangeFactory.createFragment(ASTFragmentFactory.java:166)
at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory$FragmentForSubPartBySourceRangeFactory.createFragmentFor(ASTFragmentFactory.java:146)
at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory.createFragmentForSubPartBySourceRange(ASTFragmentFactory.java:110)
at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory.createFragmentForSourceRange(ASTFragmentFactory.java:85)
at org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.getSelectedExpression(ExtractTempRefactoring.java:841)
at org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.checkSelection(ExtractTempRefactoring.java:604)
at org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.checkInitialConditions(ExtractTempRefactoring.java:577)
at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Root exception:
java.lang.NullPointerException
at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory$FragmentFactory.createFragment(ASTFragmentFactory.java:181)
at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory$FragmentForSubPartBySourceRangeFactory.createFragment(ASTFragmentFactory.java:166)
at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory$FragmentForSubPartBySourceRangeFactory.createFragmentFor(ASTFragmentFactory.java:146)
at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory.createFragmentForSubPartBySourceRange(ASTFragmentFactory.java:110)
at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory.createFragmentForSourceRange(ASTFragmentFactory.java:85)
at org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.getSelectedExpression(ExtractTempRefactoring.java:841)
at org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.checkSelection(ExtractTempRefactoring.java:604)
at org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.checkInitialConditions(ExtractTempRefactoring.java:577)
at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Unfortunately I could not reproduce. Might be a timing issue. I still report it in case I can reproduce it in the future.
Comment 1 Eclipse Genie CLA 2020-05-26 07:57: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.
Comment 2 Eclipse Genie CLA 2022-05-17 20:30:25 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 3 Eclipse Genie CLA 2024-05-08 09:05:14 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.