| Summary: | [quick fix] Quick fix can be improved in 1.4/1.5 mixed projects | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Ayushman Jain <amj87.iitr> | ||||||
| Component: | UI | Assignee: | Markus Keller <markus.kell.r> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | deepakazad, markus.kell.r | ||||||
| Version: | 3.7 | ||||||||
| Target Milestone: | 3.7 M5 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Ping. Unfortunately, Created attachment 185132 [details] Fix > Unfortunately, I first wanted to say that we don't have the infrastructure to fix this correctly, but then I found we actually do have it. With this patch, the quick fix offers to change the return type to Object. BTW: I also tried to reproduce the problem with new ArrayList() { public void toArray(Object[] a) { } }; , but there it already worked. The reason for that is an inconsistency in the DOM bindings: - In the ArrayList case, the raw type ArrayList has a declared method "Object[] toArray(Object[])" whose getMethodDeclaration() returns the version with a type parameter. - In the ConsoleSession case, the superclass ConsoleSession is not parameterized and its declared methods only exist in one version, and that version contains the type parameter. But I wouldn't touch that area right now, unless we need to straighten this for other reasons. Fixed in HEAD (the patch also fixes a few other related problems in the quick fix and in the override/implement methods logic). |
Created attachment 184711 [details] attached projects In the attached projects, there's an error in OSGIConsole.java about incorrect return type. "client" uses 1.4 compliance and "api", 1.5 compliance. The quick fix suggested is "change return type to T". Exercising this quick fix immediately causes an error because the current project is in 1.4 compliance. Perhaps, quick fix should not offer suggestions not relevant to a 1.4 project. The suggestion can be changed to "change return type to T and change compliance to 1.5" or removed altogether.