gwt-jackson icon indicating copy to clipboard operation
gwt-jackson copied to clipboard

Issue in compilation

Open rakesh-roshan opened this issue 9 years ago • 3 comments

I am using gwt-maven-plugin:2.8.0-rc2

I am getting error:

type 'long' is not safe to access in JSNI code

The error is in the generated code.

rakesh-roshan avatar Jan 26 '17 11:01 rakesh-roshan

The error occurs when I use annotation. If I remove the annotation the compilation succeeds.

@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, creatorVisibility = Visibility.NONE)

rakesh-roshan avatar Jan 26 '17 11:01 rakesh-roshan

With the annotation, you allow private & protected field to be access.
In pure java, you can't access those fields so I use JSNI to access them (no restriction in Javascript).

About the error itself on long, not sure I can do something.

nmorel avatar Jan 31 '17 16:01 nmorel

You could annotate the generated JSNI methods with UnsafeNativeLong so that the compiler ignores it. See GWT JSNI documentation. But this could result in incorrect values, as described in this stackoverflow question.

LennartH avatar Jun 08 '17 19:06 LennartH