Studio error “Cannot access…” enum class but no build or runtime errors

Hello Everyone

Could you please help me with the following situation…

Type: possible Bug
Severity: Minor (currently)
Date: 14.07.2020 - problem discovered
Reporter: Chris B.
CUBA Experience: 4 months
JPQL Experience: 4 months

Operating System: macOS 10.15.5 (19F101)
File System: Case-Sensitive Journaled HFS+ (APFS)
Datebase: MySQL 8.0.19

CUBA Platform version: 7.2.6
CUBA Studio plugin version: 13.4-191
IntelliJ version: CUBA Studio 2019.2

Use Case: Normal local standalone development

Background & Problem: I have been extending my data model und adding attributes to my entities and their screens for several weeks and have building and running my application after almost every iteration without a problem (unless I made a real mistake). During this whole time I have never had any messages within CUBA Studio indicating that a package or class could not be found. But last week I decide to add some more values to an enumeration named “RoleName” and after opening it in the editor, it was suddenly underlined in red and has approximately 50 errors in it in the other methods that I added to it. Its package is also underlined in red as are other classes that use it. Please see the image below.

RoleName_errors

The following is the first statement in the RoleName source file (“myapp” is an example name):

package com.company.myapp.entity.interestrole;

My application builds without any errors and also runs without any runtime errors; the enumeration values appear in my screen’s lookup fields and the values are correctly persisted to my local MySQL database.

When I use the “Reveal in Finder” context action, I find the source file inside the package (com.company.myapp.entity.interestrole) in the file system, mirroring the configuration and Project display in CUBA Studio left side window.

I have even refactored RoleName to move it to the “entity” package and then refactored it a second time to move it back to the “entity.interestrole” package. Each time the refactor action worked correctly but when I moved it back to the “entity.interestrole” package, I received the errors again.

It is possible that it began after I installed version 7.2.6 but I cannot be absolutely sure about this,

I have stopped and restarted CUBA Studio and rebooted several times but I cannot get rid of these error messages.

Has anyone ever seen this behavior? Does anyone have any suggestions, how I can locate the root cause of this and maybe correct it?

Many thanks in advance for your feedback and efforts.

Best regards
Chris

Hi,

Let me rephrase it: you can see error message in the IDE, but the application compiles and runs without issues, right?

If so, try to:

  1. Execute gradlew clean command in your project folder
  2. Invoke File -> Invalidate Caches and Restart menu.

Sometimes IntelliJ project indexes break, so the IDE starts “seeing” non-existing files and does not detect existing ones.

@belyaev

Hi Andrey

Yes, your understanding of my problem is correct. And your suggestions did resolve the problem; the error was gone after the cache invalidation and restart.

Thank you very much for your quick response and your assistance; I really appreciate it!

Best regards
Chris