Source:
<code>private void updateConfig() { int n = 0; ArrayList<VdcActionType> actionTypes = new ArrayList<VdcActionType>(); ArrayList<VdcActionParametersBase> parameters = new ArrayList<VdcActionParametersBase>(); IFrontendActionAsyncCallback[] callbacks; final GlusterVolumeGeoReplicationSessionConfigModel geoRepConfigModel = (GlusterVolumeGeoReplicationSessionConfigModel) getWindow(); LinkedHashMap<String, String> oldConfigs = geoRepConfigModel.getConfigs(); geoRepConfigModel.startProgress(null); for (EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> newConfigEntity : geoRepConfigModel.getConfigsModel() .getItems()) { Pair<Boolean, GlusterGeoRepSessionConfiguration> newConfigPair = newConfigEntity.getEntity(); GlusterGeoRepSessionConfiguration newConfig = newConfigPair.getSecond(); if (newConfigPair.getFirst()) { actionTypes.add(VdcActionType.ResetDefaultGeoRepConfig); parameters.add(geoRepConfigModel.formGeoRepConfigParameters(newConfig)); } else if (!newConfig.getValue().equals(oldConfigs.get(newConfig.getKey()))) { actionTypes.add(VdcActionType.SetGeoRepConfig); parameters.add(geoRepConfigModel.formGeoRepConfigParameters(newConfig)); } } <START> n = parameters.size(); <END> callbacks = new IFrontendActionAsyncCallback[n]; callbacks[n - 1] = new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { geoRepConfigModel.stopProgress(); closeWindow(); } }; Frontend.getInstance().runMultipleActions(actionTypes, parameters, Arrays.asList(callbacks), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { fetchConfigForSession(geoRepConfigModel.getGeoRepSession()); } }, this); }</code><technical_language>need variable n here. Simply paremters.size() used. If u want this in a variable give a proper name it</technical_language>

Target:
private void updateConfig() { ArrayList<VdcActionType> actionTypes = new ArrayList<VdcActionType>(); ArrayList<VdcActionParametersBase> parameters = new ArrayList<VdcActionParametersBase>(); IFrontendActionAsyncCallback[] callbacks; final GlusterVolumeGeoReplicationSessionConfigModel geoRepConfigModel = (GlusterVolumeGeoReplicationSessionConfigModel) getWindow(); LinkedHashMap<String, String> oldConfigs = geoRepConfigModel.getConfigs(); geoRepConfigModel.startProgress(null); for (EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> newConfigEntity : geoRepConfigModel.getConfigsModel() .getItems()) { Pair<Boolean, GlusterGeoRepSessionConfiguration> newConfigPair = newConfigEntity.getEntity(); GlusterGeoRepSessionConfiguration newConfig = newConfigPair.getSecond(); if (newConfigPair.getFirst()) { actionTypes.add(VdcActionType.ResetDefaultGeoRepConfig); parameters.add(geoRepConfigModel.formGeoRepConfigParameters(newConfig)); } else if (!newConfig.getValue().equals(oldConfigs.get(newConfig.getKey()))) { actionTypes.add(VdcActionType.SetGeoRepConfig); parameters.add(geoRepConfigModel.formGeoRepConfigParameters(newConfig)); } } int numberOfConfigUpdates = parameters.size(); callbacks = new IFrontendActionAsyncCallback[numberOfConfigUpdates]; callbacks[numberOfConfigUpdates - 1] = new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { geoRepConfigModel.stopProgress(); closeWindow(); } }; Frontend.getInstance().runMultipleActions(actionTypes, parameters, Arrays.asList(callbacks), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { fetchConfigForSession(geoRepConfigModel.getGeoRepSession()); } }, this); }