File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
core/pva/src/main/java/org/epics/pva/client Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -101,19 +101,31 @@ private class SearchedChannel
101101 // to handle it
102102 }
103103
104- // Hash by channel name
104+ // Searches are identified by CID because we might have the
105+ // same channel name in different searches when we try to access
106+ // the same channel with different field(...) qualifiers.
107+ // One could try to optimize this by fetching "field()" (everything)
108+ // and then picking the subelements in the client,
109+ // but in case there's only a single PV for
110+ // pva://GigaBytePV/substruct/double_field
111+ // we'd want to use "field(substruct.double_field)"
112+ // and avoid fetching the complete structure.
113+ // ... unless there is later a PV "pva://GigaBytePV",
114+ // but we don't know, yet?
115+
116+ // Hash by CID
105117 @ Override
106118 public int hashCode ()
107119 {
108- return channel .getName (). hashCode ();
120+ return channel .getCID ();
109121 }
110122
111- // Compare by channel name
123+ // Compare by CID
112124 @ Override
113125 public boolean equals (Object obj )
114126 {
115127 if (obj instanceof SearchedChannel other )
116- return other .channel .getName (). equals ( channel .getName () );
128+ return other .channel .getCID () == channel .getCID ( );
117129 return false ;
118130 }
119131 }
You can’t perform that action at this time.
0 commit comments