Bug 288257 - null pointer exception that comes from notification
Summary: null pointer exception that comes from notification
Status: RESOLVED FIXED
Alias: None
Product: EEF
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 critical
Target Milestone: ---   Edit
Assignee: Patrick Tessier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 288259
Blocks:
  Show dependency tree
 
Reported: 2009-09-01 10:02 EDT by Patrick Tessier CLA
Modified: 2016-05-05 10:27 EDT (History)
2 users (show)

See Also:


Attachments
mylyn/context/zip (738 bytes, application/octet-stream)
2009-09-16 10:03 EDT, Patrick Tessier CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Tessier CLA 2009-09-01 10:02:08 EDT
When property a tab receives a notification, the value is not tested and can make mistakes.

for example in papyrus, we obtained the following result. 

java.lang.IllegalArgumentException: Argument cannot be null
at org.eclipse.swt.SWT.error(SWT.java:3865)
at org.eclipse.swt.SWT.error(SWT.java:3799)
at org.eclipse.swt.SWT.error(SWT.java:3770)
at org.eclipse.swt.widgets.Widget.error(Widget.java:463)
at org.eclipse.swt.widgets.Text.setText(Text.java:1951)
at org.eclipse.papyrus.tabbedproperties.uml.parts.forms.ModelPropertiesEditionPartForm.setName(ModelPropertiesEditionPartForm.java:1110)
at org.eclipse.papyrus.tabbedproperties.uml.components.ModelBasePropertiesEditionComponent$1.notifyChanged(ModelBasePropertiesEditionComponent.java:114)
at org.eclipse.uml2.uml.internal.impl.ElementImpl.eNotify(ElementImpl.java:868)
at org.eclipse.uml2.uml.internal.impl.NamedElementImpl.unsetName(NamedElementImpl.java:279)
Comment 1 Eclipse Webmaster CLA 2009-09-08 13:46:29 EDT
Moving bug to emft.eef as per bug 288269
Comment 2 Bouchet Stéphane CLA 2009-09-11 10:45:39 EDT
Hi,

using the last codegen from cvs HEAD, all the text widget ( text, textarea ) have a test before setting the text : 

[template public setterSignatureImplementation(elementEditor : ElementEditor) overrides setterSignatureImplementation ? (elementEditor.representationName('Text'))]
[elementEditor.setterSignature()/] {
		if (newValue != null) {
			[elementEditor.name.toJavaIdentifier()/].setText(newValue);
		} else {
			[elementEditor.name.toJavaIdentifier()/].setText("");  //$NON-NLS-1$
		}
	}
[/template]

please use the last codegen from HEAD.
Comment 3 Patrick Tessier CLA 2009-09-16 10:03:43 EDT
Created attachment 147314 [details]
mylyn/context/zip

modified classes
Comment 4 Patrick Tessier CLA 2009-09-17 05:36:25 EDT
a test is added in order to test if the new value is null