Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 280291

Summary: [CLabel] causes NullPointerException when rendered uninitialized
Product: [RT] RAP Reporter: Rüdiger Herrmann <ruediger.herrmann>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: rsternberg
Version: 1.2Flags: rsternberg: review+
Target Milestone: 1.2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Test case and bugfix none

Description Rüdiger Herrmann CLA 2009-06-15 11:50:26 EDT
The following line causes a NullPointerException in the CLabelLCA
  CLabel label = new CLabel( parent, SWT.NONE );
  // do *not* call label.setText

Stacktrace
------------
java.lang.NullPointerException
	at java.util.regex.Matcher.getTextLength(Matcher.java:758)
	at java.util.regex.Matcher.find(Matcher.java:414)
	at org.eclipse.rwt.lifecycle.WidgetLCAUtil.escapeText(WidgetLCAUtil.java:938)
	at org.eclipse.swt.internal.custom.clabelkit.CLabelLCA.writeText(CLabelLCA.java:88)
	at org.eclipse.swt.internal.custom.clabelkit.CLabelLCA.renderChanges(CLabelLCA.java:65)
	at org.eclipse.rwt.lifecycle.AbstractWidgetLCA.render(AbstractWidgetLCA.java:36)
[ ... ]
Comment 1 Rüdiger Herrmann CLA 2009-06-15 12:23:40 EDT
Created attachment 139185 [details]
Test case and bugfix
Comment 2 Ralf Sternberg CLA 2009-06-15 14:45:29 EDT
+1 for the patch.
Comment 3 Rüdiger Herrmann CLA 2009-06-15 15:17:45 EDT
Committed patch to CVS HEAD