Skip to content

Commit da889e7

Browse files
mziccardajkannan
authored andcommitted
---
yaml --- r: 4829 b: refs/heads/logging-alpha c: 7d7b799 h: refs/heads/master i: 4827: ab464a6
1 parent 9c48942 commit da889e7

52 files changed

Lines changed: 368 additions & 190 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ refs/heads/compute-alpha: 969cba2627f1d53d352cc4a5ffe0879dacf65e6c
1212
refs/heads/dns-alpha: 2f90e7e338349287ace33375896907af0f032ca1
1313
refs/heads/dns-alpha-batch: 17442b07867021b85d0452f5f3eda29a3413288f
1414
refs/heads/gcs-nio: 283aeaf15efdcf3621eb6859f05e55ad7764375d
15-
refs/heads/logging-alpha: fd740ead7276b35128a0ba01fe08ff0bc6e55896
15+
refs/heads/logging-alpha: 7d7b799c4ab14b6c0fd90520bc1060533607a1fe
1616
refs/tags/v0.1.0: a615317f7424ed58621b1f65d5c4d8cbbe8a6ed8
1717
refs/tags/v0.1.1: 7a7f6985fe465e9dd6a075af55493f42b4933be0
1818
refs/tags/v0.1.2: 3eb3fe866ba22487686048f45d927b8c8638ea3f

