467029 : speed up Archetype catalog display

Fix does the following :
- archetypes are cached per archetype catalog, per wizard invocation : they will be downloaded once
 every time the new project wizard is opened. Given the catalogs are cached per wizard instance,
 a couple of public static methods must be changed to instance methods. Given this is internal API,
 I believe it's ok to do it.
- archetype version sort slowness is mostly due to the version comparator creating 2 DefaultArtifactVersion
  in the compare method, which doesn't scale well when sorting 13k versions. So instead of handling String
  versions, we handle ArtifactVersion instead and limit the creation of objects by caching these versions
  (Central contains about 2600 unique versions strings among these 13k+). With these enhancements, sorting
  the Central archetype catalog now takes ~50ms, 10 times faster than before.
- public Set<Archetype> filterVersions(Collection<Archetype> archetypes) was removed along the way,
  as it was stated to be removed in m2e 1.1

Some formatting changes unrelated to this fix crept in, due to the Eclipse/m2e formatter

Change-Id: I6551c6a80b09ef6e035a3c6d912ad78db5bd657e
Signed-off-by: Fred Bricon <fbricon@gmail.com>
1 file changed