Community
Participate
Working Groups
Build Identifier: 20110615-0604 Selecting an occurrence of a local variable or parameter of an anonymous function can cause occurrences of variables or parameters with the same name in _other_ anonymous functions to be highlighted as well. It appears that the functions need to declare variables in similar orders and/or have similar signatures in order for the problem to manifest itself. This may be related to bug 351473. Reproducible: Always Steps to Reproduce: 1. Create the following functions: var foo = function() { var it = 17; return it; }; var bar = function() { var it = 18; return it; }; var baz = function(it) { return it; }; var boo = function(it) { return it; }; 2. Click on an occurrence of 'it' in function 'foo'. Occurrences of 'it' in 'bar' (but not 'baz' or 'boo' are also highlighted. Clicking on an occurrence of 'it' in 'baz' will highlight the occurrence in 'boo' but those in 'foo' or 'bar.
Created attachment 214651 [details] Bugfix 358026 VariableBinding.isEqualTo() method cannot distinguish two variable bindings with same <modifier,name,type,id(declaration order in a method)> declared in two different function expressions with same <selector,returnType,declaringClass,parameters>. This is the cause of this bug. I think that current implementation has no actual way to check equality of two method bindings of this case. MethodBindings don't have something like unique id or link to declaration. This patch resolves binding equality problem for LocalVariableBindings by comparing declaration ASTNodes of local variable bindings so that at least the equality of local variable bindings are correctly checked.
Created attachment 214652 [details] testcases for this bug This zip file includes testcases for Mark Occurrences similar to Content Assist.
(In reply to comment #1) > Created attachment 214651 [details] Unless you actually want to cede the copyright to IBM, you probably want to correct it to that of your employer (the key thing is to keep it EPL).
Created attachment 214785 [details] Bugfix 358026 The company name in license boilerplate text is replaced as Nitin said. Thanks.
The problem in question seems to have been fixed indirectly by another patch because this is currently working in WTP 3.5.1 without applying the patch. Though, I think it would be good to pull in the test cases contributed by Wooyoung.