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
Document document= parser.parse(new InputSource(stream));
			NodeList elements= document.getElementsByTagName(TEMPLATE_TAG);
			
			int count= elements.getLength();
			for (int i= 0; i != count; i++) {
				Node node= elements.item(i);					
				NamedNodeMap attributes= node.getAttributes();
				if (attributes == null)
					continue;
				String name= attributes.getNamedItem(NAME_ATTRIBUTE).getNodeValue();
				String description= attributes.getNamedItem(DESCRIPTION_ATTRIBUTE).getNodeValue();
				String context= attributes.getNamedItem(CONTEXT_ATTRIBUTE).getNodeValue();
				Node enabledNode= attributes.getNamedItem(ENABLED_ATTRIBUTE);
				boolean enabled= (enabledNode == null) || (enabledNode.getNodeValue().equals("true")); 
				StringBuffer buffer= new StringBuffer();
				NodeList children= node.getChildNodes();
				for (int j= 0; j != children.getLength(); j++) {
					String value= children.item(j).getNodeValue();
					if (value != null)
						buffer.append(value);
				}
				String pattern= buffer.toString().trim();
				Template template= new Template(name, description, context, pattern);	
				template.setEnabled(enabled);
				add(template);
			}
			return true;
			
		} catch (ParserConfigurationException e) {
			JavaPlugin.log(e);