Bug 47332 Assertion failed in GetterSetter
20011121 1. create getter on this code public class InstanceCount { private String fName; private int fValue; /** * @param name * @param package1 * @param value */ public InstanceCount(String typeName, int value) { super(); fName= typeName; fValue= value; } public static InstanceCount[] deserialize(String str) { ArrayList entries= new ArrayList(); StringTokenizer tok= new StringTokenizer(str, ":\n"); //$NON-NLS-1$ while (tok.hasMoreTokens()) { String name= tok.nextToken(); String count= tok.nextToken(); InstanceCount entry= new InstanceCount(name, Integer.parseInt(count)); entries.add(entry); } return (InstanceCount[]) entries.toArray(new InstanceCount[entries.size()]); } } org.eclipse.jface.util.Assert$AssertionFailedException: null argument; at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at org.eclipse.jface.util.Assert$AssertionFailedException.<init>(Assert.java:54) at org.eclipse.jface.util.Assert.isNotNull(Assert.java:139) at org.eclipse.jface.util.Assert.isNotNull(Assert.java) at org.eclipse.jface.viewers.AbstractTreeViewer.reveal(AbstractTreeViewer.java:1233) at org.eclipse.jdt.ui.actions.AddGetterSetterAction$GetterSetterTreeSelectionDialog.createDialogArea(AddGetterSetterAction.java:972) at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:573) at org.eclipse.jface.window.Window.create(Window.java:305) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:883) at org.eclipse.ui.dialogs.SelectionStatusDialog.create(SelectionStatusDialog.java:143) at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.access$superCreate(CheckedTreeSelectionDialog.java:215) at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.access$0(CheckedTreeSelectionDialog.java:214) at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog$1.run(CheckedTreeSelectionDialog.java:240) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java) at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.create(CheckedTreeSelectionDialog.java:238) at org.eclipse.jface.window.Window.open(Window.java:555) at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.open(CheckedTreeSelectionDialog.java:209) at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:255) at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:175) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:194) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:172) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:542) at org.eclipse.jface.action.ActionContributionItem.access$4(ActionContributionItem.java:494) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:466) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1381) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:237) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:47) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41) at java.lang.reflect.Method.invoke(Method.java:386) at org.eclipse.core.launcher.Main.basicRun(Main.java:299) at org.eclipse.core.launcher.Main.run(Main.java:767) at org.eclipse.core.launcher.Main.main(Main.java:601)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
private static int fEntries;
			
		AddGetterSetterSelectionStatusValidator(int entries) {
			fEntries= entries;
		}
		
		public IStatus validate(Object[] selection) {
			
			HashSet map= null;
			if ((selection != null) && (selection.length > 1))  {
				map= new HashSet(selection.length);		
			}						
	
			int count= 0;
			for (int i = 0; i < selection.length; i++) {
				try {
					if (selection[i] instanceof GetterSetterEntry)  {
						Object key = selection[i];					
						IField getsetField= ((GetterSetterEntry) selection[i]).fField;
						if (((GetterSetterEntry) selection[i]).fGetterEntry) {
							if (!map.add(GetterSetterUtil.getGetterName(getsetField, null)))
								return new StatusInfo(IStatus.WARNING, ActionMessages.getString("AddGetterSetterAction.error.duplicate_methods")); 
						}
						else {
							key= createSignatureKey(GetterSetterUtil.getSetterName(getsetField, null), getsetField);
							if (!map.add(key))
								return new StatusInfo(IStatus.WARNING, ActionMessages.getString("AddGetterSetterAction.error.duplicate_methods")); 
						}
						count++;