| 
| Issue with Grid widget [message #62914] | Tue, 10 March 2009 11:07  |  | 
| Eclipse User  |  |  |  |  | Hi, 
 I'm facing an issue with the Grid widget that I can't reproduce.
 Sometimes when collapsing all nodes in the tree, the Grid throws an
 invalid argument exception while painting. The line of exception is 2519
 (the source code is a bit old). Here is a snippet of the code:
 
 -------------------
 // parameter preparation
 if (startIndex == -1)
 {
 if(!inverse)
 {
 // search frist visible item
 do startIndex++; while (startIndex < items.size() &&
 !((GridItem)items.get(startIndex)).isVisible());
 if (startIndex == items.size()) return null;
 }
 else
 {
 // search last visible item
 startIndex = items.size();
 do startIndex--; while (startIndex >= 0 &&
 !((GridItem)items.get(startIndex)).isVisible());
 if (startIndex == -1) return null;
 }
 }
 
 // fail fast
 if (startIndex < 0 || startIndex >= items.size()
 || ((GridItem)items.get(startIndex)).isVisible() == false)
 SWT.error(SWT.ERROR_INVALID_ARGUMENT);
 -------------------
 
 If I'm not wrong, the only case that throws the invalid argument
 exception is if the item at startIndex is not visible (if startIndex is
 out of range it should return null from the previous statements).
 
 So my question is, how it is possible to have the startIndex item not
 visible but passing the previous checks and loops ?
 
 I tried several combinations of expanded/collapsed states but I can't
 get this error. Do you have any hint on how I could reproduce such error ?
 
 Regards,
 Marco.
 |  |  |  | 
|  | 
| 
| Re: Issue with Grid widget [message #62916 is a reply to message #62915] | Tue, 10 March 2009 13:26  |  | 
| Eclipse User  |  |  |  |  | On 10/03/2009 16:45 Tom Schindl ha scritto: 
 > Could you please give the current header_footer branch a try and once
 > you manage to get a stacktrace file a bugzilla with as much information
 > (ideally with a snippet)
 
 Unfortunately I can't use the latest code because I'm still running with
 an Eclipse 3.2 SDK.
 
 The problem is that I can't build a snippet, because I don't have any
 clue about how to reproduce the error. It happens on a client
 installation but I can't run a debugger on it.
 
 This is a partial stack trace however it doesn't say much:
 
 java.lang.IllegalArgumentException: Argument not valid
 at org.eclipse.swt.SWT.error(SWT.java:3358)
 at org.eclipse.swt.SWT.error(SWT.java:3297)
 at org.eclipse.swt.SWT.error(SWT.java:3268)
 at  org.eclipse.nebula.widgets.grid.Grid.getRowRange(Grid.java:2 519)
 at  org.eclipse.nebula.widgets.grid.Grid.onPaint(Grid.java:4920)
 at  org.eclipse.nebula.widgets.grid.Grid.access$2(Grid.java:4890 )
 at
 org.eclipse.nebula.widgets.grid.Grid$4.paintControl(Grid.jav a:6013)
 at
 org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:83)
 at  org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937)
 at  org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:12 85)
 at  org.eclipse.swt.widgets.Control.windowProc(Control.java:3299 )
 at  org.eclipse.swt.widgets.Display.windowProc(Display.java:4025 )
 at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native
 Method)
 at  org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:19 23)
 at
 org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2966)
 at  org.eclipse.jface.window.Window.runEventLoop(Window.java:820 )
 at org.eclipse.jface.window.Window.open(Window.java:796)
 
 
 Regards,
 Marco.
 |  |  |  | 
| 
| Re: Issue with Grid widget [message #593927 is a reply to message #62914] | Tue, 10 March 2009 11:45  |  | 
| Eclipse User  |  |  |  |  | Hi Marco, 
 Could you please give the current header_footer branch a try and once
 you manage to get a stacktrace file a bugzilla with as much information
 (ideally with a snippet)
 
 Tom
 
 Marco Maccaferri schrieb:
 > Hi,
 >
 > I'm facing an issue with the Grid widget that I can't reproduce.
 > Sometimes when collapsing all nodes in the tree, the Grid throws an
 > invalid argument exception while painting. The line of exception is 2519
 > (the source code is a bit old). Here is a snippet of the code:
 >
 > -------------------
 > // parameter preparation
 > if (startIndex == -1)
 > {
 >     if(!inverse)
 >     {
 >         // search frist visible item
 >         do startIndex++; while (startIndex < items.size() &&
 > !((GridItem)items.get(startIndex)).isVisible());
 >         if (startIndex == items.size()) return null;
 >     }
 >     else
 >     {
 >         // search last visible item
 >     startIndex = items.size();
 >         do startIndex--; while (startIndex >= 0 &&
 > !((GridItem)items.get(startIndex)).isVisible());
 >         if (startIndex == -1) return null;
 >     }
 > }
 >
 > // fail fast
 > if (startIndex < 0 || startIndex >= items.size()
 >                 || ((GridItem)items.get(startIndex)).isVisible() == false)
 >     SWT.error(SWT.ERROR_INVALID_ARGUMENT);
 > -------------------
 >
 > If I'm not wrong, the only case that throws the invalid argument
 > exception is if the item at startIndex is not visible (if startIndex is
 > out of range it should return null from the previous statements).
 >
 > So my question is, how it is possible to have the startIndex item not
 > visible but passing the previous checks and loops ?
 >
 > I tried several combinations of expanded/collapsed states but I can't
 > get this error. Do you have any hint on how I could reproduce such error ?
 >
 > Regards,
 > Marco.
 |  |  |  | 
| 
| Re: Issue with Grid widget [message #593934 is a reply to message #62915] | Tue, 10 March 2009 13:26  |  | 
| Eclipse User  |  |  |  |  | On 10/03/2009 16:45 Tom Schindl ha scritto: 
 > Could you please give the current header_footer branch a try and once
 > you manage to get a stacktrace file a bugzilla with as much information
 > (ideally with a snippet)
 
 Unfortunately I can't use the latest code because I'm still running with
 an Eclipse 3.2 SDK.
 
 The problem is that I can't build a snippet, because I don't have any
 clue about how to reproduce the error. It happens on a client
 installation but I can't run a debugger on it.
 
 This is a partial stack trace however it doesn't say much:
 
 java.lang.IllegalArgumentException: Argument not valid
 at org.eclipse.swt.SWT.error(SWT.java:3358)
 at org.eclipse.swt.SWT.error(SWT.java:3297)
 at org.eclipse.swt.SWT.error(SWT.java:3268)
 at  org.eclipse.nebula.widgets.grid.Grid.getRowRange(Grid.java:2 519)
 at  org.eclipse.nebula.widgets.grid.Grid.onPaint(Grid.java:4920)
 at  org.eclipse.nebula.widgets.grid.Grid.access$2(Grid.java:4890 )
 at
 org.eclipse.nebula.widgets.grid.Grid$4.paintControl(Grid.jav a:6013)
 at
 org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:83)
 at  org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937)
 at  org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:12 85)
 at  org.eclipse.swt.widgets.Control.windowProc(Control.java:3299 )
 at  org.eclipse.swt.widgets.Display.windowProc(Display.java:4025 )
 at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native
 Method)
 at  org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:19 23)
 at
 org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2966)
 at  org.eclipse.jface.window.Window.runEventLoop(Window.java:820 )
 at org.eclipse.jface.window.Window.open(Window.java:796)
 
 
 Regards,
 Marco.
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.03966 seconds