Fix #265. Don't invoke getTypeParameters and getComponentType on each call of setGenerics(). Pre-compute and cache them instead whenever it is possible.