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 148391 Details for
Bug 243874
[Events] add*Listener throws wrong exception
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]
Proposed patch
Bug-243874.patch (text/plain), 2.86 KB, created by
Jordan Yakovchev
on 2009-09-30 03:28:48 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jordan Yakovchev
Created:
2009-09-30 03:28:48 EDT
Size:
2.86 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/rwt/internal/events/EventAdapter.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/events/EventAdapter.java,v >retrieving revision 1.2 >diff -u -r1.2 EventAdapter.java >--- src/org/eclipse/rwt/internal/events/EventAdapter.java 12 Jun 2008 13:12:20 -0000 1.2 >+++ src/org/eclipse/rwt/internal/events/EventAdapter.java 30 Sep 2009 07:25:54 -0000 >@@ -13,6 +13,7 @@ > import java.util.*; > > import org.eclipse.rwt.internal.util.ParamCheck; >+import org.eclipse.swt.SWT; > > public class EventAdapter implements IEventAdapter { > >@@ -108,8 +109,12 @@ > public void addListener( final Class listenerType, > final Object listener ) > { >- ParamCheck.notNull( listenerType, "listenerType" ); >- ParamCheck.notNull( listener, "listener" ); >+ if( listenerType == null ) { >+ SWT.error( SWT.ERROR_NULL_ARGUMENT ); >+ } >+ if( listener == null ) { >+ SWT.error( SWT.ERROR_NULL_ARGUMENT ); >+ } > checkTypeCompatibility( listenerType, listener ); > getListenerSet( listenerType ).add( listener ); > } >@@ -117,8 +122,12 @@ > public void removeListener( final Class listenerType, > final Object listener ) > { >- ParamCheck.notNull( listenerType, "listenerType" ); >- ParamCheck.notNull( listener, "listener" ); >+ if( listenerType == null ) { >+ SWT.error( SWT.ERROR_NULL_ARGUMENT ); >+ } >+ if( listener == null ) { >+ SWT.error( SWT.ERROR_NULL_ARGUMENT ); >+ } > checkTypeCompatibility( listenerType, listener ); > if( hasListener( listenerType ) ) { > getListenerSet( listenerType ).remove( listener ); >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/rwt/internal/events/EventAdapter_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/rwt/internal/events/EventAdapter_Test.java,v >retrieving revision 1.3 >diff -u -r1.3 EventAdapter_Test.java >--- src/org/eclipse/rwt/internal/events/EventAdapter_Test.java 12 Jun 2008 13:23:17 -0000 1.3 >+++ src/org/eclipse/rwt/internal/events/EventAdapter_Test.java 30 Sep 2009 07:25:58 -0000 >@@ -67,6 +67,16 @@ > fail(); > } catch( final IllegalArgumentException iae ) { > } >+ try { >+ eventAdapter.addListener( SelectionListener.class, null ); >+ fail(); >+ } catch( final IllegalArgumentException iae ) { >+ } >+ try { >+ eventAdapter.addListener( null, new Object() ); >+ fail(); >+ } catch( final IllegalArgumentException iae ) { >+ } > listener = eventAdapter.getListener( SelectionListener.class ); > assertEquals( 0, listener.length ); > }
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 243874
:
148391
|
148421