Skip to content

Commit

Permalink
Fixing Codacy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjonesgoogle committed Dec 7, 2016
1 parent 6271268 commit 38451c2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,9 @@

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.api.services.bigquery.Bigquery.Jobs.Query;
import com.google.cloud.bigquery.Field.Builder;
import com.google.cloud.bigquery.Field.Mode;
import com.google.cloud.bigquery.Field.Type;
import com.google.common.base.Function;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ com.google.api.services.bigquery.model.QueryParameterValue toValuePb() {
com.google.api.services.bigquery.model.QueryParameterValue valuePb =
new com.google.api.services.bigquery.model.QueryParameterValue();
valuePb.setValue(value);
if (arrayValues != null && arrayValues.size() > 0) {
if (arrayValues != null && !arrayValues.isEmpty()) {
valuePb.setArrayValues(
Lists.transform(arrayValues, QueryParameterValue.TO_VALUE_PB_FUNCTION));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@
import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.base.MoreObjects;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import javax.annotation.concurrent.Immutable;

/**
* Google Cloud BigQuery Query Request. This class can be used to run a BigQuery SQL query and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.bigquery;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.io.BaseEncoding;
import java.io.IOException;
import java.nio.ByteBuffer;
Expand All @@ -89,7 +90,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -860,10 +860,7 @@ public void testNamedQueryParameters() throws InterruptedException {
QueryResponse response = queryAndWaitForResponse(request);
assertEquals(QUERY_RESULT_SCHEMA, response.getResult().getSchema());
int rowCount = 0;
for (List<FieldValue> row : response.getResult().getValues()) {
rowCount++;
}
assertEquals(2, rowCount);
assertEquals(2, Iterables.size(response.getResult().getValues()));
}

@Test
Expand Down

0 comments on commit 38451c2

Please sign in to comment.