aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/serialization
diff options
context:
space:
mode:
authorGravatar shahan <shahan@google.com>2018-07-11 07:35:15 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-11 07:36:33 -0700
commitfc6d118f5debc4a6a466780e7284e34db3cbaf7d (patch)
tree4def4892ed17d9fddf94d3489f8079f9f01f7b7c /src/main/java/com/google/devtools/build/lib/skyframe/serialization
parentbb781f95a7837c628908b1737ab318f6d0e2dfe7 (diff)
Deletes Multimap marshaller. Superceded by MultimapCodec.
PiperOrigin-RevId: 204121958
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/serialization')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/Marshallers.java63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/Marshallers.java b/src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/Marshallers.java
index 41ab14f875..ccc19c0994 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/Marshallers.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/Marshallers.java
@@ -16,14 +16,11 @@ package com.google.devtools.build.lib.skyframe.serialization.autocodec;
import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableListMultimap;
-import com.google.common.collect.ImmutableMultimap;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.SerializationCodeGenerator.Context;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.SerializationCodeGenerator.Marshaller;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.SerializationCodeGenerator.PrimitiveValueSerializationCodeGenerator;
import com.google.devtools.build.lib.skyframe.serialization.strings.StringCodecs;
import com.squareup.javapoet.TypeName;
-import java.util.Map;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.ArrayType;
@@ -306,65 +303,6 @@ class Marshallers {
}
};
- private final Marshaller multimapMarshaller =
- new Marshaller() {
- @Override
- public boolean matches(DeclaredType type) {
- return matchesErased(type, ImmutableMultimap.class)
- || matchesErased(type, ImmutableListMultimap.class);
- }
-
- @Override
- public void addSerializationCode(Context context) {
- context.builder.addStatement("codedOut.writeInt32NoTag($L.size())", context.name);
- String entryName = context.makeName("entry");
- Context key =
- context.with(
- context.getDeclaredType().getTypeArguments().get(0), entryName + ".getKey()");
- Context value =
- context.with(
- context.getDeclaredType().getTypeArguments().get(1), entryName + ".getValue()");
- context.builder.beginControlFlow(
- "for ($T<$T, $T> $L : $L.entries())",
- Map.Entry.class,
- key.getTypeName(),
- value.getTypeName(),
- entryName,
- context.name);
- writeSerializationCode(key);
- writeSerializationCode(value);
- context.builder.endControlFlow();
- }
-
- @Override
- public void addDeserializationCode(Context context) {
- Context key =
- context.with(
- context.getDeclaredType().getTypeArguments().get(0), context.makeName("key"));
- Context value =
- context.with(
- context.getDeclaredType().getTypeArguments().get(1), context.makeName("value"));
- String builderName = context.makeName("builder");
- context.builder.addStatement(
- "$T<$T, $T> $L = new $T<>()",
- ImmutableListMultimap.Builder.class,
- key.getTypeName(),
- value.getTypeName(),
- builderName,
- ImmutableListMultimap.Builder.class);
- String lengthName = context.makeName("length");
- context.builder.addStatement("int $L = codedIn.readInt32()", lengthName);
- String indexName = context.makeName("i");
- context.builder.beginControlFlow(
- "for (int $L = 0; $L < $L; ++$L)", indexName, indexName, lengthName, indexName);
- writeDeserializationCode(key);
- writeDeserializationCode(value);
- context.builder.addStatement("$L.put($L, $L)", builderName, key.name, value.name);
- context.builder.endControlFlow();
- context.builder.addStatement("$L = $L.build()", context.name, builderName);
- }
- };
-
/** Delegates marshalling back to the context. */
private final Marshaller contextMarshaller =
new Marshaller() {
@@ -396,7 +334,6 @@ class Marshallers {
ImmutableList.of(
charSequenceMarshaller,
supplierMarshaller,
- multimapMarshaller,
contextMarshaller);
/** True when {@code type} has the same type as {@code clazz}. */