[ https://issues.apache.org/jira/browse/OFBIZ-10637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16673122#comment-16673122 ]
Mathieu Lirzin edited comment on OFBIZ-10637 at 11/2/18 1:54 PM: ----------------------------------------------------------------- Hello Jacques, As shown by the following snippet, the implementation of getAppBarWebInfos is becoming very clumsy: {code:java} if (serverName.equals(wInfo.server) && wInfo.getAppBarDisplay()) { if (UtilValidate.isNotEmpty(menuName)) { if (menuName.equals(wInfo.menuName)) { tm.put(key, wInfo); } } else { tm.put(key, wInfo); } } if (!wInfo.getAppBarDisplay() && UtilValidate.isEmpty(menuName)) { tm.put(key, wInfo); } {code} In parallel of this fix I have worked on OFBIZ-10606 which refactors this method and provides some unit tests. I would appreciate if you could complement the javadoc comment I wrote by describing the expected behavior (and the corner cases). Additionnally given the complexity of the logic used to filter webapp infos, it would be nice to have a non-regession test ensuring that nobody accidentally broke this logic in the future. was (Author: mthl): Hello Jacques, {code:java} if (serverName.equals(wInfo.server) && wInfo.getAppBarDisplay()) { if (UtilValidate.isNotEmpty(menuName)) { if (menuName.equals(wInfo.menuName)) { tm.put(key, wInfo); } } else { tm.put(key, wInfo); } } if (!wInfo.getAppBarDisplay() && UtilValidate.isEmpty(menuName)) { tm.put(key, wInfo); } {code} the implementation of {{getAppBarWebInfos}} is becoming very clumsy. In parallel of this fix I have worked on OFBIZ-10606 which refactors this method and provides some unit tests. I would appreciate if you could complement the javadoc comment I wrote by describing the expected behavior (and the corner cases). Additionnally given the complexity of the logic used to filter webapp infos, it would be nice to have a non-regession test ensuring that nobody accidentally broke this logic in the future. > ComponentConfig::getAppBarWebInfos creates infos only for components without > <<app-bar-display="false">> > -------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-10637 > URL: https://issues.apache.org/jira/browse/OFBIZ-10637 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: Trunk, Release Branch 16.11, Release Branch 17.12 > Reporter: Jacques Le Roux > Assignee: Jacques Le Roux > Priority: Major > Fix For: 17.12.01, 16.11.06 > > > While working on OFBIZ-10635 I noticed that > ComponentConfig::getAppBarWebInfos creates infos only for components whithout > <<app-bar-display="false">>. It makes no sense since if the menuName var is > empty the infos are returned. -- This message was sent by Atlassian JIRA (v7.6.3#76005)