You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there's an issue in our codebase regarding the handling of quick fixes, particularly when a method contains multiple parameters. The existing quick fix functionality does not adequately resolve the diagnostic in such cases. Unlike many other quick fixes which fully address a diagnostic, this inconsistency needs attention.
This ticket is to Determine the anticipated outcome of quick fixes when there are multiple issues detected by diagnostics, such that one quick fix may not resolve all of them or could potentially introduce new ones.
Providing an example. Attaching some screenshots below (in lsp4ij component for intellij) for reference:
In the above file eventhough the quickfix - Remove the '@Disposes' modifier from parameter 'name1' is applied still the diagnostic present in not resolved.
Similarly, In Managed Bean class when applying the below quick fix - Replace current scope with @Dependent, it replaces the @RequestScoped annotation. But the error in line 7 still persists with diagnostic - The @Dependent annotation must be the only scope defined by a managed bean with a non-static public field
In PostConstructAnnotation class in jakartasample/src/main/java/io/openliberty/sample/jakarta/annotations/PostConstructAnnotation.java, when applying the quickfix - A method with the @PostConstruct annotation must be void., a new diagnostic is created.
After changing the return type to void a diagnostic emerges stating, "Cannot return a value from a method with a void result type."
Similarly in PreDestroyAnnotation class, applying the quickfix A method with the @PreDestroy annotation must not have any parameters. results in a new diagnostic - Cannot resolve symbol 'type'
The text was updated successfully, but these errors were encountered:
anusreelakshmi934
changed the title
Design Consideration for Quick Fixes Handling Methods with Multiple Parameters
Design Consideration for quick fixes with multiple parameters to ensure they fully resolve errors
Mar 1, 2024
Currently, there's an issue in our codebase regarding the handling of quick fixes, particularly when a method contains multiple parameters. The existing quick fix functionality does not adequately resolve the diagnostic in such cases. Unlike many other quick fixes which fully address a diagnostic, this inconsistency needs attention.
This ticket is to Determine the anticipated outcome of quick fixes when there are multiple issues detected by diagnostics, such that one quick fix may not resolve all of them or could potentially introduce new ones.
Providing an example. Attaching some screenshots below (in lsp4ij component for intellij) for reference:
In the above file eventhough the quickfix -
Remove the '@Disposes' modifier from parameter 'name1'
is applied still the diagnostic present in not resolved.Similarly, In Managed Bean class when applying the below quick fix -
Replace current scope with @Dependent
, it replaces the @RequestScoped annotation. But the error in line 7 still persists with diagnostic -The @Dependent annotation must be the only scope defined by a managed bean with a non-static public field
In
PostConstructAnnotation
class in jakartasample/src/main/java/io/openliberty/sample/jakarta/annotations/PostConstructAnnotation.java, when applying the quickfix -A method with the @PostConstruct annotation must be void.
, a new diagnostic is created.After changing the return type to void a diagnostic emerges stating,
"Cannot return a value from a method with a void result type."
Similarly in
PreDestroyAnnotation
class, applying the quickfixA method with the @PreDestroy annotation must not have any parameters.
results in a new diagnostic -Cannot resolve symbol 'type'
The text was updated successfully, but these errors were encountered: