< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java

Print this page

        

*** 2361,2371 **** linkInfo.label = new StringContent("@" + annotationDoc.getSimpleName().toString()); annotation.addContent(getLink(linkInfo)); if (!map.isEmpty()) { annotation.addContent("("); boolean isFirst = true; ! for (ExecutableElement element : map.keySet()) { if (isFirst) { isFirst = false; } else { annotation.addContent(","); if (linkBreak) { --- 2361,2373 ---- linkInfo.label = new StringContent("@" + annotationDoc.getSimpleName().toString()); annotation.addContent(getLink(linkInfo)); if (!map.isEmpty()) { annotation.addContent("("); boolean isFirst = true; ! Set<? extends ExecutableElement> keys = map.keySet(); ! boolean multipleValues = keys.size() > 1; ! for (ExecutableElement element : keys) { if (isFirst) { isFirst = false; } else { annotation.addContent(","); if (linkBreak) {
*** 2374,2386 **** for (int k = 0; k < (spaces + indent); k++) { annotation.addContent(" "); } } } annotation.addContent(getDocLink(LinkInfoImpl.Kind.ANNOTATION, ! element, element.getSimpleName().toString(), false)); annotation.addContent("="); AnnotationValue annotationValue = map.get(element); List<AnnotationValue> annotationTypeValues = new ArrayList<>(); new SimpleAnnotationValueVisitor9<Void, AnnotationValue>() { @Override @DefinedBy(Api.LANGUAGE_MODEL) public Void visitArray(List<? extends AnnotationValue> vals, AnnotationValue p) { --- 2376,2391 ---- for (int k = 0; k < (spaces + indent); k++) { annotation.addContent(" "); } } } + String simpleName = element.getSimpleName().toString(); + if (multipleValues || !"value".equals(simpleName)) { // Omit "value=" where unnecessary annotation.addContent(getDocLink(LinkInfoImpl.Kind.ANNOTATION, ! element, simpleName, false)); annotation.addContent("="); + } AnnotationValue annotationValue = map.get(element); List<AnnotationValue> annotationTypeValues = new ArrayList<>(); new SimpleAnnotationValueVisitor9<Void, AnnotationValue>() { @Override @DefinedBy(Api.LANGUAGE_MODEL) public Void visitArray(List<? extends AnnotationValue> vals, AnnotationValue p) {
< prev index next >