Bug 45517 Add a 'Field comment' code template
20031024 The user should be able to specify a 'field comment' template. See 'CodeTemplateContextType.TYPE_COMMENT' as an example You have to - define a new variable type - specify the variables avaiable in this template - create an API in Codetemplates so it can be used Users are: - AddJavadocCommentAction - JavadocTagsSubProcessor.getMissingJavadocCommentProposals
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavadocTagsSubProcessor.java
for (int i= 0; i < existingTags.length; i++) {
			JavaDocTag curr= existingTags[i];
			String currName= curr.getName();
			if (JavaDocTag.THROWS.equals(currName) || JavaDocTag.EXCEPTION.equals(currName)) {
				String argument= getArgument(curr.getContent());
				if (argument.equals(arg) || (Signature.getSimpleName(argument)).equals(arg)) {
					return curr;
				}
			}
		}
		return null;
	}
	
	
	private static int findThrowsInsertPosition(JavaDocTag[] tags, MethodDeclaration methodDecl, ASTNode node) {
		Set previousArgs= new HashSet();
		List list= methodDecl.thrownExceptions();
		for (int i= 0; i < list.size() && node != list.get(i); i++) {
			Name curr= (Name) list.get(i);
			previousArgs.add(ASTResolving.getSimpleName(curr));
		}
		int lastThrows= tags.length;
		for (int i= tags.length - 1; i >= 0; i--) {
			JavaDocTag curr= tags[i];
			if (JavaDocTag.THROWS.equals(curr.getName())) {
				String arg= getArgument(curr.getContent());
				if (previousArgs.contains(arg) || previousArgs.contains(Signature.getSimpleName(arg))) {
					return i + 1;
				}
				lastThrows= i;