Details
-
Suggestion
-
Resolution: Obsolete
-
None
Description
There is a dependency of the group select box on the radio button. The value of the group select box should be only taken into an account if the radio button for the group is selected. This is currently done in ShareFilter.doExecute() method
if (options[0].equals(getOption())) getSearchRequest().setUser(getSearchRequest().getAuthor().getName()); else getSearchRequest().setUser(null); if (!options[2].equals(getOption())) setGroup(null); getSearchRequest().setGroup(getGroup());
Notice that setGroup on searchRequest is always called. The getGroup() method returns the group which may be nullified on the previous line via setGroup(null). The code is a bit misleading. It need better formatting (use braces around if-else bodies).
The second problem may not be obvious and is debatable. Either explain why is setGroup(null) called - to clear the value if other than 'group' radio button is selected or do not set the group on ShareFilter, rather make setting the group on the search request conditional. For the later verify that if somebody called getGroup(), their behaviour will not be affected by this change.