Bug 73011 [wizards] The Code Template inserted into the wrong place [code manipulation]
In my preference, I have change my Code Template - Code - New Java File to be as follows: ${typecomment} /* * Created on ${date} */ ${package_declaration} ${type_declaration} ----------------- However, when I create a new java class that extends or implement something, the result java file inserted the package declaration in the middle of my type comment. This result in a class that has compilation error. Something Like this : //**************************************************************** // xxxxx import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.model.IDebugElement; import org.eclipse.debug.core.model.IDebugTarget; // xxxxxxxxx // ssssssss //**************************************************************** /** * @author jcyfung */ /* * Created on Aug 31, 2004 */
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewTypeWizardPage.java
return enclosing.getResource();
		}
		IPackageFragment pack= getPackageFragment();
		if (pack != null) {
			return pack.getCompilationUnit(getTypeNameWithoutParameters() + ".java").getResource(); 
		}
		return null;
	}
			
	
			
	/*
	 * @see org.eclipse.jdt.ui.wizards.NewContainerWizardPage#containerChanged()
	 */
	protected IStatus containerChanged() {
		IStatus status= super.containerChanged();
	    if ((fTypeKind == ANNOTATION_TYPE || fTypeKind == ENUM_TYPE) && !status.matches(IStatus.ERROR)) {
	    	IPackageFragmentRoot root= getPackageFragmentRoot();
	    	if (root != null && !JavaModelUtil.is50OrHigher(root.getJavaProject())) {
				return new StatusInfo(IStatus.WARNING, Messages.format(NewWizardMessages.NewTypeWizardPage_warning_NotJDKCompliant, root.getJavaProject().getElementName()));  
	    	}
	    	if (fTypeKind == ENUM_TYPE) {
		    	try {
		    	    
		    	    if (findType(root.getJavaProject(), "java.lang.Enum") == null) 
		    	        return new StatusInfo(IStatus.WARNING, NewWizardMessages.NewTypeWizardPage_warning_EnumClassNotFound);  
		    	} catch (JavaModelException e) {
		    	    JavaPlugin.log(e);
		    	}
	    	}