Source:
<code>public AdElementListModel() { setRole(new ListModel()); setProfile(new ListModel()); setNamespace(new ListModel()); setSelectAll(new EntityModel()); getSelectAll().setEntity(false); getSelectAll().getEntityChangedEvent().addListener(this); setIsRoleListHiddenModel(new EntityModel()); getIsRoleListHiddenModel().setEntity(false); setIsEveryoneSelectionHidden(new EntityModel()); getIsEveryoneSelectionHidden().setEntity(false); setSearchInProgress(new EntityModel()); getSearchInProgress().setEntity(false); setIsTimerDisabled(true); AsyncDataProvider.getInstance().getAAAProfilesEntriesList(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { populateProfiles((List<ProfileEntry>) result); getProfile().getSelectedItemChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { if (namespacesMap != null) { populateNamespaces(namespacesMap.get(((ProfileEntry) getProfile().getSelectedItem()).getAuthz())); } } }); } })); AsyncDataProvider.getInstance().getAAANamespaces(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { if (getProfile().getSelectedItem() != null) { namespacesMap = (HashMap<String, List<String>>) result; List<String> selectedNamespaces = <START> namespacesMap.get(((ProfileEntry) (getProfile().getSelectedItem())).getAuthz()); <END> populateNamespaces(selectedNamespaces); } } })); AsyncDataProvider.getInstance().getRoleList(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { populateRoles((List<Role>) result); } })); }</code><technical_language>I meant 'namespacesMap.get(((ProfileEntry) (getProfile().getSelectedItem())).getAuthz()' is duplicated part of 'populateNamespaces(..)'</technical_language>

Target:
public AdElementListModel() { setRole(new ListModel()); setProfile(new ListModel()); setNamespace(new ListModel()); setSelectAll(new EntityModel()); getSelectAll().setEntity(false); getSelectAll().getEntityChangedEvent().addListener(this); setIsRoleListHiddenModel(new EntityModel()); getIsRoleListHiddenModel().setEntity(false); setIsEveryoneSelectionHidden(new EntityModel()); getIsEveryoneSelectionHidden().setEntity(false); setSearchInProgress(new EntityModel()); getSearchInProgress().setEntity(false); setIsTimerDisabled(true); AsyncDataProvider.getInstance().getAAAProfilesEntriesList(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { populateProfiles((List<ProfileEntry>) result); getProfile().getSelectedItemChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { populateNamespaces(); } }); } })); AsyncDataProvider.getInstance().getAAANamespaces(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { if (getProfile().getSelectedItem() != null) { namespacesMap = (HashMap<String, List<String>>) result; populateNamespaces(); } } })); AsyncDataProvider.getInstance().getRoleList(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { populateRoles((List<Role>) result); } })); }