langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
changeset 36038 39c5445924b9
parent 35426 374342e56a56
child 36500 d31e4986dc8b
equal deleted inserted replaced
36037:688096b6bcc4 36038:39c5445924b9
  2361         linkInfo.label = new StringContent("@" + annotationDoc.getSimpleName().toString());
  2361         linkInfo.label = new StringContent("@" + annotationDoc.getSimpleName().toString());
  2362         annotation.addContent(getLink(linkInfo));
  2362         annotation.addContent(getLink(linkInfo));
  2363         if (!map.isEmpty()) {
  2363         if (!map.isEmpty()) {
  2364             annotation.addContent("(");
  2364             annotation.addContent("(");
  2365             boolean isFirst = true;
  2365             boolean isFirst = true;
  2366             for (ExecutableElement element : map.keySet()) {
  2366             Set<? extends ExecutableElement> keys = map.keySet();
       
  2367             boolean multipleValues = keys.size() > 1;
       
  2368             for (ExecutableElement element : keys) {
  2367                 if (isFirst) {
  2369                 if (isFirst) {
  2368                     isFirst = false;
  2370                     isFirst = false;
  2369                 } else {
  2371                 } else {
  2370                     annotation.addContent(",");
  2372                     annotation.addContent(",");
  2371                     if (linkBreak) {
  2373                     if (linkBreak) {
  2374                         for (int k = 0; k < (spaces + indent); k++) {
  2376                         for (int k = 0; k < (spaces + indent); k++) {
  2375                             annotation.addContent(" ");
  2377                             annotation.addContent(" ");
  2376                         }
  2378                         }
  2377                     }
  2379                     }
  2378                 }
  2380                 }
  2379                 annotation.addContent(getDocLink(LinkInfoImpl.Kind.ANNOTATION,
  2381                 String simpleName = element.getSimpleName().toString();
  2380                         element, element.getSimpleName().toString(), false));
  2382                 if (multipleValues || !"value".equals(simpleName)) { // Omit "value=" where unnecessary
  2381                 annotation.addContent("=");
  2383                     annotation.addContent(getDocLink(LinkInfoImpl.Kind.ANNOTATION,
       
  2384                                                      element, simpleName, false));
       
  2385                     annotation.addContent("=");
       
  2386                 }
  2382                 AnnotationValue annotationValue = map.get(element);
  2387                 AnnotationValue annotationValue = map.get(element);
  2383                 List<AnnotationValue> annotationTypeValues = new ArrayList<>();
  2388                 List<AnnotationValue> annotationTypeValues = new ArrayList<>();
  2384                 new SimpleAnnotationValueVisitor9<Void, AnnotationValue>() {
  2389                 new SimpleAnnotationValueVisitor9<Void, AnnotationValue>() {
  2385                     @Override @DefinedBy(Api.LANGUAGE_MODEL)
  2390                     @Override @DefinedBy(Api.LANGUAGE_MODEL)
  2386                     public Void visitArray(List<? extends AnnotationValue> vals, AnnotationValue p) {
  2391                     public Void visitArray(List<? extends AnnotationValue> vals, AnnotationValue p) {