| Summary: | [1.7][quick fix] Quick fixes for new warnings/errors corresponding to @SafeVarargs annotation | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Deepak Azad <deepakazad> | ||||||||||||||
| Component: | UI | Assignee: | Deepak Azad <deepakazad> | ||||||||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||||||||
| Severity: | enhancement | ||||||||||||||||
| Priority: | P3 | CC: | deepakazad, jarthana, markus.kell.r | ||||||||||||||
| Version: | 3.7 | ||||||||||||||||
| Target Milestone: | 3.7.1 | ||||||||||||||||
| Hardware: | All | ||||||||||||||||
| OS: | All | ||||||||||||||||
| Whiteboard: | |||||||||||||||||
| Attachments: |
|
||||||||||||||||
Created attachment 196985 [details]
rtstubs17.jar - zipped and compressed
> Not sure if a quick fix should modify another file (when it is invoked
> from the editor). If yes, should the other file be opened in an editor ?
Yes, it should open and modify the other file. See other quick fixes that do the same and reuse their implementation (try with e.g. a wrong field type or method return type, modifiers, etc.).
Created attachment 197232 [details] fix + tests (In reply to comment #2) > Yes, it should open and modify the other file. See other quick fixes that do > the same and reuse their implementation (try with e.g. a wrong field type or > method return type, modifiers, etc.). Thanks! 'Add @SafeVarargs to method declaration' quick assist now works even when the declaration is in a different file. Markus, if you are ok with the following changes I will release the patch. > Changes to test with 1.7 compliance level > - Use rtstubs17.jar in ProjectTestSetup. (ProjectTestSetup still sets the > compiler compliance level as 1.5) > - Add helper methods in JavaProjectHelper to set compiler compliance level to > 1.7. (These helper methods are then used from individual tests which need 1.7 > compiler compliance) The content of attachment 196985 [details] has been deleted by Eclipse Webmaster <webmaster@eclipse.org> who provided the following reason: Request to Webmaster. The token used to delete this attachment was generated at 2011-06-07 09:05:23 EDT. Created attachment 197663 [details]
final fix + tests
Fixed in BETA_JAVA7 Created attachment 198124 [details]
additional fixes
- added null checks to resolved bindings and calls to ASTResolving.find(..)
- changed quick fix name to "Add @SafeVarargs to ''{0}(..)''". We always mention the other method when the quick fix changes remote methods.
Released to BETA_JAVA7.
Created attachment 198157 [details] Additional tests (In reply to comment #7) > - added null checks to resolved bindings and calls to ASTResolving.find(..) > - changed quick fix name to "Add @SafeVarargs to ''{0}(..)''". We always > mention the other method when the quick fix changes remote methods. Thanks Markus! I have updated the tests for the change in the quick fix label and also added a couple of new tests. Released to BETA_JAVA7. Verified |
Created attachment 196983 [details] fix + tests The patch includes the following 3 quick fixes and tests - Add @SafeVarargs - Add @SafeVarargs to method declaration - Remove @Safevargs Currently the second quick fix only works when the declaration is in the same file. Not sure if a quick fix should modify another file (when it is invoked from the editor). If yes, should the other file be opened in an editor ? Changes to test with 1.7 compliance level - Use rtstubs17.jar in ProjectTestSetup. (ProjectTestSetup still sets the compiler compliance level as 1.5) - Add helper methods in JavaProjectHelper to set compiler compliance level to 1.7. (These helper methods are then used from individual tests which need 1.7 compiler compliance)