[
https://issues.jboss.org/browse/GTNPORTAL-2707?page=com.atlassian.jira.pl...
]
Marek Posolda updated GTNPORTAL-2707:
-------------------------------------
Description:
Actually method getAllPortalNames() is called like 4 times (actually 2*countOfPortals
times) during rendering of UIUserToolbarSitePortlet. See code in
UIUserToolbarSitePortlet.gtmpl:
{code}
for(int i = 0; i < uicomponent.getAllPortalNames().size(); i++) {
String portalName = uicomponent.getAllPortalNames().get(i);
...
}
{code}
Actually this could mean problems like:
- Performance - There is overhead as method is unnecessarily called 4 (or more) times.
Actually the overhead shouldn't be too big as portal names are cached thanks to
PortalNamesCache class, but still it is.
- Consistency - For example if another client removes portal concurrently in the meantime,
we can potentially see consistency issues and problems like ArrayIndexOutOfBoundException
could happen
It should be improved to call getAllPortalNames only once:
{code}
List<String> allPortalNames = uicomponent.getAllPortalNames();
for(int i = 0; i < allPortalNames.size(); i++) {
String portalName = allPortalNames.get(i);
..
}
{code}
was:
Actually method getAllPortalNames() is called like 4 times (actually 2*countOfPortals
times) during rendering of UIUserToolbarSitePortlet. See code in
UIUserToolbarSitePortlet.gtmpl:
{code}
for(int i = 0; i < uicomponent.getAllPortalNames().size(); i++) {
String portalName = uicomponent.getAllPortalNames().get(i);
...
}
{code}
Actually this could mean problems like:
- Performance - There is overhead as method is unnecessarily called 4 (or more) times.
Actually the overhead shouldn't be too big as portal names thanks to PortalNamesCache
class, but still it is.
- Consistency - For example if another client removes portal concurrently in the meantime,
we can potentially see consistency issues and problems like ArrayIndexOutOfBoundException
could happen
It should be improved to call getAllPortalNames only once:
{code}
List<String> allPortalNames = uicomponent.getAllPortalNames();
for(int i = 0; i < allPortalNames.size(); i++) {
String portalName = allPortalNames.get(i);
..
}
{code}
Call getAllPortalNames() from UIUserToolbarSitePortlet only once
----------------------------------------------------------------
Key: GTNPORTAL-2707
URL:
https://issues.jboss.org/browse/GTNPORTAL-2707
Project: GateIn Portal
Issue Type: Enhancement
Security Level: Public(Everyone can see)
Components: Performance, WebUI
Affects Versions: 3.5.0.Beta01
Reporter: Marek Posolda
Assignee: Marek Posolda
Fix For: 3.5.0.Beta02
Actually method getAllPortalNames() is called like 4 times (actually 2*countOfPortals
times) during rendering of UIUserToolbarSitePortlet. See code in
UIUserToolbarSitePortlet.gtmpl:
{code}
for(int i = 0; i < uicomponent.getAllPortalNames().size(); i++) {
String portalName = uicomponent.getAllPortalNames().get(i);
...
}
{code}
Actually this could mean problems like:
- Performance - There is overhead as method is unnecessarily called 4 (or more) times.
Actually the overhead shouldn't be too big as portal names are cached thanks to
PortalNamesCache class, but still it is.
- Consistency - For example if another client removes portal concurrently in the
meantime, we can potentially see consistency issues and problems like
ArrayIndexOutOfBoundException could happen
It should be improved to call getAllPortalNames only once:
{code}
List<String> allPortalNames = uicomponent.getAllPortalNames();
for(int i = 0; i < allPortalNames.size(); i++) {
String portalName = allPortalNames.get(i);
..
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira