Deprecated API


Contents
Deprecated Classes
com.google.common.collect.DiscreteDomains
          Merged into DiscreteDomain. This class is scheduled for deletion in release 15.0. 
com.google.common.util.concurrent.ForwardingService
          Instead of using a ForwardingService, consider using the Service.Listener functionality to hook into the Service lifecycle, or if you really do need to provide access to some Service methods, consider just providing the few that you actually need (e.g. just ForwardingService.startAndWait()) and not implementing Service. 
com.google.common.io.LimitInputStream
          Use ByteStreams.limit(java.io.InputStream, long) instead. This class is scheduled to be removed in Guava release 15.0. 
com.google.common.io.NullOutputStream
          Use ByteStreams.nullOutputStream() instead. This class is scheduled to be removed in Guava release 15.0. 
com.google.common.collect.Ranges
          Use the corresponding method in Range. 
 

Deprecated Methods
com.google.common.collect.UnmodifiableListIterator.add(E)
          Unsupported operation. 
com.google.common.collect.ImmutableCollection.add(E)
          Unsupported operation. 
com.google.common.collect.ImmutableMultiset.add(E, int)
          Unsupported operation. 
com.google.common.collect.ImmutableList.add(int, E)
          Unsupported operation. 
com.google.common.primitives.UnsignedInteger.add(UnsignedInteger)
          Use UnsignedInteger.plus(UnsignedInteger). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.primitives.UnsignedLong.add(UnsignedLong)
          Use UnsignedLong.plus(UnsignedLong). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.collect.ImmutableCollection.addAll(Collection)
          Unsupported operation. 
com.google.common.collect.ImmutableList.addAll(int, Collection)
          Unsupported operation. 
com.google.common.base.Joiner.appendTo(A, I)
          use Joiner.appendTo(Appendable, Iterator) by casting parts to Iterator<?>, or better yet, by implementing only Iterator and not Iterable. This method is scheduled for deletion in June 2013. 
com.google.common.base.Joiner.MapJoiner.appendTo(A, I)
          use Joiner.MapJoiner.appendTo(Appendable, Iterator) by casting entries to Iterator<? extends Entry<?, ?>>, or better yet, by implementing only Iterator and not Iterable. This method is scheduled for deletion in June 2013. 
com.google.common.base.Joiner.appendTo(StringBuilder, I)
          use Joiner.appendTo(StringBuilder, Iterator) by casting parts to Iterator<?>, or better yet, by implementing only Iterator and not Iterable. This method is scheduled for deletion in June 2013. 
com.google.common.base.Joiner.MapJoiner.appendTo(StringBuilder, I)
          use Joiner.MapJoiner.appendTo(StringBuilder, Iterator) by casting entries to Iterator<? extends Entry<?, ?>>, or better yet, by implementing only Iterator and not Iterable. This method is scheduled for deletion in June 2013. 
com.google.common.collect.Range.asSet(DiscreteDomain)
          Use ContiguousSet.create(range, domain) instead. 
com.google.common.primitives.UnsignedInteger.asUnsigned(int)
          Use UnsignedInteger.fromIntBits(int). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.primitives.UnsignedLong.asUnsigned(long)
          Use UnsignedLong.fromLongBits(long). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.collect.ImmutableTable.clear()
          Unsupported operation. 
com.google.common.collect.ArrayTable.clear()
          Use ArrayTable.eraseAll() 
com.google.common.collect.ImmutableMap.clear()
          Unsupported operation. 
com.google.common.collect.ImmutableMultimap.clear()
          Unsupported operation. 
com.google.common.collect.ImmutableCollection.clear()
          Unsupported operation. 
com.google.common.io.Closeables.closeQuietly(Closeable)
          Where possible, use the try-with-resources statement if using JDK7 or Closer on JDK6 to close one or more Closeable objects. This method is deprecated because it is easy to misuse and may swallow IO exceptions that really should be thrown and handled. See Guava issue 1118 for a more detailed explanation of the reasons for deprecation and see Closing Resources for more information on the problems with closing Closeable objects and some of the preferred solutions for handling it correctly. This method is scheduled to be removed in Guava 16.0. 
com.google.common.collect.ComparisonChain.compare(boolean, boolean)
          Use ComparisonChain.compareFalseFirst(boolean, boolean); or, if the parameters passed are being either negated or reversed, undo the negation or reversal and use ComparisonChain.compareTrueFirst(boolean, boolean). This method is scheduled for deletion in September 2013. 
