Community
Participate
Working Groups
Call Combo#remove(int,int) with arguments out of bounds. We should throw an IAE exception in this case as stated in the Javadoc. public void testRemoveOutOfRange() { Display display = new Display(); Shell shell = new Shell( display, SWT.NONE ); final Combo combo = new Combo( shell, SWT.NONE ); combo.add( "test" ); combo.add( "test1" ); combo.add( "test2" ); try { combo.remove( 0, 100 ); fail("No exception thrown for illegal index argument"); } catch (IllegalArgumentException e) { // expected } }
Created attachment 152943 [details] Final draft I implemented that the method Combo#remove( int, int ) throws an IllegalArgumentException ( SWT.ERROR_INVALID_RANGE, as described in the Javadoc comment ) when getting invalid arguments. I used the test method above but added some more test cases.
Created attachment 153038 [details] Wrong attachment for this bug - please delete I'm sorry, i uploaded the wrong patch. This should be the right one.
Applied patch to CVS HEAD