There was some doubt on IRC as to if AnnotatedType should be thread safe as
well as some comments that eliminating the use of AnnotatedType at runtime
would be a possible solution.
We certainly can reduce or eliminate our use of AnnotatedType, but noticed the
BeanManager API gives us no choice as it allows people to create and use
AnnotatedType at runtime.
final BeanManager beanManager = getBeanManager();
final AnnotatedType<Colors> annotatedType =
beanManager.createAnnotatedType(Colors.class);
for (int i = 0; i < threads; i++)
{
new Runner(startingLine, startingPistol, exceptions, finishLine,
annotatedType)
{
@Override
public void doit()
{
beanManager.createInjectionTarget(annotatedType);
}
}.start();
}
That being said, I'll see if I can reduce the memory requirement of the fix.
Speed-wise, it's good. FutureTask is fast.
-David