com.google.common.primitives.UnsignedInteger.divide(UnsignedInteger)
          Use UnsignedInteger.dividedBy(UnsignedInteger). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.primitives.UnsignedLong.divide(UnsignedLong)
          Use UnsignedLong.dividedBy(UnsignedLong). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.base.Stopwatch.elapsedMillis()
          Use stopwatch.elapsed(MILLISECONDS) instead. This method is scheduled to be removed in Guava release 16.0. 
com.google.common.base.Stopwatch.elapsedTime(TimeUnit)
          Use Stopwatch.elapsed(TimeUnit) instead. This method is scheduled to be removed in Guava release 16.0. 
com.google.common.hash.BloomFilter.expectedFalsePositiveProbability()
          Use BloomFilter.expectedFpp() instead. 
com.google.common.collect.ImmutableBiMap.forcePut(K, V)
          Unsupported operation. 
com.google.common.collect.FluentIterable.from(FluentIterable)
          instances of FluentIterable don't need to be converted to FluentIterable 
com.google.common.collect.Ordering.from(Ordering)
          no need to use this 
com.google.common.net.InternetDomainName.fromLenient(String)
          Use InternetDomainName.from(String) 
com.google.common.io.Files.getChecksum(File, Checksum)
          Use hash with the Hashing.crc32() or Hashing.adler32() hash functions. This method is scheduled to be removed in Guava 15.0. 
com.google.common.io.ByteStreams.getChecksum(InputSupplier, Checksum)
          Use hash with the Hashing.crc32() or Hashing.adler32() hash functions instead. This method is scheduled to be removed in Guava 15.0. 
com.google.common.net.InternetDomainName.isValidLenient(String)
          Use InternetDomainName.isValid(String) instead 
com.google.common.base.Joiner.join(I)
          use Joiner.join(Iterator) by casting parts to Iterator<?>, or better yet, by implementing only Iterator and not Iterable. This method is scheduled for deletion in June 2013. 
com.google.common.base.Joiner.MapJoiner.join(I)
          use Joiner.MapJoiner.join(Iterator) by casting entries to Iterator<? extends Entry<?, ?>>, or better yet, by implementing only Iterator and not Iterable. This method is scheduled for deletion in June 2013. 
com.google.common.collect.GenericMapMaker.makeComputingMap(Function)
           
com.google.common.collect.MapMaker.makeComputingMap(Function)
          Caching functionality in MapMaker is being moved to CacheBuilder, with MapMaker.makeComputingMap(com.google.common.base.Function) being replaced by CacheBuilder.build(com.google.common.cache.CacheLoader). See the MapMaker Migration Guide for more details. This method is scheduled for deletion in February 2013. 
com.google.common.primitives.UnsignedInteger.multiply(UnsignedInteger)
          Use UnsignedInteger.times(UnsignedInteger). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.primitives.UnsignedLong.multiply(UnsignedLong)
          Use UnsignedLong.times(UnsignedLong). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.hash.Hashing.padToLong(HashCode)
          Use HashCode.padToLong() instead. This method is scheduled to be removed in Guava 15.0. 
com.google.common.collect.Iterators.peekingIterator(PeekingIterator)
          no need to use this 
com.google.common.collect.ImmutableSortedSet.pollFirst()
          Unsupported operation. 
com.google.common.collect.ImmutableSortedMultiset.pollFirstEntry()
          Unsupported operation. 
com.google.common.collect.ImmutableSortedMap.pollFirstEntry()
          Unsupported operation. 
com.google.common.collect.ImmutableSortedSet.pollLast()
          Unsupported operation. 
com.google.common.collect.ImmutableSortedMultiset.pollLastEntry()
          Unsupported operation. 
com.google.common.collect.ImmutableSortedMap.pollLastEntry()
          Unsupported operation. 
com.google.common.collect.ImmutableMap.put(K, V)
          Unsupported operation. 
com.google.common.collect.ImmutableMultimap.put(K, V)
          Unsupported operation. 
com.google.common.collect.ImmutableTable.put(R, C, V)
          Unsupported operation. 
com.google.common.collect.ImmutableMultimap.putAll(K, Iterable)
          Unsupported operation. 
com.google.common.collect.ImmutableMap.putAll(Map)
          Unsupported operation. 
com.google.common.collect.ImmutableMultimap.putAll(Multimap)
          Unsupported operation. 
com.google.common.collect.ImmutableTable.putAll(Table)
          Unsupported operation. 
com.google.common.collect.ImmutableClassToInstanceMap.putInstance(Class, T)
          Unsupported operation. 
