diff --git a/.travis.yml b/.travis.yml
index 6657b5bbe..c8305393f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,17 +1,22 @@
+dist: xenial
language: java
jdk:
- - oraclejdk8
+ - openjdk8
- openjdk11
+ - openjdk-ea
+
+matrix:
+ allow_failures:
+ - jdk: openjdk-ea
env:
global:
- - DEPLOY_JDK=oraclejdk8
+ - DEPLOY_JDK=openjdk8
- DEPLOY_REPO=jdemetra/jdemetra-app
- - DEPLOY_BIN=nbdemetra-app/target/jdemetra-*-bin.zip
+ - DEPLOY_BIN=nbdemetra-app/target/binaries/*
-before_install:
- - "export DISPLAY=:99.0"
- - "sh -e /etc/init.d/xvfb start"
+services:
+ - xvfb
deploy:
# Maven snapshots from develop branch
diff --git a/README.md b/README.md
index 13b673e66..b7db7368b 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
# Econometric software for seasonal adjustment and other time series methods (JDemetra+)
[![Download](https://img.shields.io/github/release/jdemetra/jdemetra-app.svg)](https://github.com/jdemetra/jdemetra-app/releases/latest)
+![GitHub All Releases](https://img.shields.io/github/downloads/jdemetra/jdemetra-app/total)
+![GitHub Releases](https://img.shields.io/github/downloads/jdemetra/jdemetra-app/latest/total)
**JDemetra+ is a new tool for seasonal adjustment (SA)** developed by the National Bank of Belgium (NBB) in cooperation with the Deutsche Bundesbank and Eurostat in accordance with the Guidelines of the European Statistical System (ESS).
diff --git a/nbdemetra-anomalydetection/pom.xml b/nbdemetra-anomalydetection/pom.xml
index 17f96374d..7b0dac1a3 100644
--- a/nbdemetra-anomalydetection/pom.xml
+++ b/nbdemetra-anomalydetection/pom.xml
@@ -4,7 +4,7 @@
nbdemetra-parent
eu.europa.ec.joinup.sat
- 2.2.2
+ 2.2.3
nbdemetra-anomalydetection
@@ -13,6 +13,13 @@
NbDemetra - Anomaly Detection
+
+
+ org.checkerframework
+ checker-qual
+ provided
+
+
org.netbeans.api
@@ -94,6 +101,10 @@
org.netbeans.api
org-openide-filesystems-nb
+
+ org.netbeans.api
+ org-openide-util-ui
+
@@ -113,7 +124,7 @@
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
true
diff --git a/nbdemetra-anomalydetection/src/main/java/ec/nbdemetra/anomalydetection/ui/AnomalyDetectionChart.java b/nbdemetra-anomalydetection/src/main/java/ec/nbdemetra/anomalydetection/ui/AnomalyDetectionChart.java
index eb37d7ca8..8eab070b5 100644
--- a/nbdemetra-anomalydetection/src/main/java/ec/nbdemetra/anomalydetection/ui/AnomalyDetectionChart.java
+++ b/nbdemetra-anomalydetection/src/main/java/ec/nbdemetra/anomalydetection/ui/AnomalyDetectionChart.java
@@ -45,8 +45,8 @@
import java.beans.PropertyChangeListener;
import java.text.NumberFormat;
import java.util.Arrays;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.checker.nullness.qual.Nullable;
import javax.swing.JComponent;
import javax.swing.JMenu;
@@ -171,7 +171,7 @@ public static final class Model {
private final Ts ts;
private final OutlierEstimation[] outliers;
- Model(@Nonnull Ts ts, @Nonnull PreprocessingModel model) {
+ Model(@NonNull Ts ts, @NonNull PreprocessingModel model) {
this.ts = ts;
TsData data = ts.getTsData();
this.outliers = new OutlierEstimation[data.getLength()];
@@ -181,12 +181,12 @@ public static final class Model {
}
}
- @Nonnull
+ @NonNull
public Ts getTs() {
return ts;
}
- @Nonnull
+ @NonNull
public OutlierEstimation[] getOutliers() {
return outliers;
}
diff --git a/nbdemetra-anomalydetection/src/main/java/ec/nbdemetra/anomalydetection/ui/JTsAnomalyGrid.java b/nbdemetra-anomalydetection/src/main/java/ec/nbdemetra/anomalydetection/ui/JTsAnomalyGrid.java
index a72122abe..5c3783774 100644
--- a/nbdemetra-anomalydetection/src/main/java/ec/nbdemetra/anomalydetection/ui/JTsAnomalyGrid.java
+++ b/nbdemetra-anomalydetection/src/main/java/ec/nbdemetra/anomalydetection/ui/JTsAnomalyGrid.java
@@ -38,8 +38,8 @@
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.checker.nullness.qual.Nullable;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTable;
@@ -253,7 +253,7 @@ public TsCollection getTsCollection() {
return grid.getTsCollection();
}
- @Nonnull
+ @NonNull
public ObsIndex getHoveredObs() {
return grid.getHoveredObs();
}
diff --git a/nbdemetra-app/pom.xml b/nbdemetra-app/pom.xml
index ffb644615..c4be3ed23 100644
--- a/nbdemetra-app/pom.xml
+++ b/nbdemetra-app/pom.xml
@@ -5,7 +5,7 @@
eu.europa.ec.joinup.sat
nbdemetra-parent
- 2.2.2
+ 2.2.3
nbdemetra-app
@@ -17,6 +17,8 @@
UTF-8
${netbeans.run.params.ide}
+ ${project.build.directory}/binaries
+ jdemetra-${project.version}-bin
@@ -34,6 +36,10 @@
org.netbeans.modules
org-netbeans-modules-junitlib
+
+ org.netbeans.api
+ org-netbeans-modules-javahelp
+
@@ -42,13 +48,19 @@
org.netbeans.modules
org-netbeans-modules-dbapi
${netbeans.version}
+
+
+ org.netbeans.api
+ org-netbeans-modules-javahelp
+
+
org.netbeans.modules
org-netbeans-modules-projectapi-nb
${netbeans.version}
-
+
${project.groupId}
@@ -94,39 +106,66 @@
+
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
- jdemetra-${project.version}-bin
+ ${project.x.zipname}
jdemetra-${project.version}-setup
src/main/resources/nbdemetra.conf
+
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+ 3.0.0
+
+
+ verify
+
+
+
+
+
+
+ run
+
+
+
+
+
+
+
+ net.nicoulaj.maven.plugins
+ checksum-maven-plugin
+ 1.8
+
+
+
+ files
+
+
+
+
+
+ SHA-256
+
+
+
+ ${project.x.binaries}
+
+ *.sha256
+
+
+
+ false
+
+
-
-
-
- deployment
-
-
-
- org.codehaus.mojo
- nbm-maven-plugin
-
-
- extra
-
- autoupdate
-
-
-
-
-
-
-
-
-
diff --git a/nbdemetra-app/src/main/resources/nbdemetra.conf b/nbdemetra-app/src/main/resources/nbdemetra.conf
index 1679c4588..9862677c4 100644
--- a/nbdemetra-app/src/main/resources/nbdemetra.conf
+++ b/nbdemetra-app/src/main/resources/nbdemetra.conf
@@ -1,10 +1,10 @@
# ${HOME} will be replaced by user home directory according to platform
-default_userdir="${HOME}/.${APPNAME}/dev"
-default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/dev"
+default_userdir="${DEFAULT_USERDIR_ROOT}/../.${APPNAME}/dev"
+default_mac_userdir="${DEFAULT_USERDIR_ROOT}/dev"
# options used by the launcher by default, can be overridden by explicit
# command line switches
-default_options="--branding nbdemetra -J-Xms128m -J-Xmx512m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true"
+default_options="--branding nbdemetra -J-Djdk.gtk.version=2.2 -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-XX:+IgnoreUnrecognizedVMOptions -J-Djna.nosys=false -J-Djna.nounpack=true"
# for development purposes you may wish to append: -J-Dnetbeans.logger.console=true -J-ea
# default location of JDK/JRE, can be overridden by using --jdkhome switch
diff --git a/nbdemetra-branding/pom.xml b/nbdemetra-branding/pom.xml
index c331794b8..16f53c7de 100644
--- a/nbdemetra-branding/pom.xml
+++ b/nbdemetra-branding/pom.xml
@@ -5,7 +5,7 @@
eu.europa.ec.joinup.sat
nbdemetra-parent
- 2.2.2
+ 2.2.3
nbdemetra-branding
@@ -23,7 +23,7 @@
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
diff --git a/nbdemetra-common/pom.xml b/nbdemetra-common/pom.xml
index b2e05bd12..925697058 100644
--- a/nbdemetra-common/pom.xml
+++ b/nbdemetra-common/pom.xml
@@ -4,7 +4,7 @@
eu.europa.ec.joinup.sat
nbdemetra-parent
- 2.2.2
+ 2.2.3
nbdemetra-common
@@ -83,7 +83,7 @@
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
true
diff --git a/nbdemetra-core/pom.xml b/nbdemetra-core/pom.xml
index c0a9602b3..68298e83b 100644
--- a/nbdemetra-core/pom.xml
+++ b/nbdemetra-core/pom.xml
@@ -4,7 +4,7 @@
eu.europa.ec.joinup.sat
nbdemetra-parent
- 2.2.2
+ 2.2.3
nbdemetra-core
@@ -32,6 +32,12 @@
lombok
provided
+
+ org.checkerframework
+ checker-qual
+ provided
+
+
org.netbeans.api
@@ -68,10 +74,10 @@
guava
- com.google.code.findbugs
- jsr305
+ com.github.stephenc.jcip
+ jcip-annotations
compile
-
+
org.slf4j
slf4j-api
@@ -86,16 +92,21 @@
jcl-over-slf4j
- org.xerial.snappy
- snappy-java
- 1.1.2
+ javax.xml.bind
+ jaxb-api
+ 2.4.0-b180830.0359
+
+
+ org.glassfish.jaxb
+ jaxb-runtime
+ 2.4.0-b180830.0438
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
true
@@ -111,12 +122,14 @@
org.slf4j.*
com.google.common.*
org.apache.commons.logging.*
- javax.annotation.*
ec.demetra.workspace
ec.demetra.workspace.file
ec.demetra.workspace.file.spi
ec.demetra.workspace.file.util
- ioutil
+ javax.annotation.*
+ javax.xml.bind.*
+ net.jcip.annotations
+ nbbrd.io.*
diff --git a/nbdemetra-core/src/main/java/ec/nbdemetra/core/GlobalServiceProcessor.java b/nbdemetra-core/src/main/java/ec/nbdemetra/core/GlobalServiceProcessor.java
index bb363098a..fe4e48807 100644
--- a/nbdemetra-core/src/main/java/ec/nbdemetra/core/GlobalServiceProcessor.java
+++ b/nbdemetra-core/src/main/java/ec/nbdemetra/core/GlobalServiceProcessor.java
@@ -64,7 +64,7 @@ public boolean process(Set extends TypeElement> annotations, RoundEnvironment
m.printMessage(kind, "Default method requires no parameters", e);
continue;
}
- if (!t.getReturnType().toString().equals(e.asType().toString())) {
+ if (!t.getReturnType().toString().contains(e.asType().toString())) {
m.printMessage(kind, "Default method must return the annotated type", e);
continue;
}
diff --git a/nbdemetra-core/src/main/java/ec/nbdemetra/core/Installer.java b/nbdemetra-core/src/main/java/ec/nbdemetra/core/Installer.java
index 84811e8fa..2312164e3 100644
--- a/nbdemetra-core/src/main/java/ec/nbdemetra/core/Installer.java
+++ b/nbdemetra-core/src/main/java/ec/nbdemetra/core/Installer.java
@@ -28,7 +28,6 @@
import ec.tss.sa.SaManager;
import ec.tss.tsproviders.IFileLoader;
import ec.tss.tsproviders.TsProviders;
-import ec.tss.tsproviders.utils.ByteArrayConverter;
import ec.tss.tsproviders.utils.Formatters;
import ec.tss.tsproviders.utils.IFormatter;
import ec.tss.tsproviders.utils.IParser;
@@ -57,7 +56,6 @@ public final class Installer extends ModuleInstall {
final InstallerStep step = InstallerStep.all(
new PackageInfoFixStep(),
new AppVersionStep(),
- new ByteArrayConverterStep(),
new ProvidersStep(),
new SaFactoriesStep(),
new SaDiagnosticsStep(),
@@ -100,19 +98,6 @@ public void restore() {
}
}
- private static final class ByteArrayConverterStep extends InstallerStep {
-
- @Override
- public void restore() {
- try {
- ByteArrayConverter.setInstance(new SnappyConverter());
- LOGGER.info("Using Snappy byte array converter");
- } catch (Exception ex) {
- LOGGER.warn("While loading Snappy byte array converter", ex);
- }
- }
- }
-
private static final class ProvidersStep extends InstallerStep.LookupStep {
final Preferences prefs = prefs();
diff --git a/nbdemetra-core/src/main/java/ec/nbdemetra/core/PackageInfoFix.java b/nbdemetra-core/src/main/java/ec/nbdemetra/core/PackageInfoFix.java
index c31327885..0fdd1de07 100644
--- a/nbdemetra-core/src/main/java/ec/nbdemetra/core/PackageInfoFix.java
+++ b/nbdemetra-core/src/main/java/ec/nbdemetra/core/PackageInfoFix.java
@@ -16,21 +16,15 @@
*/
package ec.nbdemetra.core;
-import ioutil.IO;
import java.io.IOException;
import java.io.UncheckedIOException;
-import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-import java.nio.file.FileSystem;
-import java.nio.file.FileSystemNotFoundException;
-import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Collections;
import java.util.Enumeration;
import java.util.logging.Level;
+import nbbrd.io.Resource;
/**
* A bug prevents NetBeans module to auto-load package-info classes under
@@ -47,7 +41,7 @@ public void doLoadPackageInfos(ClassLoader classLoader) {
Enumeration urls = classLoader.getResources("META-INF/MANIFEST.MF");
while (urls.hasMoreElements()) {
URL url = urls.nextElement();
- processRessource(url.toURI(), o -> loadPackageInfos(classLoader, getRootOfManifest(o)));
+ Resource.process(url.toURI(), o -> loadPackageInfos(classLoader, getRootOfManifest(o)));
}
} catch (IOException | URISyntaxException | UncheckedIOException ex) {
log.log(Level.WARNING, "While loading package infos", ex);
@@ -85,15 +79,4 @@ private void loadClass(ClassLoader classLoader, String className) {
log.log(Level.WARNING, "Cannot load class '" + className + "'", ex);
}
}
-
- // see https://stackoverflow.com/a/36021165
- private void processRessource(URI uri, IO.Consumer action) throws IOException {
- try {
- action.acceptWithIO(Paths.get(uri));
- } catch (FileSystemNotFoundException ex) {
- try (FileSystem fs = FileSystems.newFileSystem(uri, Collections.emptyMap())) {
- action.acceptWithIO(fs.provider().getPath(uri));
- }
- }
- }
}
diff --git a/nbdemetra-core/src/main/java/ec/nbdemetra/core/SnappyConverter.java b/nbdemetra-core/src/main/java/ec/nbdemetra/core/SnappyConverter.java
deleted file mode 100644
index f1632d656..000000000
--- a/nbdemetra-core/src/main/java/ec/nbdemetra/core/SnappyConverter.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2013 National Bank of Belgium
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved
- * by the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- *
- * http://ec.europa.eu/idabc/eupl
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- */
-package ec.nbdemetra.core;
-
-import ec.tss.tsproviders.utils.ByteArrayConverter;
-import java.io.IOException;
-import org.xerial.snappy.Snappy;
-
-/**
- *
- * @author Philippe Charles
- */
-final class SnappyConverter extends ByteArrayConverter {
-
- @Override
- public byte[] fromDoubleArray(double[] input) {
- try {
- return Snappy.compress(input);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- @Override
- public double[] toDoubleArray(byte[] input) {
- try {
- return Snappy.uncompressDoubleArray(input);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-}
diff --git a/nbdemetra-core/src/test/java/ec/nbdemetra/core/SnappyConverterTest.java b/nbdemetra-core/src/test/java/ec/nbdemetra/core/SnappyConverterTest.java
deleted file mode 100644
index 8fca5b7da..000000000
--- a/nbdemetra-core/src/test/java/ec/nbdemetra/core/SnappyConverterTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2013 National Bank of Belgium
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved
- * by the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- *
- * http://ec.europa.eu/idabc/eupl
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- */
-package ec.nbdemetra.core;
-
-import ec.tss.tsproviders.utils.ByteArrayConverter;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- *
- * @author Philippe Charles
- */
-public class SnappyConverterTest {
-
- @Test
- public void testSnappy() {
- ByteArrayConverter converter = new SnappyConverter();
-
- double[] input0 = {};
- Assert.assertArrayEquals(input0, converter.toDoubleArray(converter.fromDoubleArray(input0)), 0);
- Assert.assertNotSame(input0, converter.toDoubleArray(converter.fromDoubleArray(input0)));
-
- double[] input1 = {0.0, 1.1, 2.2, 3.3};
- Assert.assertArrayEquals(input1, converter.toDoubleArray(converter.fromDoubleArray(input1)), 0);
- Assert.assertNotSame(input1, converter.toDoubleArray(converter.fromDoubleArray(input1)));
-
- double[] input2 = {Double.NaN, Double.MAX_VALUE, Double.MIN_VALUE, Double.MIN_NORMAL,
- Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY};
- Assert.assertArrayEquals(input2, converter.toDoubleArray(converter.fromDoubleArray(input2)), 0);
- Assert.assertNotSame(input2, converter.toDoubleArray(converter.fromDoubleArray(input2)));
- }
-}
diff --git a/nbdemetra-jdbc/pom.xml b/nbdemetra-jdbc/pom.xml
index d46c5f9fa..a12453c7b 100644
--- a/nbdemetra-jdbc/pom.xml
+++ b/nbdemetra-jdbc/pom.xml
@@ -4,7 +4,7 @@
eu.europa.ec.joinup.sat
nbdemetra-parent
- 2.2.2
+ 2.2.3
nbdemetra-jdbc
@@ -14,6 +14,18 @@
This module provides JDBC IO to Demetra.
+
+
+ org.projectlombok
+ lombok
+ provided
+
+
+ org.checkerframework
+ checker-qual
+ provided
+
+
org.netbeans.api
@@ -87,7 +99,7 @@
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
true
@@ -96,6 +108,7 @@
ec.util.*
ec.nbdemetra.db.*
ec.nbdemetra.jdbc.*
+ nbbrd.sql.jdbc
diff --git a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/db/DbProviderBuddy.java b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/db/DbProviderBuddy.java
index 5142e1a4c..2372923b4 100644
--- a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/db/DbProviderBuddy.java
+++ b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/db/DbProviderBuddy.java
@@ -36,7 +36,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
@@ -96,8 +96,8 @@ private List createSheetSets(DbBean bean) {
@NbBundle.Messages({
"bean.dbName.display=Data source name",
"bean.dbName.description=Data structure describing the connection to the database."})
- @Nonnull
- protected NodePropertySetBuilder withDbName(@Nonnull NodePropertySetBuilder b, @Nonnull BEAN bean) {
+ @NonNull
+ protected NodePropertySetBuilder withDbName(@NonNull NodePropertySetBuilder b, @NonNull BEAN bean) {
return b.withAutoCompletion()
.select(bean, "dbName")
.source(getDbSource(bean))
@@ -110,8 +110,8 @@ protected NodePropertySetBuilder withDbName(@Nonnull NodePropertySetBuilder b, @
@NbBundle.Messages({
"bean.file.display=Database file",
"bean.file.description=The path to the database file."})
- @Nonnull
- protected NodePropertySetBuilder withFileName(@Nonnull NodePropertySetBuilder b, @Nonnull BEAN bean) {
+ @NonNull
+ protected NodePropertySetBuilder withFileName(@NonNull NodePropertySetBuilder b, @NonNull BEAN bean) {
Optional loader = TsProviders.lookup(IFileLoader.class, getProviderName());
if (loader.isPresent()) {
return b.withFile()
@@ -137,8 +137,8 @@ protected NodePropertySetBuilder withFileName(@Nonnull NodePropertySetBuilder b,
"bean.valueColumn.description=A column name that defines the value of an observation.",
"bean.versionColumn.display=Version column",
"bean.versionColumn.description=An optional column name that defines the version of an observation.",})
- @Nonnull
- protected NodePropertySetBuilder withSource(@Nonnull NodePropertySetBuilder b, @Nonnull BEAN bean) {
+ @NonNull
+ protected NodePropertySetBuilder withSource(@NonNull NodePropertySetBuilder b, @NonNull BEAN bean) {
AutoCompletionSource columns = getColumnSource(bean);
ListCellRenderer columnCellRenderer = getColumnRenderer(bean);
@@ -194,8 +194,8 @@ protected NodePropertySetBuilder withSource(@Nonnull NodePropertySetBuilder b, @
"bean.frequency.description=The frequency of the observations in the table. An undefined frequency allows the provider to guess it.",
"bean.aggregationType.display=Aggregation type",
"bean.aggregationType.description=The aggregation method to use when a frequency is defined."})
- @Nonnull
- protected NodePropertySetBuilder withOptions(@Nonnull NodePropertySetBuilder b, @Nonnull BEAN bean) {
+ @NonNull
+ protected NodePropertySetBuilder withOptions(@NonNull NodePropertySetBuilder b, @NonNull BEAN bean) {
b.with(DataFormat.class)
.select(bean, "dataFormat")
.display(Bundle.bean_dataFormat_display())
@@ -219,8 +219,8 @@ protected NodePropertySetBuilder withOptions(@Nonnull NodePropertySetBuilder b,
"bean.cacheDepth.description=The data retrieval depth. It is always more performant to get one big chunk of data instead of several smaller parts. The downside of it is the increase of memory usage. Setting this value to zero disables the cache.",
"bean.cacheTtl.display=Time to live",
"bean.cacheTtl.description=The lifetime of the data stored in the cache. Setting this value to zero disables the cache."})
- @Nonnull
- protected NodePropertySetBuilder withCache(@Nonnull NodePropertySetBuilder b, @Nonnull BEAN bean) {
+ @NonNull
+ protected NodePropertySetBuilder withCache(@NonNull NodePropertySetBuilder b, @NonNull BEAN bean) {
b.withInt()
.select(bean, "cacheDepth")
.display(Bundle.bean_cacheDepth_display())
@@ -248,8 +248,8 @@ protected NodePropertySetBuilder withCache(@Nonnull NodePropertySetBuilder b, @N
* @see DbBean
* @see JAutoCompletion#setSource(ec.util.completion.AutoCompletionSource)
*/
- @Nonnull
- protected AutoCompletionSource getDbSource(@Nonnull BEAN bean) {
+ @NonNull
+ protected AutoCompletionSource getDbSource(@NonNull BEAN bean) {
return AutoCompletionSources.empty();
}
@@ -265,8 +265,8 @@ protected AutoCompletionSource getDbSource(@Nonnull BEAN bean) {
* @see DbBean
* @see JAutoCompletion#setSource(ec.util.completion.AutoCompletionSource)
*/
- @Nonnull
- protected AutoCompletionSource getTableSource(@Nonnull BEAN bean) {
+ @NonNull
+ protected AutoCompletionSource getTableSource(@NonNull BEAN bean) {
return AutoCompletionSources.empty();
}
@@ -282,8 +282,8 @@ protected AutoCompletionSource getTableSource(@Nonnull BEAN bean) {
* @see DbBean
* @see JAutoCompletion#setSource(ec.util.completion.AutoCompletionSource)
*/
- @Nonnull
- protected AutoCompletionSource getColumnSource(@Nonnull BEAN bean) {
+ @NonNull
+ protected AutoCompletionSource getColumnSource(@NonNull BEAN bean) {
return AutoCompletionSources.empty();
}
@@ -299,8 +299,8 @@ protected AutoCompletionSource getColumnSource(@Nonnull BEAN bean) {
* @see DbBean
* @see JList#setCellRenderer(javax.swing.ListCellRenderer)
*/
- @Nonnull
- protected ListCellRenderer getDbRenderer(@Nonnull BEAN bean) {
+ @NonNull
+ protected ListCellRenderer getDbRenderer(@NonNull BEAN bean) {
return new DefaultListCellRenderer();
}
@@ -316,8 +316,8 @@ protected ListCellRenderer getDbRenderer(@Nonnull BEAN bean) {
* @see DbBean
* @see JList#setCellRenderer(javax.swing.ListCellRenderer)
*/
- @Nonnull
- protected ListCellRenderer getTableRenderer(@Nonnull BEAN bean) {
+ @NonNull
+ protected ListCellRenderer getTableRenderer(@NonNull BEAN bean) {
return new DefaultListCellRenderer();
}
@@ -333,8 +333,8 @@ protected ListCellRenderer getTableRenderer(@Nonnull BEAN bean) {
* @see DbBean
* @see JList#setCellRenderer(javax.swing.ListCellRenderer)
*/
- @Nonnull
- protected ListCellRenderer getColumnRenderer(@Nonnull BEAN bean) {
+ @NonNull
+ protected ListCellRenderer getColumnRenderer(@NonNull BEAN bean) {
return new DefaultListCellRenderer();
}
}
diff --git a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/DbExplorerUtil.java b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/DbExplorerUtil.java
index 7dff428e2..e0be776dc 100644
--- a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/DbExplorerUtil.java
+++ b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/DbExplorerUtil.java
@@ -18,7 +18,7 @@
import com.google.common.base.Optional;
import java.util.Properties;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import org.netbeans.api.db.explorer.ConnectionManager;
import org.netbeans.api.db.explorer.DatabaseConnection;
import org.netbeans.api.db.explorer.DatabaseException;
@@ -41,14 +41,18 @@ private DbExplorerUtil() {
// static class
}
- static boolean isConnected(@Nonnull DatabaseConnection conn) {
+ static boolean isConnected(@NonNull DatabaseConnection conn) {
return conn.getJDBCConnection() != null;
}
- static boolean isTableOrView(@Nonnull Node node) {
+ static boolean isTableOrView(@NonNull Node node) {
return lookupContains(node.getLookup(),
- "org.netbeans.modules.db.explorer.node.TableNode",
- "org.netbeans.modules.db.explorer.node.ViewNode");
+ getClassName("TableNode"),
+ getClassName("ViewNode"));
+ }
+
+ private static String getClassName(String name) {
+ return "org.netbeans.modules.db.explorer.node." + name;
}
// some part of the db api is private; we need to cheat a bit
@@ -63,8 +67,8 @@ private static boolean lookupContains(Lookup lookup, String... classNames) {
return false;
}
- @Nonnull
- static Optional findConnection(@Nonnull Node node) {
+ @NonNull
+ static Optional findConnection(@NonNull Node node) {
DatabaseConnection result = null;
Node current = node;
while (current != null && (result = current.getLookup().lookup(DatabaseConnection.class)) == null) {
@@ -73,16 +77,16 @@ static Optional findConnection(@Nonnull Node node) {
return Optional.fromNullable(result);
}
- @Nonnull
- static Optional getDriverByClass(@Nonnull String driverClass) {
+ @NonNull
+ static Optional getDriverByClass(@NonNull String driverClass) {
for (JDBCDriver o : JDBCDriverManager.getDefault().getDrivers(driverClass)) {
return Optional.of(o);
}
return Optional.absent();
}
- @Nonnull
- static Optional getConnectionByDisplayName(@Nonnull String displayName) {
+ @NonNull
+ static Optional getConnectionByDisplayName(@NonNull String displayName) {
for (DatabaseConnection o : ConnectionManager.getDefault().getConnections()) {
if (o.getDisplayName().equals(displayName)) {
return Optional.of(o);
@@ -91,7 +95,7 @@ static Optional getConnectionByDisplayName(@Nonnull String d
return Optional.absent();
}
- public static void importConnection(@Nonnull DriverBasedConfig config) {
+ public static void importConnection(@NonNull DriverBasedConfig config) {
Optional driver = getDriverByClass(config.getDriverClass());
if (!driver.isPresent()) {
String msg = "Cannot find driver '" + config.getDriverClass() + "'";
@@ -114,8 +118,8 @@ public static void importConnection(@Nonnull DriverBasedConfig config) {
}
}
- @Nonnull
- public static DriverBasedConfig exportConnection(@Nonnull DatabaseConnection conn) {
+ @NonNull
+ public static DriverBasedConfig exportConnection(@NonNull DatabaseConnection conn) {
DriverBasedConfig.Builder b = DriverBasedConfig.builder(conn.getDriverClass(), conn.getDatabaseURL(), conn.getSchema(), conn.getDisplayName());
Properties properties = conn.getConnectionProperties();
for (String o : properties.stringPropertyNames()) {
diff --git a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/DriverBasedConfig.java b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/DriverBasedConfig.java
index ace434c02..1ccfbfedc 100644
--- a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/DriverBasedConfig.java
+++ b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/DriverBasedConfig.java
@@ -30,7 +30,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.SortedMap;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.annotation.XmlAttribute;
@@ -51,7 +51,7 @@ public final class DriverBasedConfig implements IConfig {
private final ImmutableSortedMap params;
@VisibleForTesting
- DriverBasedConfig(@Nonnull String driverClass, @Nonnull String databaseUrl, @Nonnull String schema, @Nonnull String displayName, @Nonnull ImmutableSortedMap params) {
+ DriverBasedConfig(@NonNull String driverClass, @NonNull String databaseUrl, @NonNull String schema, @NonNull String displayName, @NonNull ImmutableSortedMap params) {
this.driverClass = driverClass;
this.databaseUrl = databaseUrl;
this.schema = schema;
@@ -59,22 +59,22 @@ public final class DriverBasedConfig implements IConfig {
this.params = params;
}
- @Nonnull
+ @NonNull
public String getDriverClass() {
return driverClass;
}
- @Nonnull
+ @NonNull
public String getDatabaseUrl() {
return databaseUrl;
}
- @Nonnull
+ @NonNull
public String getSchema() {
return schema;
}
- @Nonnull
+ @NonNull
public String getDisplayName() {
return displayName;
}
@@ -120,8 +120,8 @@ ConnectionBean toBean() {
return bean;
}
- @Nonnull
- public static DriverBasedConfig deepCopyOf(@Nonnull String driverClass, @Nonnull String databaseUrl, @Nonnull String schema, @Nonnull String displayName, @Nonnull Map params) {
+ @NonNull
+ public static DriverBasedConfig deepCopyOf(@NonNull String driverClass, @NonNull String databaseUrl, @NonNull String schema, @NonNull String displayName, @NonNull Map params) {
return new DriverBasedConfig(
Objects.requireNonNull(driverClass, "driverClass"),
Objects.requireNonNull(databaseUrl, "databaseUrl"),
@@ -130,8 +130,8 @@ public static DriverBasedConfig deepCopyOf(@Nonnull String driverClass, @Nonnull
ImmutableSortedMap.copyOf(Objects.requireNonNull(params, "params")));
}
- @Nonnull
- public static Builder builder(@Nonnull String driverClass, @Nonnull String databaseUrl, @Nonnull String schema, @Nonnull String displayName) {
+ @NonNull
+ public static Builder builder(@NonNull String driverClass, @NonNull String databaseUrl, @NonNull String schema, @NonNull String displayName) {
return new Builder(
Objects.requireNonNull(driverClass, "driverClass"),
Objects.requireNonNull(databaseUrl, "databaseUrl"),
@@ -139,13 +139,11 @@ public static Builder builder(@Nonnull String driverClass, @Nonnull String datab
Objects.requireNonNull(displayName, "displayName"));
}
- @Nonnull
- public static Formatters.Formatter xmlFormatter(boolean formattedOutput) {
+ public static Formatters.@NonNull Formatter xmlFormatter(boolean formattedOutput) {
return formattedOutput ? XML.get().formattedOutputFormatter : XML.get().defaultFormatter;
}
- @Nonnull
- public static Parsers.Parser xmlParser() {
+ public static Parsers.@NonNull Parser xmlParser() {
return XML.get().defaultParser;
}
@@ -157,7 +155,7 @@ public static final class Builder extends AbstractConfigBuilder {
@Override
diff --git a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JdbcProviderBuddy.java b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JdbcProviderBuddy.java
index 404e2fbe1..d718e0c36 100644
--- a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JdbcProviderBuddy.java
+++ b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JdbcProviderBuddy.java
@@ -17,7 +17,10 @@
package ec.nbdemetra.jdbc;
import com.google.common.base.Strings;
+import ec.nbdemetra.db.DbColumnListCellRenderer;
+import ec.nbdemetra.db.DbIcon;
import ec.nbdemetra.db.DbProviderBuddy;
+import ec.nbdemetra.ui.awt.SimpleHtmlListCellRenderer;
import ec.tss.tsproviders.jdbc.ConnectionSupplier;
import ec.tss.tsproviders.jdbc.JdbcBean;
import ec.tstoolkit.utilities.GuavaCaches;
@@ -26,20 +29,22 @@
import static ec.util.completion.AutoCompletionSource.Behavior.NONE;
import static ec.util.completion.AutoCompletionSource.Behavior.SYNC;
import ec.util.completion.ExtAutoCompletionSource;
-import ec.util.jdbc.JdbcColumn;
-import ec.util.jdbc.JdbcTable;
-import ec.util.jdbc.SqlIdentifierQuoter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
+import java.sql.Types;
import java.time.Duration;
import java.util.Comparator;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
+import javax.swing.Icon;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.ListCellRenderer;
+import nbbrd.sql.jdbc.SqlColumn;
+import nbbrd.sql.jdbc.SqlIdentifierQuoter;
+import nbbrd.sql.jdbc.SqlTable;
/**
* An abstract provider buddy that targets Jdbc providers.
@@ -51,73 +56,148 @@ public abstract class JdbcProviderBuddy extends DbProvide
protected final ConnectionSupplier supplier;
- public JdbcProviderBuddy(@Nonnull ConnectionSupplier supplier) {
+ public JdbcProviderBuddy(@NonNull ConnectionSupplier supplier) {
this.supplier = supplier;
}
@Override
protected AutoCompletionSource getTableSource(BEAN bean) {
return ExtAutoCompletionSource
- .builder(o -> getJdbcTables(supplier, bean))
+ .builder(o -> getSqlTables(supplier, bean))
.behavior(o -> !Strings.isNullOrEmpty(bean.getDbName()) ? ASYNC : NONE)
- .postProcessor(JdbcProviderBuddy::getJdbcTables)
- .valueToString(JdbcTable::getName)
+ .postProcessor(JdbcProviderBuddy::getSqlTables)
+ .valueToString(SqlTable::getName)
.cache(GuavaCaches.ttlCacheAsMap(Duration.ofMinutes(1)), o -> bean.getDbName(), SYNC)
.build();
}
@Override
protected ListCellRenderer getTableRenderer(BEAN bean) {
- return new JdbcTableListCellRenderer();
+ return new SqlTableRenderer();
}
@Override
protected AutoCompletionSource getColumnSource(BEAN bean) {
return ExtAutoCompletionSource
- .builder(o -> getJdbcColumns(supplier, bean))
+ .builder(o -> getSqlColumns(supplier, bean))
.behavior(o -> !Strings.isNullOrEmpty(bean.getDbName()) && !Strings.isNullOrEmpty(bean.getTableName()) ? ASYNC : NONE)
- .postProcessor(JdbcProviderBuddy::getJdbcColumns)
- .valueToString(JdbcColumn::getName)
+ .postProcessor(JdbcProviderBuddy::getSqlColumns)
+ .valueToString(SqlColumn::getName)
.cache(GuavaCaches.ttlCacheAsMap(Duration.ofMinutes(1)), o -> bean.getDbName() + "/" + bean.getTableName(), SYNC)
.build();
}
@Override
protected ListCellRenderer getColumnRenderer(BEAN bean) {
- return new JdbcColumnListCellRenderer();
+ return new SqlColumnRenderer();
}
//
- private static List getJdbcTables(ConnectionSupplier supplier, T bean) throws SQLException {
+ private static final class SqlTableRenderer extends SimpleHtmlListCellRenderer {
+
+ public SqlTableRenderer() {
+ super(o -> "" + o.getName() + " - " + o.getType() + "");
+ }
+ }
+
+ private static final class SqlColumnRenderer extends DbColumnListCellRenderer {
+
+ @Override
+ protected String getName(SqlColumn value) {
+ return value.getName();
+ }
+
+ @Override
+ protected String getTypeName(SqlColumn value) {
+ return value.getTypeName();
+ }
+
+ @Override
+ protected Icon getTypeIcon(SqlColumn value) {
+ switch (value.getType()) {
+ case Types.BIGINT:
+ case Types.DECIMAL:
+ case Types.INTEGER:
+ case Types.NUMERIC:
+ case Types.SMALLINT:
+ case Types.TINYINT:
+ return DbIcon.DATA_TYPE_INTEGER;
+ case Types.DOUBLE:
+ case Types.FLOAT:
+ case Types.REAL:
+ return DbIcon.DATA_TYPE_DOUBLE;
+ case Types.BINARY:
+ case Types.BLOB:
+ case Types.CLOB:
+ case Types.JAVA_OBJECT:
+ case Types.LONGVARBINARY:
+ case Types.NCLOB:
+ case Types.VARBINARY:
+ return DbIcon.DATA_TYPE_BINARY;
+ case Types.CHAR:
+ case Types.LONGNVARCHAR:
+ case Types.LONGVARCHAR:
+ case Types.NCHAR:
+ case Types.NVARCHAR:
+ case Types.VARCHAR:
+ return DbIcon.DATA_TYPE_STRING;
+ case Types.DATE:
+ case Types.TIME:
+ case Types.TIMESTAMP:
+ return DbIcon.DATA_TYPE_DATETIME;
+ case Types.BIT:
+ case Types.BOOLEAN:
+ return DbIcon.DATA_TYPE_BOOLEAN;
+ case Types.ARRAY:
+ case Types.DATALINK:
+ case Types.DISTINCT:
+ case Types.NULL:
+ case Types.OTHER:
+ case Types.REF:
+ case Types.ROWID:
+ case Types.SQLXML:
+ case Types.STRUCT:
+ return DbIcon.DATA_TYPE_NULL;
+ }
+ return null;
+ }
+ }
+
+ private static List getSqlTables(ConnectionSupplier supplier, T bean) throws SQLException {
try (Connection c = supplier.getConnection(bean)) {
- return JdbcTable.allOf(c.getMetaData(), c.getCatalog(), c.getSchema(), "%", new String[]{"TABLE", "VIEW"});
+ return SqlTable.allOf(c.getMetaData(), c.getCatalog(), c.getSchema(), "%", new String[]{"TABLE", "VIEW"});
}
}
- private static List getJdbcColumns(ConnectionSupplier supplier, T bean) throws SQLException {
+ private static List getSqlColumns(ConnectionSupplier supplier, T bean) throws SQLException {
try (Connection c = supplier.getConnection(bean)) {
- SqlIdentifierQuoter quoter = SqlIdentifierQuoter.create(c.getMetaData());
+ SqlIdentifierQuoter quoter = SqlIdentifierQuoter.of(c.getMetaData());
try (Statement st = c.createStatement()) {
try (ResultSet rs = st.executeQuery("select * from " + quoter.quote(bean.getTableName(), false) + " where 1 = 0")) {
- return JdbcColumn.ofAll(rs.getMetaData());
+ return SqlColumn.allOf(rs.getMetaData());
}
}
}
}
- private static List getJdbcTables(List values, String term) {
+ private static List getSqlTables(List values, String term) {
Predicate filter = ExtAutoCompletionSource.basicFilter(term);
return values.stream()
.filter(o -> filter.test(o.getName()) || filter.test(o.getSchema()) || filter.test(o.getCatalog()) || filter.test(o.getRemarks()))
- .sorted()
+ .sorted(Comparator
+ .comparing(SqlTable::getType)
+ .thenComparing(SqlTable::getCatalog)
+ .thenComparing(SqlTable::getSchema)
+ .thenComparing(SqlTable::getName)
+ )
.collect(Collectors.toList());
}
- private static List getJdbcColumns(List values, String term) {
+ private static List getSqlColumns(List values, String term) {
Predicate filter = ExtAutoCompletionSource.basicFilter(term);
return values.stream()
.filter(o -> filter.test(o.getName()) || filter.test(o.getLabel()) || filter.test(o.getTypeName()))
- .sorted(Comparator.comparing(JdbcColumn::getName))
+ .sorted(Comparator.comparing(SqlColumn::getName))
.collect(Collectors.toList());
}
//
diff --git a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JdbcTableListCellRenderer.java b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JdbcTableListCellRenderer.java
index 7d7dea9aa..272a252af 100644
--- a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JdbcTableListCellRenderer.java
+++ b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JdbcTableListCellRenderer.java
@@ -11,6 +11,7 @@
*
* @author Philippe Charles
*/
+@Deprecated
public class JdbcTableListCellRenderer extends SimpleHtmlListCellRenderer {
public JdbcTableListCellRenderer() {
diff --git a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JndiJdbcProviderBuddy.java b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JndiJdbcProviderBuddy.java
index 38d37b2bf..5807061ee 100644
--- a/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JndiJdbcProviderBuddy.java
+++ b/nbdemetra-jdbc/src/main/java/ec/nbdemetra/jdbc/JndiJdbcProviderBuddy.java
@@ -53,7 +53,7 @@
import java.util.concurrent.RunnableFuture;
import java.util.function.Predicate;
import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.Action;
import javax.swing.JCheckBox;
import javax.swing.ListCellRenderer;
@@ -305,7 +305,7 @@ private static final class FailSafeConnection extends ForwardingConnection {
private final Connection delegate;
private final String defaultSchema;
- public FailSafeConnection(@Nonnull Connection delegate, String defaultSchema) {
+ public FailSafeConnection(@NonNull Connection delegate, String defaultSchema) {
this.delegate = delegate;
this.defaultSchema = defaultSchema;
}
diff --git a/nbdemetra-odbc/pom.xml b/nbdemetra-odbc/pom.xml
index 0f9fa75d6..fdebeaa46 100644
--- a/nbdemetra-odbc/pom.xml
+++ b/nbdemetra-odbc/pom.xml
@@ -4,7 +4,7 @@
eu.europa.ec.joinup.sat
nbdemetra-parent
- 2.2.2
+ 2.2.3
nbdemetra-odbc
@@ -35,6 +35,10 @@
org.netbeans.api
org-openide-explorer
+
+ org.netbeans.api
+ org-openide-util-ui
+
@@ -75,19 +79,25 @@
com.google.guava
guava
+
+
+
+ be.nbb.rd
+ java-sql-lhod
+ 1.0.1
+
- net.java.dev.jna
- jna-platform
+ be.nbb.rd
+ java-sql-jdbc
-
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
true
diff --git a/nbdemetra-odbc/src/main/java/ec/nbdemetra/odbc/OdbcProviderBuddy.java b/nbdemetra-odbc/src/main/java/ec/nbdemetra/odbc/OdbcProviderBuddy.java
index d7483e6fd..b0a62001e 100644
--- a/nbdemetra-odbc/src/main/java/ec/nbdemetra/odbc/OdbcProviderBuddy.java
+++ b/nbdemetra-odbc/src/main/java/ec/nbdemetra/odbc/OdbcProviderBuddy.java
@@ -28,8 +28,6 @@
import ec.tss.tsproviders.jdbc.JdbcBean;
import ec.tss.tsproviders.odbc.OdbcBean;
import ec.tss.tsproviders.odbc.OdbcProvider;
-import ec.tss.tsproviders.odbc.registry.IOdbcRegistry;
-import ec.tss.tsproviders.odbc.registry.OdbcDataSource;
import ec.tstoolkit.utilities.GuavaCaches;
import ec.util.completion.AutoCompletionSource;
import ec.util.completion.ExtAutoCompletionSource;
@@ -44,9 +42,10 @@
import java.util.function.Predicate;
import java.util.stream.Collectors;
import javax.swing.ListCellRenderer;
+import nbbrd.sql.odbc.OdbcDataSource;
+import nbbrd.sql.odbc.OdbcRegistry;
import org.openide.util.Exceptions;
import org.openide.util.ImageUtilities;
-import org.openide.util.Lookup;
import org.openide.util.lookup.ServiceProvider;
/**
@@ -62,7 +61,7 @@ public class OdbcProviderBuddy extends JdbcProviderBuddy implements IC
public OdbcProviderBuddy() {
super(getOdbcConnectionSupplier());
- this.dbSource = odbcDsnSource();
+ this.dbSource = odbcDsnSource(OdbcRegistry.ofServiceLoader());
this.dbRenderer = new SimpleHtmlListCellRenderer<>((OdbcDataSource o) -> "" + o.getName() + " - " + o.getServerName() + "");
}
@@ -138,9 +137,9 @@ public Connection getConnection(JdbcBean bean) throws SQLException {
}
}
- private static AutoCompletionSource odbcDsnSource() {
+ private static AutoCompletionSource odbcDsnSource(java.util.Optional odbcRegistry) {
return ExtAutoCompletionSource
- .builder(OdbcProviderBuddy::getDataSources)
+ .builder(() -> getDataSources(odbcRegistry))
.behavior(AutoCompletionSource.Behavior.ASYNC)
.postProcessor(OdbcProviderBuddy::getDataSources)
.valueToString(OdbcDataSource::getName)
@@ -148,10 +147,9 @@ private static AutoCompletionSource odbcDsnSource() {
.build();
}
- private static List getDataSources() throws Exception {
- IOdbcRegistry odbcRegistry = Lookup.getDefault().lookup(IOdbcRegistry.class);
- return odbcRegistry != null
- ? odbcRegistry.getDataSources(OdbcDataSource.Type.SYSTEM, OdbcDataSource.Type.USER)
+ private static List getDataSources(java.util.Optional odbcRegistry) throws Exception {
+ return odbcRegistry.isPresent()
+ ? odbcRegistry.get().getDataSources(OdbcDataSource.Type.SYSTEM, OdbcDataSource.Type.USER)
: Collections.emptyList();
}
diff --git a/nbdemetra-odbc/src/main/java/ec/nbdemetra/odbc/OdbcRegistry.java b/nbdemetra-odbc/src/main/java/ec/nbdemetra/odbc/OdbcRegistry.java
deleted file mode 100644
index ebb18c4b2..000000000
--- a/nbdemetra-odbc/src/main/java/ec/nbdemetra/odbc/OdbcRegistry.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright 2013 National Bank of Belgium
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved
- * by the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- *
- * http://ec.europa.eu/idabc/eupl
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- */
-package ec.nbdemetra.odbc;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableList;
-import com.google.common.io.Files;
-import ec.tss.tsproviders.odbc.registry.IOdbcRegistry;
-import ec.tss.tsproviders.odbc.registry.OdbcDataSource;
-import ec.tss.tsproviders.odbc.registry.OdbcDriver;
-import ec.tstoolkit.design.IntValue;
-import ec.tstoolkit.design.VisibleForTesting;
-import ec.util.desktop.impl.WinRegistry;
-import static ec.util.desktop.impl.WinRegistry.Root.HKEY_CURRENT_USER;
-import static ec.util.desktop.impl.WinRegistry.Root.HKEY_LOCAL_MACHINE;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.SortedMap;
-import org.openide.util.lookup.ServiceProvider;
-
-/**
- *
- * @author Philippe Charles
- */
-@ServiceProvider(service = IOdbcRegistry.class)
-public final class OdbcRegistry implements IOdbcRegistry {
-
- private static final String DATA_SOURCES_KEY = "SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources";
- private static final String DATA_SOURCE_KEY = "SOFTWARE\\ODBC\\ODBC.INI";
- private static final String DRIVERS_KEY = "SOFTWARE\\ODBC\\Odbcinst.INI\\ODBC Drivers";
- private static final String DRIVER_KEY = "SOFTWARE\\ODBC\\Odbcinst.INI";
-
- private final WinRegistry registry;
-
- public OdbcRegistry() {
- this(WinRegistry.getDefault());
- }
-
- @VisibleForTesting
- OdbcRegistry(WinRegistry registry) {
- this.registry = registry;
- }
-
- @Override
- public List getDataSources(OdbcDataSource.Type... types) throws IOException {
- List result = new ArrayList<>();
- for (OdbcDataSource.Type type : types) {
- WinRegistry.Root root = getRoot(type);
- if (registry.keyExists(root, DATA_SOURCES_KEY)) {
- for (Entry ds : registry.getValues(root, DATA_SOURCES_KEY).entrySet()) {
- String dataSourceKey = DATA_SOURCE_KEY + "\\" + ds.getKey();
- if (registry.keyExists(root, dataSourceKey)) {
- result.add(newDataSource(type, ds, registry.getValues(root, dataSourceKey)));
- }
- }
- }
- }
- return result;
- }
-
- private static OdbcDataSource newDataSource(OdbcDataSource.Type type, Entry master, SortedMap details) {
- return new OdbcDataSource(type, master.getKey(),
- asString(details.get("Description")),
- asString(master.getValue()),
- asString(details.get("Driver")),
- asString(details.get("Server")));
- }
-
- private static WinRegistry.Root getRoot(OdbcDataSource.Type type) {
- switch (type) {
- case SYSTEM:
- return HKEY_LOCAL_MACHINE;
- case USER:
- return HKEY_CURRENT_USER;
- }
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public List getDrivers() throws IOException {
- List result = new ArrayList<>();
- if (registry.keyExists(HKEY_LOCAL_MACHINE, DRIVERS_KEY)) {
- for (String name : registry.getValues(HKEY_LOCAL_MACHINE, DRIVERS_KEY).keySet()) {
- String driverKey = DRIVER_KEY + "\\" + name;
- if (registry.keyExists(HKEY_LOCAL_MACHINE, driverKey)) {
- result.add(newDriver(name, registry.getValues(HKEY_LOCAL_MACHINE, driverKey)));
- }
- }
- }
- return result;
- }
-
- private static OdbcDriver newDriver(String name, SortedMap details) {
- return new OdbcDriver(name,
- parseEnum(details.get("APILevel"), OdbcDriver.ApiLevel.class, OdbcDriver.ApiLevel.NONE),
- OdbcDriver.ConnectFunctions.valueOf((String) asString(details.get("ConnectFunctions"))),
- asString(details.get("Driver")),
- asString(details.get("DriverOdbcVer")),
- readFileExtns(details.get("FileExtns")),
- parseEnum(details.get("FileUsage"), OdbcDriver.FileUsage.class, OdbcDriver.FileUsage.NONE),
- asString(details.get("Setup")),
- parseEnum(details.get("SQLLevel"), OdbcDriver.SqlLevel.class, OdbcDriver.SqlLevel.SQL_92_ENTRY),
- asInt(details.get("UsageCount"), -1));
- }
-
- private static String asString(Object o) {
- return o instanceof String ? (String) o : null;
- }
-
- private static int asInt(Object obj, int defaultValue) {
- return obj instanceof Integer ? (Integer) obj : defaultValue;
- }
-
- private static & IntValue> Z parseEnum(Object obj, Class clazz, Z defaultValue) {
- if (obj == null) {
- return defaultValue;
- }
- int value = Integer.parseInt(obj.toString());
- for (Z o : clazz.getEnumConstants()) {
- if (o.intValue() == value) {
- return o;
- }
- }
- return defaultValue;
- }
-
- private static ImmutableList readFileExtns(Object obj) {
- if (obj == null) {
- return ImmutableList.of();
- }
- ImmutableList.Builder builder = ImmutableList.builder();
- for (String o : EXTNS_SPLITTER.split(obj.toString())) {
- builder.add(Files.getFileExtension(o));
- }
- return builder.build();
- }
- private static final Splitter EXTNS_SPLITTER = Splitter.on(',').omitEmptyStrings();
-}
diff --git a/nbdemetra-sa/pom.xml b/nbdemetra-sa/pom.xml
index 9bc705d7d..5aca72258 100644
--- a/nbdemetra-sa/pom.xml
+++ b/nbdemetra-sa/pom.xml
@@ -4,7 +4,7 @@
eu.europa.ec.joinup.sat
nbdemetra-parent
- 2.2.2
+ 2.2.3
nbdemetra-sa
@@ -16,6 +16,13 @@
+
+
+ org.checkerframework
+ checker-qual
+ provided
+
+
org.netbeans.api
@@ -112,7 +119,7 @@
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
true
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/SaBatchUI.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/SaBatchUI.java
index 73b292b62..35f19e50f 100644
--- a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/SaBatchUI.java
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/SaBatchUI.java
@@ -890,6 +890,8 @@ static class EstimationRenderer extends SimpleRenderer {
@Override
protected String getText(SaItem item) {
switch (item.getEstimationPolicy()) {
+ case Current:
+ return "Current (AO)";
case Fixed:
return "Fixed model";
case FixedParameters:
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshConcurrent.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshConcurrent.java
index 882013f18..458c5ff0a 100644
--- a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshConcurrent.java
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshConcurrent.java
@@ -20,7 +20,7 @@
id = "ec.nbdemetra.sa.actions.LocalRefreshConcurrent")
@ActionRegistration(displayName = "#CTL_LocalRefreshConcurrent")
@ActionReferences({
- @ActionReference(path = MultiProcessingManager.LOCALPATH+LocalRefresh.PATH, position = 1290)
+ @ActionReference(path = MultiProcessingManager.LOCALPATH+LocalRefresh.PATH, position = 1230)
})
@Messages("CTL_LocalRefreshConcurrent=Concurrent")
public final class LocalRefreshConcurrent implements ActionListener {
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshCurrent.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshCurrent.java
new file mode 100644
index 000000000..5e7efcddc
--- /dev/null
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshCurrent.java
@@ -0,0 +1,40 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package ec.nbdemetra.sa.actions;
+
+import ec.nbdemetra.sa.MultiProcessingManager;
+import ec.nbdemetra.sa.SaBatchUI;
+import ec.nbdemetra.ui.ActiveViewManager;
+import ec.tss.sa.EstimationPolicyType;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+import org.openide.awt.ActionRegistration;
+import org.openide.awt.ActionReference;
+import org.openide.awt.ActionReferences;
+import org.openide.awt.ActionID;
+import org.openide.util.NbBundle.Messages;
+
+@ActionID(category = "SaProcessing",
+id = "ec.nbdemetra.sa.actions.LocalRefreshCurrent")
+@ActionRegistration(displayName = "#CTL_LocalRefreshCurrent")
+@ActionReferences({
+ @ActionReference(path = MultiProcessingManager.LOCALPATH+LocalRefresh.PATH, position = 1201)
+})
+@Messages("CTL_LocalRefreshCurrent=Current adjustment (AO approach)")
+public final class LocalRefreshCurrent implements ActionListener {
+
+ public LocalRefreshCurrent() {
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent ev) {
+ SaBatchUI ui = ActiveViewManager.getInstance().getLookup().lookup(SaBatchUI.class);
+ if (ui == null) {
+ return;
+ }
+ ui.refreshSelection(EstimationPolicyType.Current, false, true);
+ }
+}
\ No newline at end of file
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshFixedModel.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshFixedModel.java
index 721168d06..1eeb016e9 100644
--- a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshFixedModel.java
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/LocalRefreshFixedModel.java
@@ -22,7 +22,7 @@
@ActionReferences({
@ActionReference(path = MultiProcessingManager.LOCALPATH + LocalRefreshPartial.PATH, position = 1205)
})
-@Messages("CTL_LocalRefreshFixedModel=Current adjustment")
+@Messages("CTL_LocalRefreshFixedModel=Fixed model")
public final class LocalRefreshFixedModel implements ActionListener {
public LocalRefreshFixedModel() {
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/Output.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/Output.java
index 5d5b8f2e8..047c955b3 100644
--- a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/Output.java
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/Output.java
@@ -39,7 +39,7 @@
import java.io.File;
import java.util.List;
import java.util.concurrent.ExecutionException;
-import javax.annotation.Nullable;
+import org.checkerframework.checker.nullness.qual.Nullable;
import javax.swing.SwingWorker;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.DialogDescriptor;
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/RefreshConcurrent.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/RefreshConcurrent.java
index bcab62132..4c364e0bd 100644
--- a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/RefreshConcurrent.java
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/RefreshConcurrent.java
@@ -20,7 +20,7 @@
id = "ec.nbdemetra.sa.actions.RefreshConcurrent")
@ActionRegistration(displayName = "#CTL_RefreshConcurrent")
@ActionReferences({
- @ActionReference(path = MultiProcessingManager.CONTEXTPATH+Refresh.PATH, position = 1290)
+ @ActionReference(path = MultiProcessingManager.CONTEXTPATH+Refresh.PATH, position = 1230)
})
@Messages("CTL_RefreshConcurrent=Concurrent")
public final class RefreshConcurrent implements ActionListener {
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/RefreshCurrent.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/RefreshCurrent.java
new file mode 100644
index 000000000..ea3a924c4
--- /dev/null
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/sa/actions/RefreshCurrent.java
@@ -0,0 +1,40 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package ec.nbdemetra.sa.actions;
+
+import ec.nbdemetra.sa.MultiProcessingManager;
+import ec.nbdemetra.sa.SaBatchUI;
+import ec.nbdemetra.ui.ActiveViewManager;
+import ec.tss.sa.EstimationPolicyType;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+import org.openide.awt.ActionRegistration;
+import org.openide.awt.ActionReference;
+import org.openide.awt.ActionReferences;
+import org.openide.awt.ActionID;
+import org.openide.util.NbBundle.Messages;
+
+@ActionID(category = "SaProcessing",
+id = "ec.nbdemetra.sa.actions.RefreshCurrent")
+@ActionRegistration(displayName = "#CTL_RefreshCurrent")
+@ActionReferences({
+ @ActionReference(path = MultiProcessingManager.CONTEXTPATH+Refresh.PATH, position = 1201)
+})
+@Messages("CTL_RefreshCurrent=Current adjustment (AO approach)")
+public final class RefreshCurrent implements ActionListener {
+
+ public RefreshCurrent() {
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent ev) {
+ SaBatchUI ui = ActiveViewManager.getInstance().getLookup().lookup(SaBatchUI.class);
+ if (ui == null) {
+ return;
+ }
+ ui.refresh(EstimationPolicyType.Current, false, true);
+ }
+}
\ No newline at end of file
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/tramoseats/actions/ImportTramoSeatsSpec.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/tramoseats/actions/ImportTramoSeatsSpec.java
index 48c91397a..986dfe954 100644
--- a/nbdemetra-sa/src/main/java/ec/nbdemetra/tramoseats/actions/ImportTramoSeatsSpec.java
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/tramoseats/actions/ImportTramoSeatsSpec.java
@@ -30,7 +30,7 @@
import ec.tstoolkit.algorithm.IProcSpecification;
import java.util.Collections;
import java.util.List;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.JMenuItem;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
@@ -98,7 +98,7 @@ public void importConfig(Config config) throws IllegalArgumentException {
});
}
- private static TramoSeatsSpecification fromConfig(@Nonnull Config config) throws IllegalArgumentException {
+ private static TramoSeatsSpecification fromConfig(@NonNull Config config) throws IllegalArgumentException {
if (!TramoSeatsSpecification.class.getName().equals(config.getDomain())) {
throw new IllegalArgumentException("Invalid config");
}
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/tramoseats/actions/ImportTramoSpec.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/tramoseats/actions/ImportTramoSpec.java
index 921ba0066..c271fa0d5 100644
--- a/nbdemetra-sa/src/main/java/ec/nbdemetra/tramoseats/actions/ImportTramoSpec.java
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/tramoseats/actions/ImportTramoSpec.java
@@ -29,7 +29,7 @@
import ec.tstoolkit.modelling.arima.tramo.TramoSpecification;
import java.util.Collections;
import java.util.List;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.JMenuItem;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
@@ -97,7 +97,7 @@ public void importConfig(Config config) throws IllegalArgumentException {
});
}
- private static TramoSpecification fromConfig(@Nonnull Config config) throws IllegalArgumentException {
+ private static TramoSpecification fromConfig(@NonNull Config config) throws IllegalArgumentException {
if (!TramoSpecification.class.getName().equals(config.getDomain())) {
throw new IllegalArgumentException("Invalid config");
}
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/x13/actions/ImportRegArimaSpec.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/x13/actions/ImportRegArimaSpec.java
index 9e0244521..9745616d6 100644
--- a/nbdemetra-sa/src/main/java/ec/nbdemetra/x13/actions/ImportRegArimaSpec.java
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/x13/actions/ImportRegArimaSpec.java
@@ -29,7 +29,7 @@
import ec.tstoolkit.modelling.arima.x13.RegArimaSpecification;
import java.util.Collections;
import java.util.List;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.JMenuItem;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
@@ -97,7 +97,7 @@ public void importConfig(Config config) throws IllegalArgumentException {
});
}
- private static RegArimaSpecification fromConfig(@Nonnull Config config) throws IllegalArgumentException {
+ private static RegArimaSpecification fromConfig(@NonNull Config config) throws IllegalArgumentException {
if (!RegArimaSpecification.class.getName().equals(config.getDomain())) {
throw new IllegalArgumentException("Invalid config");
}
diff --git a/nbdemetra-sa/src/main/java/ec/nbdemetra/x13/actions/ImportX13Spec.java b/nbdemetra-sa/src/main/java/ec/nbdemetra/x13/actions/ImportX13Spec.java
index 83ff3eeda..477dd6b26 100644
--- a/nbdemetra-sa/src/main/java/ec/nbdemetra/x13/actions/ImportX13Spec.java
+++ b/nbdemetra-sa/src/main/java/ec/nbdemetra/x13/actions/ImportX13Spec.java
@@ -30,7 +30,7 @@
import ec.tstoolkit.algorithm.IProcSpecification;
import java.util.Collections;
import java.util.List;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.JMenuItem;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
@@ -98,7 +98,7 @@ public void importConfig(Config config) throws IllegalArgumentException {
});
}
- private static X13Specification fromConfig(@Nonnull Config config) throws IllegalArgumentException {
+ private static X13Specification fromConfig(@NonNull Config config) throws IllegalArgumentException {
if (!X13Specification.class.getName().equals(config.getDomain())) {
throw new IllegalArgumentException("Invalid config");
}
diff --git a/nbdemetra-sdmx/pom.xml b/nbdemetra-sdmx/pom.xml
index 7b516b0de..601ab6810 100644
--- a/nbdemetra-sdmx/pom.xml
+++ b/nbdemetra-sdmx/pom.xml
@@ -4,7 +4,7 @@
eu.europa.ec.joinup.sat
nbdemetra-parent
- 2.2.2
+ 2.2.3
nbdemetra-sdmx
@@ -70,7 +70,7 @@
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
true
diff --git a/nbdemetra-spreadsheet/pom.xml b/nbdemetra-spreadsheet/pom.xml
index 5999b30dd..3f016e93d 100644
--- a/nbdemetra-spreadsheet/pom.xml
+++ b/nbdemetra-spreadsheet/pom.xml
@@ -4,7 +4,7 @@
eu.europa.ec.joinup.sat
nbdemetra-parent
- 2.2.2
+ 2.2.3
nbdemetra-spreadsheet
@@ -14,6 +14,13 @@
This module provides spreadsheet IO (such as Excel files) to Demetra.
+
+
+ org.checkerframework
+ checker-qual
+ provided
+
+
org.netbeans.api
@@ -102,7 +109,7 @@
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
true
diff --git a/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetCellRenderer.java b/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetCellRenderer.java
index d80809647..0db4d0dd1 100644
--- a/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetCellRenderer.java
+++ b/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetCellRenderer.java
@@ -25,8 +25,8 @@
import java.awt.Color;
import java.awt.Component;
import java.util.Date;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.checker.nullness.qual.Nullable;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.JToolTip;
@@ -45,7 +45,7 @@ public final class SheetCellRenderer implements TableCellRenderer {
private final boolean invertColors;
private final DefaultTableCellRenderer2 delegate;
- public SheetCellRenderer(@Nonnull DataFormat dataFormat, @Nullable SwingColorSchemeSupport colorSchemeSupport, boolean invertColors) {
+ public SheetCellRenderer(@NonNull DataFormat dataFormat, @Nullable SwingColorSchemeSupport colorSchemeSupport, boolean invertColors) {
this.numberFormat = dataFormat.numberFormatter();
this.dateFormat = dataFormat.dateFormatter();
this.colorSchemeSupport = colorSchemeSupport;
diff --git a/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetGridCommand.java b/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetGridCommand.java
index 985a6f652..e8eb95145 100644
--- a/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetGridCommand.java
+++ b/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetGridCommand.java
@@ -26,7 +26,7 @@
import ec.util.various.swing.JCommand;
import java.awt.Toolkit;
import java.awt.datatransfer.Transferable;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.ListSelectionModel;
/**
@@ -43,15 +43,15 @@ public void execute(JGrid grid) {
}
// TODO: merge some code with TableGridCommand
- @Nonnull
- abstract public Table> toTable(@Nonnull JGrid grid);
+ @NonNull
+ abstract public Table> toTable(@NonNull JGrid grid);
- @Nonnull
+ @NonNull
public static SheetGridCommand copyAll(boolean rowHeader, boolean columnHeader) {
return new CopyAllCommand(rowHeader, columnHeader);
}
- @Nonnull
+ @NonNull
public static SheetGridCommand copySelection(boolean rowHeader, boolean columnHeader) {
return new CopySelectionCommand(rowHeader, columnHeader);
}
diff --git a/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetGridModel.java b/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetGridModel.java
index 9e355137b..b2e27c3f0 100644
--- a/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetGridModel.java
+++ b/nbdemetra-spreadsheet/src/main/java/ec/util/grid/swing/ext/SheetGridModel.java
@@ -18,7 +18,7 @@
import ec.util.grid.swing.AbstractGridModel;
import ec.util.spreadsheet.Sheet;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
/**
*
@@ -28,7 +28,7 @@ public final class SheetGridModel extends AbstractGridModel {
private final Sheet sheet;
- public SheetGridModel(@Nonnull Sheet sheet) {
+ public SheetGridModel(@NonNull Sheet sheet) {
this.sheet = sheet;
}
diff --git a/nbdemetra-ui/pom.xml b/nbdemetra-ui/pom.xml
index 3ae464103..17167a2ed 100644
--- a/nbdemetra-ui/pom.xml
+++ b/nbdemetra-ui/pom.xml
@@ -4,7 +4,7 @@
eu.europa.ec.joinup.sat
nbdemetra-parent
- 2.2.2
+ 2.2.3
nbdemetra-ui
@@ -14,17 +14,24 @@
3.7.4
- 1.0.5
+ 1.3.0
1.4
1.0.3
- 2.2.2
+ 2.2.4
- eu.europa.ec.joinup.sat
- nbdemetra-utils
+ be.nbb.rd
+ java-desktop-util-chart
+ ${java-desktop-util.version}
+ pom
+ import
+
+
+ be.nbb.rd
+ java-desktop-util-os
${java-desktop-util.version}
pom
import
@@ -59,6 +66,12 @@
lombok
provided
+
+ org.checkerframework
+ checker-qual
+ provided
+
+
junit
@@ -162,11 +175,6 @@
${project.groupId}
nbdemetra-core
-
- ${project.groupId}
- nbdemetra-utils
- ${java-desktop-util.version}
-
@@ -194,19 +202,31 @@
swing-layout
- net.java.dev.jna
- jna
+ be.nbb.rd
+ java-desktop-util-swing
+ ${java-desktop-util.version}
+
+
+ be.nbb.rd
+ java-desktop-util-chart
+ ${java-desktop-util.version}
- net.java.dev.jna
- jna-platform
+ be.nbb.rd
+ java-desktop-util-fa
+ ${java-desktop-util.version}
+
+
+ be.nbb.rd
+ java-desktop-util-os
+ ${java-desktop-util.version}
- org.codehaus.mojo
+ org.apache.netbeans.utilities
nbm-maven-plugin
true
@@ -221,7 +241,6 @@
ec.util.*
net.miginfocom.*
org.jfree.*
- com.sun.jna.*
com.l2fprod.common.*
com.toedter.*
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/AbstractConfigurable.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/AbstractConfigurable.java
index e0183dec9..3dc8a8de9 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/AbstractConfigurable.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/AbstractConfigurable.java
@@ -16,7 +16,7 @@
*/
package ec.nbdemetra.ui;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
/**
*
@@ -25,18 +25,18 @@
*/
public abstract class AbstractConfigurable implements IConfigurable {
- @Nonnull
+ @NonNull
protected abstract B loadBean();
- protected abstract void storeBean(@Nonnull B bean);
+ protected abstract void storeBean(@NonNull B bean);
- protected abstract boolean editBean(@Nonnull B bean);
+ protected abstract boolean editBean(@NonNull B bean);
- @Nonnull
- protected abstract Config toConfig(@Nonnull B bean);
+ @NonNull
+ protected abstract Config toConfig(@NonNull B bean);
- @Nonnull
- protected abstract B fromConfig(@Nonnull Config config) throws IllegalArgumentException;
+ @NonNull
+ protected abstract B fromConfig(@NonNull Config config) throws IllegalArgumentException;
@Override
final public Config getConfig() {
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ActiveViewManager.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ActiveViewManager.java
index 6640d9fdd..363ddc54a 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ActiveViewManager.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ActiveViewManager.java
@@ -51,7 +51,7 @@ private ActiveViewManager() {
public void set(IActiveView view) {
if (view == null) {
- content.set(Collections.EMPTY_SET, null);
+ content.set(Collections.emptySet(), null);
//mgr.setRootContext(Node.EMPTY);
} else {
content.set(Collections.singleton(view), null);
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/BeanHandler.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/BeanHandler.java
index e27a0a245..35667d6f3 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/BeanHandler.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/BeanHandler.java
@@ -20,7 +20,7 @@
import com.google.common.base.Converter;
import ec.nbdemetra.ui.properties.IBeanEditor;
import java.beans.IntrospectionException;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import org.openide.util.Exceptions;
/**
@@ -31,18 +31,18 @@
*/
public abstract class BeanHandler {
- @Nonnull
- public abstract B loadBean(@Nonnull R resource);
+ @NonNull
+ public abstract B loadBean(@NonNull R resource);
- public abstract void storeBean(@Nonnull R resource, @Nonnull B bean);
+ public abstract void storeBean(@NonNull R resource, @NonNull B bean);
- @Nonnull
- public Configurator toConfigurator(@Nonnull Converter converter) {
+ @NonNull
+ public Configurator toConfigurator(@NonNull Converter converter) {
return new ConfiguratorImpl(this, converter, DEFAULT_EDITOR);
}
- @Nonnull
- public Configurator toConfigurator(@Nonnull Converter converter, @Nonnull IBeanEditor editor) {
+ @NonNull
+ public Configurator toConfigurator(@NonNull Converter converter, @NonNull IBeanEditor editor) {
return new ConfiguratorImpl(this, converter, editor);
}
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ComponentFactory.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ComponentFactory.java
index c96750705..af79c8942 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ComponentFactory.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ComponentFactory.java
@@ -27,7 +27,7 @@
import ec.ui.grid.JTsGrid;
import ec.ui.html.JHtmlView;
import ec.ui.list.JTsList;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import org.openide.util.Lookup;
import org.openide.util.lookup.ServiceProvider;
@@ -39,32 +39,32 @@
@ServiceProvider(service = ComponentFactory.class)
public class ComponentFactory {
- @Nonnull
+ @NonNull
public static ComponentFactory getDefault() {
return Lookup.getDefault().lookup(ComponentFactory.class);
}
- @Nonnull
+ @NonNull
public ATsChart newTsChart() {
return new JTsChart();
}
- @Nonnull
+ @NonNull
public ATsGrid newTsGrid() {
return new JTsGrid();
}
- @Nonnull
+ @NonNull
public ATsGrowthChart newTsGrowthChart() {
return new JTsGrowthChart();
}
- @Nonnull
+ @NonNull
public ATsList newTsList() {
return new JTsList();
}
- @Nonnull
+ @NonNull
public AHtmlView newHtmlView() {
return new JHtmlView();
}
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/Config.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/Config.java
index ada816f6a..aed50578c 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/Config.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/Config.java
@@ -31,7 +31,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.SortedMap;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.annotation.XmlAttribute;
@@ -107,8 +107,7 @@ public String toString() {
* @return a non-null builder
* @since 2.2.0
*/
- @Nonnull
- public Config.Builder toBuilder() {
+ public Config.@NonNull Builder toBuilder() {
return new Builder(domain, name, version).putAll(params);
}
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/Configurator.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/Configurator.java
index 97e9726dc..37916b2b3 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/Configurator.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/Configurator.java
@@ -16,7 +16,7 @@
*/
package ec.nbdemetra.ui;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
/**
*
@@ -25,16 +25,16 @@
*/
public abstract class Configurator {
- @Nonnull
- abstract public Config getConfig(@Nonnull R resource);
+ @NonNull
+ abstract public Config getConfig(@NonNull R resource);
- abstract public void setConfig(@Nonnull R resource, @Nonnull Config config) throws IllegalArgumentException;
+ abstract public void setConfig(@NonNull R resource, @NonNull Config config) throws IllegalArgumentException;
- @Nonnull
- abstract public Config editConfig(@Nonnull Config config) throws IllegalArgumentException;
+ @NonNull
+ abstract public Config editConfig(@NonNull Config config) throws IllegalArgumentException;
- @Nonnull
- public IConfigurable toConfigurable(@Nonnull R resource) {
+ @NonNull
+ public IConfigurable toConfigurable(@NonNull R resource) {
return new ConfigurableImpl(this, resource);
}
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/DemetraUI.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/DemetraUI.java
index 47a53319c..f600ea634 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/DemetraUI.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/DemetraUI.java
@@ -47,7 +47,7 @@
import java.util.Collection;
import java.util.List;
import java.util.function.Function;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.Icon;
import org.netbeans.api.options.OptionsDisplayer;
import org.openide.util.Lookup;
@@ -62,13 +62,13 @@
@ServiceProvider(service = DemetraUI.class)
public class DemetraUI extends ListenableBean implements IConfigurable {
- @Nonnull
+ @NonNull
public static DemetraUI getDefault() {
return Lookup.getDefault().lookup(DemetraUI.class);
}
@Deprecated
- @Nonnull
+ @NonNull
public static DemetraUI getInstance() {
return getDefault();
}
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/DocumentUIServices.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/DocumentUIServices.java
index 3802542dd..bb7795ec7 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/DocumentUIServices.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/DocumentUIServices.java
@@ -13,7 +13,7 @@
import ec.ui.view.tsprocessing.IProcDocumentView;
import java.util.HashMap;
import java.util.Map;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.JComponent;
import org.openide.util.Lookup;
import org.openide.util.lookup.ServiceProvider;
@@ -26,7 +26,7 @@
@ServiceProvider(service = DocumentUIServices.class)
public class DocumentUIServices {
- @Nonnull
+ @NonNull
public static DocumentUIServices getDefault() {
return Lookup.getDefault().lookup(DocumentUIServices.class);
}
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/IConfigurable.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/IConfigurable.java
index e2dd6398a..7a31a934c 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/IConfigurable.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/IConfigurable.java
@@ -16,7 +16,7 @@
*/
package ec.nbdemetra.ui;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
/**
*
@@ -24,11 +24,11 @@
*/
public interface IConfigurable {
- @Nonnull
+ @NonNull
Config getConfig();
- void setConfig(@Nonnull Config config) throws IllegalArgumentException;
+ void setConfig(@NonNull Config config) throws IllegalArgumentException;
- @Nonnull
- Config editConfig(@Nonnull Config config) throws IllegalArgumentException;
+ @NonNull
+ Config editConfig(@NonNull Config config) throws IllegalArgumentException;
}
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/MonikerUI.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/MonikerUI.java
index 8fe218480..ff0947126 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/MonikerUI.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/MonikerUI.java
@@ -24,8 +24,8 @@
import ec.tss.tsproviders.DataSource;
import java.awt.Image;
import java.beans.BeanInfo;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.checker.nullness.qual.Nullable;
import javax.swing.Icon;
import org.openide.util.ImageUtilities;
import org.openide.util.Lookup;
@@ -40,13 +40,13 @@
@ServiceProvider(service = MonikerUI.class)
public class MonikerUI {
- @Nonnull
+ @NonNull
public static MonikerUI getDefault() {
return Lookup.getDefault().lookup(MonikerUI.class);
}
@Nullable
- public Icon getIcon(@Nonnull TsMoniker moniker) {
+ public Icon getIcon(@NonNull TsMoniker moniker) {
return DataSourceProviderBuddySupport.getDefault()
.getIcon(moniker, BeanInfo.ICON_COLOR_16x16, false)
.map(ImageUtilities::image2Icon)
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/NbComponents.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/NbComponents.java
index d8e554fdd..bf7d926b3 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/NbComponents.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/NbComponents.java
@@ -19,8 +19,8 @@
import ec.util.various.swing.ModernUI;
import java.awt.Component;
import java.awt.Toolkit;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.checker.nullness.qual.Nullable;
import javax.swing.*;
import javax.swing.border.Border;
import org.openide.awt.Toolbar;
@@ -43,7 +43,7 @@ public static boolean isXPTheme() {
return isXP == null ? false : isXP;
}
- @Nonnull
+ @NonNull
public static JToolBar newInnerToolbar() {
JToolBar result = new Toolbar();
Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
@@ -58,33 +58,33 @@ public static JToolBar newInnerToolbar() {
return result;
}
- @Nonnull
+ @NonNull
public static JScrollPane newJScrollPane() {
return ModernUI.withEmptyBorders(new JScrollPane());
}
- @Nonnull
- public static JScrollPane newJScrollPane(@Nonnull Component view) {
+ @NonNull
+ public static JScrollPane newJScrollPane(@NonNull Component view) {
return ModernUI.withEmptyBorders(new JScrollPane(view));
}
- @Nonnull
+ @NonNull
public static JSplitPane newJSplitPane(int orientation) {
return ModernUI.withEmptyBorders(new JSplitPane(orientation));
}
- @Nonnull
- public static JSplitPane newJSplitPane(int orientation, @Nonnull Component left, @Nonnull Component right) {
+ @NonNull
+ public static JSplitPane newJSplitPane(int orientation, @NonNull Component left, @NonNull Component right) {
return ModernUI.withEmptyBorders(new JSplitPane(orientation, left, right));
}
- @Nonnull
- public static JSplitPane newJSplitPane(int orientation, boolean continuousLayout, @Nonnull Component left, @Nonnull Component right) {
+ @NonNull
+ public static JSplitPane newJSplitPane(int orientation, boolean continuousLayout, @NonNull Component left, @NonNull Component right) {
return ModernUI.withEmptyBorders(new JSplitPane(orientation, continuousLayout, left, right));
}
@Nullable
- public static T findTopComponentByNameAndClass(@Nonnull String name, @Nonnull Class clazz) {
+ public static T findTopComponentByNameAndClass(@NonNull String name, @NonNull Class clazz) {
for (TopComponent o : TopComponent.getRegistry().getOpened()) {
if (o.getName().equals(name) && clazz.isInstance(o)) {
return (T) o;
@@ -94,7 +94,7 @@ public static T findTopComponentByNameAndClass(@Nonnull
}
@Nullable
- public static TopComponent findTopComponentByName(@Nonnull String name) {
+ public static TopComponent findTopComponentByName(@NonNull String name) {
return findTopComponentByNameAndClass(name, TopComponent.class);
}
}
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/SingleFileExporter.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/SingleFileExporter.java
index 8c129c492..aca4fb4ef 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/SingleFileExporter.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/SingleFileExporter.java
@@ -27,7 +27,7 @@
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Supplier;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.SwingUtilities;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.DialogDisplayer;
@@ -53,55 +53,55 @@ public SingleFileExporter() {
this.success = f -> notifySuccess(f, "Export succeeded");
}
- @Nonnull
- public SingleFileExporter fileChooser(@Nonnull Supplier fileChooser) {
+ @NonNull
+ public SingleFileExporter fileChooser(@NonNull Supplier fileChooser) {
this.fileChooser = Objects.requireNonNull(fileChooser);
return this;
}
- @Nonnull
- public SingleFileExporter file(@Nonnull File file) {
+ @NonNull
+ public SingleFileExporter file(@NonNull File file) {
Objects.requireNonNull(file);
return fileChooser(() -> file);
}
- @Nonnull
- public SingleFileExporter progressHandle(@Nonnull Supplier progressHandle) {
+ @NonNull
+ public SingleFileExporter progressHandle(@NonNull Supplier progressHandle) {
this.progressHandle = Objects.requireNonNull(progressHandle);
return this;
}
- @Nonnull
- public SingleFileExporter progressLabel(@Nonnull String displayName) {
+ @NonNull
+ public SingleFileExporter progressLabel(@NonNull String displayName) {
Objects.requireNonNull(displayName);
return progressHandle(() -> ProgressHandle.createHandle(displayName));
}
- @Nonnull
- public SingleFileExporter onError(@Nonnull BiConsumer error) {
+ @NonNull
+ public SingleFileExporter onError(@NonNull BiConsumer error) {
this.error = Objects.requireNonNull(error);
return this;
}
- @Nonnull
- public SingleFileExporter onErrorNotify(@Nonnull String message) {
+ @NonNull
+ public SingleFileExporter onErrorNotify(@NonNull String message) {
Objects.requireNonNull(message);
return onError((f, t) -> notifyError(f, t, message));
}
- @Nonnull
- public SingleFileExporter onSussess(@Nonnull Consumer success) {
+ @NonNull
+ public SingleFileExporter onSussess(@NonNull Consumer success) {
this.success = Objects.requireNonNull(success);
return this;
}
- @Nonnull
- public SingleFileExporter onSussessNotify(@Nonnull String message) {
+ @NonNull
+ public SingleFileExporter onSussessNotify(@NonNull String message) {
Objects.requireNonNull(message);
return onSussess(f -> notifySuccess(f, message));
}
- public void execAsync(@Nonnull SingleFileTask task) {
+ public void execAsync(@NonNull SingleFileTask task) {
Objects.requireNonNull(task);
File file = fileChooser.get();
if (file != null) {
@@ -141,8 +141,8 @@ private static void notifyError(File file, Throwable t, String message) {
NotifyUtil.error(message, getMessageOrElseType(t), t);
}
- @Nonnull
- private static String getMessageOrElseType(@Nonnull Throwable t) {
+ @NonNull
+ private static String getMessageOrElseType(@NonNull Throwable t) {
String msg = t.getMessage();
return msg != null ? t.getMessage() : t.getClass().getSimpleName();
}
@@ -155,8 +155,7 @@ private static Throwable unwrapException(Throwable ex, Class extends Throwable
return ex.getCause() != null && Arrays.stream(types).anyMatch(o -> o.isInstance(ex)) ? unwrapException(ex.getCause(), types) : ex;
}
- @Nonnull
- public static FileChooserBuilder.SelectionApprover overwriteApprover() {
+ public static FileChooserBuilder.@NonNull SelectionApprover overwriteApprover() {
return new SaveSelectionApprover();
}
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ThemeSupport.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ThemeSupport.java
index b6bf60e16..48b0358aa 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ThemeSupport.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/ThemeSupport.java
@@ -15,7 +15,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
-import javax.annotation.Nullable;
+import org.checkerframework.checker.nullness.qual.Nullable;
import org.openide.util.WeakListeners;
/**
diff --git a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/awt/ActionMaps.java b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/awt/ActionMaps.java
index ad164dcb2..21d376b60 100644
--- a/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/awt/ActionMaps.java
+++ b/nbdemetra-ui/src/main/java/ec/nbdemetra/ui/awt/ActionMaps.java
@@ -25,7 +25,7 @@
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
+import org.checkerframework.checker.nullness.qual.NonNull;
import javax.swing.Action;
import javax.swing.ActionMap;
@@ -39,8 +39,8 @@ private ActionMaps() {
// static class
}
- @Nonnull
- public static ActionMap getRoot(@Nonnull ActionMap actionMap) {
+ @NonNull
+ public static ActionMap getRoot(@NonNull ActionMap actionMap) {
ActionMap result = actionMap;
while (result.getParent() != null) {
result = result.getParent();
@@ -48,16 +48,16 @@ public static ActionMap getRoot(@Nonnull ActionMap actionMap) {
return result;
}
- @Nonnull
- public static Map