Project: SWT
Bug 68667 NPE in AddressBook example
Reported: 2004-06-25 15:44:23 | Status: resolved fixed

RC4 - run the AddressBook example - File -> Open Address Book... --> opens a FileDialog - change the file filter in the dialog to * to show all files (assuming you're on a platform whose FileDialog shows this filter) - select some random file that has nothing to do with the AddressBook example, Open - will get the following NPE: java.lang.NullPointerException at org.eclipse.swt.examples.addressbook.AddressBook$RowComparator.compare(AddressBook.java:870) at java.util.Arrays.mergeSort(Arrays.java:1278) at java.util.Arrays.mergeSort(Arrays.java:1289) at java.util.Arrays.mergeSort(Arrays.java:1289) at java.util.Arrays.mergeSort(Arrays.java:1289) at java.util.Arrays.mergeSort(Arrays.java:1289) at java.util.Arrays.mergeSort(Arrays.java:1289) at java.util.Arrays.sort(Arrays.java:1219) at org.eclipse.swt.examples.addressbook.AddressBook.openAddressBook(AddressBook.java:326) at org.eclipse.swt.examples.addressbook.AddressBook.access$9(AddressBook.java:268) at org.eclipse.swt.examples.addressbook.AddressBook$9.widgetSelected(AddressBook.java:509) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:731) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2938) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2642) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:183) at org.eclipse.core.launcher.Main.run(Main.java:644) at org.eclipse.core.launcher.Main.main(Main.java:628)

Files changed in fix:
examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java