Bug 30943 ${package_statement} should be called ${package_declaration} [code manipulation]
20030129 + latest ${package_statement} does not represent any statement but a declaration
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewTypeWizardPage.java
IJavaProject project= cu.getJavaProject();
		CodeTemplateContext context= new CodeTemplateContext(template.getContextTypeName(), project, lineDelimiter, 0);
		context.setCompilationUnitVariables(cu);
		context.setVariable(CodeTemplateContextType.PACKAGE_STATEMENT, packStatement);
		context.setVariable(CodeTemplateContextType.TYPE_COMMENT, typeComment != null ? typeComment : ""); 
		context.setVariable(CodeTemplateContextType.TYPE_DECLARATION, typeContent);
		context.setVariable(CodeTemplateContextType.ENCLOSING_TYPE, getTypeName());
		String content= context.evaluate(template).getString();
		if (content.length() == 0) {
			return getDefaultCUContent(packStatement, typeContent, lineDelimiter);
		}
		CompilationUnit unit= AST.parseCompilationUnit(content.toCharArray());
		if (!pack.isDefaultPackage() && unit.getPackage() == null || unit.types().isEmpty()) {
			return getDefaultCUContent(packStatement, typeContent, lineDelimiter);
		}
		return content;
	}
	
	private String getDefaultCUContent(String packStatement, String typeContent, String lineDelimiter) {
		return packStatement + lineDelimiter + lineDelimiter + typeContent;
	}
	
	/**
	 * Returns the created type. The method only returns a valid type 
	 * after <code>createType</code> has been called.
	 * 
	 * @return the created type
	 * @see #createType(IProgressMonitor)
	 */			
	public IType getCreatedType() {