Skip to content
Permalink
Browse files
8274900: Too weak variable type leads to unnecessary cast in jdk.javadoc
Reviewed-by: prappo
  • Loading branch information
turbanoff authored and pavelrappo committed Oct 8, 2021
1 parent 3cb9724 commit 9c431dd168c8a752d4aa1bde2268db0425d76990
Showing 3 changed files with 13 additions and 15 deletions.
@@ -151,13 +151,13 @@ public void convertPackage(PackageElement pkg, DocPath outputdir)
if (pkg == null) {
return;
}
for (Element te : utils.getAllClasses(pkg)) {
for (TypeElement te : utils.getAllClasses(pkg)) {
// If -nodeprecated option is set and the class is marked as deprecated,
// do not convert the package files to HTML. We do not check for
// containing package deprecation since it is already check in
// the calling method above.
if (!(options.noDeprecated() && utils.isDeprecated(te)))
convertClass((TypeElement)te, outputdir);
convertClass(te, outputdir);
}
}

@@ -233,8 +233,7 @@ protected void buildClassSerializedForm(Content packageSerializedTree)
*/
protected void buildSerialUIDInfo(Content classTree) {
Content serialUidTree = writer.getSerialUIDInfoHeader();
for (Element e : utils.getFieldsUnfiltered(currentTypeElement)) {
VariableElement field = (VariableElement)e;
for (VariableElement field : utils.getFieldsUnfiltered(currentTypeElement)) {
if (field.getSimpleName().toString().compareTo(SERIAL_VERSION_UID) == 0 &&
field.getConstantValue() != null) {
writer.addSerialUIDInfo(SERIAL_VERSION_UID_HEADER,
@@ -112,14 +112,13 @@ protected void buildSummaryAPIInfo() {
handleElement(pe);
}
}
for (Element e : configuration.getIncludedTypeElements()) {
TypeElement te = (TypeElement)e;
for (TypeElement te : configuration.getIncludedTypeElements()) {
SortedSet<Element> eset;
if (belongsToSummary.test(e)) {
switch (e.getKind()) {
if (belongsToSummary.test(te)) {
switch (te.getKind()) {
case ANNOTATION_TYPE -> {
eset = summaryMap.get(SummaryElementKind.ANNOTATION_TYPE);
eset.add(e);
eset.add(te);
}
case CLASS -> {
if (utils.isError(te)) {
@@ -129,19 +128,19 @@ protected void buildSummaryAPIInfo() {
} else {
eset = summaryMap.get(SummaryElementKind.CLASS);
}
eset.add(e);
eset.add(te);
}
case INTERFACE -> {
eset = summaryMap.get(SummaryElementKind.INTERFACE);
eset.add(e);
eset.add(te);
}
case ENUM -> {
eset = summaryMap.get(SummaryElementKind.ENUM);
eset.add(e);
eset.add(te);
}
case RECORD -> {
eset = summaryMap.get(SummaryElementKind.RECORD_CLASS);
eset.add(e);
eset.add(te);
}
}
handleElement(te);
@@ -152,7 +151,7 @@ protected void buildSummaryAPIInfo() {
utils.getMethods(te));
composeSummaryList(summaryMap.get(SummaryElementKind.CONSTRUCTOR),
utils.getConstructors(te));
if (utils.isEnum(e)) {
if (utils.isEnum(te)) {
composeSummaryList(summaryMap.get(SummaryElementKind.ENUM_CONSTANT),
utils.getEnumConstants(te));
}
@@ -165,7 +164,7 @@ protected void buildSummaryAPIInfo() {
}
}
}
if (utils.isAnnotationType(e)) {
if (utils.isAnnotationType(te)) {
composeSummaryList(summaryMap.get(SummaryElementKind.ANNOTATION_TYPE_MEMBER),
utils.getAnnotationMembers(te));

1 comment on commit 9c431dd

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 9c431dd Oct 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.