Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 139185 Details for
Bug 280291
[CLabel] causes NullPointerException when rendered uninitialized
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Test case and bugfix
clipboard.txt (text/plain), 4.43 KB, created by
RĂ¼diger Herrmann
on 2009-06-15 12:23:40 EDT
(
hide
)
Description:
Test case and bugfix
Filename:
MIME Type:
Creator:
RĂ¼diger Herrmann
Created:
2009-06-15 12:23:40 EDT
Size:
4.43 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt.q07 >Index: src/org/eclipse/swt/internal/custom/clabelkit/CLabelLCA.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/custom/clabelkit/CLabelLCA.java,v >retrieving revision 1.5 >diff -u -r1.5 CLabelLCA.java >--- src/org/eclipse/swt/internal/custom/clabelkit/CLabelLCA.java 15 Jun 2009 12:30:13 -0000 1.5 >+++ src/org/eclipse/swt/internal/custom/clabelkit/CLabelLCA.java 15 Jun 2009 16:24:53 -0000 >@@ -83,9 +83,13 @@ > } > > private static void writeText( final CLabel label ) throws IOException { >- if( WidgetLCAUtil.hasChanged( label, PROP_TEXT, label.getText(), "" ) ) { >+ String text = label.getText(); >+ if( WidgetLCAUtil.hasChanged( label, PROP_TEXT, text, "" ) ) { >+ if( text == null ) { >+ text = ""; >+ } >+ text = WidgetLCAUtil.escapeText( text, true ); > JSWriter writer = JSWriter.getWriterFor( label ); >- String text = WidgetLCAUtil.escapeText( label.getText(), true ); > writer.set( JSConst.QX_FIELD_LABEL, text ); > } > } >#P org.eclipse.rap.rwt.q07.test >Index: src/org/eclipse/RWTQ07TestSuite.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.q07.test/src/org/eclipse/RWTQ07TestSuite.java,v >retrieving revision 1.15 >diff -u -r1.15 RWTQ07TestSuite.java >--- src/org/eclipse/RWTQ07TestSuite.java 4 Jun 2009 11:48:59 -0000 1.15 >+++ src/org/eclipse/RWTQ07TestSuite.java 15 Jun 2009 16:24:54 -0000 >@@ -26,6 +26,7 @@ > import org.eclipse.swt.internal.graphics.TextSizeDeterminationHandler_Test; > import org.eclipse.swt.internal.widgets.WidgetAdapter_Test; > import org.eclipse.swt.internal.widgets.buttonkit.ButtonLCA_Test; >+import org.eclipse.swt.internal.widgets.clabelkit.CLabelLCA_Test; > import org.eclipse.swt.internal.widgets.combokit.ComboLCA_Test; > import org.eclipse.swt.internal.widgets.controlkit.ControlLCA_Test; > import org.eclipse.swt.internal.widgets.coolbarkit.CoolBarLCA_Test; >@@ -131,6 +132,7 @@ > suite.addTestSuite( ExpandItemLCA_Test.class ); > suite.addTestSuite( SliderLCA_Test.class ); > suite.addTestSuite( CComboLCA_Test.class ); >+ suite.addTestSuite( CLabelLCA_Test.class ); > > return suite; > } >Index: src/org/eclipse/swt/internal/widgets/clabelkit/CLabelLCA_Test.java >=================================================================== >RCS file: src/org/eclipse/swt/internal/widgets/clabelkit/CLabelLCA_Test.java >diff -N src/org/eclipse/swt/internal/widgets/clabelkit/CLabelLCA_Test.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/swt/internal/widgets/clabelkit/CLabelLCA_Test.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,49 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 EclipseSource and others. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 which accompanies this distribution, >+ * and is available at http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * EclipseSource - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.swt.internal.widgets.clabelkit; >+ >+import java.io.IOException; >+ >+import junit.framework.TestCase; >+ >+import org.eclipse.rwt.Fixture; >+import org.eclipse.rwt.lifecycle.*; >+import org.eclipse.swt.RWTFixture; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.custom.CLabel; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.Shell; >+ >+ >+public class CLabelLCA_Test extends TestCase { >+ >+ /* >+ * 280291: [CLabel] causes NullPointerException when rendered uninitialized >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=280291 >+ */ >+ public void testWriteText() throws IOException { >+ Display display = new Display(); >+ Shell shell = new Shell( display ); >+ CLabel label = new CLabel( shell, SWT.NONE ); >+ AbstractWidgetLCA lca = WidgetUtil.getLCA( label ); >+ lca.renderChanges( label ); >+ // the purpose of this test is to ensure that the LCA works without throwing >+ // an exception - thus there is no assert >+ } >+ >+ protected void setUp() throws Exception { >+ RWTFixture.setUp(); >+ Fixture.fakeResponseWriter(); >+ } >+ >+ protected void tearDown() throws Exception { >+ RWTFixture.tearDown(); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 280291
: 139185