Bug 5095 template: toarray incorrect
its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]);
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java
OutputFormat format = new OutputFormat();
			format.setPreserveSpace(true);
			Serializer serializer = SerializerFactory.getSerializerFactory("xml").makeSerializer(stream, format); 
			serializer.asDOMSerializer().serialize(document);
			
		} catch (ParserConfigurationException e) {
			JavaPlugin.log(e);
		}		
	}
	/**
	 * Adds a template to the set.
	 */
	public void add(Template template) {
		fTemplates.add(template);
		sort();
	}
	
	/**
	 * Removes a template to the set.
	 */	
	public void remove(Template template) {
		fTemplates.remove(template);
		sort();
	}
	/**
	 * Empties the set.
	 */		
	public void clear() {
		fTemplates.clear();
		sort();