From 0cb89dd110ce88770207889901e95ea2ac896932 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Wed, 30 Sep 2020 07:57:26 -0700 Subject: Fully remove GWT-RPC support externally. Really, really closes https://github.com/google/guava/issues/3680. Possible future work: - Be consistent about whether we put @GwtCompatible on the remaining internal CustomFieldSerializer classes. (For those files, it probably acts only as documentation (of something that is pretty obvious :)). Our open-source build used to take action when it saw `@GwtCompatible(emulated=true)`, but (a) it doesn't anymore, (b) those files don't exist externally anymore, and (c) they weren't `emulated=true` :) I believe that our internal build requires @GwtCompatible on most files in our GWT target, but I think there's an exception for GWT-target-only sources.) - Remove some of the GwtSerializationDependencies classes. However, some of these classe are set up as *supertypes* of our prod classes, so this would require some surgery. Keeping them is harmless: It doesn't actually make the classes GWT-serializable. - Remove the usages of serializable=true on @GwtCompatible, at least externally but maybe just entirely. RELNOTES=[Guava types can no longer be sent over GWT-RPC.](https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ) Even the earlier, temporary way to reenable support (`guava.gwt.emergency_reenable_rpc`) no longer has an effect. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=334598649 --- ...dkBackedImmutableMap_CustomFieldSerializer.java | 50 ---------------------- 1 file changed, 50 deletions(-) delete mode 100644 guava-gwt/src/com/google/common/collect/JdkBackedImmutableMap_CustomFieldSerializer.java (limited to 'guava-gwt/src/com/google/common/collect/JdkBackedImmutableMap_CustomFieldSerializer.java') diff --git a/guava-gwt/src/com/google/common/collect/JdkBackedImmutableMap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/JdkBackedImmutableMap_CustomFieldSerializer.java deleted file mode 100644 index 12b3411e0..000000000 --- a/guava-gwt/src/com/google/common/collect/JdkBackedImmutableMap_CustomFieldSerializer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2018 The Guava Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.common.collect; - -import static com.google.common.collect.Platform.checkGwtRpcEnabled; - -import com.google.gwt.user.client.rpc.SerializationException; -import com.google.gwt.user.client.rpc.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; -import com.google.gwt.user.client.rpc.core.java.util.Map_CustomFieldSerializerBase; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * This class implements the GWT serialization of {@link JdkBackedImmutableMap}. - * - * @author Louis Wasserman - */ -public class JdkBackedImmutableMap_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, ImmutableMap instance) {} - - public static ImmutableMap instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - Map entries = new LinkedHashMap<>(); - Map_CustomFieldSerializerBase.deserialize(reader, entries); - return ImmutableMap.copyOf(entries); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableMap instance) - throws SerializationException { - checkGwtRpcEnabled(); - Map_CustomFieldSerializerBase.serialize(writer, instance); - } -} -- cgit v1.2.3