com.google.common.primitives.UnsignedInteger.remainder(UnsignedInteger)
          Use UnsignedInteger.mod(UnsignedInteger). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.primitives.UnsignedLong.remainder(UnsignedLong)
          Use UnsignedLong.mod(UnsignedLong). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.collect.UnmodifiableIterator.remove()
          Unsupported operation. 
com.google.common.collect.ImmutableList.remove(int)
          Unsupported operation. 
com.google.common.collect.ImmutableMap.remove(Object)
          Unsupported operation. 
com.google.common.collect.ImmutableCollection.remove(Object)
          Unsupported operation. 
com.google.common.collect.ImmutableMultiset.remove(Object, int)
          Unsupported operation. 
com.google.common.collect.ImmutableTable.remove(Object, Object)
          Unsupported operation. 
com.google.common.collect.ArrayTable.remove(Object, Object)
          Use ArrayTable.erase(java.lang.Object, java.lang.Object) 
com.google.common.collect.ImmutableMultimap.remove(Object, Object)
          Unsupported operation. 
com.google.common.collect.ImmutableCollection.removeAll(Collection)
          Unsupported operation. 
com.google.common.collect.ImmutableSetMultimap.removeAll(Object)
          Unsupported operation. 
com.google.common.collect.ImmutableListMultimap.removeAll(Object)
          Unsupported operation. 
com.google.common.collect.ImmutableMultimap.removeAll(Object)
          Unsupported operation. 
com.google.common.collect.ImmutableSetMultimap.replaceValues(K, Iterable)
          Unsupported operation. 
com.google.common.collect.ImmutableListMultimap.replaceValues(K, Iterable)
          Unsupported operation. 
com.google.common.collect.ImmutableMultimap.replaceValues(K, Iterable)
          Unsupported operation. 
com.google.common.collect.ImmutableCollection.retainAll(Collection)
          Unsupported operation. 
com.google.common.collect.UnmodifiableListIterator.set(E)
          Unsupported operation. 
com.google.common.collect.ImmutableList.set(int, E)
          Unsupported operation. 
com.google.common.collect.ImmutableMultiset.setCount(E, int)
          Unsupported operation. 
com.google.common.collect.ImmutableMultiset.setCount(E, int, int)
          Unsupported operation. 
com.google.common.primitives.UnsignedInteger.subtract(UnsignedInteger)
          Use UnsignedInteger.minus(UnsignedInteger). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.primitives.UnsignedLong.subtract(UnsignedLong)
          Use UnsignedLong.minus(UnsignedLong). This method is scheduled to be removed in Guava release 15.0. 
com.google.common.collect.FluentIterable.toImmutableList()
          Use FluentIterable.toList() instead. This method is scheduled for removal in Guava 15.0. 
com.google.common.collect.FluentIterable.toImmutableSet()
          Use FluentIterable.toSet() instead. This method is scheduled for removal in Guava 15.0. 
com.google.common.collect.FluentIterable.toImmutableSortedSet(Comparator)
          Use FluentIterable.toSortedSet(Comparator) instead. This method is scheduled for removal in Guava 15.0. 
com.google.common.collect.FluentIterable.toSortedImmutableList(Comparator)
          Use FluentIterable.toSortedList(Comparator) instead. This method is scheduled for removal in Guava 15.0. 
com.google.common.base.Stopwatch.toString(int)
          Use Stopwatch.toString() instead. This method is scheduled to be removed in Guava release 15.0. 
com.google.common.collect.Iterables.unmodifiableIterable(ImmutableCollection)
          no need to use this 
com.google.common.collect.Iterators.unmodifiableIterator(UnmodifiableIterator)
          no need to use this 
com.google.common.collect.Multimaps.unmodifiableListMultimap(ImmutableListMultimap)
          no need to use this 
com.google.common.collect.Multimaps.unmodifiableMultimap(ImmutableMultimap)
          no need to use this 
com.google.common.collect.Multisets.unmodifiableMultiset(ImmutableMultiset)
          no need to use this 
com.google.common.collect.Multimaps.unmodifiableSetMultimap(ImmutableSetMultimap)
          no need to use this 
com.google.common.io.ByteArrayDataOutput.writeBytes(String)
          This method is dangerous as it discards the high byte of every character. For UTF-8, use write(s.getBytes(Charsets.UTF_8)). 
com.google.common.io.LittleEndianDataOutputStream.writeBytes(String)
          The semantics of writeBytes(String s) are considered dangerous. Please use LittleEndianDataOutputStream.writeUTF(String s), LittleEndianDataOutputStream.writeChars(String s) or another write method instead.