Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Freeze instead of Exception on Mac(NullPointerException thrown in Tree listener causes freeze)
Freeze instead of Exception on Mac [message #1075334] Mon, 29 July 2013 08:57
Milan Vahala is currently offline Milan VahalaFriend
Messages: 7
Registered: October 2011
Junior Member
following source code (SWT Snippet90 with added lines causing NullPointerExcetion) results in application freeze on Mac. The freeze occurs after click on some item in the tree.
package org.eclipse.swt.snippets;

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;

public class Snippet90 {

public static void main (String [] args) {
	Display display = new Display ();
	Shell shell = new Shell (display);
	final Tree tree = new Tree (shell, SWT.BORDER | SWT.MULTI);
	for (int i=0; i<12; i++) {
		TreeItem treeItem = new TreeItem (tree, SWT.NONE);
		treeItem.setText ("Item " + i);
	tree.addListener (SWT.MouseDown, new Listener () {
		public void handleEvent (Event event) {
			Point point = new Point (event.x, event.y);
			TreeItem item = tree.getItem (point);
			if (item != null) {
				System.out.println ("Mouse down: " + item);
			Image image = item.getImage();
	Rectangle clientArea = shell.getClientArea ();
	tree.setBounds (clientArea.x, clientArea.y, 200, 200);
	shell.setSize (300, 300); ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	display.dispose ();

I use Mac Os X Lion 10.7.5 (11G63) and SWT 4.2.2 ( The application hangs when calling OS.objc_msgSendSuper(objc_super, long, long) method.

Running the same code on Windows causes application crash with NullPointerException in call stack. So similar code in some Eclipse Plug-in/RCP application on Mac causes freeze with no cause in the log.

Is this some known problem on Mac? Should I report a bug about this?
Previous Topic:Supporting Multiple Data type entries in Clipboard
Next Topic:"IBM Notes Browser Plugin" used in SWT Browser crashes
Goto Forum:

Current Time: Sun May 27 20:00:51 GMT 2018

Powered by FUDForum. Page generated in 0.02088 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top