| Summary: | DeclarationGenerator fails for some cases | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Tomasz Wesolowski <kosashi> | ||||||||
| Component: | cdt-refactoring | Assignee: | Emanuel Graf <emanuel> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Emanuel Graf <emanuel> | ||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | ||||||||||
| Version: | 7.0 | ||||||||||
| Target Milestone: | 7.0.1 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | 318785 | ||||||||||
| Bug Blocks: | 318874 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Tomasz Wesolowski
Created attachment 173362 [details] new declarator generation Success! Well, that's literally my 4th attempt on the generation logic - fortunately, this one seems to be both correct and shortest in terms of code so far :) Wasn't so pleasant to throw away my original code, but at least we have the sophisticated declarations generated correctly. The good thing is that after rewriting the code it was easy to add support for function pointers, including those returning function pointers. Works like a charm, finally. See bug 318785 for NPEs after applying the change. >
> See bug 318785 for NPEs after applying the change.
The cause for the NPE is the ArrayDeclarator, getName() returns null but according to the javaDoc for this method the method should return an empty name.
Created attachment 173580 [details]
fixed declaration generation
Here we go!
+ added an empty ASTName for every created declarator where there was a null ASTName before
and:
+ fixed PointerOperator order
+ added some support for pointer-to-members
Created attachment 173625 [details]
test case
Fixed in HEAD and 7.0 > 20100707 Thanks Tomasz *** cdt cvs genie on behalf of egraf *** Bug 318784: DeclarationGenerator fails for some cases <a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=318784>https://bugs.eclipse.org/bugs/show_bug.cgi?id=318784</a> [*] DeclarationGeneratorImpl.java 1.2 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java?root=Tools_Project&r1=1.1&r2=1.2 [*] ExtractLocalVariable.rts 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractLocalVariable.rts?root=Tools_Project&r1=1.5&r2=1.6 [*] ExtractLocalVariable.rts 1.3.6.2 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractLocalVariable.rts?root=Tools_Project&r1=1.3.6.1&r2=1.3.6.2 [*] DeclarationGeneratorImpl.java 1.1.2.3 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java?root=Tools_Project&r1=1.1.2.2&r2=1.1.2.3 |