Bug 68667 NPE in AddressBook example
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)
examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java
for(int i = 0; i < items.length; i++) {
		String[] itemText = new String[table.getColumnCount()];
		for (int j = 0; j < itemText.length; j++) {
			itemText[j] = items[i].getText(j);
		}
		lines[i] = encodeLine(itemText);
	}
		
	FileWriter fileWriter = null;
	try { 
		fileWriter = new FileWriter(file.getAbsolutePath(), false);
		for (int i = 0; i < lines.length; i++) {
			fileWriter.write(lines[i]);
		}
	} catch(FileNotFoundException e) {
		displayError(resAddressBook.getString("File_not_found") + "\n" + file.getName());
		return false;
	} catch(IOException e ) {
		displayError(resAddressBook.getString("IO_error_write") + "\n" + file.getName());
		return false;
	} finally {
		shell.setCursor(null);
		waitCursor.dispose();
		
		if(fileWriter != null) {
			try {
				fileWriter.close();
			} catch(IOException e) {
				displayError(resAddressBook.getString("IO_error_close") + "\n" + file.getName());
				return false;