Affects Version/s: 7.0.X EE, Master
Component/s: Sites Administration > Sites
In the GroupLocalServiceImpl#doSearch method, there is a pointless conditional that is just wasting space and making the code harder to read.
This issue is not testable by QA
At the beginning of the GroupLocalServiceImpl#doSearch method, we have the following code:
Essentially, we're setting parentGroupIdEquals to false if parentGroupId is -1, and true otherwise. The parentGroupIdEquals variable never gets modified after this, nor does the parentGroupId variable, which is passed in as an argument, ever get modified.
Later on in the method, when filtering out groups by their parent group, we have the following code:
However, the second half of that OR statement is pointless. If parentGroupIdEquals is false, then we know from the bolded statement above that parentGroupId is -1. However, no group will ever have their parentGroupId set to -1. Therefore, the following condition will never be true:
Therefore, it should be removed from the source code to improve readability.