Bug 21183 Class javadoc created during "New Class" operation doesn't fill in variables properly [javadoc] [code manipulation]
If you use the enclosing_type variable in your javadoc comment template, it is not properly filled in when you make a new class (using the New Class dialog). Probably the class should be created, then after creating and saving, javadoc should be added. I suspect the variables don't have valid values yet at the time the javadoc is prepended to the class.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewTypeWizardPage.java
} else {
				monitor.worked(1);
			}
			fCreatedType= createdType;
		} finally {
			if (createdWorkingCopy != null) {
				createdWorkingCopy.destroy();
			}
			monitor.done();
		}
	}	
	/**
	 * Uses the New Java file template from the code template page to generate a
	 * compilation unit with the given type content.
	 * @param cu The new created compilation unit
	 * @param typeContent The content of the type, including signature and type
	 * body.
	 * @param lineDelimiter The line delimiter to be used.
	 * @return String Returns the result of evaluating the new file template
	 * with the given type content.
	 * @throws CoreException
	 */
	protected String constructCUContent(ICompilationUnit cu, String typeContent, String lineDelimiter) throws CoreException {
		IPackageFragment pack= (IPackageFragment) cu.getParent();
		String packDecl= pack.isDefaultPackage() ? "" : "package " + pack.getElementName() + ';'; 
		Template template= CodeTemplates.getCodeTemplate(CodeTemplates.NEWTYPE);
		if (template == null) {
			return getDefaultCUContent(packDecl, typeContent, lineDelimiter);
		}
		String typeComment= StubUtility.getTypeComment(cu, getTypeName());