From 448e178f710dfb9ae5e419f50234f702615ca6b0 Mon Sep 17 00:00:00 2001 From: Sabrina Wullschleger Date: Fri, 8 Mar 2024 16:12:33 +0100 Subject: [PATCH] #126: Fix @Optional annotations --- .../main/java/ch/so/agi/gretl/tasks/CsvExport.java | 13 +++++++------ .../java/ch/so/agi/gretl/tasks/CsvValidator.java | 9 ++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gretl/src/main/java/ch/so/agi/gretl/tasks/CsvExport.java b/gretl/src/main/java/ch/so/agi/gretl/tasks/CsvExport.java index cf560934..4e62e9d4 100644 --- a/gretl/src/main/java/ch/so/agi/gretl/tasks/CsvExport.java +++ b/gretl/src/main/java/ch/so/agi/gretl/tasks/CsvExport.java @@ -5,10 +5,7 @@ import org.gradle.api.DefaultTask; import org.gradle.api.GradleException; -import org.gradle.api.tasks.Input; -import org.gradle.api.tasks.InputFile; -import org.gradle.api.tasks.Optional; -import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.*; import ch.ehi.basics.settings.Settings; import ch.interlis.iom_j.csv.CsvReader; @@ -19,6 +16,8 @@ import ch.so.agi.gretl.logging.LogEnvironment; import ch.so.agi.gretl.util.TaskUtil; +import javax.annotation.Nullable; + public class CsvExport extends DefaultTask { protected GretlLogger log; private Connector database; @@ -70,12 +69,14 @@ public String getSchemaName() { return schemaName; } - @Optional + @Internal + @Nullable public String[] getAttributes(){ return attributes; } - @Optional + @Internal + @Nullable public String getEncoding(){ return encoding; } diff --git a/gretl/src/main/java/ch/so/agi/gretl/tasks/CsvValidator.java b/gretl/src/main/java/ch/so/agi/gretl/tasks/CsvValidator.java index 5ef5e7e6..878cf1d9 100644 --- a/gretl/src/main/java/ch/so/agi/gretl/tasks/CsvValidator.java +++ b/gretl/src/main/java/ch/so/agi/gretl/tasks/CsvValidator.java @@ -9,11 +9,9 @@ import ch.so.agi.gretl.tasks.impl.CsvValidatorImpl; import org.gradle.api.file.FileCollection; -import org.gradle.api.tasks.Input; -import org.gradle.api.tasks.Optional; -import org.gradle.api.tasks.TaskAction; -import org.gradle.api.tasks.TaskExecutionException; +import org.gradle.api.tasks.*; +import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; @@ -41,7 +39,8 @@ public Character getValueDelimiter() { public Character getValueSeparator() { return valueSeparator; } - @Optional + @Internal + @Nullable public String getEncoding(){ return encoding; }