Summary: | CompilationUnit.rewrite messes up .class-literal in annotation instead of changing class to interface | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Fabian Stolz <fabian.stolz> | ||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | jarthana, Olivier_Thomann | ||||
Version: | 3.5 | ||||||
Target Milestone: | 3.6 M7 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Fabian Stolz
2010-04-11 11:32:23 EDT
This is bad. I am investigating. Created attachment 164574 [details]
Proposed fix + regression tests
Released for 3.6M7. Added tests in: org.eclipse.jdt.core.tests.rewrite.describing.ASTRewritingTypeDeclTest#testTypeDeclarationChange org.eclipse.jdt.core.tests.rewrite.describing.ASTRewritingTypeDeclTest#testTypeDeclarationChange2 org.eclipse.jdt.core.tests.rewrite.modifying.ASTRewritingModifyingOtherTest#test0005 org.eclipse.jdt.core.tests.rewrite.modifying.ASTRewritingModifyingOtherTest#test0006 (In reply to comment #0) > 2. Parse the code: > ASTParser parser = ASTParser.newParser(AST.JLS3); > parser.setKind(ASTParser.K_COMPILATION_UNIT); > parser.setResolveBindings(true); > parser.setSource(input); > parser.setProject(input.getJavaProject()); > CompilationUnit parsed = (CompilationUnit)parser.createAST(new > NullProgressMonitor()); Note that org.eclipse.jdt.core.dom.ASTParser.setSource(ICompilationUnit) also sets the project. So setProject(..) call is not necessary. Let me know if you find any issue with the next I-build. (In reply to comment #4) > Let me know if you find any issue with the next I-build. Wow, that was fast. Thank you very much. I'll try out the latest build asap. (In reply to comment #5) > Wow, that was fast. Thank you very much. I'll try out the latest build asap. When the bug is well explained and the steps to reproduce are clear, it helps to get it fixed. Verified for 3.6M7 by code inspection and unit tests. |