This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | [6.9.1-7.4] Refactor/Find Usages in case statements + | ||
---|---|---|---|
Product: | ruby | Reporter: | AltairPL |
Component: | Refactoring | Assignee: | issues@ruby <issues> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.4 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
AltairPL
2014-02-24 01:05:01 UTC
Ah no this is reproduction is great and it probably won't be super difficult to fix. At least it looks like some problem where we must be appending the new name for every occurrence found. found two very similar issues - probably the same as 'case' one, hence no new issue: looking for $game_switches: @common_events[id] = ($game_switches[common_event.switch_id] ? Interpreter.new : nil) if common_event.trigger == 2 # found twice - same for normal if statements and if modifier - don't know if always or only in certain conditions $game_switches[switch_id] = !$game_switches[switch_id] # left side found once, right side found twice Fixed in last round of fixed for NB 8 support. This actually had two issues. The first was any variables with a sigil were ignoring the sigil (@foo was ignoring @) but during replace was replacing the regiion with the sigil. The second issue was the Ruby AST tree will have multiple copies of the same node in various cases like when statements (which is odd in its own right but it is what it is). The refactoring code would perform this replacement one per each time it found the occurrence. Each when would end up duplicating part of the case/when structure so each when would find the same variable n-when times. This was addresses by sorting the occurrences and removing duplicates. I strongly suspect older NB APIs did this for us and then removed that ability. |