CUBA nightly - NoSuchMethodError ULiteralExpressionPattern.callParameter

IDEA Ultimate 2019.1.2 RC Plugin v11.0.NIGHTLY72-183

java.lang.NoSuchMethodError: com.intellij.patterns.uast.ULiteralExpressionPattern.callParameter(ILcom/intellij/patterns/ElementPattern;)Lcom/intellij/patterns/uast/UElementPattern;
	at com.haulmont.studio.intellij.reference.UastCubaReferenceContributor.<clinit>(SourceFile:19)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at com.intellij.openapi.extensions.AbstractExtensionPointBean.findClass(AbstractExtensionPointBean.java:41)
	at com.intellij.util.ExtensionInstantiator.instantiateWithPicoContainerOnlyIfNeeded(ExtensionInstantiator.java:34)
	at com.intellij.openapi.extensions.CustomLoadingExtensionPointBean.instantiateExtension(CustomLoadingExtensionPointBean.java:21)
	at com.intellij.psi.impl.source.resolve.reference.PsiReferenceContributorEP.lambda$new$0(PsiReferenceContributorEP.java:23)
	at com.intellij.openapi.util.NotNullLazyValue$2.compute(NotNullLazyValue.java:68)
	at com.intellij.openapi.util.NotNullLazyValue.getValue(NotNullLazyValue.java:39)
	at com.intellij.psi.impl.source.resolve.reference.PsiReferenceContributorEP.getInstance(PsiReferenceContributorEP.java:28)
	at com.intellij.psi.impl.source.resolve.reference.PsiReferenceContributorEP.getInstance(PsiReferenceContributorEP.java:16)
	at com.intellij.openapi.util.KeyedExtensionCollector.buildExtensionsFromExtensionPoint(KeyedExtensionCollector.java:171)
	at com.intellij.openapi.util.KeyedExtensionCollector.buildExtensions(KeyedExtensionCollector.java:196)
	at com.intellij.lang.LanguageExtension.buildExtensions(LanguageExtension.java:106)
	at com.intellij.lang.LanguageExtension.buildExtensions(LanguageExtension.java:23)
	at com.intellij.openapi.util.KeyedExtensionCollector.forKey(KeyedExtensionCollector.java:134)
	at com.intellij.lang.LanguageExtension.allForLanguage(LanguageExtension.java:76)
	at com.intellij.lang.LanguageExtension.allForLanguageOrAny(LanguageExtension.java:111)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.createRegistrar(ReferenceProvidersRegistryImpl.java:45)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getRegistrar(ReferenceProvidersRegistryImpl.java:88)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:103)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:56)
	at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:148)
	at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$0(CachedValueBase.java:236)
	at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:116)
	at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:237)
	at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
	at com.intellij.util.CachedValuesManagerImpl.getCachedValueFromExHolder(CachedValuesManagerImpl.java:72)
	at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:45)
	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:147)
	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:129)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:55)
	at com.intellij.psi.PsiReferenceServiceImpl.getReferences(PsiReferenceServiceImpl.java:32)
	at com.intellij.psi.PsiReferenceService.getContributedReferences(PsiReferenceService.java:52)
	at com.intellij.psi.impl.source.tree.java.PsiLiteralExpressionImpl.getReferences(PsiLiteralExpressionImpl.java:215)
	at com.haulmont.studio.intellij.annotation.CubaLiteralExpressionsAnnotator.annotate(SourceFile:31)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:120)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:87)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:351)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectHighlights$5(GeneralHighlightingPass.java:284)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:311)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:314)
	at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.lambda$analyze$2(HighlightVisitorImpl.java:161)
	at com.intellij.codeInsight.daemon.impl.analysis.RefCountHolder.analyze(RefCountHolder.java:370)
	at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.analyze(HighlightVisitorImpl.java:160)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:314)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:314)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:71)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:314)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:281)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:225)
	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:84)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:69)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:430)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1166)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:423)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:422)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:398)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:164)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:218)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:396)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:174)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

It happens when I open file

\modules\web\src\com\dtc\callbook\web\screens\ExtAppMainWindow.java

package com.dtc.callbook.web.screens;

import com.dtc.callbook.AdminPermissions;
import com.dtc.callbook.AdminPermissionsGet;
import com.dtc.callbook.CallbookConfig;
import com.dtc.callbook.entity.Card;
import com.dtc.callbook.service.CardService;
import com.dtc.callbook.service.MemberService;
import com.haulmont.cuba.core.global.*;
import com.haulmont.cuba.gui.WindowManager;
import com.haulmont.cuba.gui.WindowManager.OpenType;
import com.haulmont.cuba.gui.WindowManagerProvider;
import com.haulmont.cuba.gui.components.Frame;
import com.haulmont.cuba.gui.components.mainwindow.AppMenu;
import com.haulmont.cuba.gui.components.mainwindow.UserIndicator;
import com.haulmont.cuba.gui.config.WindowConfig;
import com.haulmont.cuba.security.entity.Group;
import com.haulmont.cuba.security.entity.User;
import com.haulmont.cuba.web.App;
import com.haulmont.cuba.web.app.mainwindow.AppMainWindow;

