Esempio n. 1
0
  @GwtIncompatible("weakValues")
  public void testValueStrengthSetTwice() {
    CacheBuilder<Object, Object> builder1 = new CacheBuilder<Object, Object>().weakValues();
    try {
      builder1.weakValues();
      fail();
    } catch (IllegalStateException expected) {
    }
    try {
      builder1.softValues();
      fail();
    } catch (IllegalStateException expected) {
    }

    CacheBuilder<Object, Object> builder2 = new CacheBuilder<Object, Object>().softValues();
    try {
      builder2.softValues();
      fail();
    } catch (IllegalStateException expected) {
    }
    try {
      builder2.weakValues();
      fail();
    } catch (IllegalStateException expected) {
    }
  }
Esempio n. 2
0
 public com.google.common.cache.CacheBuilder<Object, Object> weakValues() {
   return builder.weakValues();
 }