@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); } }
@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; }
private Validator(GetCheckedTypeValidator validator) { this.validator = validator; }
private static GetCheckedTypeValidator nonCachingWithoutConstructorCheckValidator() { return NonCachingWithoutConstructorCheckValidator.INSTANCE; }
private static GetCheckedTypeValidator nonCachingWithConstructorCheckValidator() { return NonCachingWithConstructorCheckValidator.INSTANCE; }
Validator(GetCheckedTypeValidator validator) { this.validator = validator; }