Java 类com.google.common.util.concurrent.FuturesGetChecked.GetCheckedTypeValidator 实例源码

项目:guava-mock    文件:FuturesGetCheckedBenchmark.java   
@BeforeExperiment
void addOtherEntries() throws Exception {
  GetCheckedTypeValidator validator = this.validator.validator;
  Class<? extends Exception> exceptionType = this.exceptionType.exceptionType;

  for (Class<? extends Exception> exceptionClass :
        OTHER_EXCEPTION_TYPES.asList().subList(0, otherEntriesInDataStructure)) {
    getChecked(validator, immediateFuture(""), exceptionClass);
  }

  for (int i = 0; i < otherEntriesInDataStructure; i++) {
    ClassValue<Boolean> classValue =
        new ClassValue<Boolean>() {
          @Override
          protected Boolean computeValue(Class<?> type) {
            return true;
          }
        };
    classValue.get(exceptionType);
    retainedReferencesToOtherClassValues.add(classValue);
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedBenchmark.java   
@BeforeExperiment
void addOtherEntries() throws Exception {
  GetCheckedTypeValidator validator = this.validator.validator;
  Class<? extends Exception> exceptionType = this.exceptionType.exceptionType;

  for (Class<? extends Exception> exceptionClass :
        OTHER_EXCEPTION_TYPES.asList().subList(0, otherEntriesInDataStructure)) {
    getChecked(validator, immediateFuture(""), exceptionClass);
  }

  for (int i = 0; i < otherEntriesInDataStructure; i++) {
    ClassValue<Boolean> classValue =
        new ClassValue<Boolean>() {
          @Override
          protected Boolean computeValue(Class<?> type) {
            return true;
          }
        };
    classValue.get(exceptionType);
    retainedReferencesToOtherClassValues.add(classValue);
  }
}
项目:guava    文件:FuturesGetCheckedBenchmark.java   
@BeforeExperiment
void addOtherEntries() throws Exception {
  GetCheckedTypeValidator validator = this.validator.validator;
  Class<? extends Exception> exceptionType = this.exceptionType.exceptionType;

  for (Class<? extends Exception> exceptionClass :
      OTHER_EXCEPTION_TYPES.asList().subList(0, otherEntriesInDataStructure)) {
    getChecked(validator, immediateFuture(""), exceptionClass);
  }

  for (int i = 0; i < otherEntriesInDataStructure; i++) {
    ClassValue<Boolean> classValue =
        new ClassValue<Boolean>() {
          @Override
          protected Boolean computeValue(Class<?> type) {
            return true;
          }
        };
    classValue.get(exceptionType);
    retainedReferencesToOtherClassValues.add(classValue);
  }
}
项目:guava    文件:FuturesGetCheckedBenchmark.java   
@BeforeExperiment
void addOtherEntries() throws Exception {
  GetCheckedTypeValidator validator = this.validator.validator;
  Class<? extends Exception> exceptionType = this.exceptionType.exceptionType;

  for (Class<? extends Exception> exceptionClass :
      OTHER_EXCEPTION_TYPES.asList().subList(0, otherEntriesInDataStructure)) {
    getChecked(validator, immediateFuture(""), exceptionClass);
  }

  for (int i = 0; i < otherEntriesInDataStructure; i++) {
    ClassValue<Boolean> classValue =
        new ClassValue<Boolean>() {
          @Override
          protected Boolean computeValue(Class<?> type) {
            return true;
          }
        };
    classValue.get(exceptionType);
    retainedReferencesToOtherClassValues.add(classValue);
  }
}
项目:guava-mock    文件:FuturesGetCheckedBenchmark.java   
@Benchmark
int benchmarkGetChecked(int reps) {
  int tmp = 0;
  GetCheckedTypeValidator validator = this.validator.validator;
  Future<Object> future = this.result.future;
  Class<? extends Exception> exceptionType = this.exceptionType.exceptionType;
  for (int i = 0; i < reps; ++i) {
    try {
      tmp += getChecked(validator, future, exceptionType).hashCode();
    } catch (Exception e) {
      tmp += e.hashCode();
    }
  }
  return tmp;
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedBenchmark.java   
@Benchmark
int benchmarkGetChecked(int reps) {
  int tmp = 0;
  GetCheckedTypeValidator validator = this.validator.validator;
  Future<Object> future = this.result.future;
  Class<? extends Exception> exceptionType = this.exceptionType.exceptionType;
  for (int i = 0; i < reps; ++i) {
    try {
      tmp += getChecked(validator, future, exceptionType).hashCode();
    } catch (Exception e) {
      tmp += e.hashCode();
    }
  }
  return tmp;
}
项目:guava    文件:FuturesGetCheckedBenchmark.java   
@Benchmark
int benchmarkGetChecked(int reps) {
  int tmp = 0;
  GetCheckedTypeValidator validator = this.validator.validator;
  Future<Object> future = this.result.future;
  Class<? extends Exception> exceptionType = this.exceptionType.exceptionType;
  for (int i = 0; i < reps; ++i) {
    try {
      tmp += getChecked(validator, future, exceptionType).hashCode();
    } catch (Exception e) {
      tmp += e.hashCode();
    }
  }
  return tmp;
}
项目:guava    文件:FuturesGetCheckedBenchmark.java   
@Benchmark
int benchmarkGetChecked(int reps) {
  int tmp = 0;
  GetCheckedTypeValidator validator = this.validator.validator;
  Future<Object> future = this.result.future;
  Class<? extends Exception> exceptionType = this.exceptionType.exceptionType;
  for (int i = 0; i < reps; ++i) {
    try {
      tmp += getChecked(validator, future, exceptionType).hashCode();
    } catch (Exception e) {
      tmp += e.hashCode();
    }
  }
  return tmp;
}
项目:guava-mock    文件:FuturesGetCheckedBenchmark.java   
private Validator(GetCheckedTypeValidator validator) {
  this.validator = validator;
}
项目:guava-mock    文件:FuturesGetCheckedBenchmark.java   
private static GetCheckedTypeValidator nonCachingWithoutConstructorCheckValidator() {
  return NonCachingWithoutConstructorCheckValidator.INSTANCE;
}
项目:guava-mock    文件:FuturesGetCheckedBenchmark.java   
private static GetCheckedTypeValidator nonCachingWithConstructorCheckValidator() {
  return NonCachingWithConstructorCheckValidator.INSTANCE;
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedBenchmark.java   
private Validator(GetCheckedTypeValidator validator) {
  this.validator = validator;
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedBenchmark.java   
private static GetCheckedTypeValidator nonCachingWithoutConstructorCheckValidator() {
  return NonCachingWithoutConstructorCheckValidator.INSTANCE;
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedBenchmark.java   
private static GetCheckedTypeValidator nonCachingWithConstructorCheckValidator() {
  return NonCachingWithConstructorCheckValidator.INSTANCE;
}
项目:guava    文件:FuturesGetCheckedBenchmark.java   
Validator(GetCheckedTypeValidator validator) {
  this.validator = validator;
}
项目:guava    文件:FuturesGetCheckedBenchmark.java   
private static GetCheckedTypeValidator nonCachingWithoutConstructorCheckValidator() {
  return NonCachingWithoutConstructorCheckValidator.INSTANCE;
}
项目:guava    文件:FuturesGetCheckedBenchmark.java   
private static GetCheckedTypeValidator nonCachingWithConstructorCheckValidator() {
  return NonCachingWithConstructorCheckValidator.INSTANCE;
}
项目:guava    文件:FuturesGetCheckedBenchmark.java   
Validator(GetCheckedTypeValidator validator) {
  this.validator = validator;
}
项目:guava    文件:FuturesGetCheckedBenchmark.java   
private static GetCheckedTypeValidator nonCachingWithoutConstructorCheckValidator() {
  return NonCachingWithoutConstructorCheckValidator.INSTANCE;
}
项目:guava    文件:FuturesGetCheckedBenchmark.java   
private static GetCheckedTypeValidator nonCachingWithConstructorCheckValidator() {
  return NonCachingWithConstructorCheckValidator.INSTANCE;
}