src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java

changeset 995
62bc3775d5bb
parent 972
694ff82ca68e
child 1359
25e14ad23cef
equal deleted inserted replaced
994:459854f564ed 995:62bc3775d5bb
859 * Return true if the given Doc is deprecated. 859 * Return true if the given Doc is deprecated.
860 * 860 *
861 * @param doc the Doc to check. 861 * @param doc the Doc to check.
862 * @return true if the given Doc is deprecated. 862 * @return true if the given Doc is deprecated.
863 */ 863 */
864 public static boolean isDeprecated(ProgramElementDoc doc) { 864 public static boolean isDeprecated(Doc doc) {
865 if (doc.tags("deprecated").length > 0) { 865 if (doc.tags("deprecated").length > 0) {
866 return true; 866 return true;
867 } 867 }
868 AnnotationDesc[] annotationDescList = doc.annotations(); 868 AnnotationDesc[] annotationDescList;
869 if (doc instanceof PackageDoc)
870 annotationDescList = ((PackageDoc)doc).annotations();
871 else
872 annotationDescList = ((ProgramElementDoc)doc).annotations();
869 for (int i = 0; i < annotationDescList.length; i++) { 873 for (int i = 0; i < annotationDescList.length; i++) {
870 if (annotationDescList[i].annotationType().qualifiedName().equals( 874 if (annotationDescList[i].annotationType().qualifiedName().equals(
871 java.lang.Deprecated.class.getName())){ 875 java.lang.Deprecated.class.getName())){
872 return true; 876 return true;
873 } 877 }

mercurial