Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/share/classes/jdk/codetools/apidiff/model/API.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.Name;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.RecordComponentElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.element.VariableElement;
Expand Down Expand Up @@ -965,8 +966,17 @@ public String visitExecutable(ExecutableElement ee, APIDocs d) {
return d.getDescription(signatureVisitor.getSignature(ee));
}

@Override
public String visitRecordComponent(RecordComponentElement tpe, APIDocs d) {
// record components do not have distinct API descriptions of their own:
// they are documented by @param tags in the enclosing element
throw new IllegalArgumentException(tpe.getKind() + " " + tpe.getSimpleName());
}

@Override
public String visitTypeParameter(TypeParameterElement tpe, APIDocs d) {
// type parameters do not have distinct API descriptions of their own:
// they are documented by @param tags in the enclosing element
throw new IllegalArgumentException(tpe.getKind() + " " + tpe.getSimpleName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public boolean compare(Position rcPos, APIMap<Element> rcMap) {
allEqual = checkMissing(rcPos, rcMap);
if (rcMap.size() > 1) {
allEqual &= compareSignatures(rcPos, rcMap);
allEqual &= compareDocComments(rcPos, rcMap);
allEqual &= compareApiDescriptions(rcPos, rcMap);
// note that record components do not have distinct API descriptions or doc comments
// of their own; they are documented by @param tags in the enclosing element
}
} finally {
reporter.completed(rcPos, allEqual);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public boolean compare(Position pos, APIMap<TypeParameterElement> map) {
allEquals &= compareNames(pos, map)
& compareBounds(pos, map)
& new AnnotationComparator(map.keySet(), accessKind, reporter).compareAll(pos, map);
// note that type parameters do not have distinct API descriptions or doc comments
// of their own; they are documented by @param tags in the enclosing element


return allEquals;
}
Expand Down