Thursday, September 10, 2020

Re: Weird type error in lambdas with generics, with JsInterop

Thanks Jens. The NullPointerException was my first line of investigation. But there are no fields, object or method called 'inspectivity' - it's part of the package names. When debugging in Chrome DevTools, the exception occurred while it was executing the "method declaration line", AFAIK the GWT boilerplate code before it executes the actual method.

Unfortunately I can't share the full code, but I think I've pinned it down to invoking callbacks based with generics from JsInterop (similar code is working with JSNI callbacks):

public interface FileCallback<S, E> {
         public void onSuccess(S entry);
         public void onFailure(E error);

public abstract class DelegatingFileCallback<S> implements FileCallback<S, FileError> {
    private static final Logger log = Logger.getLogger(DelegatingFileCallback.class.getName());
    private final FileCallback<?, FileError> delegate;
    private final String operation;
    protected DelegatingFileCallback(FileCallback<?, FileError> delegate, String operation) {
        this.delegate = delegate;
        this.operation = operation;
    public final void onFailure(FileError error) {
        log.warning(error.buildErrorMessage(operation, ""));

I'm gradually replacing these callbacks by specific ones and it seems to be working.


You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

No comments:

Post a Comment