| Summary: | Extract Constant throws an exception extracting a string constant | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Farnaz Behrang <behrang.farnaz> |
| Component: | cdt-refactoring | Assignee: | Project Inbox <cdt-refactoring-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | Sergey Prigogin <eclipse.sprigogin> |
| Severity: | minor | ||
| Priority: | P3 | CC: | cdtdoug, com-eclipse-dot-org, malaperle |
| Version: | 8.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 407506 *** |
In the following program... ========== void f(char *msg1, char *name) {} typedef struct { char *name; /* */ } file; #define a void foo(file* in) { f("a", in->name); //select "a" } int main(){ file* in; foo(in); return 0; } ========== If you select "a" (on line 12), and invoke the Extract Constant refactoring, program throws the following exception: Caused by: java.lang.NullPointerException at org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.ASTCommenter$PreprocessorRangeChecker.isCommentOnSameLine(ASTCommenter.java:86) at org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.ASTCommenter$PreprocessorRangeChecker.checkOffsets(ASTCommenter.java:70) at org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.ASTCommenter$PreprocessorRangeChecker.visit(ASTCommenter.java:141) . . .