Project: SWT
Bug 84891 In the specifications some methods do not describe their return value fully
Reported: 2005-02-10 09:58:22 | Status: resolved fixed

In the specs, the return value of some methods has not been specified fully, especially when there is nothing to return or an error has occurred (eg an invalid parameter has been received). When there is nothing to return, should an empty array/string be returned or should null be returned? I suspect there is a generic convention but I could not find it anywhere. Class Method ----- ------ SWTError public String getMessage() SWTException public String getMessage() Combo public String [] getItems () Combo public String getText () Composite public Control [] getChildren () Composite public Control [] getTabList () Display public Shell [] getShells () List public String [] getItems () Menu public MenuItem [] getItems () Text public String getSelectionText () Text public String getText () FileDialog public String getFileName () FileDialog public String [] getFileNames () FileDialog public String getFilterPath () List public int getSelectionIndex () MenuItem public int getAccelerator () MessageBox public String getMessage () Text public String getText (int start, int end) Table public TableItem [] getItems () TableItem public Rectangle getImageBounds (int index) Tree public TreeItem [] getItems () TreeItem public TreeItem [] getItems ()

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/List.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MessageBox.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableItem.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java