Bug 82311 [correction] Add '@throws' tag does not insert the exception type name
Version: 3.1.0 Build id: 200412210800 When you have javadoc compiler checks turned on and have a method like the following the quick fix to add a throws tag does not insert the name of the exception. The add all missing tags quick fix does add the exception type so the information should be available. I did figure out that the change was simple, but wasn't really sure how to create a copy of an existing ast node (the name of the exception is in "missingNode"). JavadocTagsSubProcessor.AddMissingJavadocTagProposal#insertMissingJavadocTag: after creating the throws tag ( newTag.setTagName(TagElement.TAG_THROWS) ) a simple name has to be added ( newTag.fragments().add(<SimpleNameNode>) )
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavadocTagsSubProcessor.java
private static final class AddJavadocCommentProposal extends CUCorrectionProposal {
		
	 	private final int fInsertPosition;
		private final String fComment;
		
		private AddJavadocCommentProposal(String name, ICompilationUnit cu, int relevance, int insertPosition, String comment) {
			super(name, cu, relevance, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_JAVADOCTAG));
			fInsertPosition= insertPosition;
			fComment= comment;
		}
		
		protected void addEdits(IDocument document, TextEdit rootEdit) throws CoreException {
			try {
				String lineDelimiter= TextUtilities.getDefaultLineDelimiter(document);
				int tabWidth= CodeFormatterUtil.getTabWidth(getCompilationUnit().getJavaProject());
				IRegion region= document.getLineInformationOfOffset(fInsertPosition);
				
				String lineContent= document.get(region.getOffset(), region.getLength());
				String indentString= Strings.getIndentString(lineContent, tabWidth);
				String str= Strings.changeIndent(fComment, 0, tabWidth, indentString, lineDelimiter);
				InsertEdit edit= new InsertEdit(fInsertPosition, str);
				rootEdit.addChild(edit);
				if (fComment.charAt(fComment.length() - 1) != '\n') {
					rootEdit.addChild(new InsertEdit(fInsertPosition, lineDelimiter));