|
@@ -77,21 +77,20 @@ public void inherit(DocFinder.Input input, DocFinder.Output output) { |
|
|
? ch.getExceptionName(input.docTreeInfo.docTree).getSignature() |
|
|
: utils.getFullyQualifiedName(exception); |
|
|
} else { |
|
|
TypeElement element = input.utils.findClass(input.element, input.tagId); |
|
|
exception = (element == null) ? null : element; |
|
|
exception = input.utils.findClass(input.element, input.tagId); |
|
|
} |
|
|
|
|
|
for (DocTree dt : input.utils.getThrowsTrees(input.element)) { |
|
|
Element texception = ch.getException(utils.configuration, dt); |
|
|
if (texception != null && (input.tagId.equals(utils.getSimpleName(texception)) || |
|
|
(input.tagId.equals(utils.getFullyQualifiedName(texception))))) { |
|
|
Element exc = ch.getException(utils.configuration, dt); |
|
|
if (exc != null && (input.tagId.equals(utils.getSimpleName(exc)) || |
|
|
(input.tagId.equals(utils.getFullyQualifiedName(exc))))) { |
|
|
output.holder = input.element; |
|
|
output.holderTag = dt; |
|
|
output.inlineTags = ch.getBody(input.utils.configuration, output.holderTag); |
|
|
output.tagList.add(dt); |
|
|
} else if (exception != null && texception != null && |
|
|
utils.isTypeElement(texception) && utils.isTypeElement(exception) && |
|
|
utils.isSubclassOf((TypeElement)texception, (TypeElement)exception)) { |
|
|
} else if (exception != null && exc != null && |
|
|
utils.isTypeElement(exc) && utils.isTypeElement(exception) && |
|
|
utils.isSubclassOf((TypeElement)exc, (TypeElement)exception)) { |
|
|
output.tagList.add(dt); |
|
|
} |
|
|
} |
|
@@ -106,15 +105,15 @@ private Content linkToUndocumentedDeclaredExceptions(List<? extends TypeMirror> |
|
|
Content result = writer.getOutputInstance(); |
|
|
//Add links to the exceptions declared but not documented. |
|
|
for (TypeMirror declaredExceptionType : declaredExceptionTypes) { |
|
|
TypeElement klass = utils.asTypeElement(declaredExceptionType); |
|
|
if (klass != null && |
|
|
TypeElement te = utils.asTypeElement(declaredExceptionType); |
|
|
if (te != null && |
|
|
!alreadyDocumented.contains(declaredExceptionType.toString()) && |
|
|
!alreadyDocumented.contains(utils.getFullyQualifiedName(klass, false))) { |
|
|
!alreadyDocumented.contains(utils.getFullyQualifiedName(te, false))) { |
|
|
if (alreadyDocumented.isEmpty()) { |
|
|
result.add(writer.getThrowsHeader()); |
|
|
} |
|
|
result.add(writer.throwsTagOutput(declaredExceptionType)); |
|
|
alreadyDocumented.add(utils.getSimpleName(klass)); |
|
|
alreadyDocumented.add(utils.getSimpleName(te)); |
|
|
} |
|
|
} |
|
|
return result; |
|
@@ -176,18 +175,17 @@ public Content getTagletOutput(Element holder, TagletWriter writer) { |
|
|
} |
|
|
|
|
|
/** |
|
|
* Given an array of <code>Tag</code>s representing this custom |
|
|
* tag, return its string representation. |
|
|
* @param throwTags the array of <code>ThrowsTag</code>s to convert. |
|
|
* @param writer the TagletWriter that will write this tag. |
|
|
* @param alreadyDocumented the set of exceptions that have already |
|
|
* been documented. |
|
|
* @param allowDups True if we allow duplicate throws tags to be documented. |
|
|
* @return the Content representation of this <code>Tag</code>. |
|
|
* Returns the generated content for a collection of {@code @throws} tags. |
|
|
* |
|
|
* @param throwTags the collection of tags to be converted |
|
|
* @param writer the taglet-writer used by the doclet |
|
|
* @param alreadyDocumented the set of exceptions that have already been documented |
|
|
* @param allowDuplicates {@code true} if we allow duplicate tags to be documented |
|
|
* @return the generated content for the tags |
|
|
*/ |
|
|
protected Content throwsTagsOutput(Map<List<? extends DocTree>, ExecutableElement> throwTags, |
|
|
TagletWriter writer, Set<String> alreadyDocumented, |
|
|
Map<String,TypeMirror> typeSubstitutions, boolean allowDups) { |
|
|
Map<String,TypeMirror> typeSubstitutions, boolean allowDuplicates) { |
|
|
Utils utils = writer.configuration().utils; |
|
|
Content result = writer.getOutputInstance(); |
|
|
if (!throwTags.isEmpty()) { |
|
@@ -198,7 +196,7 @@ protected Content throwsTagsOutput(Map<List<? extends DocTree>, ExecutableElemen |
|
|
Element te = ch.getException(utils.configuration, dt); |
|
|
String excName = ch.getExceptionName(dt).toString(); |
|
|
TypeMirror substituteType = typeSubstitutions.get(excName); |
|
|
if ((!allowDups) && |
|
|
if ((!allowDuplicates) && |
|
|
(alreadyDocumented.contains(excName) || |
|
|
(te != null && alreadyDocumented.contains(utils.getFullyQualifiedName(te, false)))) || |
|
|
(substituteType != null && alreadyDocumented.contains(substituteType.toString()))) { |
|
|