diff --git a/guava-gwt/src/com/google/common/base/Absent_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/base/Absent_CustomFieldSerializer.java deleted file mode 100644 index f410258055a1..000000000000 --- a/guava-gwt/src/com/google/common/base/Absent_CustomFieldSerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2012 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.base; - -import static com.google.common.base.Platform.checkGwtRpcEnabled; - -import com.google.common.annotations.GwtCompatible; -import com.google.gwt.user.client.rpc.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; - -/** - * Custom GWT serializer for {@link Absent}. - * - *

GWT can serialize an absent {@code Optional} on its own, but the resulting object is a - * different instance than the singleton {@code Absent.INSTANCE}, which breaks equality. We - * implement a custom serializer to maintain the singleton property. - * - * @author Chris Povirk - */ -@GwtCompatible -public class Absent_CustomFieldSerializer { - public static void deserialize(SerializationStreamReader reader, Absent instance) {} - - public static Absent instantiate(SerializationStreamReader reader) { - checkGwtRpcEnabled(); - return Absent.INSTANCE; - } - - public static void serialize(SerializationStreamWriter writer, Absent instance) { - checkGwtRpcEnabled(); - } -} diff --git a/guava-gwt/src/com/google/common/base/PairwiseEquivalence_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/base/PairwiseEquivalence_CustomFieldSerializer.java deleted file mode 100644 index 4a97e14380de..000000000000 --- a/guava-gwt/src/com/google/common/base/PairwiseEquivalence_CustomFieldSerializer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2011 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.base; - -import static com.google.common.base.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; - -/** - * GWT serialization logic for {@link PairwiseEquivalence}. - * - * @author Kedar Kanitkar - */ -public class PairwiseEquivalence_CustomFieldSerializer { - - private PairwiseEquivalence_CustomFieldSerializer() {} - - public static void deserialize( - SerializationStreamReader reader, PairwiseEquivalence instance) {} - - public static PairwiseEquivalence instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return create((Equivalence) reader.readObject()); - } - - private static PairwiseEquivalence create(Equivalence elementEquivalence) { - return new PairwiseEquivalence(elementEquivalence); - } - - public static void serialize(SerializationStreamWriter writer, PairwiseEquivalence instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.elementEquivalence); - } -} diff --git a/guava-gwt/src/com/google/common/base/Present_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/base/Present_CustomFieldSerializer.java deleted file mode 100644 index 768b970a3a4e..000000000000 --- a/guava-gwt/src/com/google/common/base/Present_CustomFieldSerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2012 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.base; - -import static com.google.common.base.Platform.checkGwtRpcEnabled; - -import com.google.common.annotations.GwtCompatible; -import com.google.gwt.user.client.rpc.SerializationException; -import com.google.gwt.user.client.rpc.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; - -/** - * Custom GWT serializer for {@link Present}. - * - * @author Chris Povirk - */ -@GwtCompatible -public class Present_CustomFieldSerializer { - public static void deserialize(SerializationStreamReader reader, Present instance) {} - - public static Present instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return (Present) Optional.of(reader.readObject()); - } - - public static void serialize(SerializationStreamWriter writer, Present instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.get()); - } -} diff --git a/guava-gwt/src/com/google/common/collect/AllEqualOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/AllEqualOrdering_CustomFieldSerializer.java deleted file mode 100644 index 268de3cbf342..000000000000 --- a/guava-gwt/src/com/google/common/collect/AllEqualOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2009 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.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; - -/** - * This class implements the GWT serialization of {@link AllEqualOrdering}. - * - * @author Chris Povirk - */ -public class AllEqualOrdering_CustomFieldSerializer { - public static void deserialize(SerializationStreamReader reader, AllEqualOrdering instance) {} - - public static AllEqualOrdering instantiate(SerializationStreamReader reader) { - checkGwtRpcEnabled(); - return AllEqualOrdering.INSTANCE; - } - - public static void serialize(SerializationStreamWriter writer, AllEqualOrdering instance) { - checkGwtRpcEnabled(); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ArrayListMultimap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ArrayListMultimap_CustomFieldSerializer.java deleted file mode 100644 index 616841c8411f..000000000000 --- a/guava-gwt/src/com/google/common/collect/ArrayListMultimap_CustomFieldSerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link ArrayListMultimap}. - * - * @author Chris Povirk - */ -public class ArrayListMultimap_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader in, ArrayListMultimap out) {} - - public static ArrayListMultimap instantiate(SerializationStreamReader in) - throws SerializationException { - checkGwtRpcEnabled(); - return (ArrayListMultimap) - Multimap_CustomFieldSerializerBase.populate(in, ArrayListMultimap.create()); - } - - public static void serialize(SerializationStreamWriter out, ArrayListMultimap multimap) - throws SerializationException { - checkGwtRpcEnabled(); - Multimap_CustomFieldSerializerBase.serialize(out, multimap); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ByFunctionOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ByFunctionOrdering_CustomFieldSerializer.java deleted file mode 100644 index 8b7ff712163c..000000000000 --- a/guava-gwt/src/com/google/common/collect/ByFunctionOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2009 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.common.base.Function; -import com.google.gwt.user.client.rpc.SerializationException; -import com.google.gwt.user.client.rpc.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; - -/** - * This class implements the GWT serialization of {@link ByFunctionOrdering}. - * - * @author Chris Povirk - */ -public class ByFunctionOrdering_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, ByFunctionOrdering instance) {} - - @SuppressWarnings("unchecked") // deserialization is unsafe - public static ByFunctionOrdering instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return new ByFunctionOrdering<>( - (Function) reader.readObject(), (Ordering) reader.readObject()); - } - - public static void serialize(SerializationStreamWriter writer, ByFunctionOrdering instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.function); - writer.writeObject(instance.ordering); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ComparatorOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ComparatorOrdering_CustomFieldSerializer.java deleted file mode 100644 index d589027d1d59..000000000000 --- a/guava-gwt/src/com/google/common/collect/ComparatorOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2009 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 java.util.Comparator; - -/** - * This class implements the GWT serialization of {@link ComparatorOrdering}. - * - * @author Chris Povirk - */ -public class ComparatorOrdering_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, ComparatorOrdering instance) {} - - @SuppressWarnings("unchecked") // deserialization is unsafe - public static ComparatorOrdering instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return new ComparatorOrdering<>((Comparator) reader.readObject()); - } - - public static void serialize(SerializationStreamWriter writer, ComparatorOrdering instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.comparator); - } -} diff --git a/guava-gwt/src/com/google/common/collect/CompoundOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/CompoundOrdering_CustomFieldSerializer.java deleted file mode 100644 index 2d9756628b06..000000000000 --- a/guava-gwt/src/com/google/common/collect/CompoundOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2009 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 java.util.ArrayList; -import java.util.Comparator; -import java.util.List; - -/** - * This class implements the GWT serialization of {@link CompoundOrdering}. - * - * @author Chris Povirk - */ -public class CompoundOrdering_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, CompoundOrdering instance) {} - - @SuppressWarnings("unchecked") // deserialization is unsafe - public static CompoundOrdering instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - int n = reader.readInt(); - List> comparators = new ArrayList<>(); - for (int i = 0; i < n; i++) { - comparators.add((Comparator) reader.readObject()); - } - return new CompoundOrdering<>(comparators); - } - - public static void serialize(SerializationStreamWriter writer, CompoundOrdering instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeInt(instance.comparators.length); - for (Comparator comparator : instance.comparators) { - writer.writeObject(comparator); - } - } -} diff --git a/guava-gwt/src/com/google/common/collect/DenseImmutableTable_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/DenseImmutableTable_CustomFieldSerializer.java deleted file mode 100644 index b5d4d27ecda3..000000000000 --- a/guava-gwt/src/com/google/common/collect/DenseImmutableTable_CustomFieldSerializer.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2012 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; - -/** - * This class implements the GWT serialization of {@link DenseImmutableTable}. - * - * @author Chris Povirk - */ -public class DenseImmutableTable_CustomFieldSerializer { - public static void deserialize( - SerializationStreamReader reader, DenseImmutableTable instance) {} - - public static DenseImmutableTable instantiate( - SerializationStreamReader reader) throws SerializationException { - checkGwtRpcEnabled(); - return (DenseImmutableTable) - ImmutableTable_CustomFieldSerializerBase.instantiate(reader); - } - - public static void serialize( - SerializationStreamWriter writer, DenseImmutableTable table) - throws SerializationException { - checkGwtRpcEnabled(); - ImmutableTable_CustomFieldSerializerBase.serialize(writer, table); - } -} diff --git a/guava-gwt/src/com/google/common/collect/EmptyImmutableListMultimap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/EmptyImmutableListMultimap_CustomFieldSerializer.java deleted file mode 100644 index 1a43dc715fa2..000000000000 --- a/guava-gwt/src/com/google/common/collect/EmptyImmutableListMultimap_CustomFieldSerializer.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2009 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.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; - -/** - * This class implements the GWT serialization of {@link EmptyImmutableListMultimap}. - * - * @author Chris Povirk - */ -public class EmptyImmutableListMultimap_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, EmptyImmutableListMultimap instance) {} - - public static EmptyImmutableListMultimap instantiate(SerializationStreamReader reader) { - checkGwtRpcEnabled(); - return EmptyImmutableListMultimap.INSTANCE; - } - - public static void serialize( - SerializationStreamWriter writer, EmptyImmutableListMultimap instance) { - checkGwtRpcEnabled(); - } -} diff --git a/guava-gwt/src/com/google/common/collect/EmptyImmutableSetMultimap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/EmptyImmutableSetMultimap_CustomFieldSerializer.java deleted file mode 100644 index c0051ca7c620..000000000000 --- a/guava-gwt/src/com/google/common/collect/EmptyImmutableSetMultimap_CustomFieldSerializer.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2009 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.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; - -/** - * This class implements the GWT serialization of {@link EmptyImmutableSetMultimap}. - * - * @author Chris Povirk - */ -public class EmptyImmutableSetMultimap_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, EmptyImmutableSetMultimap instance) {} - - public static EmptyImmutableSetMultimap instantiate(SerializationStreamReader reader) { - checkGwtRpcEnabled(); - return EmptyImmutableSetMultimap.INSTANCE; - } - - public static void serialize( - SerializationStreamWriter writer, EmptyImmutableSetMultimap instance) { - checkGwtRpcEnabled(); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ExplicitOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ExplicitOrdering_CustomFieldSerializer.java deleted file mode 100644 index 370da81f7c10..000000000000 --- a/guava-gwt/src/com/google/common/collect/ExplicitOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link ExplicitOrdering}. - * - * @author Chris Povirk - */ -public class ExplicitOrdering_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, ExplicitOrdering instance) {} - - @SuppressWarnings("unchecked") // deserialization is unsafe - public static ExplicitOrdering instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return new ExplicitOrdering<>((ImmutableMap) reader.readObject()); - } - - public static void serialize(SerializationStreamWriter writer, ExplicitOrdering instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.rankMap); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ForwardingImmutableList_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ForwardingImmutableList_CustomFieldSerializer.java deleted file mode 100644 index dc632816492d..000000000000 --- a/guava-gwt/src/com/google/common/collect/ForwardingImmutableList_CustomFieldSerializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * Even though {@link ForwardingImmutableList} cannot be instantiated, we still need a custom field - * serializer. TODO(cpovirk): why? - * - * @author Hayward Chan - */ -public final class ForwardingImmutableList_CustomFieldSerializer {} diff --git a/guava-gwt/src/com/google/common/collect/ForwardingImmutableSet_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ForwardingImmutableSet_CustomFieldSerializer.java deleted file mode 100644 index aec60884ce16..000000000000 --- a/guava-gwt/src/com/google/common/collect/ForwardingImmutableSet_CustomFieldSerializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * Even though {@link ForwardingImmutableSet} cannot be instantiated, we still need a custom field - * serializer. TODO(cpovirk): why? - * - * @author Hayward Chan - */ -public final class ForwardingImmutableSet_CustomFieldSerializer {} diff --git a/guava-gwt/src/com/google/common/collect/HashBasedTable_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/HashBasedTable_CustomFieldSerializer.java deleted file mode 100644 index 005e71aecf3b..000000000000 --- a/guava-gwt/src/com/google/common/collect/HashBasedTable_CustomFieldSerializer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link HashBasedTable}. - * - * @author Hayward Chan - */ -public class HashBasedTable_CustomFieldSerializer { - public static void deserialize(SerializationStreamReader reader, HashBasedTable table) {} - - public static HashBasedTable instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return Table_CustomFieldSerializerBase.populate(reader, HashBasedTable.create()); - } - - public static void serialize(SerializationStreamWriter writer, HashBasedTable table) - throws SerializationException { - checkGwtRpcEnabled(); - Table_CustomFieldSerializerBase.serialize(writer, table); - } -} diff --git a/guava-gwt/src/com/google/common/collect/HashMultimap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/HashMultimap_CustomFieldSerializer.java deleted file mode 100644 index d34b5b7a37c8..000000000000 --- a/guava-gwt/src/com/google/common/collect/HashMultimap_CustomFieldSerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link HashMultimap}. - * - * @author Jord Sonneveld - */ -public class HashMultimap_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader in, HashMultimap out) {} - - public static HashMultimap instantiate(SerializationStreamReader in) - throws SerializationException { - checkGwtRpcEnabled(); - return (HashMultimap) - Multimap_CustomFieldSerializerBase.populate(in, HashMultimap.create()); - } - - public static void serialize(SerializationStreamWriter out, HashMultimap multimap) - throws SerializationException { - checkGwtRpcEnabled(); - Multimap_CustomFieldSerializerBase.serialize(out, multimap); - } -} diff --git a/guava-gwt/src/com/google/common/collect/HashMultiset_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/HashMultiset_CustomFieldSerializer.java deleted file mode 100644 index 020ee6985bef..000000000000 --- a/guava-gwt/src/com/google/common/collect/HashMultiset_CustomFieldSerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link HashMultiset}. - * - * @author Chris Povirk - */ -public class HashMultiset_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, HashMultiset instance) {} - - public static HashMultiset instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return (HashMultiset) - Multiset_CustomFieldSerializerBase.populate(reader, HashMultiset.create()); - } - - public static void serialize(SerializationStreamWriter writer, HashMultiset instance) - throws SerializationException { - checkGwtRpcEnabled(); - Multiset_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableAsList_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableAsList_CustomFieldSerializer.java deleted file mode 100644 index d02eb6d03fde..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableAsList_CustomFieldSerializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * Even though {@link ImmutableAsList} cannot be instantiated, we still need a custom field - * serializer. TODO(cpovirk): why? - * - * @author Hayward Chan - */ -public final class ImmutableAsList_CustomFieldSerializer {} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableBiMap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableBiMap_CustomFieldSerializer.java deleted file mode 100644 index d952317ef705..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableBiMap_CustomFieldSerializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * Even though {@link ImmutableBiMap} cannot be instantiated, we still need a custom field - * serializer to unify the type signature of {@code ImmutableBiMap[]} on server and client side. - * - * @author Hayward Chan - */ -public final class ImmutableBiMap_CustomFieldSerializer {} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableEntry_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableEntry_CustomFieldSerializer.java deleted file mode 100644 index 2b195a4eb88b..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableEntry_CustomFieldSerializer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link ImmutableEntry}. - * - * @author Kyle Butt - */ -public class ImmutableEntry_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, ImmutableEntry instance) {} - - public static ImmutableEntry instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - Object key = reader.readObject(); - Object value = reader.readObject(); - return new ImmutableEntry<>(key, value); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableEntry instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.getKey()); - writer.writeObject(instance.getValue()); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableEnumMap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableEnumMap_CustomFieldSerializer.java deleted file mode 100644 index 034e0023c758..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableEnumMap_CustomFieldSerializer.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2012 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.Map; - -/** - * This class implements the GWT serialization of {@link ImmutableEnumMap}. - * - * @author Louis Wasserman - */ -public class ImmutableEnumMap_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, ImmutableEnumMap instance) {} - - public static , V> ImmutableEnumMap instantiate( - SerializationStreamReader reader) throws SerializationException { - checkGwtRpcEnabled(); - Map deserialized = Maps.newHashMap(); - Map_CustomFieldSerializerBase.deserialize(reader, deserialized); - /* - * It is safe to cast to ImmutableEnumSet because in order for it to be - * serialized as an ImmutableEnumSet, it must be non-empty to start - * with. - */ - return (ImmutableEnumMap) Maps.immutableEnumMap(deserialized); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableEnumMap instance) - throws SerializationException { - checkGwtRpcEnabled(); - Map_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableEnumSet_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableEnumSet_CustomFieldSerializer.java deleted file mode 100644 index 3dcfeb759032..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableEnumSet_CustomFieldSerializer.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2009 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.Collection_CustomFieldSerializerBase; -import java.util.List; - -/** - * This class implements the GWT serialization of {@link ImmutableEnumSet}. - * - * @author Hayward Chan - */ -public class ImmutableEnumSet_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, ImmutableEnumSet instance) {} - - public static > ImmutableEnumSet instantiate( - SerializationStreamReader reader) throws SerializationException { - checkGwtRpcEnabled(); - List deserialized = Lists.newArrayList(); - Collection_CustomFieldSerializerBase.deserialize(reader, deserialized); - /* - * It is safe to cast to ImmutableEnumSet because in order for it to be - * serialized as an ImmutableEnumSet, it must be non-empty to start - * with. - */ - return (ImmutableEnumSet) Sets.immutableEnumSet(deserialized); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableEnumSet instance) - throws SerializationException { - checkGwtRpcEnabled(); - Collection_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableListMultimap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableListMultimap_CustomFieldSerializer.java deleted file mode 100644 index 04b690c94f09..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableListMultimap_CustomFieldSerializer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link ImmutableListMultimap}. - * - * @author Chris Povirk - */ -public class ImmutableListMultimap_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, ImmutableListMultimap instance) {} - - public static ImmutableListMultimap instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return (ImmutableListMultimap) - Multimap_CustomFieldSerializerBase.instantiate(reader, ImmutableListMultimap.builder()); - } - - public static void serialize( - SerializationStreamWriter writer, ImmutableListMultimap instance) - throws SerializationException { - checkGwtRpcEnabled(); - Multimap_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableList_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableList_CustomFieldSerializer.java deleted file mode 100644 index 7ccbe3b3ae76..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableList_CustomFieldSerializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * Even though {@link ImmutableList} cannot be instantiated, we still need a custom field serializer - * to unify the type signature of {@code ImmutableList[]} on server and client side. - * - * @author Hayward Chan - */ -public final class ImmutableList_CustomFieldSerializer {} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableMultiset_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableMultiset_CustomFieldSerializer.java deleted file mode 100644 index 16086c3f8a63..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableMultiset_CustomFieldSerializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * Even though {@link ImmutableMultiset} cannot be instantiated, we still need a custom field - * serializer to unify the type signature of {@code ImmutableMultiset[]} on server and client side. - * - * @author Chris Povirk - */ -public class ImmutableMultiset_CustomFieldSerializer {} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableSetMultimap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableSetMultimap_CustomFieldSerializer.java deleted file mode 100644 index b8d189aa0b86..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableSetMultimap_CustomFieldSerializer.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2009 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 java.util.Comparator; - -/** - * This class implements the GWT serialization of {@link ImmutableSetMultimap}. - * - * @author Chris Povirk - */ -public class ImmutableSetMultimap_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, ImmutableSetMultimap instance) {} - - // Serialization type safety is at the caller's mercy. - @SuppressWarnings("unchecked") - public static ImmutableSetMultimap instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - Comparator valueComparator = (Comparator) reader.readObject(); - ImmutableSetMultimap.Builder builder = ImmutableSetMultimap.builder(); - if (valueComparator != null) { - builder.orderValuesBy(valueComparator); - } - return (ImmutableSetMultimap) - Multimap_CustomFieldSerializerBase.instantiate(reader, builder); - } - - public static void serialize( - SerializationStreamWriter writer, ImmutableSetMultimap instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.valueComparator()); - Multimap_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableSet_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableSet_CustomFieldSerializer.java deleted file mode 100644 index d4c4144861e4..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableSet_CustomFieldSerializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * Even though {@link ImmutableSet} cannot be instantiated, we still need a custom field serializer - * to unify the type signature of {@code ImmutableSet[]} on server and client side. - * - * @author Hayward Chan - */ -public final class ImmutableSet_CustomFieldSerializer {} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableSortedMap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableSortedMap_CustomFieldSerializer.java deleted file mode 100644 index 6d3bc12fb1c2..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableSortedMap_CustomFieldSerializer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * Even though {@link ImmutableSortedMap} cannot be instantiated, we still need a custom field - * serializer. TODO(cpovirk): why? Does it help if ensure that the GWT and non-GWT classes have the - * same fields? Is that worth the trouble? - * - * @author Chris Povirk - */ -public final class ImmutableSortedMap_CustomFieldSerializer { - public static void deserialize( - SerializationStreamReader reader, ImmutableSortedMap instance) {} - - public static ImmutableSortedMap instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return ImmutableSortedMap_CustomFieldSerializerBase.instantiate(reader); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableSortedMap instance) - throws SerializationException { - checkGwtRpcEnabled(); - ImmutableSortedMap_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableSortedMap_CustomFieldSerializerBase.java b/guava-gwt/src/com/google/common/collect/ImmutableSortedMap_CustomFieldSerializerBase.java deleted file mode 100644 index 06b434eac66d..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableSortedMap_CustomFieldSerializerBase.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2009 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 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.Comparator; -import java.util.SortedMap; -import java.util.TreeMap; - -/** - * This class contains static utility methods for writing {@code ImmutableSortedMap} GWT field - * serializers. - * - * @author Chris Povirk - */ -final class ImmutableSortedMap_CustomFieldSerializerBase { - static ImmutableSortedMap instantiate(SerializationStreamReader reader) - throws SerializationException { - /* - * Nothing we can do, but we're already assuming the serialized form is - * correctly typed, anyway. - */ - @SuppressWarnings("unchecked") - Comparator comparator = (Comparator) reader.readObject(); - - SortedMap entries = new TreeMap<>(comparator); - Map_CustomFieldSerializerBase.deserialize(reader, entries); - - return ImmutableSortedMap.orderedBy(comparator).putAll(entries).build(); - } - - static void serialize(SerializationStreamWriter writer, ImmutableSortedMap instance) - throws SerializationException { - writer.writeObject(instance.comparator()); - - Map_CustomFieldSerializerBase.serialize(writer, instance); - } - - private ImmutableSortedMap_CustomFieldSerializerBase() {} -} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableSortedSet_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ImmutableSortedSet_CustomFieldSerializer.java deleted file mode 100644 index 8924e9e52de8..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableSortedSet_CustomFieldSerializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * Even though {@link ImmutableSortedSet} cannot be instantiated, we still need a custom field - * serializer to unify the type signature of {@code ImmutableSortedSet[]} on server and client side. - * - * @author Hayward Chan - */ -public final class ImmutableSortedSet_CustomFieldSerializer {} diff --git a/guava-gwt/src/com/google/common/collect/ImmutableTable_CustomFieldSerializerBase.java b/guava-gwt/src/com/google/common/collect/ImmutableTable_CustomFieldSerializerBase.java deleted file mode 100644 index da2fabd845e6..000000000000 --- a/guava-gwt/src/com/google/common/collect/ImmutableTable_CustomFieldSerializerBase.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2012 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 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; - -/** - * This class contains static utility methods for writing {@link ImmutableTable} GWT field - * serializers. Serializers should delegate to {@link #serialize} and {@link #instantiate}. - * - * @author Chris Povirk - */ -final class ImmutableTable_CustomFieldSerializerBase { - public static ImmutableTable instantiate(SerializationStreamReader reader) - throws SerializationException { - ImmutableTable.Builder builder = ImmutableTable.builder(); - int rowCount = reader.readInt(); - for (int i = 0; i < rowCount; i++) { - Object rowKey = reader.readObject(); - int colCount = reader.readInt(); - for (int j = 0; j < colCount; j++) { - builder.put(rowKey, reader.readObject(), reader.readObject()); - } - } - return builder.build(); - } - - public static void serialize( - SerializationStreamWriter writer, ImmutableTable table) - throws SerializationException { - writer.writeInt(table.rowKeySet().size()); - for (Object rowKey : table.rowKeySet()) { - writer.writeObject(rowKey); - Map_CustomFieldSerializerBase.serialize(writer, table.row(rowKey)); - } - } - - private ImmutableTable_CustomFieldSerializerBase() {} -} diff --git a/guava-gwt/src/com/google/common/collect/IndexedImmutableSet_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/IndexedImmutableSet_CustomFieldSerializer.java deleted file mode 100644 index b5269951aaf4..000000000000 --- a/guava-gwt/src/com/google/common/collect/IndexedImmutableSet_CustomFieldSerializer.java +++ /dev/null @@ -1,26 +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; - -/** - * Dummy serializer. Otherwise, GWT, in processing JdkBackedImmutableSet -- even though that class - * has a custom field serializer -- would generate its own version of this class, implemented in - * terms of calls to ImmutableSet_CustomFieldSerializer, which is itself a dummy that we've - * provided. That produces GWT compilation errors, albeit ones that are non-fatal (even with -strict - * on, oddly). - */ -public final class IndexedImmutableSet_CustomFieldSerializer {} diff --git a/guava-gwt/src/com/google/common/collect/JdkBackedImmutableBiMap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/JdkBackedImmutableBiMap_CustomFieldSerializer.java deleted file mode 100644 index b6aed12af528..000000000000 --- a/guava-gwt/src/com/google/common/collect/JdkBackedImmutableBiMap_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 JdkBackedImmutableBiMap}. - * - * @author Louis Wasserman - */ -public class JdkBackedImmutableBiMap_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, ImmutableBiMap instance) {} - - public static ImmutableBiMap instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - Map entries = new LinkedHashMap<>(); - Map_CustomFieldSerializerBase.deserialize(reader, entries); - return ImmutableBiMap.copyOf(entries); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableBiMap instance) - throws SerializationException { - checkGwtRpcEnabled(); - Map_CustomFieldSerializerBase.serialize(writer, instance); - } -} 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 12b3411e0c78..000000000000 --- 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); - } -} diff --git a/guava-gwt/src/com/google/common/collect/JdkBackedImmutableMultiset_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/JdkBackedImmutableMultiset_CustomFieldSerializer.java deleted file mode 100644 index 0c741d97f7b0..000000000000 --- a/guava-gwt/src/com/google/common/collect/JdkBackedImmutableMultiset_CustomFieldSerializer.java +++ /dev/null @@ -1,46 +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; - -/** - * This class implements the GWT serialization of {@link JdkBackedImmutableMultiset}. - * - * @author Louis Wasserman - */ -public class JdkBackedImmutableMultiset_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, ImmutableMultiset instance) {} - - public static ImmutableMultiset instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return ImmutableMultiset.copyOf( - Multiset_CustomFieldSerializerBase.populate(reader, LinkedHashMultiset.create())); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableMultiset instance) - throws SerializationException { - checkGwtRpcEnabled(); - Multiset_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/JdkBackedImmutableSet_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/JdkBackedImmutableSet_CustomFieldSerializer.java deleted file mode 100644 index 7295065dbc98..000000000000 --- a/guava-gwt/src/com/google/common/collect/JdkBackedImmutableSet_CustomFieldSerializer.java +++ /dev/null @@ -1,49 +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.Collection_CustomFieldSerializerBase; -import java.util.List; - -/** - * This class implements the GWT serialization of {@link JdkBackedImmutableSet}. - * - * @author Louis Wasserman - */ -public class JdkBackedImmutableSet_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, ImmutableSet instance) {} - - public static ImmutableSet instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - List elements = Lists.newArrayList(); - Collection_CustomFieldSerializerBase.deserialize(reader, elements); - return ImmutableSet.copyOf(elements); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableSet instance) - throws SerializationException { - checkGwtRpcEnabled(); - Collection_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/LexicographicalOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/LexicographicalOrdering_CustomFieldSerializer.java deleted file mode 100644 index 339a14fedebe..000000000000 --- a/guava-gwt/src/com/google/common/collect/LexicographicalOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link LexicographicalOrdering}. - * - * @author Chris Povirk - */ -public class LexicographicalOrdering_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, LexicographicalOrdering instance) {} - - @SuppressWarnings("unchecked") // deserialization is unsafe - public static LexicographicalOrdering instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return new LexicographicalOrdering<>((Ordering) reader.readObject()); - } - - public static void serialize( - SerializationStreamWriter writer, LexicographicalOrdering instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.elementOrder); - } -} diff --git a/guava-gwt/src/com/google/common/collect/LinkedHashMultimap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/LinkedHashMultimap_CustomFieldSerializer.java deleted file mode 100644 index c1b163e52761..000000000000 --- a/guava-gwt/src/com/google/common/collect/LinkedHashMultimap_CustomFieldSerializer.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2009 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 java.util.Collection; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; - -/** - * This class implements the GWT serialization of {@link LinkedHashMultimap}. - * - * @author Chris Povirk - */ -public class LinkedHashMultimap_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader in, LinkedHashMultimap out) {} - - public static LinkedHashMultimap instantiate(SerializationStreamReader stream) - throws SerializationException { - checkGwtRpcEnabled(); - LinkedHashMultimap multimap = LinkedHashMultimap.create(); - - int distinctKeys = stream.readInt(); - Map> map = new LinkedHashMap<>(); - for (int i = 0; i < distinctKeys; i++) { - Object key = stream.readObject(); - map.put(key, multimap.createCollection(key)); - } - int entries = stream.readInt(); - for (int i = 0; i < entries; i++) { - Object key = stream.readObject(); - Object value = stream.readObject(); - map.get(key).add(value); - } - multimap.setMap(map); - - return multimap; - } - - public static void serialize(SerializationStreamWriter stream, LinkedHashMultimap multimap) - throws SerializationException { - checkGwtRpcEnabled(); - stream.writeInt(multimap.keySet().size()); - for (Object key : multimap.keySet()) { - stream.writeObject(key); - } - stream.writeInt(multimap.size()); - for (Entry entry : multimap.entries()) { - stream.writeObject(entry.getKey()); - stream.writeObject(entry.getValue()); - } - } -} diff --git a/guava-gwt/src/com/google/common/collect/LinkedHashMultiset_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/LinkedHashMultiset_CustomFieldSerializer.java deleted file mode 100644 index b7e612a69589..000000000000 --- a/guava-gwt/src/com/google/common/collect/LinkedHashMultiset_CustomFieldSerializer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link LinkedHashMultiset}. - * - * @author Chris Povirk - */ -public class LinkedHashMultiset_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, LinkedHashMultiset instance) {} - - public static LinkedHashMultiset instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return (LinkedHashMultiset) - Multiset_CustomFieldSerializerBase.populate(reader, LinkedHashMultiset.create()); - } - - public static void serialize(SerializationStreamWriter writer, LinkedHashMultiset instance) - throws SerializationException { - checkGwtRpcEnabled(); - Multiset_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/LinkedListMultimap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/LinkedListMultimap_CustomFieldSerializer.java deleted file mode 100644 index 3242ede16085..000000000000 --- a/guava-gwt/src/com/google/common/collect/LinkedListMultimap_CustomFieldSerializer.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2009 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 java.util.Map.Entry; - -/** - * This class implements the GWT serialization of {@link LinkedListMultimap}. - * - * @author Chris Povirk - */ -public class LinkedListMultimap_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader in, LinkedListMultimap out) {} - - public static LinkedListMultimap instantiate(SerializationStreamReader in) - throws SerializationException { - checkGwtRpcEnabled(); - LinkedListMultimap multimap = LinkedListMultimap.create(); - int size = in.readInt(); - for (int i = 0; i < size; i++) { - Object key = in.readObject(); - Object value = in.readObject(); - multimap.put(key, value); - } - return multimap; - } - - public static void serialize(SerializationStreamWriter out, LinkedListMultimap multimap) - throws SerializationException { - checkGwtRpcEnabled(); - out.writeInt(multimap.size()); - for (Entry entry : multimap.entries()) { - out.writeObject(entry.getKey()); - out.writeObject(entry.getValue()); - } - } -} diff --git a/guava-gwt/src/com/google/common/collect/Multimap_CustomFieldSerializerBase.java b/guava-gwt/src/com/google/common/collect/Multimap_CustomFieldSerializerBase.java deleted file mode 100644 index 31a048305b21..000000000000 --- a/guava-gwt/src/com/google/common/collect/Multimap_CustomFieldSerializerBase.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2009 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 com.google.errorprone.annotations.CanIgnoreReturnValue; -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 java.util.Collection; -import java.util.Map.Entry; - -/** - * This class contains static utility methods for writing {@code Multimap} GWT field serializers. - * Serializers should delegate to {@link #serialize(SerializationStreamWriter, Multimap)} and to - * either {@link #instantiate(SerializationStreamReader, ImmutableMultimap.Builder)} or {@link - * #populate(SerializationStreamReader, Multimap)}. - * - * @author Chris Povirk - */ -public final class Multimap_CustomFieldSerializerBase { - - static ImmutableMultimap instantiate( - SerializationStreamReader reader, ImmutableMultimap.Builder builder) - throws SerializationException { - int keyCount = reader.readInt(); - for (int i = 0; i < keyCount; ++i) { - Object key = reader.readObject(); - int valueCount = reader.readInt(); - for (int j = 0; j < valueCount; ++j) { - Object value = reader.readObject(); - builder.put(key, value); - } - } - return builder.build(); - } - - @CanIgnoreReturnValue - public static Multimap populate( - SerializationStreamReader reader, Multimap multimap) - throws SerializationException { - int keyCount = reader.readInt(); - for (int i = 0; i < keyCount; ++i) { - Object key = reader.readObject(); - int valueCount = reader.readInt(); - for (int j = 0; j < valueCount; ++j) { - Object value = reader.readObject(); - multimap.put(key, value); - } - } - return multimap; - } - - public static void serialize(SerializationStreamWriter writer, Multimap instance) - throws SerializationException { - writer.writeInt(instance.asMap().size()); - for (Entry> entry : instance.asMap().entrySet()) { - writer.writeObject(entry.getKey()); - writer.writeInt(entry.getValue().size()); - for (Object value : entry.getValue()) { - writer.writeObject(value); - } - } - } - - private Multimap_CustomFieldSerializerBase() {} -} diff --git a/guava-gwt/src/com/google/common/collect/Multiset_CustomFieldSerializerBase.java b/guava-gwt/src/com/google/common/collect/Multiset_CustomFieldSerializerBase.java deleted file mode 100644 index d03ed676514c..000000000000 --- a/guava-gwt/src/com/google/common/collect/Multiset_CustomFieldSerializerBase.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2009 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 com.google.gwt.user.client.rpc.SerializationException; -import com.google.gwt.user.client.rpc.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; - -/** - * This class contains static utility methods for writing {@code Multiset} GWT field serializers. - * Serializers should delegate to {@link #serialize(SerializationStreamWriter, Multiset)} and {@link - * #populate(SerializationStreamReader, Multiset)}. - * - * @author Chris Povirk - */ -final class Multiset_CustomFieldSerializerBase { - - static Multiset populate(SerializationStreamReader reader, Multiset multiset) - throws SerializationException { - int distinctElements = reader.readInt(); - for (int i = 0; i < distinctElements; i++) { - Object element = reader.readObject(); - int count = reader.readInt(); - multiset.add(element, count); - } - return multiset; - } - - static void serialize(SerializationStreamWriter writer, Multiset instance) - throws SerializationException { - int entryCount = instance.entrySet().size(); - writer.writeInt(entryCount); - for (Multiset.Entry entry : instance.entrySet()) { - writer.writeObject(entry.getElement()); - writer.writeInt(entry.getCount()); - } - } - - private Multiset_CustomFieldSerializerBase() {} -} diff --git a/guava-gwt/src/com/google/common/collect/NaturalOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/NaturalOrdering_CustomFieldSerializer.java deleted file mode 100644 index 1680e51ffd3a..000000000000 --- a/guava-gwt/src/com/google/common/collect/NaturalOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2009 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.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; - -/** - * This class implements the GWT serialization of {@link NaturalOrdering}. - * - * @author Chris Povirk - */ -public class NaturalOrdering_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, NaturalOrdering instance) {} - - public static NaturalOrdering instantiate(SerializationStreamReader reader) { - checkGwtRpcEnabled(); - return NaturalOrdering.INSTANCE; - } - - public static void serialize(SerializationStreamWriter writer, NaturalOrdering instance) { - checkGwtRpcEnabled(); - } -} diff --git a/guava-gwt/src/com/google/common/collect/NullsFirstOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/NullsFirstOrdering_CustomFieldSerializer.java deleted file mode 100644 index 99a1018495ba..000000000000 --- a/guava-gwt/src/com/google/common/collect/NullsFirstOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link NullsFirstOrdering}. - * - * @author Chris Povirk - */ -public class NullsFirstOrdering_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, NullsFirstOrdering instance) {} - - @SuppressWarnings("unchecked") // deserialization is unsafe - public static NullsFirstOrdering instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return new NullsFirstOrdering<>((Ordering) reader.readObject()); - } - - public static void serialize(SerializationStreamWriter writer, NullsFirstOrdering instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.ordering); - } -} diff --git a/guava-gwt/src/com/google/common/collect/NullsLastOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/NullsLastOrdering_CustomFieldSerializer.java deleted file mode 100644 index da1afaba0c75..000000000000 --- a/guava-gwt/src/com/google/common/collect/NullsLastOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link NullsLastOrdering}. - * - * @author Chris Povirk - */ -public class NullsLastOrdering_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, NullsLastOrdering instance) {} - - @SuppressWarnings("unchecked") // deserialization is unsafe - public static NullsLastOrdering instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return new NullsLastOrdering<>((Ordering) reader.readObject()); - } - - public static void serialize(SerializationStreamWriter writer, NullsLastOrdering instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.ordering); - } -} diff --git a/guava-gwt/src/com/google/common/collect/Range_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/Range_CustomFieldSerializer.java deleted file mode 100644 index d861300c5716..000000000000 --- a/guava-gwt/src/com/google/common/collect/Range_CustomFieldSerializer.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2016 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; - -/** - * This class implements the GWT serialization of {@link Range}. - * - * @author Dean de Bree - */ -public class Range_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, Range instance) {} - - public static Range instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - - Cut lowerBound; - boolean hasLowerBound = reader.readBoolean(); - if (hasLowerBound) { - boolean lowerIsClosed = reader.readBoolean(); - Comparable lower = (Comparable) reader.readObject(); - - lowerBound = lowerIsClosed ? Cut.belowValue(lower) : Cut.aboveValue(lower); - } else { - lowerBound = Cut.belowAll(); - } - - Cut upperBound; - boolean hasUpperBound = reader.readBoolean(); - if (hasUpperBound) { - boolean upperIsClosed = reader.readBoolean(); - Comparable upper = (Comparable) reader.readObject(); - - upperBound = upperIsClosed ? Cut.aboveValue(upper) : Cut.belowValue(upper); - } else { - upperBound = Cut.aboveAll(); - } - - return Range.create(lowerBound, upperBound); - } - - public static void serialize(SerializationStreamWriter writer, Range instance) - throws SerializationException { - checkGwtRpcEnabled(); - - if (instance.hasLowerBound()) { - writer.writeBoolean(true); - writer.writeBoolean(instance.lowerBoundType() == BoundType.CLOSED); - writer.writeObject(instance.lowerEndpoint()); - } else { - writer.writeBoolean(false); - } - - if (instance.hasUpperBound()) { - writer.writeBoolean(true); - writer.writeBoolean(instance.upperBoundType() == BoundType.CLOSED); - writer.writeObject(instance.upperEndpoint()); - } else { - writer.writeBoolean(false); - } - } -} diff --git a/guava-gwt/src/com/google/common/collect/RegularImmutableAsList_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/RegularImmutableAsList_CustomFieldSerializer.java deleted file mode 100644 index ddd255deb5a0..000000000000 --- a/guava-gwt/src/com/google/common/collect/RegularImmutableAsList_CustomFieldSerializer.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2010 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.common.annotations.GwtCompatible; -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.Collection_CustomFieldSerializerBase; -import java.util.ArrayList; - -/** - * This class implements the GWT serialization of {@link RegularImmutableAsList}. - * - * @author Hayward Chan - */ -@GwtCompatible(emulated = true) -public class RegularImmutableAsList_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, RegularImmutableAsList instance) {} - - public static RegularImmutableAsList instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - ArrayList elements = new ArrayList<>(); - Collection_CustomFieldSerializerBase.deserialize(reader, elements); - ImmutableList delegate = ImmutableList.copyOf(elements); - return new RegularImmutableAsList<>(delegate, delegate); - } - - public static void serialize(SerializationStreamWriter writer, RegularImmutableAsList instance) - throws SerializationException { - checkGwtRpcEnabled(); - Collection_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/RegularImmutableBiMap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/RegularImmutableBiMap_CustomFieldSerializer.java deleted file mode 100644 index b68e90d5b312..000000000000 --- a/guava-gwt/src/com/google/common/collect/RegularImmutableBiMap_CustomFieldSerializer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2009 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 RegularImmutableBiMap}. - * - * @author Chris Povirk - */ -public class RegularImmutableBiMap_CustomFieldSerializer { - public static void deserialize(SerializationStreamReader reader, ImmutableBiMap instance) {} - - public static ImmutableBiMap instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - Map entries = new LinkedHashMap<>(); - Map_CustomFieldSerializerBase.deserialize(reader, entries); - return ImmutableBiMap.copyOf(entries); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableBiMap instance) - throws SerializationException { - checkGwtRpcEnabled(); - Map_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/RegularImmutableList_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/RegularImmutableList_CustomFieldSerializer.java deleted file mode 100644 index 20e952a11dc6..000000000000 --- a/guava-gwt/src/com/google/common/collect/RegularImmutableList_CustomFieldSerializer.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2009 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.Collection_CustomFieldSerializerBase; -import java.util.ArrayList; -import java.util.List; - -/** - * This class implements the GWT serialization of {@link RegularImmutableList}. - * - * @author Hayward Chan - */ -public class RegularImmutableList_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, RegularImmutableList instance) {} - - public static RegularImmutableList instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - List elements = new ArrayList<>(); - Collection_CustomFieldSerializerBase.deserialize(reader, elements); - /* - * For this custom field serializer to be invoked, the list must have been - * RegularImmutableList before it's serialized. Since RegularImmutableList - * always have one or more elements, ImmutableList.copyOf always return - * a RegularImmutableList back. - */ - return (RegularImmutableList) ImmutableList.copyOf(elements); - } - - public static void serialize(SerializationStreamWriter writer, RegularImmutableList instance) - throws SerializationException { - checkGwtRpcEnabled(); - Collection_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/RegularImmutableMap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/RegularImmutableMap_CustomFieldSerializer.java deleted file mode 100644 index 8fbffc1e96a8..000000000000 --- a/guava-gwt/src/com/google/common/collect/RegularImmutableMap_CustomFieldSerializer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2009 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 RegularImmutableMap}. - * - * @author Hayward Chan - */ -public class RegularImmutableMap_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); - } -} diff --git a/guava-gwt/src/com/google/common/collect/RegularImmutableMultiset_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/RegularImmutableMultiset_CustomFieldSerializer.java deleted file mode 100644 index b3b021646d84..000000000000 --- a/guava-gwt/src/com/google/common/collect/RegularImmutableMultiset_CustomFieldSerializer.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2011 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; - -/** - * This class implements the GWT serialization of {@link RegularImmutableMultiset}. - * - * @author Louis Wasserman - */ -public class RegularImmutableMultiset_CustomFieldSerializer { - public static void deserialize(SerializationStreamReader reader, ImmutableMultiset instance) {} - - public static ImmutableMultiset instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return ImmutableMultiset.copyOf( - Multiset_CustomFieldSerializerBase.populate(reader, LinkedHashMultiset.create())); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableMultiset instance) - throws SerializationException { - checkGwtRpcEnabled(); - Multiset_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/RegularImmutableSet_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/RegularImmutableSet_CustomFieldSerializer.java deleted file mode 100644 index de026969872d..000000000000 --- a/guava-gwt/src/com/google/common/collect/RegularImmutableSet_CustomFieldSerializer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2009 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.Collection_CustomFieldSerializerBase; -import java.util.List; - -/** - * This class implements the GWT serialization of {@link RegularImmutableSet}. - * - * @author Hayward Chan - */ -public class RegularImmutableSet_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, ImmutableSet instance) {} - - public static ImmutableSet instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - List elements = Lists.newArrayList(); - Collection_CustomFieldSerializerBase.deserialize(reader, elements); - return ImmutableSet.copyOf(elements); - } - - public static void serialize(SerializationStreamWriter writer, ImmutableSet instance) - throws SerializationException { - checkGwtRpcEnabled(); - Collection_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/RegularImmutableSortedSet_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/RegularImmutableSortedSet_CustomFieldSerializer.java deleted file mode 100644 index 07a6b1fa3131..000000000000 --- a/guava-gwt/src/com/google/common/collect/RegularImmutableSortedSet_CustomFieldSerializer.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2009 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.Collection_CustomFieldSerializerBase; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; - -/** - * This class implements the GWT serialization of {@link RegularImmutableSortedSet}. - * - * @author Chris Povirk - */ -public class RegularImmutableSortedSet_CustomFieldSerializer { - public static void deserialize( - SerializationStreamReader reader, RegularImmutableSortedSet instance) {} - - public static RegularImmutableSortedSet instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - /* - * Nothing we can do, but we're already assuming the serialized form is - * correctly typed, anyway. - */ - @SuppressWarnings("unchecked") - Comparator comparator = (Comparator) reader.readObject(); - - List elements = new ArrayList<>(); - Collection_CustomFieldSerializerBase.deserialize(reader, elements); - /* - * For this custom field serializer to be invoked, the set must have been - * RegularImmutableSortedSet before it's serialized. Since - * RegularImmutableSortedSet always have one or more elements, - * ImmutableSortedSet.copyOf always return a RegularImmutableSortedSet back. - */ - return (RegularImmutableSortedSet) ImmutableSortedSet.copyOf(comparator, elements); - } - - public static void serialize( - SerializationStreamWriter writer, RegularImmutableSortedSet instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.comparator()); - - Collection_CustomFieldSerializerBase.serialize(writer, instance); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ReverseNaturalOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ReverseNaturalOrdering_CustomFieldSerializer.java deleted file mode 100644 index 8dcf9edaa0f5..000000000000 --- a/guava-gwt/src/com/google/common/collect/ReverseNaturalOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2009 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.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; - -/** - * This class implements the GWT serialization of {@link ReverseNaturalOrdering}. - * - * @author Chris Povirk - */ -public class ReverseNaturalOrdering_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, ReverseNaturalOrdering instance) {} - - public static ReverseNaturalOrdering instantiate(SerializationStreamReader reader) { - checkGwtRpcEnabled(); - return ReverseNaturalOrdering.INSTANCE; - } - - public static void serialize(SerializationStreamWriter writer, ReverseNaturalOrdering instance) { - checkGwtRpcEnabled(); - } -} diff --git a/guava-gwt/src/com/google/common/collect/ReverseOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/ReverseOrdering_CustomFieldSerializer.java deleted file mode 100644 index dece431120d0..000000000000 --- a/guava-gwt/src/com/google/common/collect/ReverseOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link ReverseOrdering}. - * - * @author Chris Povirk - */ -public class ReverseOrdering_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader reader, ReverseOrdering instance) {} - - @SuppressWarnings("unchecked") // deserialization is unsafe - public static ReverseOrdering instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return new ReverseOrdering<>((Ordering) reader.readObject()); - } - - public static void serialize(SerializationStreamWriter writer, ReverseOrdering instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.forwardOrder); - } -} diff --git a/guava-gwt/src/com/google/common/collect/SingletonImmutableBiMap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/SingletonImmutableBiMap_CustomFieldSerializer.java deleted file mode 100644 index 906c61074a59..000000000000 --- a/guava-gwt/src/com/google/common/collect/SingletonImmutableBiMap_CustomFieldSerializer.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2009 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.base.Preconditions.checkNotNull; -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; - -/** - * This class implements the GWT serialization of {@link SingletonImmutableBiMap}. - * - * @author Chris Povirk - */ -public class SingletonImmutableBiMap_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, SingletonImmutableBiMap instance) {} - - public static SingletonImmutableBiMap instantiate( - SerializationStreamReader reader) throws SerializationException { - checkGwtRpcEnabled(); - Object key = checkNotNull(reader.readObject()); - Object value = checkNotNull(reader.readObject()); - return new SingletonImmutableBiMap<>(key, value); - } - - public static void serialize( - SerializationStreamWriter writer, SingletonImmutableBiMap instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.singleKey); - writer.writeObject(instance.singleValue); - } -} diff --git a/guava-gwt/src/com/google/common/collect/SingletonImmutableList_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/SingletonImmutableList_CustomFieldSerializer.java deleted file mode 100644 index 15688f7b1edc..000000000000 --- a/guava-gwt/src/com/google/common/collect/SingletonImmutableList_CustomFieldSerializer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link SingletonImmutableList}. - * - * @author Chris Povirk - */ -public class SingletonImmutableList_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, SingletonImmutableList instance) {} - - public static SingletonImmutableList instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - Object element = reader.readObject(); - return new SingletonImmutableList<>(element); - } - - public static void serialize(SerializationStreamWriter writer, SingletonImmutableList instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.element); - } -} diff --git a/guava-gwt/src/com/google/common/collect/SingletonImmutableSet_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/SingletonImmutableSet_CustomFieldSerializer.java deleted file mode 100644 index d6db6203e437..000000000000 --- a/guava-gwt/src/com/google/common/collect/SingletonImmutableSet_CustomFieldSerializer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link SingletonImmutableSet}. - * - * @author Hayward Chan - */ -public class SingletonImmutableSet_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, SingletonImmutableSet instance) {} - - public static SingletonImmutableSet instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - Object element = reader.readObject(); - return new SingletonImmutableSet<>(element); - } - - public static void serialize(SerializationStreamWriter writer, SingletonImmutableSet instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.element); - } -} diff --git a/guava-gwt/src/com/google/common/collect/SingletonImmutableTable_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/SingletonImmutableTable_CustomFieldSerializer.java deleted file mode 100644 index 27298ba54aec..000000000000 --- a/guava-gwt/src/com/google/common/collect/SingletonImmutableTable_CustomFieldSerializer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2009 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; - -/** - * This class implements the GWT serialization of {@link SingletonImmutableTable}. - * - * @author Chris Povirk - */ -public class SingletonImmutableTable_CustomFieldSerializer { - public static void deserialize( - SerializationStreamReader reader, SingletonImmutableTable instance) {} - - public static SingletonImmutableTable instantiate( - SerializationStreamReader reader) throws SerializationException { - checkGwtRpcEnabled(); - Object rowKey = reader.readObject(); - Object columnKey = reader.readObject(); - Object value = reader.readObject(); - return new SingletonImmutableTable<>(rowKey, columnKey, value); - } - - public static void serialize( - SerializationStreamWriter writer, SingletonImmutableTable instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(instance.singleRowKey); - writer.writeObject(instance.singleColumnKey); - writer.writeObject(instance.singleValue); - } -} diff --git a/guava-gwt/src/com/google/common/collect/SparseImmutableTable_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/SparseImmutableTable_CustomFieldSerializer.java deleted file mode 100644 index b944490472eb..000000000000 --- a/guava-gwt/src/com/google/common/collect/SparseImmutableTable_CustomFieldSerializer.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2012 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; - -/** - * This class implements the GWT serialization of {@link SparseImmutableTable}. - * - * @author Chris Povirk - */ -public class SparseImmutableTable_CustomFieldSerializer { - public static void deserialize( - SerializationStreamReader reader, SparseImmutableTable instance) {} - - public static SparseImmutableTable instantiate( - SerializationStreamReader reader) throws SerializationException { - checkGwtRpcEnabled(); - return (SparseImmutableTable) - ImmutableTable_CustomFieldSerializerBase.instantiate(reader); - } - - public static void serialize( - SerializationStreamWriter writer, SparseImmutableTable table) - throws SerializationException { - checkGwtRpcEnabled(); - ImmutableTable_CustomFieldSerializerBase.serialize(writer, table); - } -} diff --git a/guava-gwt/src/com/google/common/collect/Table_CustomFieldSerializerBase.java b/guava-gwt/src/com/google/common/collect/Table_CustomFieldSerializerBase.java deleted file mode 100644 index cd857d155a6c..000000000000 --- a/guava-gwt/src/com/google/common/collect/Table_CustomFieldSerializerBase.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2009 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 com.google.gwt.user.client.rpc.SerializationException; -import com.google.gwt.user.client.rpc.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; -import java.util.Map; -import java.util.Map.Entry; - -/** - * This class contains static utility methods for writing {@link Table} GWT field serializers. - * Serializers should delegate to {@link #serialize} and {@link #populate}. - * - *

