diff options
author | shahan <shahan@google.com> | 2018-02-28 09:18:36 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-02-28 09:20:24 -0800 |
commit | 1fe23126d4a30d49b7668b235ea1bfb2e2c8a39e (patch) | |
tree | 7807839ba173ef69dd87e5933f0419767ab327e0 /src/main/java/com/google/devtools/build/lib/events | |
parent | e959e44a4363fc12ae2df2c5bc0cd0d12f80bbd9 (diff) |
Deletes AutoCodec.Strategy.SINGLETON now that we have @AutoCodec field tags.
This also gets rid of some static initialization cycles which we should try very hard to avoid in the future.
PiperOrigin-RevId: 187334087
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/events')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/events/Location.java | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/events/Location.java b/src/main/java/com/google/devtools/build/lib/events/Location.java index 162678dbf1..586548943b 100644 --- a/src/main/java/com/google/devtools/build/lib/events/Location.java +++ b/src/main/java/com/google/devtools/build/lib/events/Location.java @@ -15,7 +15,6 @@ package com.google.devtools.build.lib.events; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; -import com.google.devtools.build.lib.skyframe.serialization.ObjectCodec; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; @@ -36,9 +35,6 @@ public abstract class Location implements Serializable { @AutoCodec @Immutable static final class LocationWithPathAndStartColumn extends Location { - public static final ObjectCodec<LocationWithPathAndStartColumn> CODEC = - new Location_LocationWithPathAndStartColumn_AutoCodec(); - private final PathFragment path; private final LineAndColumn startLineAndColumn; @@ -219,14 +215,14 @@ public abstract class Location implements Serializable { * "23:2" * "foo.cc:char offsets 123--456" * "char offsets 123--456" - *</pre> + * </pre> * * <p>This version replace the package's path with the relative package path. I.e., if {@code * packagePath} is equivalent to "/absolute/path/to/workspace/pack/age" and {@code * relativePackage} is equivalent to "pack/age" then the result for the 2nd character of the 23rd * line of the "foo/bar.cc" file in "pack/age" would be "pack/age/foo/bar.cc:23:2" whereas with * {@link #print()} the result would be "/absolute/path/to/workspace/pack/age/foo/bar.cc:23:2". - * + * * <p>If {@code packagePath} is not a parent of the location path, then the result of this * function is the same as the result of {@link #print()}. */ @@ -262,8 +258,6 @@ public abstract class Location implements Serializable { @AutoCodec @Immutable public static final class LineAndColumn { - public static final ObjectCodec<LineAndColumn> CODEC = new Location_LineAndColumn_AutoCodec(); - private final int line; private final int column; @@ -298,11 +292,7 @@ public abstract class Location implements Serializable { } } - @AutoCodec(strategy = AutoCodec.Strategy.SINGLETON) - @AutoCodec.VisibleForSerialization static final class BuiltinLocation extends Location { - public static final BuiltinLocation INSTANCE = new BuiltinLocation(); - private BuiltinLocation() { super(0, 0); } @@ -332,7 +322,7 @@ public abstract class Location implements Serializable { * Dummy location for built-in functions which ensures that stack traces contain "nice" location * strings. */ - public static final Location BUILTIN = BuiltinLocation.INSTANCE; + @AutoCodec public static final Location BUILTIN = new BuiltinLocation(); /** * Returns the location in the format "filename:line". @@ -343,7 +333,7 @@ public abstract class Location implements Serializable { if (location == null) { return ""; } - + StringBuilder builder = new StringBuilder(); PathFragment path = location.getPath(); if (path != null) { |