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/internal/ui/text/javadoc/JavaDocAutoIndentStrategy.java
if (fBufferedEnd != -1) {
				fStart= fEnd;
				fEnd= fBufferedEnd;
				fBufferedEnd= -1;
				return fEnd;
			}
			fStart= fEnd;
			fEnd= fIterator.next();
			if (fEnd == BreakIterator.DONE)
				return fEnd;
			final String string= fString.substring(fStart, fEnd);
			
			if (string.trim().length() == 0)
				return fEnd;
			final String word= string.trim();
			if (word.length() == string.length())
				return fEnd;
			
			
			fBufferedEnd= fEnd;
			return fStart + word.length();
		}	
	};
	
	/**
	 * Formats a paragraph, using break iterator.  
	 * 
	 * @param offset an offset within the paragraph, which will be updated with respect to formatting.
	 */
	private static String formatParagraph(String paragraph, int[] offset, String prefix, String lineDelimiter, int margin) {