For {@link ImmutableTable}, see {@link ImmutableTable_CustomFieldSerializerBase}. - * - * @author Chris Povirk - */ -final class Table_CustomFieldSerializerBase { - static > T populate( - SerializationStreamReader reader, T table) throws SerializationException { - Map hashMap = (Map) reader.readObject(); - for (Entry row : hashMap.entrySet()) { - table.row(row.getKey()).putAll((Map) row.getValue()); - } - return table; - } - - static void serialize(SerializationStreamWriter writer, StandardTable table) - throws SerializationException { - /* - * The backing map of a {Hash,Tree}BasedTable is a {Hash,Tree}Map of {Hash,Tree}Maps. Therefore, - * the backing map is serializable (assuming that the row, column and values, along with any - * comparators, are all serializable). - */ - writer.writeObject(table.backingMap); - } - - private Table_CustomFieldSerializerBase() {} -} diff --git a/guava-gwt/src/com/google/common/collect/TreeBasedTable_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/TreeBasedTable_CustomFieldSerializer.java deleted file mode 100644 index 4f2c532d0f89..000000000000 --- a/guava-gwt/src/com/google/common/collect/TreeBasedTable_CustomFieldSerializer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2009 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 java.util.Comparator; - -/** - * This class implements the GWT serialization of {@link TreeBasedTable}. - * - * @author Hayward Chan - */ -public class TreeBasedTable_CustomFieldSerializer { - public static void deserialize(SerializationStreamReader reader, TreeBasedTable table) {} - - public static TreeBasedTable instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - @SuppressWarnings("unchecked") // The comparator isn't used statically. - Comparator rowComparator = (Comparator) reader.readObject(); - @SuppressWarnings("unchecked") // The comparator isn't used statically. - Comparator columnComparator = (Comparator) reader.readObject(); - - TreeBasedTable table = - TreeBasedTable.create(rowComparator, columnComparator); - return Table_CustomFieldSerializerBase.populate(reader, table); - } - - public static void serialize(SerializationStreamWriter writer, TreeBasedTable table) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeObject(table.rowComparator()); - writer.writeObject(table.columnComparator()); - Table_CustomFieldSerializerBase.serialize(writer, table); - } -} diff --git a/guava-gwt/src/com/google/common/collect/TreeMultimap_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/TreeMultimap_CustomFieldSerializer.java deleted file mode 100644 index a1139087bc9e..000000000000 --- a/guava-gwt/src/com/google/common/collect/TreeMultimap_CustomFieldSerializer.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2009 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 java.util.Comparator; - -/** - * This class implements the GWT serialization of {@link TreeMultimap}. - * - * @author Nikhil Singhal - */ -public class TreeMultimap_CustomFieldSerializer { - - public static void deserialize(SerializationStreamReader in, TreeMultimap out) {} - - @SuppressWarnings("unchecked") - public static TreeMultimap instantiate(SerializationStreamReader in) - throws SerializationException { - checkGwtRpcEnabled(); - Comparator keyComparator = (Comparator) in.readObject(); - Comparator valueComparator = (Comparator) in.readObject(); - - return (TreeMultimap) - Multimap_CustomFieldSerializerBase.populate( - in, TreeMultimap.create(keyComparator, valueComparator)); - } - - public static void serialize(SerializationStreamWriter out, TreeMultimap multimap) - throws SerializationException { - checkGwtRpcEnabled(); - out.writeObject(multimap.keyComparator()); - out.writeObject(multimap.valueComparator()); - Multimap_CustomFieldSerializerBase.serialize(out, multimap); - } -} diff --git a/guava-gwt/src/com/google/common/collect/UsingToStringOrdering_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/collect/UsingToStringOrdering_CustomFieldSerializer.java deleted file mode 100644 index afe636a7f22a..000000000000 --- a/guava-gwt/src/com/google/common/collect/UsingToStringOrdering_CustomFieldSerializer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2009 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.SerializationStreamReader; -import com.google.gwt.user.client.rpc.SerializationStreamWriter; - -/** - * This class implements the GWT serialization of {@link UsingToStringOrdering}. - * - * @author Chris Povirk - */ -public class UsingToStringOrdering_CustomFieldSerializer { - - public static void deserialize( - SerializationStreamReader reader, UsingToStringOrdering instance) {} - - public static UsingToStringOrdering instantiate(SerializationStreamReader reader) { - checkGwtRpcEnabled(); - return UsingToStringOrdering.INSTANCE; - } - - public static void serialize(SerializationStreamWriter writer, UsingToStringOrdering instance) { - checkGwtRpcEnabled(); - } -} diff --git a/guava-gwt/src/com/google/common/primitives/UnsignedLong_CustomFieldSerializer.java b/guava-gwt/src/com/google/common/primitives/UnsignedLong_CustomFieldSerializer.java deleted file mode 100644 index 264656ec5b86..000000000000 --- a/guava-gwt/src/com/google/common/primitives/UnsignedLong_CustomFieldSerializer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2011 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.primitives; - -import static com.google.common.primitives.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; - -/** - * This class implements the GWT serialization of {@code UnsignedLong}. - * - * @author Louis Wasserman - */ -public class UnsignedLong_CustomFieldSerializer { - public static void deserialize(SerializationStreamReader reader, UnsignedLong instance) {} - - public static UnsignedLong instantiate(SerializationStreamReader reader) - throws SerializationException { - checkGwtRpcEnabled(); - return UnsignedLong.fromLongBits(reader.readLong()); - } - - public static void serialize(SerializationStreamWriter writer, UnsignedLong instance) - throws SerializationException { - checkGwtRpcEnabled(); - writer.writeLong(instance.longValue()); - } -}