Java code generated with static method using "this"

Hi All

I am using in my project. The java code generated for this has static method as follows.

    	public static native void setDelegate_unsafe(
    			@Mapped(ObjCObjectMapper.class) MDCSnackbarManagerDelegate value);

	public static void setDelegate(
			@Mapped(ObjCObjectMapper.class) MDCSnackbarManagerDelegate value) {
		Object __old = delegate();
		if (value != null) {, value);
		if (__old != null) {, __old);

This static method makes use of “this”, which cannot be used in static context.

The ObjC definition is as follows.

@implementation MDCSnackbarManager

    + (void)setDelegate:(id<MDCSnackbarManagerDelegate>)delegate {
      MDCSnackbarManagerInternal *manager = [MDCSnackbarManagerInternal sharedInstance];
      manager.delegate = delegate;


Is this a bug ?

To overcome this I have created an instance variable of type MDCSnackbarManager as follows

private static final MDCSnackbarManager _this = MDCSnackbarManager.alloc().init();

and I am using this “_this” in place of generated “this”.

Just wanted inputs the work around is fine.

On version 1.4.2