diff --git a/service/src/main/java/bio/terra/tanagra/service/UnderlayService.java b/service/src/main/java/bio/terra/tanagra/service/UnderlayService.java index 7b74824a1..15d9fb438 100644 --- a/service/src/main/java/bio/terra/tanagra/service/UnderlayService.java +++ b/service/src/main/java/bio/terra/tanagra/service/UnderlayService.java @@ -29,7 +29,7 @@ import bio.terra.tanagra.underlay.entitymodel.*; import bio.terra.tanagra.underlay.serialization.*; import com.google.common.collect.ImmutableMap; -import jakarta.annotation.*; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; diff --git a/service/src/main/java/bio/terra/tanagra/service/artifact/model/CohortRevision.java b/service/src/main/java/bio/terra/tanagra/service/artifact/model/CohortRevision.java index 9f642dc7a..a5df65f97 100644 --- a/service/src/main/java/bio/terra/tanagra/service/artifact/model/CohortRevision.java +++ b/service/src/main/java/bio/terra/tanagra/service/artifact/model/CohortRevision.java @@ -9,7 +9,7 @@ import java.util.Collections; import java.util.List; import java.util.Objects; -import java.util.stream.*; +import java.util.stream.Stream; @SuppressWarnings("PMD.ExcessivePublicCount") public final class CohortRevision { @@ -238,7 +238,7 @@ public static class CriteriaGroupSection { @SuppressWarnings("checkstyle:ParameterNumber") private CriteriaGroupSection( String id, - String displayName, + @Nullable String displayName, List criteriaGroups, List secondConditionCriteriaGroups, BooleanAndOrFilter.LogicalOperator operator, @@ -269,6 +269,7 @@ public String getId() { return id; } + @Nullable public String getDisplayName() { return displayName; } diff --git a/service/src/main/java/bio/terra/tanagra/service/filter/FilterBuilderService.java b/service/src/main/java/bio/terra/tanagra/service/filter/FilterBuilderService.java index 29d5c8ce6..61173a902 100644 --- a/service/src/main/java/bio/terra/tanagra/service/filter/FilterBuilderService.java +++ b/service/src/main/java/bio/terra/tanagra/service/filter/FilterBuilderService.java @@ -30,7 +30,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; -import java.util.stream.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.slf4j.Logger; diff --git a/underlay/src/main/java/bio/terra/tanagra/api/filter/TemporalPrimaryFilter.java b/underlay/src/main/java/bio/terra/tanagra/api/filter/TemporalPrimaryFilter.java index b22cde937..56f3c4314 100644 --- a/underlay/src/main/java/bio/terra/tanagra/api/filter/TemporalPrimaryFilter.java +++ b/underlay/src/main/java/bio/terra/tanagra/api/filter/TemporalPrimaryFilter.java @@ -7,7 +7,8 @@ import bio.terra.tanagra.underlay.entitymodel.*; import com.google.common.collect.ImmutableList; import jakarta.annotation.Nullable; -import java.util.*; +import java.util.List; +import java.util.Objects; public class TemporalPrimaryFilter extends EntityFilter { private final Underlay underlay; diff --git a/underlay/src/main/java/bio/terra/tanagra/api/shared/ValueDisplay.java b/underlay/src/main/java/bio/terra/tanagra/api/shared/ValueDisplay.java index f637ae437..be2b2e671 100644 --- a/underlay/src/main/java/bio/terra/tanagra/api/shared/ValueDisplay.java +++ b/underlay/src/main/java/bio/terra/tanagra/api/shared/ValueDisplay.java @@ -1,7 +1,8 @@ package bio.terra.tanagra.api.shared; -import com.google.common.collect.*; -import java.util.*; +import com.google.common.collect.ImmutableList; +import java.util.List; +import java.util.Objects; public class ValueDisplay { private final Literal value; diff --git a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQExecutor.java b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQExecutor.java index d5cf011c7..7814b27ae 100644 --- a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQExecutor.java +++ b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQExecutor.java @@ -16,7 +16,7 @@ import com.google.cloud.bigquery.Table; import com.google.cloud.bigquery.TableId; import com.google.cloud.bigquery.TableResult; -import com.google.cloud.storage.*; +import com.google.cloud.storage.BlobId; import com.google.common.collect.Iterables; import java.math.BigInteger; import java.sql.Timestamp; diff --git a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQExecutorInfrastructure.java b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQExecutorInfrastructure.java index 7879fd4ea..40355cc5a 100644 --- a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQExecutorInfrastructure.java +++ b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQExecutorInfrastructure.java @@ -1,8 +1,8 @@ package bio.terra.tanagra.query.bigquery; -import com.google.common.collect.*; -import jakarta.annotation.*; -import java.util.*; +import com.google.common.collect.ImmutableList; +import jakarta.annotation.Nullable; +import java.util.List; public class BQExecutorInfrastructure { private final String queryProjectId; @@ -12,7 +12,7 @@ public class BQExecutorInfrastructure { private BQExecutorInfrastructure( String queryProjectId, - String datasetLocation, + @Nullable String datasetLocation, List exportDatasetIds, List exportBucketNames) { this.queryProjectId = queryProjectId; @@ -40,14 +40,17 @@ public String getQueryProjectId() { return queryProjectId; } + @Nullable public String getDatasetLocation() { return datasetLocation; } + @Nullable public ImmutableList getExportDatasetIds() { return exportDatasetIds; } + @Nullable public ImmutableList getExportBucketNames() { return exportBucketNames; } diff --git a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQQueryRunner.java b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQQueryRunner.java index f3bdda13e..5c4024240 100644 --- a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQQueryRunner.java +++ b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQQueryRunner.java @@ -35,9 +35,15 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.HashBasedTable; import com.google.common.collect.Table; -import jakarta.annotation.*; +import jakarta.annotation.Nullable; import java.time.Instant; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.apache.commons.lang3.*; import org.apache.commons.lang3.tuple.Pair; diff --git a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQRowResult.java b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQRowResult.java index eb76ea3e8..5460d41a4 100644 --- a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQRowResult.java +++ b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/BQRowResult.java @@ -6,7 +6,7 @@ import com.google.cloud.bigquery.FieldValue; import com.google.cloud.bigquery.FieldValueList; import java.sql.Timestamp; -import java.util.*; +import java.util.List; public class BQRowResult implements SqlRowResult { private final FieldValueList fieldValues; diff --git a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/translator/BQApiTranslator.java b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/translator/BQApiTranslator.java index e6f290b0a..89dc5380b 100644 --- a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/translator/BQApiTranslator.java +++ b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/translator/BQApiTranslator.java @@ -33,8 +33,10 @@ import bio.terra.tanagra.query.sql.translator.ApiFilterTranslator; import bio.terra.tanagra.query.sql.translator.ApiTranslator; import bio.terra.tanagra.underlay.entitymodel.Attribute; -import jakarta.annotation.*; -import java.util.*; +import jakarta.annotation.Nullable; +import java.util.List; +import java.util.Map; +import java.util.Optional; public final class BQApiTranslator implements ApiTranslator { @Override diff --git a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/translator/field/BQAttributeFieldTranslator.java b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/translator/field/BQAttributeFieldTranslator.java index 8e0718e94..bac016a02 100644 --- a/underlay/src/main/java/bio/terra/tanagra/query/bigquery/translator/field/BQAttributeFieldTranslator.java +++ b/underlay/src/main/java/bio/terra/tanagra/query/bigquery/translator/field/BQAttributeFieldTranslator.java @@ -12,7 +12,7 @@ import bio.terra.tanagra.query.sql.translator.ApiFieldTranslator; import bio.terra.tanagra.underlay.entitymodel.Attribute; import bio.terra.tanagra.underlay.indextable.ITEntityMain; -import jakarta.annotation.*; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.List; import java.util.Optional; diff --git a/underlay/src/main/java/bio/terra/tanagra/query/sql/SqlRowResult.java b/underlay/src/main/java/bio/terra/tanagra/query/sql/SqlRowResult.java index a9c124e6f..d25ab86cb 100644 --- a/underlay/src/main/java/bio/terra/tanagra/query/sql/SqlRowResult.java +++ b/underlay/src/main/java/bio/terra/tanagra/query/sql/SqlRowResult.java @@ -2,7 +2,7 @@ import bio.terra.tanagra.api.shared.DataType; import bio.terra.tanagra.api.shared.Literal; -import java.util.*; +import java.util.List; public interface SqlRowResult { /** Get literal value for the column in this row. */ diff --git a/underlay/src/main/java/bio/terra/tanagra/underlay/SourceSchema.java b/underlay/src/main/java/bio/terra/tanagra/underlay/SourceSchema.java index 0d698e637..a89f8ee66 100644 --- a/underlay/src/main/java/bio/terra/tanagra/underlay/SourceSchema.java +++ b/underlay/src/main/java/bio/terra/tanagra/underlay/SourceSchema.java @@ -9,7 +9,9 @@ import bio.terra.tanagra.underlay.sourcetable.*; import com.google.common.collect.ImmutableList; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; @SuppressFBWarnings( value = "NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", diff --git a/underlay/src/main/java/bio/terra/tanagra/underlay/indextable/ITRelationshipIdPairs.java b/underlay/src/main/java/bio/terra/tanagra/underlay/indextable/ITRelationshipIdPairs.java index 8a812780f..255f429f6 100644 --- a/underlay/src/main/java/bio/terra/tanagra/underlay/indextable/ITRelationshipIdPairs.java +++ b/underlay/src/main/java/bio/terra/tanagra/underlay/indextable/ITRelationshipIdPairs.java @@ -6,8 +6,8 @@ import bio.terra.tanagra.underlay.serialization.SZBigQuery; import bio.terra.tanagra.underlay.sourcetable.*; import com.google.common.collect.ImmutableList; -import java.util.*; -import java.util.stream.*; +import java.util.Arrays; +import java.util.stream.Collectors; public final class ITRelationshipIdPairs extends IndexTable { private static final String TABLE_NAME = "RIDS"; diff --git a/underlay/src/main/java/bio/terra/tanagra/underlay/serialization/SZBigQuery.java b/underlay/src/main/java/bio/terra/tanagra/underlay/serialization/SZBigQuery.java index 11e09b9d1..0dd29b6c8 100644 --- a/underlay/src/main/java/bio/terra/tanagra/underlay/serialization/SZBigQuery.java +++ b/underlay/src/main/java/bio/terra/tanagra/underlay/serialization/SZBigQuery.java @@ -2,7 +2,8 @@ import bio.terra.tanagra.annotation.AnnotatedClass; import bio.terra.tanagra.annotation.AnnotatedField; -import java.util.*; +import java.util.List; +import java.util.Map; @AnnotatedClass( name = "SZBigQuery", diff --git a/underlay/src/test/java/bio/terra/tanagra/query/bigquery/resultparsing/BQCountQueryResultsTest.java b/underlay/src/test/java/bio/terra/tanagra/query/bigquery/resultparsing/BQCountQueryResultsTest.java index dc1690923..071b51f63 100644 --- a/underlay/src/test/java/bio/terra/tanagra/query/bigquery/resultparsing/BQCountQueryResultsTest.java +++ b/underlay/src/test/java/bio/terra/tanagra/query/bigquery/resultparsing/BQCountQueryResultsTest.java @@ -23,7 +23,9 @@ import bio.terra.tanagra.query.bigquery.BQRunnerTest; import bio.terra.tanagra.underlay.entitymodel.*; import bio.terra.tanagra.underlay.entitymodel.entitygroup.EntityGroup; -import java.util.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; import org.junit.jupiter.api.Test; public class BQCountQueryResultsTest extends BQRunnerTest { @@ -213,8 +215,8 @@ void repeatedAttributeField() { .equals(Literal.forString("baz"))) .findAny(); assertTrue(bazCount.isPresent()); - assertTrue(fooCount.get().getCount() == barCount.get().getCount()); - assertTrue(barCount.get().getCount() == bazCount.get().getCount()); + assertEquals(fooCount.get().getCount(), barCount.get().getCount()); + assertEquals(barCount.get().getCount(), bazCount.get().getCount()); } @Test