| Summary: | [refactoring] Extract method throws NPE if declared lifting arg is involved | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||
| Component: | OTDT | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | 0.8 | ||||||
| Target Milestone: | 0.8 M4 | ||||||
| Hardware: | Other | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Stephan Herrmann
Created attachment 183094 [details]
test & fix
Several locations didn't respect the fact that an argument with declared
lifting is mapped to two variables internally (arg + local), because the
lifting local variable declaration is marked as generated and thus not
converted to DOM AST.
Resolved by the following steps:
+ DefaultBindingResolver registers both variables, creating a faked
SingleVariableDeclaration for the hidden local, yet binding this to
the existing compiler binding.
+ LocalVariableIndex respects lifting args with the help of
+ new role DOMAdaptor.LocalVariableIndex
+ new method VariableBinding.getVariableIdMax()
+ JDT/UI's ASTFlattener is adapted for flattening declared lifting
Note, that the problem in LocalVariableIndex was easily masked if the
method declares real local variables with higher IDs than the lifting arg.
Committed as r1029 ff. Verified for M4 using build 201011141250. |