test_class.file: mercator-core/src/test/java/org/lendingclub/mercator/core/ScannerContextTest.java
test_class.identifier: ScannerContextTest
test_case.body: @Test
  	public void testCleanup() throws InterruptedException {
  
  		CountDownLatch latch = new CountDownLatch(1);
  		CleanupTask task = new CleanupTask() {
  
  			@Override
  			public void cleanup(ScannerContext context) {
  				latch.countDown();
  
  			}
  		};
  		new ScannerContext().withName("test").withCleanupTask(task).exec(ctx -> {
  			Assertions.assertThat(ctx.getMap().get("name")).isEqualTo("test");
  		});
  
  		Assertions.assertThat(latch.await(1, TimeUnit.SECONDS)).isTrue();
  
  	}
test_case.class_method_signature: ScannerContextTest.testCleanup()
test_case.full_signature: @Test public void testCleanup()
test_case.identifier: testCleanup
test_case.invocations: countDown exec withCleanupTask withName isEqualTo assertThat get getMap isTrue assertThat await
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCleanup()
focal_class.declarator: logger = LoggerFactory.getLogger(ScannerContext.class)
focal_class.modifier: static
focal_class.original_string: static Logger logger = LoggerFactory.getLogger(ScannerContext.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: map = Maps.newConcurrentMap()
focal_class.original_string: Map<String, Object> map = Maps.newConcurrentMap();
focal_class.type: Map<String, Object>
focal_class.var_name: map
focal_class.declarator: entityScanCount = new AtomicLong()
focal_class.original_string: AtomicLong entityScanCount = new AtomicLong();
focal_class.type: AtomicLong
focal_class.var_name: entityScanCount
focal_class.declarator: t0 = System.currentTimeMillis()
focal_class.original_string: long t0 = System.currentTimeMillis();
focal_class.type: long
focal_class.var_name: t0
focal_class.declarator: threadLocalContext = new ThreadLocal<>()
focal_class.modifier: private static
focal_class.original_string: private static ThreadLocal<ScannerContext> threadLocalContext = new ThreadLocal<>();
focal_class.type: ThreadLocal<ScannerContext>
focal_class.var_name: threadLocalContext
focal_class.declarator: cleanupQueue = Lists.newArrayList()
focal_class.modifier: private
focal_class.original_string: private List<CleanupTask> cleanupQueue = Lists.newArrayList();
focal_class.type: List<CleanupTask>
focal_class.var_name: cleanupQueue
focal_class.declarator: exceptions = Lists.newArrayList()
focal_class.original_string: List<Exception> exceptions = Lists.newArrayList();
focal_class.type: List<Exception>
focal_class.var_name: exceptions
focal_class.file: mercator-core/src/main/java/org/lendingclub/mercator/core/ScannerContext.java
focal_class.identifier: ScannerContext
focal_class.class_method_signature: ScannerContext.hasExceptions()
focal_class.full_signature: public boolean hasExceptions()
focal_class.identifier: hasExceptions
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean hasExceptions()
focal_class.class_method_signature: ScannerContext.getName()
focal_class.full_signature: public String getName()
focal_class.identifier: getName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: ScannerContext.getMap()
focal_class.full_signature: public Map<String, Object> getMap()
focal_class.identifier: getMap
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> getMap()
focal_class.class_method_signature: ScannerContext.withAttribute(String key, Object val)
focal_class.full_signature: public ScannerContext withAttribute(String key, Object val)
focal_class.identifier: withAttribute
focal_class.modifiers: public
focal_class.parameters: (String key, Object val)
focal_class.return: ScannerContext
focal_class.signature: ScannerContext withAttribute(String key, Object val)
focal_class.class_method_signature: ScannerContext.addCleanupTask(CleanupTask task)
focal_class.full_signature: public ScannerContext addCleanupTask(CleanupTask task)
focal_class.identifier: addCleanupTask
focal_class.modifiers: public
focal_class.parameters: (CleanupTask task)
focal_class.return: ScannerContext
focal_class.signature: ScannerContext addCleanupTask(CleanupTask task)
focal_class.class_method_signature: ScannerContext.withCleanupTask(CleanupTask task)
focal_class.full_signature: public ScannerContext withCleanupTask(CleanupTask task)
focal_class.identifier: withCleanupTask
focal_class.modifiers: public
focal_class.parameters: (CleanupTask task)
focal_class.return: ScannerContext
focal_class.signature: ScannerContext withCleanupTask(CleanupTask task)
focal_class.class_method_signature: ScannerContext.getScannerContext()
focal_class.full_signature: public static Optional<ScannerContext> getScannerContext()
focal_class.identifier: getScannerContext
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Optional<ScannerContext>
focal_class.signature: Optional<ScannerContext> getScannerContext()
focal_class.class_method_signature: ScannerContext.getEntityCount()
focal_class.full_signature: public long getEntityCount()
focal_class.identifier: getEntityCount
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getEntityCount()
focal_class.class_method_signature: ScannerContext.incrementEntityCount()
focal_class.full_signature: public long incrementEntityCount()
focal_class.identifier: incrementEntityCount
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long incrementEntityCount()
focal_class.class_method_signature: ScannerContext.getExceptions()
focal_class.full_signature: public List<Exception> getExceptions()
focal_class.identifier: getExceptions
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<Exception>
focal_class.signature: List<Exception> getExceptions()
focal_class.class_method_signature: ScannerContext.markException(Exception e)
focal_class.full_signature: public ScannerContext markException(Exception e)
focal_class.identifier: markException
focal_class.modifiers: public
focal_class.parameters: (Exception e)
focal_class.return: ScannerContext
focal_class.signature: ScannerContext markException(Exception e)
focal_class.class_method_signature: ScannerContext.withName(String name)
focal_class.full_signature: public ScannerContext withName(String name)
focal_class.identifier: withName
focal_class.modifiers: public
focal_class.parameters: (String name)
focal_class.return: ScannerContext
focal_class.signature: ScannerContext withName(String name)
focal_class.class_method_signature: ScannerContext.exec(Invokable x)
focal_class.full_signature: public void exec(Invokable x)
focal_class.identifier: exec
focal_class.modifiers: public
focal_class.parameters: (Invokable x)
focal_class.return: void
focal_class.signature: void exec(Invokable x)
focal_class.class_method_signature: ScannerContext.cleanup()
focal_class.full_signature: private void cleanup()
focal_class.identifier: cleanup
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void cleanup()
focal_class.class_method_signature: ScannerContext.logMetrics(String msg)
focal_class.full_signature: private void logMetrics(String msg)
focal_class.identifier: logMetrics
focal_class.modifiers: private
focal_class.parameters: (String msg)
focal_class.return: void
focal_class.signature: void logMetrics(String msg)
focal_class.class_method_signature: ScannerContext.toStringHelper()
focal_class.full_signature: protected ToStringHelper toStringHelper()
focal_class.identifier: toStringHelper
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: ToStringHelper
focal_class.signature: ToStringHelper toStringHelper()
focal_class.class_method_signature: ScannerContext.toString()
focal_class.full_signature: public String toString()
focal_class.identifier: toString
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: private void cleanup() {
  		logger.debug("cleanup");
  		cleanupQueue.forEach(c -> {
  			try {
  				logger.info("invoking cleanup task: {}", c);
  				c.cleanup(this);
  			} catch (Exception e) {
  				logger.warn("problem during cleanup: " + e);
  			}
  		});
  	}
focal_method.class_method_signature: ScannerContext.cleanup()
focal_method.full_signature: private void cleanup()
focal_method.identifier: cleanup
focal_method.invocations: debug forEach info cleanup warn
focal_method.modifiers: private
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void cleanup()