Coverage Summary for Class: Platform (com.google.common.primitives)

Class Class, % Method, % Line, %
Platform 0% (0/1) 0% (0/3) 0% (0/7)


1 /* 2  * Copyright (C) 2019 The Guava Authors 3  * 4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5  * in compliance with the License. You may obtain a copy of the License at 6  * 7  * http://www.apache.org/licenses/LICENSE-2.0 8  * 9  * Unless required by applicable law or agreed to in writing, software distributed under the License 10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11  * or implied. See the License for the specific language governing permissions and limitations under 12  * the License. 13  */ 14  15 package com.google.common.primitives; 16  17 import com.google.common.annotations.GwtCompatible; 18  19 /** Methods factored out so that they can be emulated differently in GWT. */ 20 @GwtCompatible(emulated = true) 21 @ElementTypesAreNonnullByDefault 22 final class Platform { 23  private static final java.util.logging.Logger logger = 24  java.util.logging.Logger.getLogger(Platform.class.getName()); 25  26  static void checkGwtRpcEnabled() { 27  String propertyName = "guava.gwt.emergency_reenable_rpc"; 28  29  if (!Boolean.parseBoolean(System.getProperty(propertyName, "false"))) { 30  throw new UnsupportedOperationException( 31  com.google.common.base.Strings.lenientFormat( 32  "We are removing GWT-RPC support for Guava types. You can temporarily reenable" 33  + " support by setting the system property %s to true. For more about system" 34  + " properties, see %s. For more about Guava's GWT-RPC support, see %s.", 35  propertyName, 36  "https://stackoverflow.com/q/5189914/28465", 37  "https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ")); 38  } 39  logger.log( 40  java.util.logging.Level.WARNING, 41  "Later in 2020, we will remove GWT-RPC support for Guava types. You are seeing this" 42  + " warning because you are sending a Guava type over GWT-RPC, which will break. You" 43  + " can identify which type by looking at the class name in the attached stack trace.", 44  new Throwable()); 45  } 46  47  private Platform() {} 48 }