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

IntelliJ 2024.2: ProcessCanceledException class hierarchy changed. Resolve issues that arise from this API change. #767

Closed
mrglavas opened this issue May 22, 2024 · 5 comments
Assignees
Milestone

Comments

@mrglavas
Copy link
Contributor

mrglavas commented May 22, 2024

Change in IntelliJ 2024.2 JetBrains/intellij-community@12e78f1#diff-53953a080bfbb7f3d529336a7318cfde6b06098f5fbb136f7c58c3fad831f500
See resolution in LSP4iJ: redhat-developer/lsp4ij#293.

LTI has multiple places with multi catch of CancellationException and ProcessCanceledException and will face the same problem.

LSP4iJ compilation errors that occurred with IntelliJ 2024.2:
image

@mrglavas mrglavas added the future An issue that is expected to arise in the future. label May 22, 2024
@mrglavas mrglavas changed the title IntelliJ 2024.2: ProcessCanceledException class hierarchy changed; resolve issues that arise from this change. IntelliJ 2024.2: ProcessCanceledException class hierarchy changed. Resolve issues that arise from this change. May 22, 2024
@mrglavas mrglavas changed the title IntelliJ 2024.2: ProcessCanceledException class hierarchy changed. Resolve issues that arise from this change. IntelliJ 2024.2: ProcessCanceledException class hierarchy changed. Resolve issues that arise from this API change. May 22, 2024
@TrevCraw TrevCraw added high priority and removed future An issue that is expected to arise in the future. labels Aug 1, 2024
@TrevCraw TrevCraw added this to the Next milestone Aug 1, 2024
@vaisakhkannan vaisakhkannan self-assigned this Aug 6, 2024
@vaisakhkannan
Copy link
Contributor

vaisakhkannan commented Aug 6, 2024

I haven't found the exact usage of the following in our code.
catch (CancellationException | ProcessCanceledException e)

I found usages of the following
catch (IndexNotReadyException | ProcessCanceledException | CancellationException e)

  • AnnotationUtil.getScopeAnnotations()
  • PostConstructReturnTypeQuickFix.resolveCodeAction()
  • BeanValidationQuickFix.resolveRemoveConstraintAnnotationsCodeAction()
  • BeanValidationQuickFix.resolveStaticModifierCodeAction()
  • ManagedBeanNoArgConstructorQuickFix.resolveCodeAction()
  • ManagedBeanQuickFix.resolveCodeAction()
  • InsertAnnotationMissingQuickFix.resolveCodeAction()
  • InsertAnnotationQuickFix.resolveCodeAction()
  • RemoveAnnotationConflictQuickFix.resolveCodeAction()
  • RemoveMethodParametersQuickFix.resolveCodeAction()
  • RemoveModifierConflictQuickFix.resolveCodeAction()
  • RemoveParamAnnotationQuickFix.resolveCodeAction()
  • NoResourcePublicConstructorQuickFix.convertWorkspaceEdit()
  • NonPublicResourceMethodQuickFix.resolveCodeAction()
  • ResourceMethodMultipleEntityParamsQuickFix.resolveCodeAction()
  • PersistenceAnnotationQuickFix.resolveCodeAction()
  • PersistenceEntityQuickFix.resolveCodeAction()
  • CompleteFilterAnnotationQuickFix.resolveCodeAction() --- 2 usages
  • CompleteServletAnnotationQuickFix.resolveCodeAction() -- 2 usages
  • FilterImplementationQuickFix.resolveCodeAction()
  • HttpServletQuickFix.resolveCodeAction()
  • ListenerImplementationQuickFix.resolveCodeAction()
  • InsertAnnotationAttributeQuickFix.resolveCodeAction()
  • InsertAnnotationMissingQuickFix.resolveCodeAction()
  • AnnotationValidator.validate()
  • JavaCompletionDefinition.isAdaptedForCompletion()
  • JavaCompletionDefinition.collectCompletionItems()
  • JavaDiagnosticsDefinition.isAdaptedForDiagnostics()
  • JavaDiagnosticsDefinition.beginDiagnostics()
  • JavaDiagnosticsDefinition.collectDiagnostics()
  • JavaDiagnosticsDefinition.endDiagnostics()
  • MicroProfileFaultToleranceASTValidator.validateAsynchronousAnnotation()
  • ImplementHealthCheckQuickFix.resolveCodeAction()
  • ApplicationScopedAnnotationMissingQuickFix.resolveCodeAction()
  • MicroProfileGenerateOpenAPIOperation.resolveCodeAction()

I have made Fixes to the above occurrences.

@mrglavas
Copy link
Contributor Author

mrglavas commented Aug 8, 2024

@vaisakhkannan I've moved this back to parked. We're not targeting IntelliJ 2024.2 for 24.0.8. Will revisit when we do move up to 2024.2.

vaisakhkannan added a commit to vaisakhkannan/liberty-tools-intellij that referenced this issue Oct 9, 2024
vaisakhkannan added a commit that referenced this issue Oct 11, 2024
…ception

Fix usage of ProcessCanceledException and CancellationException in catch block
@vaisakhkannan
Copy link
Contributor

vaisakhkannan commented Oct 14, 2024

The changes in the above PR 901 have been merged into the feature branch Support_intellij_2024.2. Those changes are required for @staicy123 to support 2024.2. We can revisit the PR changes once build.gradle starts building successfully.

@mrglavas
Copy link
Contributor Author

@vaisakhkannan I noticed the PR was merged on to the feature branch without a code review. Adding review comments here about the code that was changed.

It would be desirable to refactor out common code so that the next time the exception handling requires an update, it won't require changes in so many places. For instance, this could be accomplished by writing a method which accepts a function (i.e. a lambda expression) as a parameter. The method would call the function which is wrapped in a try/catch. If the exception handling needs to be updated again then you only need to update the code in one place. In general if you find that you're making the same change in multiple places it could be a sign of duplicated code which could be improved.

@vaisakhkannan vaisakhkannan moved this from Parked to In Progress in Open Liberty Developer Experience Oct 22, 2024
@vaisakhkannan vaisakhkannan moved this from In Progress to In Review in Open Liberty Developer Experience Nov 1, 2024
vaisakhkannan added a commit that referenced this issue Nov 8, 2024
…xception

Fix usage of ProcessCanceledException to support 2024.2
@vaisakhkannan
Copy link
Contributor

Closing this issue since the PR is merged

@github-project-automation github-project-automation bot moved this from In Review to Sprint Closed in Open Liberty Developer Experience Nov 8, 2024
dessina-devasia pushed a commit to dessina-devasia/liberty-tools-intellij that referenced this issue Nov 25, 2024
…FIx-ProcessCanceledException

Fix usage of ProcessCanceledException to support 2024.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants