Community
Participate
Working Groups
I20080122-1600, probably been like this for a long time FieldReferenceMatch and LocalVariableReferenceMatch confuse isReadAccess() and isWriteAccess() for qualifier of field access expressions on the leftHandSide of an assignment expression. public class Try { int fField; void m() { Try t; // refs to t t = new Try(); t.fField = 42; // match for t is writeAccess, should be readAccess } } class Wrapper { Try fWrapped; // refs to fWrapped void wrapper() { fWrapped.fField = 12; // match for fWrapped is writeAccess } }
In fact it seems that the 't' and 'fWrapped' are neither readAccess nor writeAccess. Searching for write access on t gives only one match on line 't = new Try();' (correct); but searching for read access does not give any match (wrong). Searching for 'fWrapped' write access does not give any match (correct), but searching for read access also does not give any match (wrong). I'll investigate...
(In reply to comment #1) It also depends on how you perform the search. If I use Search > Write Access > Workspace, I can confirm the findings from comment 1. However, when I search for all references to 't' or 'fWrapped' and then use the Read and Write filters in the search result view, I see that reference search find all references, but categorizes them wrongly (see //comments in comment 0)
Created attachment 88312 [details] Proposed patch
Released for 3.4M5 in HEAD stream.
Verified for 34M5 using I20080204-0010 build.