test_class.file: handlebars/src/test/java/com/github/jknack/handlebars/cache/HighConcurrencyTemplateCacheTest.java
test_class.identifier: HighConcurrencyTemplateCacheTest
test_case.body: @Test(expected = Error.class)
    @SuppressWarnings("unchecked")
    public void errorShouldBeReThrow() throws Exception {
      ConcurrentMap<TemplateSource, Future<Pair<TemplateSource, Template>>> cache = createMock(
          ConcurrentHashMap.class);
  
      TemplateSource source = new URLTemplateSource("/template.hbs", getClass().getResource(
          "/template.hbs"));
  
      Future<Pair<TemplateSource, Template>> future = createMock(Future.class);
      // 1st try interrupt thread
      expect(cache.get(source)).andReturn(future);
      expect(future.get()).andThrow(new Error());
  
      // 2nd success
      Template template = createMock(Template.class);
      Pair<TemplateSource, Template> pair = createMock(Pair.class);
      expect(pair.getLeft()).andReturn(source);
      expect(pair.getValue()).andReturn(template);
      expect(cache.get(source)).andReturn(future);
      expect(future.get()).andReturn(pair).times(2);
  
      Parser parser = createMock(Parser.class);
  
      replay(parser, template, cache, future, pair);
  
      // 1st call, parse must be call it
      assertEquals(template, new HighConcurrencyTemplateCache(cache).get(source, parser));
  
      verify(parser, template, cache, future, pair);
    }
test_case.class_method_signature: HighConcurrencyTemplateCacheTest.errorShouldBeReThrow()
test_case.full_signature: @Test(expected = Error.class) @SuppressWarnings("unchecked") public void errorShouldBeReThrow()
test_case.identifier: errorShouldBeReThrow
test_case.invocations: createMock getResource getClass createMock andReturn expect get andThrow expect get createMock createMock andReturn expect getLeft andReturn expect getValue andReturn expect get times andReturn expect get createMock replay assertEquals get verify
test_case.modifiers: @Test(expected = Error.class) @SuppressWarnings("unchecked") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void errorShouldBeReThrow()
focal_class.declarator: logger = LoggerFactory.getLogger(getClass())
focal_class.modifier: private final
focal_class.original_string: private final Logger logger = LoggerFactory.getLogger(getClass());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: cache
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<TemplateSource, Future<Pair<TemplateSource, Template>>> cache;
focal_class.type: ConcurrentMap<TemplateSource, Future<Pair<TemplateSource, Template>>>
focal_class.var_name: cache
focal_class.declarator: reload
focal_class.modifier: private
focal_class.original_string: private boolean reload;
focal_class.type: boolean
focal_class.var_name: reload
focal_class.file: handlebars/src/main/java/com/github/jknack/handlebars/cache/HighConcurrencyTemplateCache.java
focal_class.identifier: HighConcurrencyTemplateCache
focal_class.interfaces: implements TemplateCache
focal_class.class_method_signature: HighConcurrencyTemplateCache.HighConcurrencyTemplateCache(
        final ConcurrentMap<TemplateSource, Future<Pair<TemplateSource, Template>>> cache)
focal_class.full_signature: protected  HighConcurrencyTemplateCache(
        final ConcurrentMap<TemplateSource, Future<Pair<TemplateSource, Template>>> cache)
focal_class.identifier: HighConcurrencyTemplateCache
focal_class.modifiers: protected
focal_class.parameters: (
        final ConcurrentMap<TemplateSource, Future<Pair<TemplateSource, Template>>> cache)
focal_class.signature:  HighConcurrencyTemplateCache(
        final ConcurrentMap<TemplateSource, Future<Pair<TemplateSource, Template>>> cache)
