pan3793 commented on code in PR #8182: URL: https://github.com/apache/hadoop/pull/8182#discussion_r2730799138
########## hadoop-common-project/hadoop-annotations/src/main/java/org/apache/hadoop/classification/tools/HadoopDocEnvImpl.java: ########## @@ -0,0 +1,156 @@ +package org.apache.hadoop.classification.tools; + +import com.sun.source.util.DocTrees; +import jdk.javadoc.doclet.DocletEnvironment; +import jdk.javadoc.internal.tool.DocEnvImpl; +import jdk.javadoc.internal.tool.ToolEnvironment; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; + +import javax.lang.model.SourceVersion; +import javax.lang.model.element.AnnotationMirror; +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.Elements; +import javax.lang.model.util.Types; +import javax.tools.JavaFileManager; +import javax.tools.JavaFileObject; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * This class extends Java internal DocEnvImpl to avoid cast error while + * migrating to JDK17. It filters elements based on Hadoop's InterfaceAudience + * and InterfaceStability annotations. + * This class depends on JDK internal implementation, so we might need to + * update the source code when upgrading to upper JDK versions. Review Comment: nice! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
