aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupValue.java
diff options
context:
space:
mode:
authorGravatar shahan <shahan@google.com>2018-02-23 15:41:52 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-23 15:43:54 -0800
commitbbbf3dce2b95f054c8f2e85746b6b50b47740f61 (patch)
tree04d99f077d117a513d97651526c77cccada47b53 /src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupValue.java
parent62476a2738456c14bf92b6bcc81ade2c93ca7e87 (diff)
Integrates CodecScanner into SkyValueEncoder.
* Deletes a number of CODEC references, now superceded by registry functionality. * Minimal SkyKeySerializer modifications for correctness, as certain codec changes require codecs to be in available in the registry. PiperOrigin-RevId: 186834520
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupValue.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupValue.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupValue.java
index 491275ceef..4454dbe339 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupValue.java
@@ -15,6 +15,7 @@ package com.google.devtools.build.lib.skyframe;
import com.google.common.base.Preconditions;
import com.google.devtools.build.lib.cmdline.PackageIdentifier;
+import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
import com.google.devtools.build.lib.vfs.Root;
import com.google.devtools.build.skyframe.LegacySkyKey;
import com.google.devtools.build.skyframe.SkyKey;
@@ -27,7 +28,7 @@ import com.google.devtools.build.skyframe.SkyValue;
*/
public abstract class ContainingPackageLookupValue implements SkyValue {
- public static final NoContainingPackage NONE = new NoContainingPackage();
+ public static final NoContainingPackage NONE = NoContainingPackage.INSTANCE;
/** Returns whether there is a containing package. */
public abstract boolean hasContainingPackage();
@@ -49,7 +50,9 @@ public abstract class ContainingPackageLookupValue implements SkyValue {
}
/** Value indicating there is no containing package. */
+ @AutoCodec(strategy = AutoCodec.Strategy.SINGLETON)
public static class NoContainingPackage extends ContainingPackageLookupValue {
+ public static final NoContainingPackage INSTANCE = new NoContainingPackage();
private NoContainingPackage() {}
@@ -70,12 +73,15 @@ public abstract class ContainingPackageLookupValue implements SkyValue {
}
/** A successful lookup value. */
+ @AutoCodec
public static class ContainingPackage extends ContainingPackageLookupValue {
private final PackageIdentifier containingPackage;
private final Root containingPackageRoot;
- private ContainingPackage(PackageIdentifier pkgId, Root containingPackageRoot) {
- this.containingPackage = pkgId;
+ @AutoCodec.Instantiator
+ @AutoCodec.VisibleForSerialization
+ ContainingPackage(PackageIdentifier containingPackage, Root containingPackageRoot) {
+ this.containingPackage = containingPackage;
this.containingPackageRoot = containingPackageRoot;
}