带有 SWT.VIRTUAL 的 SWT 表引发 StackOverflowError [英] SWT Table with SWT.VIRTUAL raises StackOverflowError

查看:37
本文介绍了带有 SWT.VIRTUAL 的 SWT 表引发 StackOverflowError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近安装了 Windows 7 Professional 后,我遇到了一个奇怪的问题,即从 SWT 中填充的表中删除表项.它特定于 Windows 7 和表的 SWT.VIRTUAL 样式常量.

After recently installing Windows 7 Professional, I'm getting a strange problem removing a TableItem from a populated Table in SWT. It is specific to Windows 7 and to the SWT.VIRTUAL style constant for the table.

考虑以下代码:

table = new Table(parent, SWT.VIRTUAL | Skin.SCROLL_STYLE |
                          SWT.FULL_SELECTION | SWT.BORDER);
TableItem item = new TableItem(table, SWT.NONE);
item.setText("Table item");
table.remove(0);

这会导致 StackOverflowError 如下:

This causes a StackOverflowError as follows:

Caused by: java.lang.StackOverflowError
    at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2312)
    at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:334)
    at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:200)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
    at org.eclipse.swt.widgets.Table.windowProc(Table.java:5520)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
    at org.eclipse.swt.internal.win32.OS.SendMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.SendMessage(OS.java:3106)
    at org.eclipse.swt.widgets.Table.wmNotifyChild(Table.java:6319)
    at org.eclipse.swt.widgets.Control.wmNotify(Control.java:4877)
    at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1757)
    at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:4507)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4000)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
    at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
    at ...

如上所示,堆栈从显示器的windowProc 调用循环到操作系统的CallWindowProcW;这让我怀疑它与 Windows 7 特定的 SWT 实现有关.堆栈跟踪最终源自 table.remove(0) 行.

As shown above, the stack cycles from the Display's windowProc call to the OS' CallWindowProcW; this leads me to suspect that it has something to do with the Windows 7-specific implementation of SWT. The stack trace eventually originates from the table.remove(0) line.

在 Vista、XP 或 Mac OS X 下测试没有问题.

Testing under Vista, XP or Mac OS X gives no problems.

删除 SWT.VIRTUAL 样式常量可以解决问题,但不允许在表中使用自定义对象.

Removing the SWT.VIRTUAL style constant resolves the problem, but doesn't allow for custom objects in the table.

这似乎是一个 SWT 错误,还是我遗漏了什么?

It would seem that this is a SWT bug, or am I missing something?

推荐答案

看起来像一个错误.用测试用例将其报告给 SWT 人员.

Looks like a bug. Report it to the SWT guys with a test case.

这篇关于带有 SWT.VIRTUAL 的 SWT 表引发 StackOverflowError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