尝试在Eclipse CDT中提取常量时出现神秘错误:“在条件检查期间发生意外异常”

时间:2014-11-29 17:17:31

标签: refactoring eclipse-cdt ubuntu-14.04

我试图在Eclipse CDT中编写的C程序中提取常量,并且出现以下错误:

"An unexpected exception occurred during condition checking.   
See the error log for more details."

例如:我试图在

中提取32
 char filename[32]    

是一个常数。

我尝试使用谷歌搜索,但找不到任何有用的东西;以前似乎没有人问过这个问题。

会话数据:

eclipse.buildId=debbuild
java.version=1.7.0_65
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_CA
Command-line arguments:  -os linux -ws gtk -arch x86_64  

Eclipse的错误日志输出(Window> Show View> Error Log):

java.lang.reflect.InvocationTargetException
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
    at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275)
    at org.eclipse.ui.internal.progress.ProgressManager$5.run(ProgressManager.java:960)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:995)
    at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:970)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.checkInitialConditions(RefactoringWizardOpenOperation.java:215)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.access$1(RefactoringWizardOpenOperation.java:210)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:170)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:202)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:122)
    at org.eclipse.cdt.internal.ui.refactoring.RefactoringStarter.activate(RefactoringStarter.java:33)
    at org.eclipse.cdt.internal.ui.refactoring.RefactoringRunner.run(RefactoringRunner.java:43)
    at org.eclipse.cdt.internal.ui.refactoring.extractconstant.ExtractConstantRefactoringRunner.run(ExtractConstantRefactoringRunner.java:39)
    at org.eclipse.cdt.ui.refactoring.actions.ExtractConstantAction.run(ExtractConstantAction.java:40)
    at org.eclipse.cdt.ui.refactoring.actions.RefactoringAction.run(RefactoringAction.java:84)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
    at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1484)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1275)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1300)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1285)
    at org.eclipse.swt.widgets.Control.traverse(Control.java:4946)
    at org.eclipse.swt.widgets.Control.translateMnemonic(Control.java:4847)
    at org.eclipse.swt.widgets.Composite.translateMnemonic(Composite.java:1528)
    at org.eclipse.swt.widgets.Control.translateMnemonic(Control.java:4866)
    at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3039)
    at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:741)
    at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1773)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:5116)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4377)
    at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
    at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8317)
    at org.eclipse.swt.widgets.Display.eventProc(Display.java:1193)
    at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
    at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2342)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3184)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.NullPointerException
    at org.eclipse.cdt.internal.ui.refactoring.utils.NodeHelper.getMethodContexWithIndex(NodeHelper.java:119)
    at org.eclipse.cdt.internal.ui.refactoring.utils.NodeHelper.findMethodContext(NodeHelper.java:108)
    at org.eclipse.cdt.internal.ui.refactoring.extractconstant.ExtractConstantRefactoring.checkInitialConditions(ExtractConstantRefactoring.java:132)
    at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    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.cdt.internal.ui.refactoring.utils.NodeHelper.getMethodContexWithIndex(NodeHelper.java:119)
    at org.eclipse.cdt.internal.ui.refactoring.utils.NodeHelper.findMethodContext(NodeHelper.java:108)
    at org.eclipse.cdt.internal.ui.refactoring.extractconstant.ExtractConstantRefactoring.checkInitialConditions(ExtractConstantRefactoring.java:132)
    at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

任何帮助表示赞赏!

0 个答案:

没有答案