Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : Modification to replace the usage of deprecated method DumbService.runReadActionInSmartMode(Computable) #1421

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dessina-devasia
Copy link

  • Replaced deprecated method DumbService.runReadActionInSmartMode(Computable)
  • Removed unused DumbService and other imports in related files
  • Changed copyright year to 2025

Fixes #1420

…ted method DumbService.runReadActionInSmartMode(Computable)
Copy link

sonarqubecloud bot commented Jan 8, 2025

@dessina-devasia dessina-devasia changed the title fix : [#1420] Modification to replace the usage of deprecated method DumbService.runReadActionInSmartMode(Computable) fix : Modification to replace the usage of deprecated method DumbService.runReadActionInSmartMode(Computable) Jan 8, 2025
@@ -222,7 +220,8 @@ public Location findPropertyLocation(VirtualFile file, String sourceType, String
}

public Location findPropertyLocation(Module module, String sourceType, String sourceField, String sourceMethod, IPsiUtils utils) {
return DumbService.getInstance(module.getProject()).runReadActionInSmartMode(() -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like you have removed ReadAction in ProjectLabelManager, should we need this wrap with ReadAction ?

Copy link
Author

@dessina-devasia dessina-devasia Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@angelozerr I've already added ReadAction block here. So, no need to wrap this in ReadAction

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's very strange because this findPropertyLocation should be called also in a non blocking read action in the QuarkusLanguageClient.

Do you see trouble if you remove this ReadAction?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@angelozerr Let me test the same without ReadAction and will update you.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@angelozerr Removed the ReadAction.nonBlocking() as findPropertyLocation() is already executed in a NonBlocking ReadAction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address usage of deprecated method 'DumbService.runReadActionInSmartMode(Computable)'
2 participants