branches/logging-alpha/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryError.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* {@link BigQueryException} is thrown the BigQuery Error that caused it, if any, can be accessed
1818
* with {@link BigQueryException#error()}.
1919
*/
20-
public class BigQueryError implements Serializable {
20+
public final class BigQueryError implements Serializable {
2121

2222
static final Function<ErrorProto, BigQueryError> FROM_PB_FUNCTION =
2323
new Function<ErrorProto, BigQueryError>() {
@@ -98,7 +98,9 @@ public String toString() {
9898

9999
@Override
100100
public boolean equals(Object obj) {
101-
return obj instanceof BigQueryError && Objects.equals(toPb(), ((BigQueryError) obj).toPb());
101+
return obj == this
102+
|| obj instanceof BigQueryError
103+
&& Objects.equals(toPb(), ((BigQueryError) obj).toPb());
102104
}
103105

104106
ErrorProto toPb() {

branches/logging-alpha/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ ToStringHelper toStringHelper() {
181181

182182
@Override
183183
public boolean equals(Object obj) {
184-
return obj instanceof CopyJobConfiguration && baseEquals((CopyJobConfiguration) obj);
184+
return obj == this
185+
|| obj instanceof CopyJobConfiguration
186+
&& baseEquals((CopyJobConfiguration) obj);
185187
}
186188

187189
@Override

branches/logging-alpha/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* Google BigQuery options for CSV format. This class wraps some properties of CSV files used by
2626
* BigQuery to parse external data.
2727
*/
28-
public class CsvOptions extends FormatOptions {
28+
public final class CsvOptions extends FormatOptions {
2929

3030
private static final long serialVersionUID = 2193570529308612708L;
3131

@@ -224,7 +224,9 @@ public int hashCode() {
224224

225225
@Override
226226
public boolean equals(Object obj) {
227-
return obj instanceof CsvOptions && Objects.equals(toPb(), ((CsvOptions) obj).toPb());
227+
return obj == this
228+
|| obj instanceof CsvOptions
229+
&& Objects.equals(toPb(), ((CsvOptions) obj).toPb());
228230
}
229231

230232
com.google.api.services.bigquery.model.CsvOptions toPb() {

branches/logging-alpha/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* {@link DatasetInfo}.
3535
* </p>
3636
*/
37-
public final class Dataset extends DatasetInfo {
37+
public class Dataset extends DatasetInfo {
3838

3939
private static final long serialVersionUID = -4272921483363065593L;
4040

@@ -230,14 +230,20 @@ public Builder toBuilder() {
230230
}
231231

232232
@Override
233-
public boolean equals(Object obj) {
234-
return obj instanceof Dataset
235-
&& Objects.equals(toPb(), ((Dataset) obj).toPb())
236-
&& Objects.equals(options, ((Dataset) obj).options);
233+
public final boolean equals(Object obj) {
234+
if (obj == this) {
235+
return true;
236+
}
237+
if (obj == null || !obj.getClass().equals(Dataset.class)) {
238+
return false;
239+
}
240+
Dataset other = (Dataset) obj;
241+
return Objects.equals(toPb(), other.toPb())
242+
&& Objects.equals(options, other.options);
237243
}
238244

239245
@Override
240-
public int hashCode() {
246+
public final int hashCode() {
241247
return Objects.hash(super.hashCode(), options);
242248
}
243249

branches/logging-alpha/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/**
2727
* Google BigQuery Dataset identity.
2828
*/
29-
public class DatasetId implements Serializable {
29+
public final class DatasetId implements Serializable {
3030

3131
private static final long serialVersionUID = -6186254820908152300L;
3232

@@ -68,7 +68,9 @@ public static DatasetId of(String dataset) {
6868

6969
@Override
7070
public boolean equals(Object obj) {
71-
return obj instanceof DatasetId && Objects.equals(toPb(), ((DatasetId) obj).toPb());
71+
return obj == this
72+
|| obj instanceof DatasetId
73+
&& Objects.equals(toPb(), ((DatasetId) obj).toPb());
7274
}
7375

7476
@Override

branches/logging-alpha/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ public int hashCode() {
395395

396396
@Override
397397
public boolean equals(Object obj) {
398-
return obj != null
398+
return obj == this
399+
|| obj != null
399400
&& obj.getClass().equals(DatasetInfo.class)
400401
&& Objects.equals(toPb(), ((DatasetInfo) obj).toPb());
401402
}

branches/logging-alpha/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,15 @@ ToStringHelper toStringHelper() {
255255
}
256256

257257
@Override
258-
public boolean equals(Object obj) {
259-
return obj instanceof ExternalTableDefinition && baseEquals((ExternalTableDefinition) obj);
258+
public final boolean equals(Object obj) {
259+
return obj == this
260+
|| obj != null
261+
&& obj.getClass().equals(ExternalTableDefinition.class)
262+
&& baseEquals((ExternalTableDefinition) obj);
260263
}
261264

262265
@Override
263-
public int hashCode() {
266+
public final int hashCode() {
264267
return Objects.hash(baseHashCode(), compression, ignoreUnknownValues, maxBadRecords,
265268
formatOptions, sourceUris);
266269
}

branches/logging-alpha/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ ToStringHelper toStringHelper() {
211211

212212
@Override
213213
public boolean equals(Object obj) {
214-
return obj instanceof ExtractJobConfiguration && baseEquals((ExtractJobConfiguration) obj);
214+
return obj == this
215+
|| obj instanceof ExtractJobConfiguration
216+
&& baseEquals((ExtractJobConfiguration) obj);
215217
}
216218

217219
@Override

branches/logging-alpha/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/Field.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
import java.util.Objects;
3333

3434
/**
35-
* Google BigQuery Table field. A table field has a name, a value, a mode and possibly a
36-
* description. Supported types are: {@link Type#integer()}, {@link Type#bool()},
37-
* {@link Type#string()}, {@link Type#floatingPoint()}, {@link Type#timestamp()} and
38-
* {@link Type#record(Field...)}. One or more fields form a table's schema.
35+
* Google BigQuery Table field. A table field has a name, a type, a mode and possibly a description.
36+
* Supported types are: {@link Type#integer()}, {@link Type#bool()}, {@link Type#string()},
37+
* {@link Type#floatingPoint()}, {@link Type#timestamp()} and {@link Type#record(Field...)}. One or
38+
* more fields form a table's schema.
3939
*/
40-
public class Field implements Serializable {
40+
public final class Field implements Serializable {
4141

4242
static final Function<TableFieldSchema, Field> FROM_PB_FUNCTION =
4343
new Function<TableFieldSchema, Field>() {
@@ -56,6 +56,11 @@ public TableFieldSchema apply(Field field) {
5656

5757
private static final long serialVersionUID = -8154262932305199256L;
5858

59+
private final String name;
60+
private final Type type;
61+
private final String mode;
62+
private final String description;
63+
5964
/**
6065
* Data Types for a BigQuery Table field. This class provides factory methods for all BigQuery
6166
* field types. To instantiate a RECORD value the list of sub-fields must be provided.
@@ -185,11 +190,6 @@ public enum Mode {
185190
NULLABLE, REQUIRED, REPEATED
186191
}
187192

188-
private final String name;
189-
private final Type type;
190-
private final String mode;
191-
private final String description;
192-
193193
public static final class Builder {
194194

195195
private String name;

0 commit comments

Comments
 (0)