import javax.annotation.Nullable;
import javax.inject.Inject;
import java.util.Map;
import java.util.UUID;
import java.util.function.Consumer;

public class ExtAppMainWindow extends AppMainWindow {
    CardService cardService = AppBeans.get(CardService.NAME);


    @Inject
    private DataManager dataManager;



    @Inject
    private UserIndicator userIndicator;

    private WindowConfig wc = getWindowConfig();
    @Inject
    private Configuration configuration;

    @Override
    public void ready() {
        super.ready();


        openWindow("callbookScreen", OpenType.NEW_TAB);
    }

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);
        CallbookConfig callbookConfig = configuration.getConfig(CallbookConfig.class);
        Group adminGroup = dataManager.load(LoadContext.create(Group.class).setId(UUID.fromString(
                callbookConfig.getAdminGroupID())
        ));
        Group minAdminGroup = dataManager.load(LoadContext.create(Group.class).setId(UUID.fromString(
                callbookConfig.getMinAdminGroupID())
        ));
        Group instAdminGroup = dataManager.load(LoadContext.create(Group.class).setId(UUID.fromString(
                callbookConfig.getInstAdminGroupID())
        ));
        Group userGroup = dataManager.load(LoadContext.create(Group.class).setId(UUID.fromString(
                callbookConfig.getUserGroupId())
        ));

        AdminPermissionsGet adminPermissionsGet = new AdminPermissionsGet(userGroup,adminGroup,minAdminGroup,instAdminGroup);

        User currentUser = AppBeans.get(UserSessionSource.class).getUserSession().getCurrentOrSubstitutedUser();

        userIndicator.setUserNameFormatter(value -> {
            Card cardOfUser = cardService.getCardOfUser(value);
            String userName = cardOfUser == null ? value.getInstanceName() : cardOfUser.getFullName();
            userName += " (" + value.getGroup().getInstanceName() + ")";
            return userName;
        });

        Card currentMember = findCurrentMember();
        AppMenu.MenuItem item = createMenuItem("admin-menu", null, null);
        AppMenu.MenuItem subItem;
        //icon: font-icon:USER
        item = mainMenu.getMenuItemNN("cabinet");
        if (currentMember != null) {
            item.setCommand(menuItem -> {
                AppBeans.get(WindowManagerProvider.class).get().openEditor(wc.getWindowInfo("cabinet"), currentMember, OpenType.NEW_TAB);
//                    getWindowManager().openEditor(wc.getWindowInfo("cabinet"), currentMember, WindowManager.OpenType.NEW_TAB);
                // showErrorNotification(messages.getMessage("com/dtc/callbook/web/cabinet"
                //                        "noCabinet"));
            });
        } else {
            item.setVisible(false);
        }


        if (!adminPermissionsGet.isUser(currentUser)) {
            item = createMenuItem("admin-menu", null, null);
            if (currentMember != null) {
                if (adminPermissionsGet.isMinistryAdmin(currentUser)) {
                    subItem = createMenuItem("myMinistry", null, menuItem -> {
                        getWindowManager().openEditor(wc.getWindowInfo("callbook$Ministry.edit"), currentMember.getMinistry(), OpenType.NEW_TAB);
                    });
                    item.addChildItem(subItem);
                }
                if (currentMember.getInstitution() != null && adminPermissionsGet.isInstitutionAdmin(currentUser)) {
                    subItem = createMenuItem("myInstitution", null, menuItem -> {
                        getWindowManager().openEditor(wc.getWindowInfo("callbook$Institution.edit"), currentMember.getInstitution(), OpenType.NEW_TAB);
                    });
                    item.addChildItem(subItem);
                }

                mainMenu.addMenuItem(item, 0);
            }
        }


    }

    private AppMenu.MenuItem createMenuItem(String id, @Nullable String icon, @Nullable Consumer<AppMenu.MenuItem> command) {
        return mainMenu.createMenuItem(id, messages.getMessage("", "menu-config." + id), icon, command);

    }


    protected Messages messages = AppBeans.get(Messages.class);

    private void showErrorNotification(String errorText) {
        getWindowManager().showNotification(errorText, NotificationType.ERROR);
    }

    private void openCabinet(Card currentMember) {

    }

    private Card findCurrentMember() {
        MemberService memberService = getMemberService();
        return memberService.getCurrentMember();
    }

    private WindowConfig getWindowConfig() {
        return AppBeans.get(WindowConfig.NAME);
    }

    private MemberService getMemberService() {
        return AppBeans.get(MemberService.class);
    }

}

Hi,

Thank you for reporting the problem, we will check this.

By the way, why do you use AppBeans everywhere instead of dependency injection?

Instead of:

You’d better use:

@Inject
CardService cardService;

I’m just learning. Trying out this and that. You now reminded me the way to “inject” something later than during class’ loading. For example conditionally. I need to remember about this trick.

Filed the issue.