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 103552 Details for
Bug 235368
[table] ArrayIndexOutOfBoundsException in virtual TableViewer
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]
Bugfix
clipboard.txt (text/plain), 4.59 KB, created by
RĂ¼diger Herrmann
on 2008-06-04 10:12:04 EDT
(
hide
)
Description:
Bugfix
Filename:
MIME Type:
Creator:
RĂ¼diger Herrmann
Created:
2008-06-04 10:12:04 EDT
Size:
4.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/swt/widgets/Table.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Table.java,v >retrieving revision 1.38 >diff -u -r1.38 Table.java >--- src/org/eclipse/swt/widgets/Table.java 2 Jun 2008 17:03:34 -0000 1.38 >+++ src/org/eclipse/swt/widgets/Table.java 4 Jun 2008 14:11:33 -0000 >@@ -127,7 +127,9 @@ > } > > public void checkData( final int index ) { >- Table.this.checkData( Table.this._getItem( index ), index ); >+ if( index >= 0 && index < Table.this.itemCount ) { >+ Table.this.checkData( Table.this._getItem( index ), index ); >+ } > } > > public int getDefaultColumnWidth() { >#P org.eclipse.rap.rwt.q07 >Index: src/org/eclipse/swt/internal/widgets/tablekit/TableLCA.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/tablekit/TableLCA.java,v >retrieving revision 1.2 >diff -u -r1.2 TableLCA.java >--- src/org/eclipse/swt/internal/widgets/tablekit/TableLCA.java 2 Jun 2008 17:03:37 -0000 1.2 >+++ src/org/eclipse/swt/internal/widgets/tablekit/TableLCA.java 4 Jun 2008 14:11:35 -0000 >@@ -83,7 +83,7 @@ > Table table = ( Table )widget; > readTopIndex( table ); // topIndex MUST be read *before* processSetData > readSelection( table ); >- processSetData( table ); >+ readSetData( table ); > readWidgetSelected( table ); > readWidgetDefaultSelected( table ); > ControlLCAUtil.processMouseEvents( table ); >@@ -169,7 +169,7 @@ > } > } > >- private static void processSetData( final Table table ) { >+ private static void readSetData( final Table table ) { > if( WidgetLCAUtil.wasEventSent( table, JSConst.EVENT_SET_DATA ) ) { > HttpServletRequest request = ContextProvider.getRequest(); > String value = request.getParameter( JSConst.EVENT_SET_DATA_INDEX ); >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/swt/widgets/Table_Test.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt.test/src/org/eclipse/swt/widgets/Table_Test.java,v >retrieving revision 1.27 >diff -u -r1.27 Table_Test.java >--- src/org/eclipse/swt/widgets/Table_Test.java 2 Jun 2008 17:03:40 -0000 1.27 >+++ src/org/eclipse/swt/widgets/Table_Test.java 4 Jun 2008 14:11:36 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002-2008 Innoopract Informationssysteme GmbH. > * 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 >@@ -8,7 +8,6 @@ > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation > ******************************************************************************/ >- > package org.eclipse.swt.widgets; > > import junit.framework.TestCase; >@@ -424,10 +423,6 @@ > Object adapter = table.getAdapter( ITableAdapter.class ); > ITableAdapter tableAdapter = ( ITableAdapter )adapter; > >-// table.setItemCount( 100 ); >-// table.setSelection( 90 ); >-// table.setSize( 501, 501 ); >-// table.setItemCount( 10 ); > table.setItemCount( 100 ); > table.setSelection( 99 ); > table.setSize( 501, 501 ); >@@ -1447,6 +1442,25 @@ > assertNotNull( item ); > assertEquals( 0, table.indexOf( item ) ); > } >+ >+ /* >+ * Ensures that checkData calls with an invalid index are silently ignored. >+ * This may happen, when the itemCount is reduced during a SetData event. >+ * Queued SetData events may then have stale (out-of-bounds) indices. >+ * See 235368: [table] [table] ArrayIndexOutOfBoundsException in virtual >+ * TableViewer >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=235368 >+ */ >+ public void testCheckDataWithInvalidIndex() { >+ RWTFixture.fakePhase( PhaseId.PROCESS_ACTION ); >+ Display display = new Display(); >+ Shell shell = new Shell( display ); >+ Table table = new Table( shell, SWT.VIRTUAL ); >+ table.setItemCount( 10 ); >+ ITableAdapter adapter >+ = ( ITableAdapter )table.getAdapter( ITableAdapter.class ); >+ adapter.checkData( 99 ); >+ } > > private static void clearColumns( final Table table ) { > while( table.getColumnCount() > 0 ) {
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 235368
:
103345
|
103552
|
103757
|
103908
|
104115