Skip to content

Commit

Permalink
Replace wildcard imports with specifics for external libs (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
dexamundsen authored Jan 17, 2025
1 parent 2367166 commit 2429a14
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -238,7 +238,7 @@ public static class CriteriaGroupSection {
@SuppressWarnings("checkstyle:ParameterNumber")
private CriteriaGroupSection(
String id,
String displayName,
@Nullable String displayName,
List<CriteriaGroup> criteriaGroups,
List<CriteriaGroup> secondConditionCriteriaGroups,
BooleanAndOrFilter.LogicalOperator operator,
Expand Down Expand Up @@ -269,6 +269,7 @@ public String getId() {
return id;
}

@Nullable
public String getDisplayName() {
return displayName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -12,7 +12,7 @@ public class BQExecutorInfrastructure {

private BQExecutorInfrastructure(
String queryProjectId,
String datasetLocation,
@Nullable String datasetLocation,
List<String> exportDatasetIds,
List<String> exportBucketNames) {
this.queryProjectId = queryProjectId;
Expand Down Expand Up @@ -40,14 +40,17 @@ public String getQueryProjectId() {
return queryProjectId;
}

@Nullable
public String getDatasetLocation() {
return datasetLocation;
}

@Nullable
public ImmutableList<String> getExportDatasetIds() {
return exportDatasetIds;
}

@Nullable
public ImmutableList<String> getExportBucketNames() {
return exportBucketNames;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2429a14

Please sign in to comment.