Commit 526b777c26a4e4e41016f91314c98ed77fa65209

Authored by Nathanael Jourdane
1 parent b9fc63f5
Exists in master

bugFix: NPE when selecting several services.

src/main/java/eu/omp/irap/vespa/epntapclient/gui/servicespanel/ServicesPanelCtrl.java
... ... @@ -42,6 +42,9 @@ public class ServicesPanelCtrl extends VOTableController implements ServicesPane
42 42 /** The position of the column displaying the services target URLs in the service table. */
43 43 private static final int SERVICE_URL_COLUMN_POSITION = 1;
44 44  
  45 + /** The separator used between each services in the custom service text fields. */
  46 + private static final String CUSTOM_SERVICES_SEPARATOR = ";";
  47 +
45 48 /** The view of the services panel. */
46 49 private ServicesPanelView view;
47 50  
... ... @@ -68,6 +71,8 @@ public class ServicesPanelCtrl extends VOTableController implements ServicesPane
68 71 */
69 72 public ServicesPanelCtrl(MainPanelListener listener) {
70 73 this.listener = listener;
  74 + customTablesNames = new ArrayList<>();
  75 + customServicesUrls = new ArrayList<>();
71 76 targetURL = Consts.DEFAULT_REGISTRY_URL;
72 77 query = String.format(Queries.SELECT_ALL_TAP_SERVICES_WHERE_CORE, ServiceCore.EPNCORE);
73 78 view = new ServicesPanelView(this);
... ... @@ -135,8 +140,8 @@ public class ServicesPanelCtrl extends VOTableController implements ServicesPane
135 140 List<String> servicesUrls = new ArrayList<>();
136 141 List<String> tableNames = new ArrayList<>();
137 142  
138   - servicesUrls.addAll(Arrays.asList(customServiceUrl.split(";")));
139   - tableNames.addAll(Arrays.asList(customTableName.split(";")));
  143 + servicesUrls.addAll(Arrays.asList(customServiceUrl.split(CUSTOM_SERVICES_SEPARATOR)));
  144 + tableNames.addAll(Arrays.asList(customTableName.split(CUSTOM_SERVICES_SEPARATOR)));
140 145  
141 146 if (servicesUrls.size() == tableNames.size()) {
142 147 // TODO: regex to check valid url / table name
... ...