Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
0920f857
by Tony Chemit at 2020-12-07T15:50:43+01:00
-
4642347a
by Tony Chemit at 2020-12-07T21:55:02+01:00
3 changed files:
- client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSource.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/wizard/tabs/RolesTableModel.java
- toolkit/service/src/main/java/fr/ird/observe/spi/ServicesProvider.java
Changes:
| ... | ... | @@ -85,7 +85,6 @@ import javax.swing.Icon; |
| 85 | 85 |
import javax.swing.JOptionPane;
|
| 86 | 86 |
import javax.swing.event.EventListenerList;
|
| 87 | 87 |
import java.io.File;
|
| 88 |
-import java.io.IOException;
|
|
| 89 | 88 |
import java.nio.file.Files;
|
| 90 | 89 |
import java.nio.file.Path;
|
| 91 | 90 |
import java.util.Iterator;
|
| ... | ... | @@ -262,7 +261,7 @@ public class ObserveSwingDataSource extends ObserveServicesProviderSupport imple |
| 262 | 261 |
} finally {
|
| 263 | 262 |
try {
|
| 264 | 263 |
servicesProvider.close();
|
| 265 |
- } catch (IOException e) {
|
|
| 264 |
+ } catch (Exception e) {
|
|
| 266 | 265 |
log.error("Could not close properly services provider", e);
|
| 267 | 266 |
}
|
| 268 | 267 |
ObserveUtil.cleanMemory();
|
| ... | ... | @@ -285,7 +284,7 @@ public class ObserveSwingDataSource extends ObserveServicesProviderSupport imple |
| 285 | 284 |
ObserveUtil.cleanMemory();
|
| 286 | 285 |
try {
|
| 287 | 286 |
servicesProvider.close();
|
| 288 |
- } catch (IOException e) {
|
|
| 287 |
+ } catch (Exception e) {
|
|
| 289 | 288 |
log.error("Could not close properly services provider", e);
|
| 290 | 289 |
}
|
| 291 | 290 |
connection = null;
|
| ... | ... | @@ -77,11 +77,11 @@ public class RolesTableModel extends AbstractTableModel { |
| 77 | 77 |
Collections.sort(roles);
|
| 78 | 78 |
for (ObserveDbUserDto role : roles) {
|
| 79 | 79 |
String name = role.getName();
|
| 80 |
- if (name.endsWith("-referentiel") || name.endsWith("-referential")) {
|
|
| 80 |
+ if (name.equals("referentiel") || name.equals("referential") || name.endsWith("-referentiel") || name.endsWith("-referential")) {
|
|
| 81 | 81 |
role.setRole(ObserveDbRole.REFERENTIAL);
|
| 82 |
- } else if (name.endsWith("-technicien") || name.endsWith("-technical")) {
|
|
| 82 |
+ } else if (name.equals("technicien") || name.equals("technical") || name.endsWith("-technicien") || name.endsWith("-technical")) {
|
|
| 83 | 83 |
role.setRole(ObserveDbRole.TECHNICAL);
|
| 84 |
- } else if (name.endsWith("-utilisateur") || name.endsWith("-user")) {
|
|
| 84 |
+ } else if (name.equals("utilisateur") || name.equals("user") ||name.endsWith("-utilisateur") || name.endsWith("-user")) {
|
|
| 85 | 85 |
role.setRole(ObserveDbRole.USER);
|
| 86 | 86 |
}
|
| 87 | 87 |
}
|
| ... | ... | @@ -35,4 +35,8 @@ import java.io.Closeable; |
| 35 | 35 |
public interface ServicesProvider extends Closeable {
|
| 36 | 36 |
|
| 37 | 37 |
<S extends ObserveService> S getService(Class<S> serviceType);
|
| 38 |
+ |
|
| 39 |
+ default void close() {
|
|
| 40 |
+ // do nothing
|
|
| 41 |
+ }
|
|
| 38 | 42 |
}
|