Summary: | IllegalArgumentException in refactor-extract method | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Peter Burka <peter_burka> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | akiezun |
Version: | 2.0 | ||
Target Milestone: | 2.0 F3 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Peter Burka
2002-06-10 17:28:45 EDT
i think the problem is on our (refactoring) side this class is so messed up that cu.isStructureKnown() returns false we should guard our code against it more actions fail: OrganizeImport SurroundWithTryCatch Rename (when you select sth in the file) SelfEncapsulateField (add a field, select and invoke the action) i suggest moving to the ui land and putting guards in the ui actions I don't agree with this. As we can see from the walkback there is an old AST which somehow can't be converted into a new AST. Even if the CU is totally broken creating an AST for it should not result in an IllegalArgumentException. What I would expect to get is an AST containing only a CompilationUnitNode. Pls investigate - internal calls should never result in invalid argument exceptions. I cannot reproduce in latest. This seems to be a duplicate of bug 18708. I got the following cu after applying refact -> extract method on the selected line: public class Foo { protected void primExecute() { test(); } private String test() { return this.toString(); } if (image != null) { Object loc = null; } } |