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
String typeQualifiedName= Bindings.getTypeQualifiedName(binding);
			String[] typeParamNames;
			if (declaration instanceof TypeDeclaration) {
				List typeParams= ((TypeDeclaration) declaration).typeParameters();
				typeParamNames= new String[typeParams.size()];
				for (int i= 0; i < typeParamNames.length; i++) {
					typeParamNames[i]= ((TypeParameter) typeParams.get(i)).getName().getIdentifier();
				}
			} else {
				typeParamNames= new String[0];
			}
			String string= CodeGeneration.getTypeComment(cu, typeQualifiedName, typeParamNames, String.valueOf('\n'));
			if (string != null) {
				String label= CorrectionMessages.getString("JavadocTagsSubProcessor.addjavadoc.type.description"); 
				proposals.add(new AddJavadocCommentProposal(label, cu, 1, declaration.getStartPosition(), string));
			}
		} else if (declaration instanceof FieldDeclaration) {
			String comment= "/**\n *\n */\n"; 
			List fragments= ((FieldDeclaration)declaration).fragments();
			if (fragments != null && fragments.size() > 0) {
				VariableDeclaration decl= (VariableDeclaration)fragments.get(0);
				String fieldName= decl.getName().getIdentifier();
				String typeName= binding.getName();
				comment= CodeGeneration.getFieldComment(cu, typeName, fieldName, String.valueOf('\n'));
			}
			if (comment != null) {
				String label= CorrectionMessages.getString("JavadocTagsSubProcessor.addjavadoc.field.description"); 
				proposals.add(new AddJavadocCommentProposal(label, cu, 1, declaration.getStartPosition(), comment));
			}
		} else if (declaration instanceof EnumConstantDeclaration) {