Bug 272307 [Mac] CocoaUIEnhancer crashes with NullPointer under Mac OS X Cocoa when running Riena example
When bringing up the Riena example app, we get a NullPointer Exception. The exception is logged and the app continues to run. I am unsure why that is happening. Same app runs without a problem with windows, linux, mac os x carbon. I will supply a screenshot of the debugger before the nullpointer happens and a screen shot of the actual app. Its a little tricky to set up the Riena example app yourself unless you like to download Riena and setup a target platform and all that. Then I am happy to post you a link with description. I will also attach the stacktrace with some error messages. Hope that helps to get to the cause of the problem.
bundles/org.eclipse.ui.cocoa/src/org/eclipse/ui/internal/cocoa/CocoaUIEnhancer.java
static Callback proc3Args;
	static final byte[] SWT_OBJECT = {'S', 'W', 'T', '_', 'O', 'B', 'J', 'E', 'C', 'T', '\0'};
	private void init() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchFieldException {
		
		byte[] types = {'*','\0'};
		int size = C.PTR_SIZEOF, align = C.PTR_SIZEOF == 4 ? 2 : 3;
		Class clazz = CocoaUIEnhancer.class;
		proc3Args = new Callback(clazz, "actionProc", 3); 
		
		Method getAddress = Callback.class.getMethod("getAddress", new Class[0]);
		Object object = getAddress.invoke(proc3Args, null);
		long proc3 = convertToLong(object);
		if (proc3 == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS);
		
		Field field = OS.class.getField("class_NSObject");
		Object fieldObj = field.get(OS.class);
		object = invokeMethod(OS.class, "objc_allocateClassPair", new Object[] { fieldObj, "SWTCocoaEnhancerDelegate", wrapPointer(0) });
		long cls = convertToLong(object);
		
		invokeMethod(OS.class, "class_addIvar", new Object[] {
				wrapPointer(cls), SWT_OBJECT, wrapPointer(size),
				new Byte((byte) align), types });
		
		invokeMethod(
				OS.class,
				"class_addMethod", new Object[] { wrapPointer(cls), wrapPointer(sel_toolbarButtonClicked_), wrapPointer(proc3), "@:@" }); 
		invokeMethod(OS.class, "class_addMethod", new Object[] {
				wrapPointer(cls),