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.
Globally renaming a variable works well - except for assertion. See this example: /** * set name * @param string $name */ public function setName($name) { assert('is_string($name);'); $this->name = $name; } Renaming variable $name renames every occurrence except for the variable reference inside the assertion. This causes all assertions to fail, which use this name.
Single quoted strings - variables and escape sequences for special characters will not be expanded && netbeans code doesn't care about its content workaround: assert(is_string($name));
This workaround is _not_ an option. There is a reason for these quotes in assertions. It is part of the language specification. leaving off the quotes will: 1) drop the assertion message and render it totally useless, because you are unable to determine the reason for a failed assertion 2) prevent live applications in a production-environment from being able to turn off assertions, resulting in (possibly extreme) performance issues Assertions are an important part of the design-by-contract programming paradigm and cannot be avoided. You will find such checks in _all_ functions for just about _every_ var which is ever defined. Assertion mark pre-condition, invariant conditions, post-condition and even the begin-of-life point for any defined variable, like this: assert('!isset($foo); // Cannot redeclare var $foo'); $foo = null; Actually you will experience that several functions have more assertions than lines of code. As an example: I got 1800 assertions in 100 files. I suggest to re-open this issue.
We will try to look at it but this issue has no easy solution.
I do understand that this is complicated. Perhaps it might help to look at it that way: assert('!isset($foo); // Cannot redeclare var $foo'); assert('<expression1>; <expression2>'); is just the same as the Java-style code: assert !isset($foo) : Cannot redeclare var $foo; assert <expression1> : <expression2>; (Note that this is not valid PHP-code) Most (if not all) annotations will be very straight-forward, easy expressions and composed in that way. Be careful with double-quotes though. Assertions using expressions in double-quotes are rarely seen, uncommon, more complex situations. I believe it would be okay to ignore these.
As a side-note: I believe that this should be low priority. If find out that this is too complicated for now, you may want to reduce the priority and just keep it for some future release. I've added another issue 170255 which is related to this one. You may decide to reduce the priority of both and fix them some time later.
batch reassigning
Still not fixed in NB7.1.
Reproductible in 8.2rc / Dev 201609210002