focal_class.class_method_signature: HighConcurrencyTemplateCache.HighConcurrencyTemplateCache()
focal_class.full_signature: public  HighConcurrencyTemplateCache()
focal_class.identifier: HighConcurrencyTemplateCache
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  HighConcurrencyTemplateCache()
focal_class.class_method_signature: HighConcurrencyTemplateCache.clear()
focal_class.full_signature: @Override public void clear()
focal_class.identifier: clear
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: HighConcurrencyTemplateCache.evict(final TemplateSource source)
focal_class.full_signature: @Override public void evict(final TemplateSource source)
focal_class.identifier: evict
focal_class.modifiers: @Override public
focal_class.parameters: (final TemplateSource source)
focal_class.return: void
focal_class.signature: void evict(final TemplateSource source)
focal_class.class_method_signature: HighConcurrencyTemplateCache.get(final TemplateSource source, final Parser parser)
focal_class.full_signature: @Override public Template get(final TemplateSource source, final Parser parser)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (final TemplateSource source, final Parser parser)
focal_class.return: Template
focal_class.signature: Template get(final TemplateSource source, final Parser parser)
focal_class.class_method_signature: HighConcurrencyTemplateCache.setReload(final boolean reload)
focal_class.full_signature: @Override public HighConcurrencyTemplateCache setReload(final boolean reload)
focal_class.identifier: setReload
focal_class.modifiers: @Override public
focal_class.parameters: (final boolean reload)
focal_class.return: HighConcurrencyTemplateCache
focal_class.signature: HighConcurrencyTemplateCache setReload(final boolean reload)
focal_class.class_method_signature: HighConcurrencyTemplateCache.cacheGet(final TemplateSource source, final Parser parser)
focal_class.full_signature: private Template cacheGet(final TemplateSource source, final Parser parser)
focal_class.identifier: cacheGet
focal_class.modifiers: private
focal_class.parameters: (final TemplateSource source, final Parser parser)
focal_class.return: Template
focal_class.signature: Template cacheGet(final TemplateSource source, final Parser parser)
focal_class.class_method_signature: HighConcurrencyTemplateCache.newTask(final TemplateSource source,
        final Parser parser)
focal_class.full_signature: private FutureTask<Pair<TemplateSource, Template>> newTask(final TemplateSource source,
        final Parser parser)
focal_class.identifier: newTask
focal_class.modifiers: private
focal_class.parameters: (final TemplateSource source,
        final Parser parser)
focal_class.return: FutureTask<Pair<TemplateSource, Template>>
focal_class.signature: FutureTask<Pair<TemplateSource, Template>> newTask(final TemplateSource source,
        final Parser parser)
focal_class.class_method_signature: HighConcurrencyTemplateCache.putIfAbsent(final TemplateSource source,
        final FutureTask<Pair<TemplateSource, Template>> futureTask)
focal_class.full_signature: private Future<Pair<TemplateSource, Template>> putIfAbsent(final TemplateSource source,
        final FutureTask<Pair<TemplateSource, Template>> futureTask)
focal_class.identifier: putIfAbsent
focal_class.modifiers: private
focal_class.parameters: (final TemplateSource source,
        final FutureTask<Pair<TemplateSource, Template>> futureTask)
focal_class.return: Future<Pair<TemplateSource, Template>>
focal_class.signature: Future<Pair<TemplateSource, Template>> putIfAbsent(final TemplateSource source,
        final FutureTask<Pair<TemplateSource, Template>> futureTask)
focal_class.class_method_signature: HighConcurrencyTemplateCache.launderThrowable(final TemplateSource source, final Throwable cause)
focal_class.full_signature: private RuntimeException launderThrowable(final TemplateSource source, final Throwable cause)
focal_class.identifier: launderThrowable
focal_class.modifiers: private
focal_class.parameters: (final TemplateSource source, final Throwable cause)
focal_class.return: RuntimeException
focal_class.signature: RuntimeException launderThrowable(final TemplateSource source, final Throwable cause)
focal_method.body: @Override
    public Template get(final TemplateSource source, final Parser parser) throws IOException {
      notNull(source, "The source is required.");
      notNull(parser, "The parser is required.");
  
      /**
       * Don't keep duplicated entries, remove old templates if a change is detected.
       */
      return cacheGet(source, parser);
    }
focal_method.class_method_signature: HighConcurrencyTemplateCache.get(final TemplateSource source, final Parser parser)
focal_method.full_signature: @Override public Template get(final TemplateSource source, final Parser parser)
focal_method.identifier: get
focal_method.invocations: notNull notNull cacheGet
focal_method.modifiers: @Override public
focal_method.parameters: (final TemplateSource source, final Parser parser)
focal_method.return: Template
focal_method.signature: Template get(final TemplateSource source, final Parser parser)