Bug 181394 - filter for connection A shows data from connection B
Summary: filter for connection A shows data from connection B
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P1 critical (vote)
Target Milestone: 2.0   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: contributed, greatbug
Depends on:
Blocks:
 
Reported: 2007-04-06 07:11 EDT by Tobias Schwarz CLA
Modified: 2011-05-25 10:04 EDT (History)
5 users (show)

See Also:


Attachments
Patch to fix non-unique absolute name of filter and filter pool references (4.31 KB, patch)
2007-04-06 08:16 EDT, Tobias Schwarz CLA
mober.at+eclipse: iplog+
Details | Diff
Update patch fixing Copyright, Typo and deprecated access (7.48 KB, patch)
2007-04-06 08:44 EDT, Martin Oberhuber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Schwarz CLA 2007-04-06 07:11:43 EDT
Build ID: eclipse 3.3m6, rse2.0m6(candidate)

Steps To Reproduce:
1. make 2 ssh connections
2. connect both
3. generate system filter for e.g. the /tmp directory
4. open both filter references
5. refresh the filter references

-> both filter shows up the same information, so can either see information from connection A under the filter for connection B or vice versa.


More information:
the problem is the getAbsoluteName() method in the filter reference adapter (and also the filter pool reference adapter). the absolute name is generated using the filter and filter pool manager name, so both filters have the same absolute name.
but the system view uses the absolute name to determine if two elements are equal - so the system view thinks, that both filter references (!) are equal - only the filter is the same, not the reference!!) and so the data element of the tree item is replaced.

getAbsoluteName() should always return the parents absolute name + the current elements name, so the absolute name is always unique.

i will attach a fix for this today.
Comment 1 Martin Oberhuber CLA 2007-04-06 07:47:43 EDT
FYI the problem is DaveM's change to use the SWT Tree's elementMap hash lookup. It's supposed to bring us closer to standard implementations and improve performance where we've been using hand-written recursive lookups before. This was a major change to the SystemView.

This changed was checked in last week and not sufficiently tested. The SystemView is more sensitive to correct absolute names now, since these are used for the hash lookup in the SWT elementMap. Tobias' fix will be generating proper return of getAbsoluteName() for filterReferences and filterPoolReferences.
Comment 2 Tobias Schwarz CLA 2007-04-06 08:16:35 EDT
Created attachment 63169 [details]
Patch to fix non-unique absolute name of filter and filter pool references

filter pool reference: the absolute name now starts with the parents absolute name (subsystem), the filter pool managers name and the pool name

filter reference: the absolute name starts with the filter pool references absolute name (see above) and the filters (reference) name

Legal Message:
   I, Tobias Schwarz, declare that I developed attached code from scratch,  without referencing any 3rd party materials except material licensed under the EPL. {I am authorized by my employer to make this contribution under the EPL.}
Comment 3 Martin Oberhuber CLA 2007-04-06 08:42:57 EDT
Thanks for the patch. Just to be sure, this looks weird in SystemViewFilterReferenceAdapter line 193:

String parentAbsoluteName = (adapter != null) ?	parentAbsoluteName = adapter.getAbsoluteName(filterPoolReference) : ""

I think it should be 

String parentAbsoluteName = (adapter != null) ? adapter.getAbsoluteName(filterPoolReference): ""


Comment 4 Martin Oberhuber CLA 2007-04-06 08:44:32 EDT
Created attachment 63170 [details]
Update patch fixing Copyright, Typo and deprecated access

Attached updated patch fixes the issue mentioned, and also the copyright header, a typo (sysSytsem), and deprecated method access.

Please review the patch if this is what you meant.
Comment 5 Martin Oberhuber CLA 2007-04-06 08:45:48 EDT
I think this qualifies for a great bug: problem detected, analyzed and patch provided within very few hours, at a critical point in time towards the TM 2.0 M6 milestone release.
Comment 6 Martin Oberhuber CLA 2007-04-06 09:38:29 EDT
Patch released. Thanks!
Please verify with I20070406-0930.
Comment 7 Kushal Munir CLA 2007-04-06 11:17:57 EDT
A great bug fix indeed. Looks good to me.
Comment 8 Martin Oberhuber CLA 2008-08-13 13:17:23 EDT
[target cleanup] 2.0 M6 was the original target milestone for this bug
Comment 9 Martin Oberhuber CLA 2011-05-25 10:04:04 EDT
Comment on attachment 63169 [details]
Patch to fix non-unique absolute name of filter and filter pool references

Patch ended up being used