Source:
private void loadChannelData() { this.channelDataProvider.getList().clear(); this.channelDataProvider.setList(GwtWifiChannelModel.getChannels()); this.gwtXSRFService.generateSecurityToken(new AsyncCallback<GwtXSRFToken>() { @Override public void onFailure(Throwable ex) { FailureHandler.handle(ex); } @Override public void onSuccess(GwtXSRFToken token) { TabWirelessUi.this.gwtDeviceService.findDeviceConfiguration(token, new AsyncCallback<ArrayList<GwtGroupedNVPair>>() { @Override public void onFailure(Throwable caught) { TabWirelessUi.this.channelGrid.setVisible(false); FailureHandler.handle(caught); } @Override public void onSuccess(ArrayList<GwtGroupedNVPair> result) { if (result != null) { TabWirelessUi.this.channelGrid.setVisible(true); for (GwtGroupedNVPair pair : result) { String name = pair.getName(); if (name != null && name.equals("devLastWifiChannel")) { int topChannel = Integer.parseInt(pair.getValue()); if (topChannel < MAX_WIFI_CHANNEL) { try { TabWirelessUi.this.channelDataProvider.getList() .remove(MAX_WIFI_CHANNEL - 1); TabWirelessUi.this.channelDataProvider.getList() .remove(MAX_WIFI_CHANNEL - 2); } catch (UnsupportedOperationException e) { logger.info(e.getLocalizedMessage()); } catch (IndexOutOfBoundsException e) { logger.info(e.getLocalizedMessage()); } } } } TabWirelessUi.this.channelDataProvider.flush(); } } }); } }); this.noChannelsText.setText(MSGS.netWifiAlertNoChannels()); if (!this.channelDataProvider.getList().isEmpty()) { this.noChannels.setVisible(false); this.channelGrid.setVisible(true); } else { this.channelGrid.setVisible(false); this.noChannels.setVisible(true); } }

Target:
private void loadChannelData() { this.channelDataProvider.getList().clear(); this.channelDataProvider.setList(GwtWifiChannelModel.getChannels()); this.gwtXSRFService.generateSecurityToken(new AsyncCallback<GwtXSRFToken>() { @Override public void onFailure(Throwable ex) { FailureHandler.handle(ex); } @Override public void onSuccess(GwtXSRFToken token) { TabWirelessUi.this.gwtDeviceService.findDeviceConfiguration(token, new AsyncCallback<ArrayList<GwtGroupedNVPair>>() { @Override public void onFailure(Throwable caught) { TabWirelessUi.this.channelGrid.setVisible(false); FailureHandler.handle(caught); } @Override public void onSuccess(ArrayList<GwtGroupedNVPair> result) { if (result != null) { TabWirelessUi.this.channelGrid.setVisible(true); for (GwtGroupedNVPair pair : result) { String name = pair.getName(); if (name != null && name.equals("devLastWifiChannel")) { int topChannel = Integer.parseInt(pair.getValue()); if (topChannel < MAX_WIFI_CHANNEL) { try { TabWirelessUi.this.channelDataProvider.getList() .remove(MAX_WIFI_CHANNEL - 1); TabWirelessUi.this.channelDataProvider.getList() .remove(MAX_WIFI_CHANNEL - 2); } catch (UnsupportedOperationException | IndexOutOfBoundsException e) { logger.info(e.getLocalizedMessage()); } } } } TabWirelessUi.this.channelDataProvider.flush(); } } }); } }); this.noChannelsText.setText(MSGS.netWifiAlertNoChannels()); if (!this.channelDataProvider.getList().isEmpty()) { this.noChannels.setVisible(false); this.channelGrid.setVisible(true); } else { this.channelGrid.setVisible(false); this.noChannels.setVisible(true); } }