From a991b1f95d8812bff3e6f3f1f889ff62d669b91e Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Mon, 4 Jun 2018 10:12:48 -0700 Subject: [PATCH 1/2] add newBuilder() to logging.SourceLocation --- .../java/com/google/cloud/logging/SourceLocation.java | 8 ++++++++ .../java/com/google/cloud/logging/SourceLocationTest.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/SourceLocation.java b/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/SourceLocation.java index 7b4a56473d79..915d156de99a 100644 --- a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/SourceLocation.java +++ b/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/SourceLocation.java @@ -33,6 +33,14 @@ public final class SourceLocation implements Serializable { private final Long line; private final String function; + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newBuilder(SourceLocation sourceLocation) { + return new Builder(sourceLocation); + } + /** * A builder for {@code SourceLocation} objects. */ diff --git a/google-cloud-clients/google-cloud-logging/src/test/java/com/google/cloud/logging/SourceLocationTest.java b/google-cloud-clients/google-cloud-logging/src/test/java/com/google/cloud/logging/SourceLocationTest.java index a20a1ba84f04..9bb2d2e5de3d 100644 --- a/google-cloud-clients/google-cloud-logging/src/test/java/com/google/cloud/logging/SourceLocationTest.java +++ b/google-cloud-clients/google-cloud-logging/src/test/java/com/google/cloud/logging/SourceLocationTest.java @@ -25,7 +25,7 @@ public class SourceLocationTest { private static final String FILE = "file"; private static final Long LINE = 42L; private static final String FUNCTION = "function"; - private static final SourceLocation SOURCE_LOCATION = new SourceLocation.Builder() + private static final SourceLocation SOURCE_LOCATION = SourceLocation.newBuilder() .setFile(FILE) .setLine(LINE) .setFunction(FUNCTION) From e42df39c8379c41286b4796a1973df0ba0607692 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Mon, 4 Jun 2018 10:27:05 -0700 Subject: [PATCH 2/2] fix code review --- .../main/java/com/google/cloud/logging/SourceLocation.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/SourceLocation.java b/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/SourceLocation.java index 915d156de99a..2520c9613a36 100644 --- a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/SourceLocation.java +++ b/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/SourceLocation.java @@ -37,10 +37,6 @@ public static Builder newBuilder() { return new Builder(); } - public static Builder newBuilder(SourceLocation sourceLocation) { - return new Builder(sourceLocation); - } - /** * A builder for {@code SourceLocation} objects. */