Project: JDT
Bug 135091 [nls tooling] NPE when previewing changes in string externalization wizard
Reported: 2006-04-05 13:54:12 | Status: resolved fixed

M6 When attempting to externalize a string (via the Eclipse externalization mechanism) I have stumbled across the following NPE. It prevents completion of the wizard and appears in the preview page. I can't provide the source file via bugzilla that causes this problem but it is reproducible. It is a mature file and already contains some externalized strings and I am attempting to add a new one in the middle of the file. java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:350) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:851) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(RefactoringWizard.java:571) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage(RefactoringWizard.java:414) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.computeSuccessorPage(UserInputWizardPage.java:75) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.getNextPage(UserInputWizardPage.java:115) at org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizardPage.getNextPage(ExternalizeWizardPage.java:1327) at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:751) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:351) at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:652) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3346) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:132) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:145) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:40) at org.eclipse.jdt.internal.ui.text.correction.LocalCorrectionsSubProcessor$1.apply(LocalCorrectionsSubProcessor.java:295) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:725) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:671) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$26(CompletionProposalPopup.java:667) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$5.widgetDefaultSelected(CompletionProposalPopup.java:537) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:97) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3346) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: java.lang.NullPointerException at java.text.CollationElementIterator.<init>(Unknown Source) at java.text.RuleBasedCollator.getCollationElementIterator(Unknown Source) at java.text.RuleBasedCollator.compare(Unknown Source) at org.eclipse.jdt.internal.corext.refactoring.nls.AccessorClassCreator$1.compare(AccessorClassCreator.java:230) at java.util.Arrays.mergeSort(Unknown Source) at java.util.Arrays.mergeSort(Unknown Source) at java.util.Arrays.mergeSort(Unknown Source) at java.util.Arrays.sort(Unknown Source) at java.util.Collections.sort(Unknown Source) at org.eclipse.jdt.internal.corext.refactoring.nls.AccessorClassCreator.createStaticFields(AccessorClassCreator.java:226) at org.eclipse.jdt.internal.corext.refactoring.nls.AccessorClassCreator.createClass(AccessorClassCreator.java:156) at org.eclipse.jdt.internal.corext.refactoring.nls.AccessorClassCreator.getUnformattedSource(AccessorClassCreator.java:107) at org.eclipse.jdt.internal.corext.refactoring.nls.AccessorClassCreator.createAccessorCUSource(AccessorClassCreator.java:86) at org.eclipse.jdt.internal.corext.refactoring.nls.AccessorClassCreator.create(AccessorClassCreator.java:80) at org.eclipse.jdt.internal.corext.refactoring.nls.NLSRefactoring.createChange(NLSRefactoring.java:207) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/AccessorClassCreator.java