Merge

Tue, 24 Sep 2013 14:35:24 -0700

author
mfang
date
Tue, 24 Sep 2013 14:35:24 -0700
changeset 2058
daa3bfb82e58
parent 2057
1332a99572c5
parent 2054
3ae62331a56f
child 2059
6b702ace3e45

Merge

     1.1 --- a/.hgtags	Tue Sep 24 14:20:33 2013 -0700
     1.2 +++ b/.hgtags	Tue Sep 24 14:35:24 2013 -0700
     1.3 @@ -228,3 +228,5 @@
     1.4  dd4a00c220c6e14d9b2ce93a2bd436a1d04f0d03 jdk8-b104
     1.5  375834b5cf086dd7ce9e49f602d81bb51d3e0fa9 jdk8-b105
     1.6  fcd768844b9926c5f994292ec6350c20cc7c0f76 jdk8-b106
     1.7 +3f274927ec1863544b8214262ab02b7de2970da6 jdk8-b107
     1.8 +252f872b8a2f81a416f9127e77924ca56a4578b0 jdk8-b108
     2.1 --- a/src/share/classes/com/sun/tools/classfile/Code_attribute.java	Tue Sep 24 14:20:33 2013 -0700
     2.2 +++ b/src/share/classes/com/sun/tools/classfile/Code_attribute.java	Tue Sep 24 14:35:24 2013 -0700
     2.3 @@ -61,9 +61,9 @@
     2.4          code_length = cr.readInt();
     2.5          code = new byte[code_length];
     2.6          cr.readFully(code);
     2.7 -        exception_table_langth = cr.readUnsignedShort();
     2.8 -        exception_table = new Exception_data[exception_table_langth];
     2.9 -        for (int i = 0; i < exception_table_langth; i++)
    2.10 +        exception_table_length = cr.readUnsignedShort();
    2.11 +        exception_table = new Exception_data[exception_table_length];
    2.12 +        for (int i = 0; i < exception_table_length; i++)
    2.13              exception_table[i] = new Exception_data(cr);
    2.14          attributes = new Attributes(cr);
    2.15      }
    2.16 @@ -139,7 +139,7 @@
    2.17      public final int max_locals;
    2.18      public final int code_length;
    2.19      public final byte[] code;
    2.20 -    public final int exception_table_langth;
    2.21 +    public final int exception_table_length;
    2.22      public final Exception_data[] exception_table;
    2.23      public final Attributes attributes;
    2.24  
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Tue Sep 24 14:35:24 2013 -0700
     3.3 @@ -0,0 +1,301 @@
     3.4 +/*
     3.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     3.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.7 + *
     3.8 + * This code is free software; you can redistribute it and/or modify it
     3.9 + * under the terms of the GNU General Public License version 2 only, as
    3.10 + * published by the Free Software Foundation.  Oracle designates this
    3.11 + * particular file as subject to the "Classpath" exception as provided
    3.12 + * by Oracle in the LICENSE file that accompanied this code.
    3.13 + *
    3.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    3.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.17 + * version 2 for more details (a copy is included in the LICENSE file that
    3.18 + * accompanied this code).
    3.19 + *
    3.20 + * You should have received a copy of the GNU General Public License version
    3.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    3.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.23 + *
    3.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    3.25 + * or visit www.oracle.com if you need additional information or have any
    3.26 + * questions.
    3.27 + */
    3.28 +
    3.29 +package com.sun.tools.doclets.formats.html;
    3.30 +
    3.31 +import java.io.*;
    3.32 +
    3.33 +import com.sun.javadoc.*;
    3.34 +import com.sun.tools.doclets.formats.html.markup.*;
    3.35 +import com.sun.tools.doclets.internal.toolkit.*;
    3.36 +
    3.37 +/**
    3.38 + * Writes annotation type field documentation in HTML format.
    3.39 + *
    3.40 + *  <p><b>This is NOT part of any supported API.
    3.41 + *  If you write code that depends on this, you do so at your own risk.
    3.42 + *  This code and its internal interfaces are subject to change or
    3.43 + *  deletion without notice.</b>
    3.44 + *
    3.45 + * @author Bhavesh Patel
    3.46 + */
    3.47 +public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
    3.48 +    implements AnnotationTypeFieldWriter, MemberSummaryWriter {
    3.49 +
    3.50 +    /**
    3.51 +     * Construct a new AnnotationTypeFieldWriterImpl.
    3.52 +     *
    3.53 +     * @param writer         the writer that will write the output.
    3.54 +     * @param annotationType the AnnotationType that holds this member.
    3.55 +     */
    3.56 +    public AnnotationTypeFieldWriterImpl(SubWriterHolderWriter writer,
    3.57 +            AnnotationTypeDoc annotationType) {
    3.58 +        super(writer, annotationType);
    3.59 +    }
    3.60 +
    3.61 +    /**
    3.62 +     * {@inheritDoc}
    3.63 +     */
    3.64 +    public Content getMemberSummaryHeader(ClassDoc classDoc,
    3.65 +            Content memberSummaryTree) {
    3.66 +        memberSummaryTree.addContent(
    3.67 +                HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
    3.68 +        Content memberTree = writer.getMemberTreeHeader();
    3.69 +        writer.addSummaryHeader(this, classDoc, memberTree);
    3.70 +        return memberTree;
    3.71 +    }
    3.72 +
    3.73 +    /**
    3.74 +     * {@inheritDoc}
    3.75 +     */
    3.76 +    public Content getMemberTreeHeader() {
    3.77 +        return writer.getMemberTreeHeader();
    3.78 +    }
    3.79 +
    3.80 +    /**
    3.81 +     * {@inheritDoc}
    3.82 +     */
    3.83 +    public void addAnnotationFieldDetailsMarker(Content memberDetails) {
    3.84 +        memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_DETAILS);
    3.85 +    }
    3.86 +
    3.87 +    /**
    3.88 +     * {@inheritDoc}
    3.89 +     */
    3.90 +    public void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
    3.91 +            Content memberDetailsTree) {
    3.92 +        if (!writer.printedAnnotationFieldHeading) {
    3.93 +            memberDetailsTree.addContent(writer.getMarkerAnchor(
    3.94 +                    "annotation_type_field_detail"));
    3.95 +            Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
    3.96 +                    writer.fieldDetailsLabel);
    3.97 +            memberDetailsTree.addContent(heading);
    3.98 +            writer.printedAnnotationFieldHeading = true;
    3.99 +        }
   3.100 +    }
   3.101 +
   3.102 +    /**
   3.103 +     * {@inheritDoc}
   3.104 +     */
   3.105 +    public Content getAnnotationDocTreeHeader(MemberDoc member,
   3.106 +            Content annotationDetailsTree) {
   3.107 +        annotationDetailsTree.addContent(
   3.108 +                writer.getMarkerAnchor(member.name()));
   3.109 +        Content annotationDocTree = writer.getMemberTreeHeader();
   3.110 +        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
   3.111 +        heading.addContent(member.name());
   3.112 +        annotationDocTree.addContent(heading);
   3.113 +        return annotationDocTree;
   3.114 +    }
   3.115 +
   3.116 +    /**
   3.117 +     * {@inheritDoc}
   3.118 +     */
   3.119 +    public Content getSignature(MemberDoc member) {
   3.120 +        Content pre = new HtmlTree(HtmlTag.PRE);
   3.121 +        writer.addAnnotationInfo(member, pre);
   3.122 +        addModifiers(member, pre);
   3.123 +        Content link =
   3.124 +                writer.getLink(new LinkInfoImpl(configuration,
   3.125 +                        LinkInfoImpl.Kind.MEMBER, getType(member)));
   3.126 +        pre.addContent(link);
   3.127 +        pre.addContent(writer.getSpace());
   3.128 +        if (configuration.linksource) {
   3.129 +            Content memberName = new StringContent(member.name());
   3.130 +            writer.addSrcLink(member, memberName, pre);
   3.131 +        } else {
   3.132 +            addName(member.name(), pre);
   3.133 +        }
   3.134 +        return pre;
   3.135 +    }
   3.136 +
   3.137 +    /**
   3.138 +     * {@inheritDoc}
   3.139 +     */
   3.140 +    public void addDeprecated(MemberDoc member, Content annotationDocTree) {
   3.141 +        addDeprecatedInfo(member, annotationDocTree);
   3.142 +    }
   3.143 +
   3.144 +    /**
   3.145 +     * {@inheritDoc}
   3.146 +     */
   3.147 +    public void addComments(MemberDoc member, Content annotationDocTree) {
   3.148 +        addComment(member, annotationDocTree);
   3.149 +    }
   3.150 +
   3.151 +    /**
   3.152 +     * {@inheritDoc}
   3.153 +     */
   3.154 +    public void addTags(MemberDoc member, Content annotationDocTree) {
   3.155 +        writer.addTagsInfo(member, annotationDocTree);
   3.156 +    }
   3.157 +
   3.158 +    /**
   3.159 +     * {@inheritDoc}
   3.160 +     */
   3.161 +    public Content getAnnotationDetails(Content annotationDetailsTree) {
   3.162 +        return getMemberTree(annotationDetailsTree);
   3.163 +    }
   3.164 +
   3.165 +    /**
   3.166 +     * {@inheritDoc}
   3.167 +     */
   3.168 +    public Content getAnnotationDoc(Content annotationDocTree,
   3.169 +            boolean isLastContent) {
   3.170 +        return getMemberTree(annotationDocTree, isLastContent);
   3.171 +    }
   3.172 +
   3.173 +    /**
   3.174 +     * Close the writer.
   3.175 +     */
   3.176 +    public void close() throws IOException {
   3.177 +        writer.close();
   3.178 +    }
   3.179 +
   3.180 +    /**
   3.181 +     * {@inheritDoc}
   3.182 +     */
   3.183 +    public void addSummaryLabel(Content memberTree) {
   3.184 +        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
   3.185 +                writer.getResource("doclet.Field_Summary"));
   3.186 +        memberTree.addContent(label);
   3.187 +    }
   3.188 +
   3.189 +    /**
   3.190 +     * {@inheritDoc}
   3.191 +     */
   3.192 +    public String getTableSummary() {
   3.193 +        return configuration.getText("doclet.Member_Table_Summary",
   3.194 +                configuration.getText("doclet.Field_Summary"),
   3.195 +                configuration.getText("doclet.fields"));
   3.196 +    }
   3.197 +
   3.198 +    /**
   3.199 +     * {@inheritDoc}
   3.200 +     */
   3.201 +    public Content getCaption() {
   3.202 +        return configuration.getResource("doclet.Fields");
   3.203 +    }
   3.204 +
   3.205 +    /**
   3.206 +     * {@inheritDoc}
   3.207 +     */
   3.208 +    public String[] getSummaryTableHeader(ProgramElementDoc member) {
   3.209 +        String[] header = new String[] {
   3.210 +            writer.getModifierTypeHeader(),
   3.211 +            configuration.getText("doclet.0_and_1",
   3.212 +                    configuration.getText("doclet.Fields"),
   3.213 +                    configuration.getText("doclet.Description"))
   3.214 +        };
   3.215 +        return header;
   3.216 +    }
   3.217 +
   3.218 +    /**
   3.219 +     * {@inheritDoc}
   3.220 +     */
   3.221 +    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
   3.222 +        memberTree.addContent(writer.getMarkerAnchor(
   3.223 +                "annotation_type_field_summary"));
   3.224 +    }
   3.225 +
   3.226 +    /**
   3.227 +     * {@inheritDoc}
   3.228 +     */
   3.229 +    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
   3.230 +    }
   3.231 +
   3.232 +    /**
   3.233 +     * {@inheritDoc}
   3.234 +     */
   3.235 +    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
   3.236 +    }
   3.237 +
   3.238 +    /**
   3.239 +     * {@inheritDoc}
   3.240 +     */
   3.241 +    protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
   3.242 +            Content tdSummary) {
   3.243 +        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
   3.244 +                writer.getDocLink(context, (MemberDoc) member, member.name(), false));
   3.245 +        Content code = HtmlTree.CODE(strong);
   3.246 +        tdSummary.addContent(code);
   3.247 +    }
   3.248 +
   3.249 +    /**
   3.250 +     * {@inheritDoc}
   3.251 +     */
   3.252 +    protected void addInheritedSummaryLink(ClassDoc cd,
   3.253 +            ProgramElementDoc member, Content linksTree) {
   3.254 +        //Not applicable.
   3.255 +    }
   3.256 +
   3.257 +    /**
   3.258 +     * {@inheritDoc}
   3.259 +     */
   3.260 +    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
   3.261 +        MemberDoc m = (MemberDoc)member;
   3.262 +        addModifierAndType(m, getType(m), tdSummaryType);
   3.263 +    }
   3.264 +
   3.265 +    /**
   3.266 +     * {@inheritDoc}
   3.267 +     */
   3.268 +    protected Content getDeprecatedLink(ProgramElementDoc member) {
   3.269 +        return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
   3.270 +                (MemberDoc) member, ((MemberDoc)member).qualifiedName());
   3.271 +    }
   3.272 +
   3.273 +    /**
   3.274 +     * {@inheritDoc}
   3.275 +     */
   3.276 +    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
   3.277 +        if (link) {
   3.278 +            return writer.getHyperLink("annotation_type_field_summary",
   3.279 +                    writer.getResource("doclet.navField"));
   3.280 +        } else {
   3.281 +            return writer.getResource("doclet.navField");
   3.282 +        }
   3.283 +    }
   3.284 +
   3.285 +    /**
   3.286 +     * {@inheritDoc}
   3.287 +     */
   3.288 +    protected void addNavDetailLink(boolean link, Content liNav) {
   3.289 +        if (link) {
   3.290 +            liNav.addContent(writer.getHyperLink("annotation_type_field_detail",
   3.291 +                    writer.getResource("doclet.navField")));
   3.292 +        } else {
   3.293 +            liNav.addContent(writer.getResource("doclet.navField"));
   3.294 +        }
   3.295 +    }
   3.296 +
   3.297 +    private Type getType(MemberDoc member) {
   3.298 +        if (member instanceof FieldDoc) {
   3.299 +            return ((FieldDoc) member).type();
   3.300 +        } else {
   3.301 +            return ((MethodDoc) member).returnType();
   3.302 +        }
   3.303 +    }
   3.304 +}
     4.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Tue Sep 24 14:20:33 2013 -0700
     4.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Tue Sep 24 14:35:24 2013 -0700
     4.3 @@ -71,6 +71,20 @@
     4.4      /**
     4.5       * {@inheritDoc}
     4.6       */
     4.7 +    public Content getMemberTreeHeader() {
     4.8 +        return writer.getMemberTreeHeader();
     4.9 +    }
    4.10 +
    4.11 +    /**
    4.12 +     * {@inheritDoc}
    4.13 +     */
    4.14 +    public void addAnnotationDetailsMarker(Content memberDetails) {
    4.15 +        memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
    4.16 +    }
    4.17 +
    4.18 +    /**
    4.19 +     * {@inheritDoc}
    4.20 +     */
    4.21      public void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
    4.22              Content memberDetailsTree) {
    4.23          if (!writer.printedAnnotationHeading) {
     5.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Sep 24 14:20:33 2013 -0700
     5.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Sep 24 14:35:24 2013 -0700
     5.3 @@ -278,13 +278,6 @@
     5.4      /**
     5.5       * {@inheritDoc}
     5.6       */
     5.7 -    public void addAnnotationDetailsMarker(Content memberDetails) {
     5.8 -        memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
     5.9 -    }
    5.10 -
    5.11 -    /**
    5.12 -     * {@inheritDoc}
    5.13 -     */
    5.14      protected Content getNavLinkTree() {
    5.15          Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE,
    5.16                  treeLabel, "", "");
    5.17 @@ -319,6 +312,12 @@
    5.18          Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
    5.19          MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
    5.20                  configuration.getBuilderFactory().getMemberSummaryBuilder(this);
    5.21 +        Content liNavField = new HtmlTree(HtmlTag.LI);
    5.22 +        addNavSummaryLink(memberSummaryBuilder,
    5.23 +                "doclet.navField",
    5.24 +                VisibleMemberMap.ANNOTATION_TYPE_FIELDS, liNavField);
    5.25 +        addNavGap(liNavField);
    5.26 +        ulNav.addContent(liNavField);
    5.27          Content liNavReq = new HtmlTree(HtmlTag.LI);
    5.28          addNavSummaryLink(memberSummaryBuilder,
    5.29                  "doclet.navAnnotationTypeRequiredMember",
    5.30 @@ -364,12 +363,23 @@
    5.31          Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
    5.32          MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
    5.33                  configuration.getBuilderFactory().getMemberSummaryBuilder(this);
    5.34 +        AbstractMemberWriter writerField =
    5.35 +                ((AbstractMemberWriter) memberSummaryBuilder.
    5.36 +                getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_FIELDS));
    5.37          AbstractMemberWriter writerOptional =
    5.38                  ((AbstractMemberWriter) memberSummaryBuilder.
    5.39                  getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL));
    5.40          AbstractMemberWriter writerRequired =
    5.41                  ((AbstractMemberWriter) memberSummaryBuilder.
    5.42                  getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED));
    5.43 +        Content liNavField = new HtmlTree(HtmlTag.LI);
    5.44 +        if (writerField != null){
    5.45 +            writerField.addNavDetailLink(annotationType.fields().length > 0, liNavField);
    5.46 +        } else {
    5.47 +            liNavField.addContent(getResource("doclet.navField"));
    5.48 +        }
    5.49 +        addNavGap(liNavField);
    5.50 +        ulNav.addContent(liNavField);
    5.51          if (writerOptional != null){
    5.52              Content liNavOpt = new HtmlTree(HtmlTag.LI);
    5.53              writerOptional.addNavDetailLink(annotationType.elements().length > 0, liNavOpt);
     6.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Tue Sep 24 14:20:33 2013 -0700
     6.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Tue Sep 24 14:35:24 2013 -0700
     6.3 @@ -85,6 +85,11 @@
     6.4      protected boolean printedAnnotationHeading = false;
     6.5  
     6.6      /**
     6.7 +     * To check whether annotation field heading is printed or not.
     6.8 +     */
     6.9 +    protected boolean printedAnnotationFieldHeading = false;
    6.10 +
    6.11 +    /**
    6.12       * To check whether the repeated annotations is documented or not.
    6.13       */
    6.14      private boolean isAnnotationDocumented = false;
     7.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java	Tue Sep 24 14:20:33 2013 -0700
     7.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java	Tue Sep 24 14:35:24 2013 -0700
     7.3 @@ -107,6 +107,16 @@
     7.4      /**
     7.5       * {@inheritDoc}
     7.6       */
     7.7 +    public AnnotationTypeFieldWriter
     7.8 +            getAnnotationTypeFieldWriter(AnnotationTypeWriter annotationTypeWriter) throws Exception {
     7.9 +        return new AnnotationTypeFieldWriterImpl(
    7.10 +            (SubWriterHolderWriter) annotationTypeWriter,
    7.11 +            annotationTypeWriter.getAnnotationTypeDoc());
    7.12 +    }
    7.13 +
    7.14 +    /**
    7.15 +     * {@inheritDoc}
    7.16 +     */
    7.17      public AnnotationTypeOptionalMemberWriter
    7.18              getAnnotationTypeOptionalMemberWriter(
    7.19          AnnotationTypeWriter annotationTypeWriter) throws Exception {
    7.20 @@ -202,6 +212,9 @@
    7.21          AnnotationTypeWriter annotationTypeWriter, int memberType)
    7.22      throws Exception {
    7.23          switch (memberType) {
    7.24 +            case VisibleMemberMap.ANNOTATION_TYPE_FIELDS:
    7.25 +                return (AnnotationTypeFieldWriterImpl)
    7.26 +                    getAnnotationTypeFieldWriter(annotationTypeWriter);
    7.27              case VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL:
    7.28                  return (AnnotationTypeOptionalMemberWriterImpl)
    7.29                      getAnnotationTypeOptionalMemberWriter(annotationTypeWriter);
     8.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java	Tue Sep 24 14:20:33 2013 -0700
     8.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java	Tue Sep 24 14:35:24 2013 -0700
     8.3 @@ -94,6 +94,12 @@
     8.4              new Comment("=========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY ===========");
     8.5  
     8.6      /**
     8.7 +     * Marker to identify start of annotation type required member summary.
     8.8 +     */
     8.9 +    public static final Content START_OF_ANNOTATION_TYPE_FIELD_SUMMARY =
    8.10 +            new Comment("=========== ANNOTATION TYPE FIELD SUMMARY ===========");
    8.11 +
    8.12 +    /**
    8.13       * Marker to identify start of constructor summary.
    8.14       */
    8.15      public static final Content START_OF_CONSTRUCTOR_SUMMARY =
    8.16 @@ -130,6 +136,12 @@
    8.17              new Comment("============ ANNOTATION TYPE MEMBER DETAIL ===========");
    8.18  
    8.19      /**
    8.20 +     * Marker to identify start of annotation type field details.
    8.21 +     */
    8.22 +    public static final Content START_OF_ANNOTATION_TYPE_FIELD_DETAILS =
    8.23 +            new Comment("============ ANNOTATION TYPE FIELD DETAIL ===========");
    8.24 +
    8.25 +    /**
    8.26       * Marker to identify start of method details.
    8.27       */
    8.28      public static final Content START_OF_METHOD_DETAILS =
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeFieldWriter.java	Tue Sep 24 14:35:24 2013 -0700
     9.3 @@ -0,0 +1,132 @@
     9.4 +/*
     9.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     9.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     9.7 + *
     9.8 + * This code is free software; you can redistribute it and/or modify it
     9.9 + * under the terms of the GNU General Public License version 2 only, as
    9.10 + * published by the Free Software Foundation.  Oracle designates this
    9.11 + * particular file as subject to the "Classpath" exception as provided
    9.12 + * by Oracle in the LICENSE file that accompanied this code.
    9.13 + *
    9.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    9.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    9.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    9.17 + * version 2 for more details (a copy is included in the LICENSE file that
    9.18 + * accompanied this code).
    9.19 + *
    9.20 + * You should have received a copy of the GNU General Public License version
    9.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    9.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    9.23 + *
    9.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    9.25 + * or visit www.oracle.com if you need additional information or have any
    9.26 + * questions.
    9.27 + */
    9.28 +
    9.29 +package com.sun.tools.doclets.internal.toolkit;
    9.30 +
    9.31 +import java.io.*;
    9.32 +import com.sun.javadoc.*;
    9.33 +
    9.34 +/**
    9.35 + * The interface for writing annotation type field output.
    9.36 + *
    9.37 + *  <p><b>This is NOT part of any supported API.
    9.38 + *  If you write code that depends on this, you do so at your own risk.
    9.39 + *  This code and its internal interfaces are subject to change or
    9.40 + *  deletion without notice.</b>
    9.41 + *
    9.42 + *
    9.43 + * @author Bhavesh Patel
    9.44 + * @since 1.8
    9.45 + */
    9.46 +
    9.47 +public interface AnnotationTypeFieldWriter {
    9.48 +
    9.49 +    /**
    9.50 +     * Add the annotation type member tree header.
    9.51 +     *
    9.52 +     * @return content tree for the member tree header
    9.53 +     */
    9.54 +    public Content getMemberTreeHeader();
    9.55 +
    9.56 +    /**
    9.57 +     * Add the annotation type field details marker.
    9.58 +     *
    9.59 +     * @param memberDetails the content tree representing field details marker
    9.60 +     */
    9.61 +    public void addAnnotationFieldDetailsMarker(Content memberDetails);
    9.62 +
    9.63 +    /**
    9.64 +     * Add the annotation type details tree header.
    9.65 +     *
    9.66 +     * @param classDoc the annotation type being documented
    9.67 +     * @param memberDetailsTree the content tree representing member details
    9.68 +     */
    9.69 +    public void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
    9.70 +            Content memberDetailsTree);
    9.71 +
    9.72 +    /**
    9.73 +     * Get the annotation type documentation tree header.
    9.74 +     *
    9.75 +     * @param member the annotation type being documented
    9.76 +     * @param annotationDetailsTree the content tree representing annotation type details
    9.77 +     * @return content tree for the annotation type documentation header
    9.78 +     */
    9.79 +    public Content getAnnotationDocTreeHeader(MemberDoc member,
    9.80 +            Content annotationDetailsTree);
    9.81 +
    9.82 +    /**
    9.83 +     * Get the annotation type details tree.
    9.84 +     *
    9.85 +     * @param annotationDetailsTree the content tree representing annotation type details
    9.86 +     * @return content tree for the annotation type details
    9.87 +     */
    9.88 +    public Content getAnnotationDetails(Content annotationDetailsTree);
    9.89 +
    9.90 +    /**
    9.91 +     * Get the annotation type documentation.
    9.92 +     *
    9.93 +     * @param annotationDocTree the content tree representing annotation type documentation
    9.94 +     * @param isLastContent true if the content to be added is the last content
    9.95 +     * @return content tree for the annotation type documentation
    9.96 +     */
    9.97 +    public Content getAnnotationDoc(Content annotationDocTree, boolean isLastContent);
    9.98 +
    9.99 +    /**
   9.100 +     * Get the signature for the given member.
   9.101 +     *
   9.102 +     * @param member the member being documented
   9.103 +     * @return content tree for the annotation type signature
   9.104 +     */
   9.105 +    public Content getSignature(MemberDoc member);
   9.106 +
   9.107 +    /**
   9.108 +     * Add the deprecated output for the given member.
   9.109 +     *
   9.110 +     * @param member the member being documented
   9.111 +     * @param annotationDocTree content tree to which the deprecated information will be added
   9.112 +     */
   9.113 +    public void addDeprecated(MemberDoc member, Content annotationDocTree);
   9.114 +
   9.115 +    /**
   9.116 +     * Add the comments for the given member.
   9.117 +     *
   9.118 +     * @param member the member being documented
   9.119 +     * @param annotationDocTree the content tree to which the comments will be added
   9.120 +     */
   9.121 +    public void addComments(MemberDoc member, Content annotationDocTree);
   9.122 +
   9.123 +    /**
   9.124 +     * Add the tags for the given member.
   9.125 +     *
   9.126 +     * @param member the member being documented
   9.127 +     * @param annotationDocTree the content tree to which the tags will be added
   9.128 +     */
   9.129 +    public void addTags(MemberDoc member, Content annotationDocTree);
   9.130 +
   9.131 +    /**
   9.132 +     * Close the writer.
   9.133 +     */
   9.134 +    public void close() throws IOException;
   9.135 +}
    10.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java	Tue Sep 24 14:20:33 2013 -0700
    10.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java	Tue Sep 24 14:35:24 2013 -0700
    10.3 @@ -1,5 +1,5 @@
    10.4  /*
    10.5 - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    10.6 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
    10.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    10.8   *
    10.9   * This code is free software; you can redistribute it and/or modify it
   10.10 @@ -45,6 +45,20 @@
   10.11  public interface AnnotationTypeRequiredMemberWriter {
   10.12  
   10.13      /**
   10.14 +     * Add the annotation type member tree header.
   10.15 +     *
   10.16 +     * @return content tree for the member tree header
   10.17 +     */
   10.18 +    public Content getMemberTreeHeader();
   10.19 +
   10.20 +    /**
   10.21 +     * Add the annotation type details marker.
   10.22 +     *
   10.23 +     * @param memberDetails the content tree representing details marker
   10.24 +     */
   10.25 +    public void addAnnotationDetailsMarker(Content memberDetails);
   10.26 +
   10.27 +    /**
   10.28       * Add the annotation type details tree header.
   10.29       *
   10.30       * @param classDoc the annotation type being documented
    11.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java	Tue Sep 24 14:20:33 2013 -0700
    11.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java	Tue Sep 24 14:35:24 2013 -0700
    11.3 @@ -1,5 +1,5 @@
    11.4  /*
    11.5 - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    11.6 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
    11.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    11.8   *
    11.9   * This code is free software; you can redistribute it and/or modify it
   11.10 @@ -104,13 +104,6 @@
   11.11      public void addAnnotationTypeDeprecationInfo (Content annotationInfoTree);
   11.12  
   11.13      /**
   11.14 -     * Add the annotation type details marker.
   11.15 -     *
   11.16 -     * @param memberDetails the content tree representing member details marker
   11.17 -     */
   11.18 -    public void addAnnotationDetailsMarker(Content memberDetails);
   11.19 -
   11.20 -    /**
   11.21       * Get the member tree header for the annotation type.
   11.22       *
   11.23       * @return a content tree for the member tree header
    12.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java	Tue Sep 24 14:20:33 2013 -0700
    12.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java	Tue Sep 24 14:35:24 2013 -0700
    12.3 @@ -130,6 +130,18 @@
    12.4              throws Exception;
    12.5  
    12.6      /**
    12.7 +     * Return the annotation type field writer for a given annotation type.
    12.8 +     *
    12.9 +     * @param annotationTypeWriter the writer for the annotation type
   12.10 +     *        being documented.
   12.11 +     * @return the member writer for the given annotation type.  Return null if
   12.12 +     *         this writer is not supported by the doclet.
   12.13 +     */
   12.14 +    public abstract AnnotationTypeFieldWriter
   12.15 +            getAnnotationTypeFieldWriter(
   12.16 +        AnnotationTypeWriter annotationTypeWriter) throws Exception;
   12.17 +
   12.18 +    /**
   12.19       * Return the annotation type optional member writer for a given annotation
   12.20       * type.
   12.21       *
    13.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Tue Sep 24 14:20:33 2013 -0700
    13.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Tue Sep 24 14:35:24 2013 -0700
    13.3 @@ -223,14 +223,23 @@
    13.4          Content memberDetailsTree = writer.getMemberTreeHeader();
    13.5          buildChildren(node, memberDetailsTree);
    13.6          if (memberDetailsTree.isValid()) {
    13.7 -            Content memberDetails = writer.getMemberTreeHeader();
    13.8 -            writer.addAnnotationDetailsMarker(memberDetails);
    13.9 -            memberDetails.addContent(writer.getMemberTree(memberDetailsTree));
   13.10 -            annotationContentTree.addContent(writer.getMemberDetailsTree(memberDetails));
   13.11 +            annotationContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree));
   13.12          }
   13.13      }
   13.14  
   13.15      /**
   13.16 +     * Build the annotation type field documentation.
   13.17 +     *
   13.18 +     * @param node the XML element that specifies which components to document
   13.19 +     * @param memberDetailsTree the content tree to which the documentation will be added
   13.20 +     */
   13.21 +    public void buildAnnotationTypeFieldDetails(XMLNode node, Content memberDetailsTree)
   13.22 +            throws Exception {
   13.23 +        configuration.getBuilderFactory().
   13.24 +                getAnnotationTypeFieldsBuilder(writer).buildChildren(node, memberDetailsTree);
   13.25 +    }
   13.26 +
   13.27 +    /**
   13.28       * Build the annotation type optional member documentation.
   13.29       *
   13.30       * @param node the XML element that specifies which components to document
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeFieldBuilder.java	Tue Sep 24 14:35:24 2013 -0700
    14.3 @@ -0,0 +1,240 @@
    14.4 +/*
    14.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    14.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    14.7 + *
    14.8 + * This code is free software; you can redistribute it and/or modify it
    14.9 + * under the terms of the GNU General Public License version 2 only, as
   14.10 + * published by the Free Software Foundation.  Oracle designates this
   14.11 + * particular file as subject to the "Classpath" exception as provided
   14.12 + * by Oracle in the LICENSE file that accompanied this code.
   14.13 + *
   14.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   14.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   14.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   14.17 + * version 2 for more details (a copy is included in the LICENSE file that
   14.18 + * accompanied this code).
   14.19 + *
   14.20 + * You should have received a copy of the GNU General Public License version
   14.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   14.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   14.23 + *
   14.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   14.25 + * or visit www.oracle.com if you need additional information or have any
   14.26 + * questions.
   14.27 + */
   14.28 +
   14.29 +package com.sun.tools.doclets.internal.toolkit.builders;
   14.30 +
   14.31 +import java.util.*;
   14.32 +
   14.33 +import com.sun.javadoc.*;
   14.34 +import com.sun.tools.doclets.internal.toolkit.*;
   14.35 +import com.sun.tools.doclets.internal.toolkit.util.*;
   14.36 +
   14.37 +/**
   14.38 + * Builds documentation for annotation type fields.
   14.39 + *
   14.40 + *  <p><b>This is NOT part of any supported API.
   14.41 + *  If you write code that depends on this, you do so at your own risk.
   14.42 + *  This code and its internal interfaces are subject to change or
   14.43 + *  deletion without notice.</b>
   14.44 + *
   14.45 + * @author Bhavesh Patel
   14.46 + * @since 1.8
   14.47 + */
   14.48 +public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder {
   14.49 +
   14.50 +    /**
   14.51 +     * The annotation type whose members are being documented.
   14.52 +     */
   14.53 +    protected ClassDoc classDoc;
   14.54 +
   14.55 +    /**
   14.56 +     * The visible members for the given class.
   14.57 +     */
   14.58 +    protected VisibleMemberMap visibleMemberMap;
   14.59 +
   14.60 +    /**
   14.61 +     * The writer to output the member documentation.
   14.62 +     */
   14.63 +    protected AnnotationTypeFieldWriter writer;
   14.64 +
   14.65 +    /**
   14.66 +     * The list of members being documented.
   14.67 +     */
   14.68 +    protected List<ProgramElementDoc> members;
   14.69 +
   14.70 +    /**
   14.71 +     * The index of the current member that is being documented at this point
   14.72 +     * in time.
   14.73 +     */
   14.74 +    protected int currentMemberIndex;
   14.75 +
   14.76 +    /**
   14.77 +     * Construct a new AnnotationTypeFieldsBuilder.
   14.78 +     *
   14.79 +     * @param context  the build context.
   14.80 +     * @param classDoc the class whose members are being documented.
   14.81 +     * @param writer the doclet specific writer.
   14.82 +     * @param memberType the type of member that is being documented.
   14.83 +     */
   14.84 +    protected AnnotationTypeFieldBuilder(Context context,
   14.85 +            ClassDoc classDoc,
   14.86 +            AnnotationTypeFieldWriter writer,
   14.87 +            int memberType) {
   14.88 +        super(context);
   14.89 +        this.classDoc = classDoc;
   14.90 +        this.writer = writer;
   14.91 +        this.visibleMemberMap = new VisibleMemberMap(classDoc, memberType,
   14.92 +            configuration);
   14.93 +        this.members = new ArrayList<ProgramElementDoc>(
   14.94 +            this.visibleMemberMap.getMembersFor(classDoc));
   14.95 +        if (configuration.getMemberComparator() != null) {
   14.96 +            Collections.sort(this.members, configuration.getMemberComparator());
   14.97 +        }
   14.98 +    }
   14.99 +
  14.100 +
  14.101 +    /**
  14.102 +     * Construct a new AnnotationTypeFieldBuilder.
  14.103 +     *
  14.104 +     * @param context  the build context.
  14.105 +     * @param classDoc the class whose members are being documented.
  14.106 +     * @param writer the doclet specific writer.
  14.107 +     */
  14.108 +    public static AnnotationTypeFieldBuilder getInstance(
  14.109 +            Context context, ClassDoc classDoc,
  14.110 +            AnnotationTypeFieldWriter writer) {
  14.111 +        return new AnnotationTypeFieldBuilder(context, classDoc,
  14.112 +                    writer, VisibleMemberMap.ANNOTATION_TYPE_FIELDS);
  14.113 +    }
  14.114 +
  14.115 +    /**
  14.116 +     * {@inheritDoc}
  14.117 +     */
  14.118 +    public String getName() {
  14.119 +        return "AnnotationTypeFieldDetails";
  14.120 +    }
  14.121 +
  14.122 +    /**
  14.123 +     * Returns a list of members that will be documented for the given class.
  14.124 +     * This information can be used for doclet specific documentation
  14.125 +     * generation.
  14.126 +     *
  14.127 +     * @param classDoc the {@link ClassDoc} we want to check.
  14.128 +     * @return a list of members that will be documented.
  14.129 +     */
  14.130 +    public List<ProgramElementDoc> members(ClassDoc classDoc) {
  14.131 +        return visibleMemberMap.getMembersFor(classDoc);
  14.132 +    }
  14.133 +
  14.134 +    /**
  14.135 +     * Returns the visible member map for the members of this class.
  14.136 +     *
  14.137 +     * @return the visible member map for the members of this class.
  14.138 +     */
  14.139 +    public VisibleMemberMap getVisibleMemberMap() {
  14.140 +        return visibleMemberMap;
  14.141 +    }
  14.142 +
  14.143 +    /**
  14.144 +     * summaryOrder.size()
  14.145 +     */
  14.146 +    public boolean hasMembersToDocument() {
  14.147 +        return members.size() > 0;
  14.148 +    }
  14.149 +
  14.150 +    /**
  14.151 +     * Build the annotation type field documentation.
  14.152 +     *
  14.153 +     * @param node the XML element that specifies which components to document
  14.154 +     * @param memberDetailsTree the content tree to which the documentation will be added
  14.155 +     */
  14.156 +    public void buildAnnotationTypeField(XMLNode node, Content memberDetailsTree) {
  14.157 +        buildAnnotationTypeMember(node, memberDetailsTree);
  14.158 +    }
  14.159 +
  14.160 +    /**
  14.161 +     * Build the member documentation.
  14.162 +     *
  14.163 +     * @param node the XML element that specifies which components to document
  14.164 +     * @param memberDetailsTree the content tree to which the documentation will be added
  14.165 +     */
  14.166 +    public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) {
  14.167 +        if (writer == null) {
  14.168 +            return;
  14.169 +        }
  14.170 +        int size = members.size();
  14.171 +        if (size > 0) {
  14.172 +            writer.addAnnotationFieldDetailsMarker(memberDetailsTree);
  14.173 +            for (currentMemberIndex = 0; currentMemberIndex < size;
  14.174 +                    currentMemberIndex++) {
  14.175 +                Content detailsTree = writer.getMemberTreeHeader();
  14.176 +                writer.addAnnotationDetailsTreeHeader(classDoc, detailsTree);
  14.177 +                Content annotationDocTree = writer.getAnnotationDocTreeHeader(
  14.178 +                        (MemberDoc) members.get(currentMemberIndex),
  14.179 +                        detailsTree);
  14.180 +                buildChildren(node, annotationDocTree);
  14.181 +                detailsTree.addContent(writer.getAnnotationDoc(
  14.182 +                        annotationDocTree, (currentMemberIndex == size - 1)));
  14.183 +                memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree));
  14.184 +            }
  14.185 +        }
  14.186 +    }
  14.187 +
  14.188 +    /**
  14.189 +     * Build the signature.
  14.190 +     *
  14.191 +     * @param node the XML element that specifies which components to document
  14.192 +     * @param annotationDocTree the content tree to which the documentation will be added
  14.193 +     */
  14.194 +    public void buildSignature(XMLNode node, Content annotationDocTree) {
  14.195 +        annotationDocTree.addContent(
  14.196 +                writer.getSignature((MemberDoc) members.get(currentMemberIndex)));
  14.197 +    }
  14.198 +
  14.199 +    /**
  14.200 +     * Build the deprecation information.
  14.201 +     *
  14.202 +     * @param node the XML element that specifies which components to document
  14.203 +     * @param annotationDocTree the content tree to which the documentation will be added
  14.204 +     */
  14.205 +    public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) {
  14.206 +        writer.addDeprecated((MemberDoc) members.get(currentMemberIndex),
  14.207 +                annotationDocTree);
  14.208 +    }
  14.209 +
  14.210 +    /**
  14.211 +     * Build the comments for the member.  Do nothing if
  14.212 +     * {@link Configuration#nocomment} is set to true.
  14.213 +     *
  14.214 +     * @param node the XML element that specifies which components to document
  14.215 +     * @param annotationDocTree the content tree to which the documentation will be added
  14.216 +     */
  14.217 +    public void buildMemberComments(XMLNode node, Content annotationDocTree) {
  14.218 +        if(! configuration.nocomment){
  14.219 +            writer.addComments((MemberDoc) members.get(currentMemberIndex),
  14.220 +                    annotationDocTree);
  14.221 +        }
  14.222 +    }
  14.223 +
  14.224 +    /**
  14.225 +     * Build the tag information.
  14.226 +     *
  14.227 +     * @param node the XML element that specifies which components to document
  14.228 +     * @param annotationDocTree the content tree to which the documentation will be added
  14.229 +     */
  14.230 +    public void buildTagInfo(XMLNode node, Content annotationDocTree) {
  14.231 +        writer.addTags((MemberDoc) members.get(currentMemberIndex),
  14.232 +                annotationDocTree);
  14.233 +    }
  14.234 +
  14.235 +    /**
  14.236 +     * Return the annotation type field writer for this builder.
  14.237 +     *
  14.238 +     * @return the annotation type field writer for this builder.
  14.239 +     */
  14.240 +    public AnnotationTypeFieldWriter getWriter() {
  14.241 +        return writer;
  14.242 +    }
  14.243 +}
    15.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java	Tue Sep 24 14:20:33 2013 -0700
    15.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java	Tue Sep 24 14:35:24 2013 -0700
    15.3 @@ -167,16 +167,17 @@
    15.4          }
    15.5          int size = members.size();
    15.6          if (size > 0) {
    15.7 -            writer.addAnnotationDetailsTreeHeader(
    15.8 -                    classDoc, memberDetailsTree);
    15.9 +            writer.addAnnotationDetailsMarker(memberDetailsTree);
   15.10              for (currentMemberIndex = 0; currentMemberIndex < size;
   15.11 -            currentMemberIndex++) {
   15.12 +                    currentMemberIndex++) {
   15.13 +                Content detailsTree = writer.getMemberTreeHeader();
   15.14 +                writer.addAnnotationDetailsTreeHeader(classDoc, detailsTree);
   15.15                  Content annotationDocTree = writer.getAnnotationDocTreeHeader(
   15.16 -                        (MemberDoc) members.get(currentMemberIndex),
   15.17 -                        memberDetailsTree);
   15.18 +                        (MemberDoc) members.get(currentMemberIndex), detailsTree);
   15.19                  buildChildren(node, annotationDocTree);
   15.20 -                memberDetailsTree.addContent(writer.getAnnotationDoc(
   15.21 +                detailsTree.addContent(writer.getAnnotationDoc(
   15.22                          annotationDocTree, (currentMemberIndex == size - 1)));
   15.23 +                memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree));
   15.24              }
   15.25          }
   15.26      }
    16.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java	Tue Sep 24 14:20:33 2013 -0700
    16.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java	Tue Sep 24 14:35:24 2013 -0700
    16.3 @@ -174,10 +174,26 @@
    16.4      }
    16.5  
    16.6      /**
    16.7 +     * Return an instance of the annotation type fields builder for the given
    16.8 +     * class.
    16.9 +     *
   16.10 +     * @return an instance of the annotation type field builder for the given
   16.11 +     *         annotation type.
   16.12 +     */
   16.13 +    public AbstractBuilder getAnnotationTypeFieldsBuilder(
   16.14 +            AnnotationTypeWriter annotationTypeWriter)
   16.15 +    throws Exception {
   16.16 +        return AnnotationTypeFieldBuilder.getInstance(context,
   16.17 +            annotationTypeWriter.getAnnotationTypeDoc(),
   16.18 +            writerFactory.getAnnotationTypeFieldWriter(
   16.19 +                annotationTypeWriter));
   16.20 +    }
   16.21 +
   16.22 +    /**
   16.23       * Return an instance of the annotation type member builder for the given
   16.24       * class.
   16.25       *
   16.26 -     * @return an instance of the annotation type memebr builder for the given
   16.27 +     * @return an instance of the annotation type member builder for the given
   16.28       *         annotation type.
   16.29       */
   16.30      public AbstractBuilder getAnnotationTypeOptionalMemberBuilder(
   16.31 @@ -193,7 +209,7 @@
   16.32       * Return an instance of the annotation type member builder for the given
   16.33       * class.
   16.34       *
   16.35 -     * @return an instance of the annotation type memebr builder for the given
   16.36 +     * @return an instance of the annotation type member builder for the given
   16.37       *         annotation type.
   16.38       */
   16.39      public AbstractBuilder getAnnotationTypeRequiredMemberBuilder(
    17.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Tue Sep 24 14:20:33 2013 -0700
    17.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Tue Sep 24 14:35:24 2013 -0700
    17.3 @@ -213,6 +213,20 @@
    17.4      }
    17.5  
    17.6      /**
    17.7 +     * Build the summary for fields.
    17.8 +     *
    17.9 +     * @param node the XML element that specifies which components to document
   17.10 +     * @param memberSummaryTree the content tree to which the documentation will be added
   17.11 +     */
   17.12 +    public void buildAnnotationTypeFieldsSummary(XMLNode node, Content memberSummaryTree) {
   17.13 +        MemberSummaryWriter writer =
   17.14 +                memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_FIELDS];
   17.15 +        VisibleMemberMap visibleMemberMap =
   17.16 +                visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_FIELDS];
   17.17 +        addSummary(writer, visibleMemberMap, false, memberSummaryTree);
   17.18 +    }
   17.19 +
   17.20 +    /**
   17.21       * Build the summary for the optional members.
   17.22       *
   17.23       * @param node the XML element that specifies which components to document
    18.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml	Tue Sep 24 14:20:33 2013 -0700
    18.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml	Tue Sep 24 14:35:24 2013 -0700
    18.3 @@ -66,10 +66,19 @@
    18.4              <AnnotationTypeTagInfo/>
    18.5          </AnnotationTypeInfo>
    18.6          <MemberSummary>
    18.7 +            <AnnotationTypeFieldsSummary/>
    18.8              <AnnotationTypeRequiredMemberSummary/>
    18.9              <AnnotationTypeOptionalMemberSummary/>
   18.10          </MemberSummary>
   18.11          <AnnotationTypeMemberDetails>
   18.12 +            <AnnotationTypeFieldDetails>
   18.13 +                <AnnotationTypeField>
   18.14 +                    <Signature/>
   18.15 +                    <DeprecationInfo/>
   18.16 +                    <MemberComments/>
   18.17 +                    <TagInfo/>
   18.18 +                </AnnotationTypeField>
   18.19 +            </AnnotationTypeFieldDetails>
   18.20              <AnnotationTypeRequiredMemberDetails>
   18.21                  <AnnotationTypeRequiredMember>
   18.22                      <Signature/>
    19.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java	Tue Sep 24 14:20:33 2013 -0700
    19.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java	Tue Sep 24 14:35:24 2013 -0700
    19.3 @@ -55,14 +55,15 @@
    19.4      public static final int FIELDS          = 2;
    19.5      public static final int CONSTRUCTORS    = 3;
    19.6      public static final int METHODS         = 4;
    19.7 -    public static final int ANNOTATION_TYPE_MEMBER_OPTIONAL = 5;
    19.8 -    public static final int ANNOTATION_TYPE_MEMBER_REQUIRED = 6;
    19.9 -    public static final int PROPERTIES      = 7;
   19.10 +    public static final int ANNOTATION_TYPE_FIELDS = 5;
   19.11 +    public static final int ANNOTATION_TYPE_MEMBER_OPTIONAL = 6;
   19.12 +    public static final int ANNOTATION_TYPE_MEMBER_REQUIRED = 7;
   19.13 +    public static final int PROPERTIES      = 8;
   19.14  
   19.15      /**
   19.16       * The total number of member types is {@value}.
   19.17       */
   19.18 -    public static final int NUM_MEMBER_TYPES = 8;
   19.19 +    public static final int NUM_MEMBER_TYPES = 9;
   19.20  
   19.21      public static final String STARTLEVEL = "start";
   19.22  
   19.23 @@ -433,6 +434,9 @@
   19.24              }
   19.25              ProgramElementDoc[] members = null;
   19.26              switch (kind) {
   19.27 +                case ANNOTATION_TYPE_FIELDS:
   19.28 +                    members = cd.fields(filter);
   19.29 +                    break;
   19.30                  case ANNOTATION_TYPE_MEMBER_OPTIONAL:
   19.31                      members = cd.isAnnotationType() ?
   19.32                          filter((AnnotationTypeDoc) cd, false) :
    20.1 --- a/src/share/classes/com/sun/tools/doclint/Checker.java	Tue Sep 24 14:20:33 2013 -0700
    20.2 +++ b/src/share/classes/com/sun/tools/doclint/Checker.java	Tue Sep 24 14:35:24 2013 -0700
    20.3 @@ -44,6 +44,7 @@
    20.4  import javax.lang.model.element.ElementKind;
    20.5  import javax.lang.model.element.ExecutableElement;
    20.6  import javax.lang.model.element.Name;
    20.7 +import javax.lang.model.element.VariableElement;
    20.8  import javax.lang.model.type.TypeKind;
    20.9  import javax.lang.model.type.TypeMirror;
   20.10  import javax.tools.Diagnostic.Kind;
   20.11 @@ -93,7 +94,7 @@
   20.12  
   20.13      Set<Element> foundParams = new HashSet<>();
   20.14      Set<TypeMirror> foundThrows = new HashSet<>();
   20.15 -    Map<JavaFileObject, Set<String>> foundAnchors = new HashMap<>();
   20.16 +    Map<Element, Set<String>> foundAnchors = new HashMap<>();
   20.17      boolean foundInheritDoc = false;
   20.18      boolean foundReturn = false;
   20.19  
   20.20 @@ -576,13 +577,30 @@
   20.21      }
   20.22  
   20.23      private boolean checkAnchor(String name) {
   20.24 -        JavaFileObject fo = env.currPath.getCompilationUnit().getSourceFile();
   20.25 -        Set<String> set = foundAnchors.get(fo);
   20.26 +        Element e = getEnclosingPackageOrClass(env.currElement);
   20.27 +        if (e == null)
   20.28 +            return true;
   20.29 +        Set<String> set = foundAnchors.get(e);
   20.30          if (set == null)
   20.31 -            foundAnchors.put(fo, set = new HashSet<>());
   20.32 +            foundAnchors.put(e, set = new HashSet<>());
   20.33          return set.add(name);
   20.34      }
   20.35  
   20.36 +    private Element getEnclosingPackageOrClass(Element e) {
   20.37 +        while (e != null) {
   20.38 +            switch (e.getKind()) {
   20.39 +                case CLASS:
   20.40 +                case ENUM:
   20.41 +                case INTERFACE:
   20.42 +                case PACKAGE:
   20.43 +                    return e;
   20.44 +                default:
   20.45 +                    e = e.getEnclosingElement();
   20.46 +            }
   20.47 +        }
   20.48 +        return e;
   20.49 +    }
   20.50 +
   20.51      // http://www.w3.org/TR/html401/types.html#type-name
   20.52      private static final Pattern validName = Pattern.compile("[A-Za-z][A-Za-z0-9-_:.]*");
   20.53  
   20.54 @@ -712,6 +730,10 @@
   20.55  
   20.56      @Override
   20.57      public Void visitReference(ReferenceTree tree, Void ignore) {
   20.58 +        String sig = tree.getSignature();
   20.59 +        if (sig.contains("<") || sig.contains(">"))
   20.60 +            env.messages.error(REFERENCE, tree, "dc.type.arg.not.allowed");
   20.61 +
   20.62          Element e = env.trees.getElement(getCurrentPath());
   20.63          if (e == null)
   20.64              env.messages.error(REFERENCE, tree, "dc.ref.not.found");
   20.65 @@ -805,10 +827,33 @@
   20.66  
   20.67      @Override
   20.68      public Void visitValue(ValueTree tree, Void ignore) {
   20.69 +        ReferenceTree ref = tree.getReference();
   20.70 +        if (ref == null || ref.getSignature().isEmpty()) {
   20.71 +            if (!isConstant(env.currElement))
   20.72 +                env.messages.error(REFERENCE, tree, "dc.value.not.allowed.here");
   20.73 +        } else {
   20.74 +            Element e = env.trees.getElement(new DocTreePath(getCurrentPath(), ref));
   20.75 +            if (!isConstant(e))
   20.76 +                env.messages.error(REFERENCE, tree, "dc.value.not.a.constant");
   20.77 +        }
   20.78 +
   20.79          markEnclosingTag(Flag.HAS_INLINE_TAG);
   20.80          return super.visitValue(tree, ignore);
   20.81      }
   20.82  
   20.83 +    private boolean isConstant(Element e) {
   20.84 +        if (e == null)
   20.85 +            return false;
   20.86 +
   20.87 +        switch (e.getKind()) {
   20.88 +            case FIELD:
   20.89 +                Object value = ((VariableElement) e).getConstantValue();
   20.90 +                return (value != null); // can't distinguish "not a constant" from "constant is null"
   20.91 +            default:
   20.92 +                return false;
   20.93 +        }
   20.94 +    }
   20.95 +
   20.96      @Override
   20.97      public Void visitVersion(VersionTree tree, Void ignore) {
   20.98          warnIfEmpty(tree, tree.getBody());
    21.1 --- a/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Tue Sep 24 14:20:33 2013 -0700
    21.2 +++ b/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Tue Sep 24 14:35:24 2013 -0700
    21.3 @@ -86,6 +86,9 @@
    21.4      DD(BlockType.LIST_ITEM, EndKind.OPTIONAL,
    21.5              EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE, Flag.EXPECT_CONTENT)),
    21.6  
    21.7 +    DFN(BlockType.INLINE, EndKind.REQUIRED,
    21.8 +            EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
    21.9 +
   21.10      DIV(BlockType.BLOCK, EndKind.REQUIRED,
   21.11              EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
   21.12  
    22.1 --- a/src/share/classes/com/sun/tools/doclint/resources/doclint.properties	Tue Sep 24 14:20:33 2013 -0700
    22.2 +++ b/src/share/classes/com/sun/tools/doclint/resources/doclint.properties	Tue Sep 24 14:35:24 2013 -0700
    22.3 @@ -67,7 +67,10 @@
    22.4  dc.tag.start.unmatched = end tag missing: </{0}>
    22.5  dc.tag.unknown = unknown tag: {0}
    22.6  dc.text.not.allowed = text not allowed in <{0}> element
    22.7 +dc.type.arg.not.allowed = type arguments not allowed here
    22.8  dc.unexpected.comment=documentation comment not expected here
    22.9 +dc.value.not.allowed.here='{@value}' not allowed here
   22.10 +dc.value.not.a.constant=value does not refer to a constant
   22.11  
   22.12  dc.main.ioerror=IO error: {0}
   22.13  dc.main.no.files.given=No files given
    23.1 --- a/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java	Tue Sep 24 14:20:33 2013 -0700
    23.2 +++ b/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java	Tue Sep 24 14:35:24 2013 -0700
    23.3 @@ -472,7 +472,7 @@
    23.4              for (TypeElement item: classes)
    23.5                  set.add(item);
    23.6  
    23.7 -            ListBuffer<Env<AttrContext>> defer = ListBuffer.<Env<AttrContext>>lb();
    23.8 +            ListBuffer<Env<AttrContext>> defer = new ListBuffer<>();
    23.9              while (list.peek() != null) {
   23.10                  Env<AttrContext> env = list.remove();
   23.11                  ClassSymbol csym = env.enclClass.sym;
    24.1 --- a/src/share/classes/com/sun/tools/javac/code/DeferredLintHandler.java	Tue Sep 24 14:20:33 2013 -0700
    24.2 +++ b/src/share/classes/com/sun/tools/javac/code/DeferredLintHandler.java	Tue Sep 24 14:35:24 2013 -0700
    24.3 @@ -81,7 +81,7 @@
    24.4          } else {
    24.5              ListBuffer<LintLogger> loggers = loggersQueue.get(currentPos);
    24.6              if (loggers == null) {
    24.7 -                loggersQueue.put(currentPos, loggers = ListBuffer.<LintLogger>lb());
    24.8 +                loggersQueue.put(currentPos, loggers = new ListBuffer<>());
    24.9              }
   24.10              loggers.append(logger);
   24.11          }
    25.1 --- a/src/share/classes/com/sun/tools/javac/code/Flags.java	Tue Sep 24 14:20:33 2013 -0700
    25.2 +++ b/src/share/classes/com/sun/tools/javac/code/Flags.java	Tue Sep 24 14:35:24 2013 -0700
    25.3 @@ -261,7 +261,7 @@
    25.4      public static final long SIGNATURE_POLYMORPHIC = 1L<<46;
    25.5  
    25.6      /**
    25.7 -     * Flag that marks inference variables used in a 'throws' clause
    25.8 +     * Flag that indicates that an inference variable is used in a 'throws' clause.
    25.9       */
   25.10      public static final long THROWS = 1L<<47;
   25.11  
    26.1 --- a/src/share/classes/com/sun/tools/javac/code/Printer.java	Tue Sep 24 14:20:33 2013 -0700
    26.2 +++ b/src/share/classes/com/sun/tools/javac/code/Printer.java	Tue Sep 24 14:35:24 2013 -0700
    26.3 @@ -103,7 +103,7 @@
    26.4       * @return localized string representation
    26.5       */
    26.6      public String visitTypes(List<Type> ts, Locale locale) {
    26.7 -        ListBuffer<String> sbuf = ListBuffer.lb();
    26.8 +        ListBuffer<String> sbuf = new ListBuffer<>();
    26.9          for (Type t : ts) {
   26.10              sbuf.append(visit(t, locale));
   26.11          }
   26.12 @@ -118,7 +118,7 @@
   26.13       * @return localized string representation
   26.14       */
   26.15      public String visitSymbols(List<Symbol> ts, Locale locale) {
   26.16 -        ListBuffer<String> sbuf = ListBuffer.lb();
   26.17 +        ListBuffer<String> sbuf = new ListBuffer<>();
   26.18          for (Symbol t : ts) {
   26.19              sbuf.append(visit(t, locale));
   26.20          }
    27.1 --- a/src/share/classes/com/sun/tools/javac/code/Symbol.java	Tue Sep 24 14:20:33 2013 -0700
    27.2 +++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java	Tue Sep 24 14:35:24 2013 -0700
    27.3 @@ -614,7 +614,7 @@
    27.4      }
    27.5  
    27.6      public List<TypeVariableSymbol> getTypeParameters() {
    27.7 -        ListBuffer<TypeVariableSymbol> l = ListBuffer.lb();
    27.8 +        ListBuffer<TypeVariableSymbol> l = new ListBuffer<>();
    27.9          for (Type t : type.getTypeArguments()) {
   27.10              Assert.check(t.tsym.getKind() == ElementKind.TYPE_PARAMETER);
   27.11              l.append((TypeVariableSymbol)t.tsym);
    28.1 --- a/src/share/classes/com/sun/tools/javac/code/Type.java	Tue Sep 24 14:20:33 2013 -0700
    28.2 +++ b/src/share/classes/com/sun/tools/javac/code/Type.java	Tue Sep 24 14:35:24 2013 -0700
    28.3 @@ -433,7 +433,7 @@
    28.4      }
    28.5  
    28.6      public static List<Type> filter(List<Type> ts, Filter<Type> tf) {
    28.7 -        ListBuffer<Type> buf = ListBuffer.lb();
    28.8 +        ListBuffer<Type> buf = new ListBuffer<>();
    28.9          for (Type t : ts) {
   28.10              if (tf.accepts(t)) {
   28.11                  buf.append(t);
   28.12 @@ -977,7 +977,7 @@
   28.13          }
   28.14  
   28.15          public java.util.List<? extends TypeMirror> getBounds() {
   28.16 -            return Collections.unmodifiableList(getComponents());
   28.17 +            return Collections.unmodifiableList(getExplicitComponents());
   28.18          }
   28.19  
   28.20          public List<Type> getComponents() {
   28.21 @@ -1496,7 +1496,7 @@
   28.22  
   28.23          /** get all bounds of a given kind */
   28.24          public List<Type> getBounds(InferenceBound... ibs) {
   28.25 -            ListBuffer<Type> buf = ListBuffer.lb();
   28.26 +            ListBuffer<Type> buf = new ListBuffer<>();
   28.27              for (InferenceBound ib : ibs) {
   28.28                  buf.appendList(bounds.get(ib));
   28.29              }
   28.30 @@ -1505,7 +1505,7 @@
   28.31  
   28.32          /** get the list of declared (upper) bounds */
   28.33          public List<Type> getDeclaredBounds() {
   28.34 -            ListBuffer<Type> buf = ListBuffer.lb();
   28.35 +            ListBuffer<Type> buf = new ListBuffer<>();
   28.36              int count = 0;
   28.37              for (Type b : getBounds(InferenceBound.UPPER)) {
   28.38                  if (count++ == declaredCount) break;
   28.39 @@ -1565,8 +1565,8 @@
   28.40                  for (Map.Entry<InferenceBound, List<Type>> _entry : bounds.entrySet()) {
   28.41                      InferenceBound ib = _entry.getKey();
   28.42                      List<Type> prevBounds = _entry.getValue();
   28.43 -                    ListBuffer<Type> newBounds = ListBuffer.lb();
   28.44 -                    ListBuffer<Type> deps = ListBuffer.lb();
   28.45 +                    ListBuffer<Type> newBounds = new ListBuffer<>();
   28.46 +                    ListBuffer<Type> deps = new ListBuffer<>();
   28.47                      //step 1 - re-add bounds that are not dependent on ivars
   28.48                      for (Type t : prevBounds) {
   28.49                          if (!t.containsAny(instVars)) {
    29.1 --- a/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java	Tue Sep 24 14:20:33 2013 -0700
    29.2 +++ b/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java	Tue Sep 24 14:35:24 2013 -0700
    29.3 @@ -304,7 +304,7 @@
    29.4       * @param list The bytecode representation of the type path.
    29.5       */
    29.6      public static List<TypePathEntry> getTypePathFromBinary(java.util.List<Integer> list) {
    29.7 -        ListBuffer<TypePathEntry> loc = ListBuffer.lb();
    29.8 +        ListBuffer<TypePathEntry> loc = new ListBuffer<>();
    29.9          Iterator<Integer> iter = list.iterator();
   29.10          while (iter.hasNext()) {
   29.11              Integer fst = iter.next();
   29.12 @@ -316,7 +316,7 @@
   29.13      }
   29.14  
   29.15      public static List<Integer> getBinaryFromTypePath(java.util.List<TypePathEntry> locs) {
   29.16 -        ListBuffer<Integer> loc = ListBuffer.lb();
   29.17 +        ListBuffer<Integer> loc = new ListBuffer<>();
   29.18          for (TypePathEntry tpe : locs) {
   29.19              loc = loc.append(tpe.tag.tag);
   29.20              loc = loc.append(tpe.arg);
    30.1 --- a/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Tue Sep 24 14:20:33 2013 -0700
    30.2 +++ b/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Tue Sep 24 14:35:24 2013 -0700
    30.3 @@ -233,7 +233,7 @@
    30.4           * When traversing the AST we keep the "frames" of visited
    30.5           * trees in order to determine the position of annotations.
    30.6           */
    30.7 -        private ListBuffer<JCTree> frames = ListBuffer.lb();
    30.8 +        private ListBuffer<JCTree> frames = new ListBuffer<>();
    30.9  
   30.10          protected void push(JCTree t) { frames = frames.prepend(t); }
   30.11          protected JCTree pop() { return frames.next(); }
   30.12 @@ -381,7 +381,7 @@
   30.13                  }
   30.14                  JCArrayTypeTree arTree = arrayTypeTree(typetree);
   30.15  
   30.16 -                ListBuffer<TypePathEntry> depth = ListBuffer.lb();
   30.17 +                ListBuffer<TypePathEntry> depth = new ListBuffer<>();
   30.18                  depth = depth.append(TypePathEntry.ARRAY);
   30.19                  while (arType.elemtype.hasTag(TypeTag.ARRAY)) {
   30.20                      if (arType.elemtype.isAnnotated()) {
   30.21 @@ -473,7 +473,7 @@
   30.22                  // the correct nesting.
   30.23  
   30.24                  // The genericLocation for the annotation.
   30.25 -                ListBuffer<TypePathEntry> depth = ListBuffer.lb();
   30.26 +                ListBuffer<TypePathEntry> depth = new ListBuffer<>();
   30.27  
   30.28                  Type topTy = enclTy;
   30.29                  while (enclEl != null &&
   30.30 @@ -793,7 +793,7 @@
   30.31                  }
   30.32  
   30.33                  case ARRAY_TYPE: {
   30.34 -                    ListBuffer<TypePathEntry> index = ListBuffer.lb();
   30.35 +                    ListBuffer<TypePathEntry> index = new ListBuffer<>();
   30.36                      index = index.append(TypePathEntry.ARRAY);
   30.37                      List<JCTree> newPath = path.tail;
   30.38                      while (true) {
   30.39 @@ -956,7 +956,7 @@
   30.40          private static void locateNestedTypes(Type type, TypeAnnotationPosition p) {
   30.41              // The number of "steps" to get from the full type to the
   30.42              // left-most outer type.
   30.43 -            ListBuffer<TypePathEntry> depth = ListBuffer.lb();
   30.44 +            ListBuffer<TypePathEntry> depth = new ListBuffer<>();
   30.45  
   30.46              Type encl = type.getEnclosingType();
   30.47              while (encl != null &&
   30.48 @@ -1226,7 +1226,7 @@
   30.49          public void visitNewArray(JCNewArray tree) {
   30.50              findPosition(tree, tree, tree.annotations);
   30.51              int dimAnnosCount = tree.dimAnnotations.size();
   30.52 -            ListBuffer<TypePathEntry> depth = ListBuffer.lb();
   30.53 +            ListBuffer<TypePathEntry> depth = new ListBuffer<>();
   30.54  
   30.55              // handle annotations associated with dimensions
   30.56              for (int i = 0; i < dimAnnosCount; ++i) {
    31.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Sep 24 14:20:33 2013 -0700
    31.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Sep 24 14:35:24 2013 -0700
    31.3 @@ -51,7 +51,6 @@
    31.4  import static com.sun.tools.javac.code.Type.*;
    31.5  import static com.sun.tools.javac.code.TypeTag.*;
    31.6  import static com.sun.tools.javac.jvm.ClassFile.externalize;
    31.7 -import static com.sun.tools.javac.util.ListBuffer.lb;
    31.8  
    31.9  /**
   31.10   * Utility class containing various operations on types.
   31.11 @@ -411,7 +410,7 @@
   31.12                  throw failure("not.a.functional.intf", origin);
   31.13              }
   31.14  
   31.15 -            final ListBuffer<Symbol> abstracts = ListBuffer.lb();
   31.16 +            final ListBuffer<Symbol> abstracts = new ListBuffer<>();
   31.17              for (Symbol sym : membersCache.getElements(new DescriptorFilter(origin))) {
   31.18                  Type mtype = memberType(origin.type, sym);
   31.19                  if (abstracts.isEmpty() ||
   31.20 @@ -434,7 +433,7 @@
   31.21                  FunctionDescriptor descRes = mergeDescriptors(origin, abstracts.toList());
   31.22                  if (descRes == null) {
   31.23                      //we can get here if the functional interface is ill-formed
   31.24 -                    ListBuffer<JCDiagnostic> descriptors = ListBuffer.lb();
   31.25 +                    ListBuffer<JCDiagnostic> descriptors = new ListBuffer<>();
   31.26                      for (Symbol desc : abstracts) {
   31.27                          String key = desc.type.getThrownTypes().nonEmpty() ?
   31.28                                  "descriptor.throws" : "descriptor";
   31.29 @@ -596,7 +595,7 @@
   31.30          Type capturedSite = capture(site);
   31.31          if (capturedSite != site) {
   31.32              Type formalInterface = site.tsym.type;
   31.33 -            ListBuffer<Type> typeargs = ListBuffer.lb();
   31.34 +            ListBuffer<Type> typeargs = new ListBuffer<>();
   31.35              List<Type> actualTypeargs = site.getTypeArguments();
   31.36              List<Type> capturedTypeargs = capturedSite.getTypeArguments();
   31.37              //simply replace the wildcards with its bound
   31.38 @@ -662,7 +661,7 @@
   31.39          Assert.check(isFunctionalInterface(origin));
   31.40          Symbol descSym = findDescriptorSymbol(origin);
   31.41          CompoundScope members = membersClosure(origin.type, false);
   31.42 -        ListBuffer<Symbol> overridden = ListBuffer.lb();
   31.43 +        ListBuffer<Symbol> overridden = new ListBuffer<>();
   31.44          outer: for (Symbol m2 : members.getElementsByName(descSym.name, bridgeFilter)) {
   31.45              if (m2 == descSym) continue;
   31.46              else if (descSym.overrides(m2, origin, Types.this, false)) {
   31.47 @@ -885,12 +884,12 @@
   31.48              private Type rewriteSupers(Type t) {
   31.49                  if (!t.isParameterized())
   31.50                      return t;
   31.51 -                ListBuffer<Type> from = lb();
   31.52 -                ListBuffer<Type> to = lb();
   31.53 +                ListBuffer<Type> from = new ListBuffer<>();
   31.54 +                ListBuffer<Type> to = new ListBuffer<>();
   31.55                  adaptSelf(t, from, to);
   31.56                  if (from.isEmpty())
   31.57                      return t;
   31.58 -                ListBuffer<Type> rewrite = lb();
   31.59 +                ListBuffer<Type> rewrite = new ListBuffer<>();
   31.60                  boolean changed = false;
   31.61                  for (Type orig : to.toList()) {
   31.62                      Type s = rewriteSupers(orig);
   31.63 @@ -2415,6 +2414,29 @@
   31.64              }
   31.65          };
   31.66  
   31.67 +    public List<Type> directSupertypes(Type t) {
   31.68 +        return directSupertypes.visit(t);
   31.69 +    }
   31.70 +    // where
   31.71 +        private final UnaryVisitor<List<Type>> directSupertypes = new UnaryVisitor<List<Type>>() {
   31.72 +
   31.73 +            public List<Type> visitType(final Type type, final Void ignored) {
   31.74 +                if (!type.isCompound()) {
   31.75 +                    final Type sup = supertype(type);
   31.76 +                    return (sup == Type.noType || sup == type || sup == null)
   31.77 +                        ? interfaces(type)
   31.78 +                        : interfaces(type).prepend(sup);
   31.79 +                } else {
   31.80 +                    return visitIntersectionType((IntersectionClassType) type);
   31.81 +                }
   31.82 +            }
   31.83 +
   31.84 +            private List<Type> visitIntersectionType(final IntersectionClassType it) {
   31.85 +                return it.getExplicitComponents();
   31.86 +            }
   31.87 +
   31.88 +        };
   31.89 +
   31.90      public boolean isDirectSuperInterface(TypeSymbol isym, TypeSymbol origin) {
   31.91          for (Type i2 : interfaces(origin.type)) {
   31.92              if (isym == i2.tsym) return true;
   31.93 @@ -2744,7 +2766,7 @@
   31.94          }
   31.95  
   31.96      public List<MethodSymbol> prune(List<MethodSymbol> methods) {
   31.97 -        ListBuffer<MethodSymbol> methodsMin = ListBuffer.lb();
   31.98 +        ListBuffer<MethodSymbol> methodsMin = new ListBuffer<>();
   31.99          for (MethodSymbol m1 : methods) {
  31.100              boolean isMin_m1 = true;
  31.101              for (MethodSymbol m2 : methods) {
  31.102 @@ -3001,7 +3023,7 @@
  31.103                                    List<Type> to) {
  31.104          if (tvars.isEmpty())
  31.105              return tvars;
  31.106 -        ListBuffer<Type> newBoundsBuf = lb();
  31.107 +        ListBuffer<Type> newBoundsBuf = new ListBuffer<>();
  31.108          boolean changed = false;
  31.109          // calculate new bounds
  31.110          for (Type t : tvars) {
  31.111 @@ -3013,7 +3035,7 @@
  31.112          }
  31.113          if (!changed)
  31.114              return tvars;
  31.115 -        ListBuffer<Type> newTvars = lb();
  31.116 +        ListBuffer<Type> newTvars = new ListBuffer<>();
  31.117          // create new type variables without bounds
  31.118          for (Type t : tvars) {
  31.119              newTvars.append(new TypeVar(t.tsym, null, syms.botType));
  31.120 @@ -3440,15 +3462,15 @@
  31.121       * compoundMin or glb.
  31.122       */
  31.123      private List<Type> closureMin(List<Type> cl) {
  31.124 -        ListBuffer<Type> classes = lb();
  31.125 -        ListBuffer<Type> interfaces = lb();
  31.126 +        ListBuffer<Type> classes = new ListBuffer<>();
  31.127 +        ListBuffer<Type> interfaces = new ListBuffer<>();
  31.128          while (!cl.isEmpty()) {
  31.129              Type current = cl.head;
  31.130              if (current.isInterface())
  31.131                  interfaces.append(current);
  31.132              else
  31.133                  classes.append(current);
  31.134 -            ListBuffer<Type> candidates = lb();
  31.135 +            ListBuffer<Type> candidates = new ListBuffer<>();
  31.136              for (Type t : cl.tail) {
  31.137                  if (!isSubtypeNoCapture(current, t))
  31.138                      candidates.append(t);
  31.139 @@ -3564,7 +3586,7 @@
  31.140      }
  31.141      // where
  31.142          List<Type> erasedSupertypes(Type t) {
  31.143 -            ListBuffer<Type> buf = lb();
  31.144 +            ListBuffer<Type> buf = new ListBuffer<>();
  31.145              for (Type sup : closure(t)) {
  31.146                  if (sup.hasTag(TYPEVAR)) {
  31.147                      buf.append(sup);
  31.148 @@ -3914,7 +3936,7 @@
  31.149      }
  31.150      // where
  31.151          public List<Type> freshTypeVariables(List<Type> types) {
  31.152 -            ListBuffer<Type> result = lb();
  31.153 +            ListBuffer<Type> result = new ListBuffer<>();
  31.154              for (Type t : types) {
  31.155                  if (t.hasTag(WILDCARD)) {
  31.156                      t = t.unannotatedType();
    32.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Sep 24 14:20:33 2013 -0700
    32.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Sep 24 14:35:24 2013 -0700
    32.3 @@ -1724,7 +1724,7 @@
    32.4          boolean isConstructorCall =
    32.5              methName == names._this || methName == names._super;
    32.6  
    32.7 -        ListBuffer<Type> argtypesBuf = ListBuffer.lb();
    32.8 +        ListBuffer<Type> argtypesBuf = new ListBuffer<>();
    32.9          if (isConstructorCall) {
   32.10              // We are seeing a ...this(...) or ...super(...) call.
   32.11              // Check that this is the first statement in a constructor.
   32.12 @@ -1989,7 +1989,7 @@
   32.13          }
   32.14  
   32.15          // Attribute constructor arguments.
   32.16 -        ListBuffer<Type> argtypesBuf = ListBuffer.lb();
   32.17 +        ListBuffer<Type> argtypesBuf = new ListBuffer<>();
   32.18          int pkind = attribArgs(tree.args, localEnv, argtypesBuf);
   32.19          List<Type> argtypes = argtypesBuf.toList();
   32.20          List<Type> typeargtypes = attribTypes(tree.typeargs, localEnv);
   32.21 @@ -2476,8 +2476,8 @@
   32.22              }
   32.23  
   32.24              private TypeSymbol makeNotionalInterface(IntersectionClassType ict) {
   32.25 -                ListBuffer<Type> targs = ListBuffer.lb();
   32.26 -                ListBuffer<Type> supertypes = ListBuffer.lb();
   32.27 +                ListBuffer<Type> targs = new ListBuffer<>();
   32.28 +                ListBuffer<Type> supertypes = new ListBuffer<>();
   32.29                  for (Type i : ict.interfaces_field) {
   32.30                      if (i.isParameterized()) {
   32.31                          targs.appendList(i.tsym.type.allparams());
   32.32 @@ -2907,7 +2907,7 @@
   32.33                  }
   32.34              });
   32.35          } else {
   32.36 -            ListBuffer<Type> targets = ListBuffer.lb();
   32.37 +            ListBuffer<Type> targets = new ListBuffer<>();
   32.38              if (pt.hasTag(CLASS)) {
   32.39                  if (pt.isCompound()) {
   32.40                      targets.append(types.removeWildcards(primaryTarget)); //this goes first
   32.41 @@ -3102,8 +3102,14 @@
   32.42      public void visitTypeTest(JCInstanceOf tree) {
   32.43          Type exprtype = chk.checkNullOrRefType(
   32.44              tree.expr.pos(), attribExpr(tree.expr, env));
   32.45 -        Type clazztype = chk.checkReifiableReferenceType(
   32.46 -            tree.clazz.pos(), attribType(tree.clazz, env));
   32.47 +        Type clazztype = attribType(tree.clazz, env);
   32.48 +        if (!clazztype.hasTag(TYPEVAR)) {
   32.49 +            clazztype = chk.checkClassOrArrayType(tree.clazz.pos(), clazztype);
   32.50 +        }
   32.51 +        if (!clazztype.isErroneous() && !types.isReifiable(clazztype)) {
   32.52 +            log.error(tree.clazz.pos(), "illegal.generic.type.for.instof");
   32.53 +            clazztype = types.createErrorType(clazztype);
   32.54 +        }
   32.55          chk.validate(tree.clazz, env, false);
   32.56          chk.checkCastable(tree.expr.pos(), exprtype, clazztype);
   32.57          result = check(tree, syms.booleanType, VAL, resultInfo);
   32.58 @@ -3903,7 +3909,7 @@
   32.59      }
   32.60  
   32.61      public void visitTypeUnion(JCTypeUnion tree) {
   32.62 -        ListBuffer<Type> multicatchTypes = ListBuffer.lb();
   32.63 +        ListBuffer<Type> multicatchTypes = new ListBuffer<>();
   32.64          ListBuffer<Type> all_multicatchTypes = null; // lazy, only if needed
   32.65          for (JCExpression typeTree : tree.alternatives) {
   32.66              Type ctype = attribType(typeTree, env);
   32.67 @@ -3930,7 +3936,7 @@
   32.68                      all_multicatchTypes.append(ctype);
   32.69              } else {
   32.70                  if (all_multicatchTypes == null) {
   32.71 -                    all_multicatchTypes = ListBuffer.lb();
   32.72 +                    all_multicatchTypes = new ListBuffer<>();
   32.73                      all_multicatchTypes.appendList(multicatchTypes);
   32.74                  }
   32.75                  all_multicatchTypes.append(ctype);
   32.76 @@ -4085,7 +4091,7 @@
   32.77          if (annotations.isEmpty())
   32.78              return List.nil();
   32.79  
   32.80 -        ListBuffer<Attribute.TypeCompound> buf = ListBuffer.lb();
   32.81 +        ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
   32.82          for (JCAnnotation anno : annotations) {
   32.83              if (anno.attribute != null) {
   32.84                  // TODO: this null-check is only needed for an obscure
    33.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Tue Sep 24 14:20:33 2013 -0700
    33.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Tue Sep 24 14:35:24 2013 -0700
    33.3 @@ -706,20 +706,6 @@
    33.4          return t;
    33.5      }
    33.6  
    33.7 -    /** Check that type is a reifiable class, interface or array type.
    33.8 -     *  @param pos           Position to be used for error reporting.
    33.9 -     *  @param t             The type to be checked.
   33.10 -     */
   33.11 -    Type checkReifiableReferenceType(DiagnosticPosition pos, Type t) {
   33.12 -        t = checkClassOrArrayType(pos, t);
   33.13 -        if (!t.isErroneous() && !types.isReifiable(t)) {
   33.14 -            log.error(pos, "illegal.generic.type.for.instof");
   33.15 -            return types.createErrorType(t);
   33.16 -        } else {
   33.17 -            return t;
   33.18 -        }
   33.19 -    }
   33.20 -
   33.21      /** Check that type is a reference type, i.e. a class, interface or array type
   33.22       *  or a type variable.
   33.23       *  @param pos           Position to be used for error reporting.
   33.24 @@ -1245,6 +1231,7 @@
   33.25       */
   33.26      class Validator extends JCTree.Visitor {
   33.27  
   33.28 +        boolean checkRaw;
   33.29          boolean isOuter;
   33.30          Env<AttrContext> env;
   33.31  
   33.32 @@ -1254,7 +1241,7 @@
   33.33  
   33.34          @Override
   33.35          public void visitTypeArray(JCArrayTypeTree tree) {
   33.36 -            tree.elemtype.accept(this);
   33.37 +            validateTree(tree.elemtype, checkRaw, isOuter);
   33.38          }
   33.39  
   33.40          @Override
   33.41 @@ -1345,15 +1332,20 @@
   33.42          }
   33.43  
   33.44          public void validateTree(JCTree tree, boolean checkRaw, boolean isOuter) {
   33.45 -            try {
   33.46 -                if (tree != null) {
   33.47 -                    this.isOuter = isOuter;
   33.48 +            if (tree != null) {
   33.49 +                boolean prevCheckRaw = this.checkRaw;
   33.50 +                this.checkRaw = checkRaw;
   33.51 +                this.isOuter = isOuter;
   33.52 +
   33.53 +                try {
   33.54                      tree.accept(this);
   33.55                      if (checkRaw)
   33.56                          checkRaw(tree, env);
   33.57 +                } catch (CompletionFailure ex) {
   33.58 +                    completionError(tree.pos(), ex);
   33.59 +                } finally {
   33.60 +                    this.checkRaw = prevCheckRaw;
   33.61                  }
   33.62 -            } catch (CompletionFailure ex) {
   33.63 -                completionError(tree.pos(), ex);
   33.64              }
   33.65          }
   33.66  
   33.67 @@ -2446,8 +2438,8 @@
   33.68              Assert.check(m.kind == MTH);
   33.69              List<MethodSymbol> prov = types.interfaceCandidates(site, (MethodSymbol)m);
   33.70              if (prov.size() > 1) {
   33.71 -                ListBuffer<Symbol> abstracts = ListBuffer.lb();
   33.72 -                ListBuffer<Symbol> defaults = ListBuffer.lb();
   33.73 +                ListBuffer<Symbol> abstracts = new ListBuffer<>();
   33.74 +                ListBuffer<Symbol> defaults = new ListBuffer<>();
   33.75                  for (MethodSymbol provSym : prov) {
   33.76                      if ((provSym.flags() & DEFAULT) != 0) {
   33.77                          defaults = defaults.append(provSym);
    34.1 --- a/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Tue Sep 24 14:20:33 2013 -0700
    34.2 +++ b/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Tue Sep 24 14:35:24 2013 -0700
    34.3 @@ -637,7 +637,7 @@
    34.4                      Env<AttrContext> localEnv = env.dup(tree);
    34.5                      JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
    34.6                              attr.memberReferenceQualifierResult(tree));
    34.7 -                    ListBuffer<Type> argtypes = ListBuffer.lb();
    34.8 +                    ListBuffer<Type> argtypes = new ListBuffer<>();
    34.9                      for (Type t : types.findDescriptorType(pt).getParameterTypes()) {
   34.10                          argtypes.append(Type.noType);
   34.11                      }
    35.1 --- a/src/share/classes/com/sun/tools/javac/comp/Flow.java	Tue Sep 24 14:20:33 2013 -0700
    35.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Flow.java	Tue Sep 24 14:35:24 2013 -0700
    35.3 @@ -713,7 +713,7 @@
    35.4              ListBuffer<PendingExit> prevPending = pendingExits;
    35.5              boolean prevAlive = alive;
    35.6              try {
    35.7 -                pendingExits = ListBuffer.lb();
    35.8 +                pendingExits = new ListBuffer<>();
    35.9                  alive = true;
   35.10                  scanStat(tree.body);
   35.11                  tree.canCompleteNormally = alive;
   35.12 @@ -1265,7 +1265,7 @@
   35.13              List<Type> prevThrown = thrown;
   35.14              ListBuffer<FlowPendingExit> prevPending = pendingExits;
   35.15              try {
   35.16 -                pendingExits = ListBuffer.lb();
   35.17 +                pendingExits = new ListBuffer<>();
   35.18                  caught = tree.getDescriptorType(types).getThrownTypes();
   35.19                  thrown = List.nil();
   35.20                  scan(tree.body);
   35.21 @@ -1338,7 +1338,7 @@
   35.22              ListBuffer<FlowPendingExit> prevPending = pendingExits;
   35.23              inLambda = true;
   35.24              try {
   35.25 -                pendingExits = ListBuffer.lb();
   35.26 +                pendingExits = new ListBuffer<>();
   35.27                  caught = List.of(syms.throwableType);
   35.28                  thrown = List.nil();
   35.29                  scan(tree.body);
   35.30 @@ -2030,7 +2030,7 @@
   35.31          void reportWarning(Lint.LintCategory lc, DiagnosticPosition pos, String key, Object ... args) {}
   35.32  
   35.33          public void visitTry(JCTry tree) {
   35.34 -            ListBuffer<JCVariableDecl> resourceVarDecls = ListBuffer.lb();
   35.35 +            ListBuffer<JCVariableDecl> resourceVarDecls = new ListBuffer<>();
   35.36              final Bits uninitsTryPrev = new Bits(uninitsTry);
   35.37              ListBuffer<P> prevPendingExits = pendingExits;
   35.38              pendingExits = new ListBuffer<>();
    36.1 --- a/src/share/classes/com/sun/tools/javac/comp/Infer.java	Tue Sep 24 14:20:33 2013 -0700
    36.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java	Tue Sep 24 14:35:24 2013 -0700
    36.3 @@ -277,7 +277,7 @@
    36.4        * Infer cyclic inference variables as described in 15.12.2.8.
    36.5        */
    36.6      private void instantiateAsUninferredVars(List<Type> vars, InferenceContext inferenceContext) {
    36.7 -        ListBuffer<Type> todo = ListBuffer.lb();
    36.8 +        ListBuffer<Type> todo = new ListBuffer<>();
    36.9          //step 1 - create fresh tvars
   36.10          for (Type t : vars) {
   36.11              UndetVar uv = (UndetVar)inferenceContext.asFree(t);
   36.12 @@ -1832,7 +1832,7 @@
   36.13          }
   36.14  
   36.15          private List<Type> filterVars(Filter<UndetVar> fu) {
   36.16 -            ListBuffer<Type> res = ListBuffer.lb();
   36.17 +            ListBuffer<Type> res = new ListBuffer<>();
   36.18              for (Type t : undetvars) {
   36.19                  UndetVar uv = (UndetVar)t;
   36.20                  if (fu.accepts(uv)) {
   36.21 @@ -1860,7 +1860,7 @@
   36.22           * Returns a list of free variables in a given type
   36.23           */
   36.24          final List<Type> freeVarsIn(Type t) {
   36.25 -            ListBuffer<Type> buf = ListBuffer.lb();
   36.26 +            ListBuffer<Type> buf = new ListBuffer<>();
   36.27              for (Type iv : inferenceVars()) {
   36.28                  if (t.contains(iv)) {
   36.29                      buf.add(iv);
   36.30 @@ -1870,11 +1870,11 @@
   36.31          }
   36.32  
   36.33          final List<Type> freeVarsIn(List<Type> ts) {
   36.34 -            ListBuffer<Type> buf = ListBuffer.lb();
   36.35 +            ListBuffer<Type> buf = new ListBuffer<>();
   36.36              for (Type t : ts) {
   36.37                  buf.appendList(freeVarsIn(t));
   36.38              }
   36.39 -            ListBuffer<Type> buf2 = ListBuffer.lb();
   36.40 +            ListBuffer<Type> buf2 = new ListBuffer<>();
   36.41              for (Type t : buf) {
   36.42                  if (!buf2.contains(t)) {
   36.43                      buf2.add(t);
   36.44 @@ -1893,7 +1893,7 @@
   36.45          }
   36.46  
   36.47          final List<Type> asFree(List<Type> ts) {
   36.48 -            ListBuffer<Type> buf = ListBuffer.lb();
   36.49 +            ListBuffer<Type> buf = new ListBuffer<>();
   36.50              for (Type t : ts) {
   36.51                  buf.append(asFree(t));
   36.52              }
   36.53 @@ -1901,7 +1901,7 @@
   36.54          }
   36.55  
   36.56          List<Type> instTypes() {
   36.57 -            ListBuffer<Type> buf = ListBuffer.lb();
   36.58 +            ListBuffer<Type> buf = new ListBuffer<>();
   36.59              for (Type t : undetvars) {
   36.60                  UndetVar uv = (UndetVar)t;
   36.61                  buf.append(uv.inst != null ? uv.inst : uv.qtype);
   36.62 @@ -1919,7 +1919,7 @@
   36.63          }
   36.64  
   36.65          List<Type> asInstTypes(List<Type> ts) {
   36.66 -            ListBuffer<Type> buf = ListBuffer.lb();
   36.67 +            ListBuffer<Type> buf = new ListBuffer<>();
   36.68              for (Type t : ts) {
   36.69                  buf.append(asInstType(t));
   36.70              }
   36.71 @@ -1967,7 +1967,7 @@
   36.72           * Save the state of this inference context
   36.73           */
   36.74          List<Type> save() {
   36.75 -            ListBuffer<Type> buf = ListBuffer.lb();
   36.76 +            ListBuffer<Type> buf = new ListBuffer<>();
   36.77              for (Type t : undetvars) {
   36.78                  UndetVar uv = (UndetVar)t;
   36.79                  UndetVar uv2 = new UndetVar((TypeVar)uv.qtype, types);
    37.1 --- a/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Tue Sep 24 14:20:33 2013 -0700
    37.2 +++ b/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Tue Sep 24 14:35:24 2013 -0700
    37.3 @@ -126,7 +126,7 @@
    37.4          private final VarSymbol deserParamSym;
    37.5  
    37.6          private KlassInfo(Symbol kSym) {
    37.7 -            appendedMethodList = ListBuffer.lb();
    37.8 +            appendedMethodList = new ListBuffer<>();
    37.9              deserializeCases = new HashMap<String, ListBuffer<JCStatement>>();
   37.10              long flags = PRIVATE | STATIC | SYNTHETIC;
   37.11              MethodType type = new MethodType(List.of(syms.serializedLambdaType), syms.objectType,
   37.12 @@ -153,6 +153,8 @@
   37.13          return instance;
   37.14      }
   37.15  
   37.16 +    private Attr attr;
   37.17 +
   37.18      private LambdaToMethod(Context context) {
   37.19          diags = JCDiagnostic.Factory.instance(context);
   37.20          log = Log.instance(context);
   37.21 @@ -166,6 +168,7 @@
   37.22          analyzer = new LambdaAnalyzerPreprocessor();
   37.23          Options options = Options.instance(context);
   37.24          dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats");
   37.25 +        attr = Attr.instance(context);
   37.26      }
   37.27      // </editor-fold>
   37.28  
   37.29 @@ -188,7 +191,7 @@
   37.30      }
   37.31  
   37.32      <T extends JCTree> List<T> translate(List<T> trees, TranslationContext<?> newContext) {
   37.33 -        ListBuffer<T> buf = ListBuffer.lb();
   37.34 +        ListBuffer<T> buf = new ListBuffer<>();
   37.35          for (T tree : trees) {
   37.36              buf.append(translate(tree, newContext));
   37.37          }
   37.38 @@ -301,7 +304,7 @@
   37.39          // * the "this" argument if it is an instance method
   37.40          // * enclosing locals captured by the lambda expression
   37.41  
   37.42 -        ListBuffer<JCExpression> syntheticInits = ListBuffer.lb();
   37.43 +        ListBuffer<JCExpression> syntheticInits = new ListBuffer<>();
   37.44  
   37.45          if (!sym.isStatic()) {
   37.46              syntheticInits.append(makeThis(
   37.47 @@ -368,6 +371,7 @@
   37.48  
   37.49              case BOUND:             /** Expr :: instMethod */
   37.50                  init = tree.getQualifierExpression();
   37.51 +                init = attr.makeNullCheck(init);
   37.52                  break;
   37.53  
   37.54              case UNBOUND:           /** Type :: instMethod */
   37.55 @@ -465,7 +469,7 @@
   37.56          } else if (isLambda_void && isTarget_Void) {
   37.57              //void to Void conversion:
   37.58              // BODY; return null;
   37.59 -            ListBuffer<JCStatement> stats = ListBuffer.lb();
   37.60 +            ListBuffer<JCStatement> stats = new ListBuffer<>();
   37.61              stats.append(make.Exec(expr));
   37.62              stats.append(make.Return(make.Literal(BOT, null).setType(syms.botType)));
   37.63              return make.Block(0, stats.toList());
   37.64 @@ -527,8 +531,8 @@
   37.65      }
   37.66  
   37.67      private JCMethodDecl makeDeserializeMethod(Symbol kSym) {
   37.68 -        ListBuffer<JCCase> cases = ListBuffer.lb();
   37.69 -        ListBuffer<JCBreak> breaks = ListBuffer.lb();
   37.70 +        ListBuffer<JCCase> cases = new ListBuffer<>();
   37.71 +        ListBuffer<JCBreak> breaks = new ListBuffer<>();
   37.72          for (Map.Entry<String, ListBuffer<JCStatement>> entry : kInfo.deserializeCases.entrySet()) {
   37.73              JCBreak br = make.Break(null);
   37.74              breaks.add(br);
   37.75 @@ -590,11 +594,11 @@
   37.76          String implMethodSignature = methodSig(types.erasure(refSym.type));
   37.77  
   37.78          JCExpression kindTest = eqTest(syms.intType, deserGetter("getImplMethodKind", syms.intType), make.Literal(implMethodKind));
   37.79 -        ListBuffer<JCExpression> serArgs = ListBuffer.lb();
   37.80 +        ListBuffer<JCExpression> serArgs = new ListBuffer<>();
   37.81          int i = 0;
   37.82          for (Type t : indyType.getParameterTypes()) {
   37.83 -            List<JCExpression> indexAsArg = ListBuffer.<JCExpression>lb().append(make.Literal(i)).toList();
   37.84 -            List<Type> argTypes = ListBuffer.<Type>lb().append(syms.intType).toList();
   37.85 +            List<JCExpression> indexAsArg = new ListBuffer<JCExpression>().append(make.Literal(i)).toList();
   37.86 +            List<Type> argTypes = new ListBuffer<Type>().append(syms.intType).toList();
   37.87              serArgs.add(make.TypeCast(types.erasure(t), deserGetter("getCapturedArg", syms.objectType, argTypes, indexAsArg)));
   37.88              ++i;
   37.89          }
   37.90 @@ -614,7 +618,7 @@
   37.91                  null);
   37.92          ListBuffer<JCStatement> stmts = kInfo.deserializeCases.get(implMethodName);
   37.93          if (stmts == null) {
   37.94 -            stmts = ListBuffer.lb();
   37.95 +            stmts = new ListBuffer<>();
   37.96              kInfo.deserializeCases.put(implMethodName, stmts);
   37.97          }
   37.98          /****
   37.99 @@ -724,8 +728,8 @@
  37.100  
  37.101          private final JCMemberReference tree;
  37.102          private final ReferenceTranslationContext localContext;
  37.103 -        private final ListBuffer<JCExpression> args = ListBuffer.lb();
  37.104 -        private final ListBuffer<JCVariableDecl> params = ListBuffer.lb();
  37.105 +        private final ListBuffer<JCExpression> args = new ListBuffer<>();
  37.106 +        private final ListBuffer<JCVariableDecl> params = new ListBuffer<>();
  37.107  
  37.108          MemberReferenceBridger(JCMemberReference tree, ReferenceTranslationContext localContext) {
  37.109              this.tree = tree;
  37.110 @@ -930,7 +934,7 @@
  37.111                  typeToMethodType(tree.getDescriptorType(types)));
  37.112  
  37.113          //computed indy arg types
  37.114 -        ListBuffer<Type> indy_args_types = ListBuffer.lb();
  37.115 +        ListBuffer<Type> indy_args_types = new ListBuffer<>();
  37.116          for (JCExpression arg : indy_args) {
  37.117              indy_args_types.append(arg.type);
  37.118          }
  37.119 @@ -945,7 +949,7 @@
  37.120                  names.altMetafactory : names.metafactory;
  37.121  
  37.122          if (context.needsAltMetafactory()) {
  37.123 -            ListBuffer<Object> markers = ListBuffer.lb();
  37.124 +            ListBuffer<Object> markers = new ListBuffer<>();
  37.125              for (Type t : tree.targets.tail) {
  37.126                  if (t.tsym != syms.serializableType.tsym) {
  37.127                      markers.append(t.tsym);
  37.128 @@ -1023,7 +1027,7 @@
  37.129      }
  37.130      //where
  37.131      private List<Type> bsmStaticArgToTypes(List<Object> args) {
  37.132 -        ListBuffer<Type> argtypes = ListBuffer.lb();
  37.133 +        ListBuffer<Type> argtypes = new ListBuffer<>();
  37.134          for (Object arg : args) {
  37.135              argtypes.append(bsmStaticArgToType(arg));
  37.136          }
  37.137 @@ -1847,7 +1851,7 @@
  37.138                          (thisReferenced? (inInterface? DEFAULT : 0) : STATIC);
  37.139  
  37.140                  //compute synthetic params
  37.141 -                ListBuffer<JCVariableDecl> params = ListBuffer.lb();
  37.142 +                ListBuffer<JCVariableDecl> params = new ListBuffer<>();
  37.143  
  37.144                  // The signature of the method is augmented with the following
  37.145                  // synthetic parameters:
    38.1 --- a/src/share/classes/com/sun/tools/javac/comp/Lower.java	Tue Sep 24 14:20:33 2013 -0700
    38.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Lower.java	Tue Sep 24 14:35:24 2013 -0700
    38.3 @@ -3725,7 +3725,7 @@
    38.4                  (JCVariableDecl)make.VarDef(dollar_tmp, make.Literal(INT, -1)).setType(dollar_tmp.type);
    38.5              dollar_tmp_def.init.type = dollar_tmp.type = syms.intType;
    38.6              stmtList.append(dollar_tmp_def);
    38.7 -            ListBuffer<JCCase> caseBuffer = ListBuffer.lb();
    38.8 +            ListBuffer<JCCase> caseBuffer = new ListBuffer<>();
    38.9              // hashCode will trigger nullcheck on original switch expression
   38.10              JCMethodInvocation hashCodeCall = makeCall(make.Ident(dollar_s),
   38.11                                                         names.hashCode,
   38.12 @@ -3749,7 +3749,7 @@
   38.13                                         elsepart);
   38.14                  }
   38.15  
   38.16 -                ListBuffer<JCStatement> lb = ListBuffer.lb();
   38.17 +                ListBuffer<JCStatement> lb = new ListBuffer<>();
   38.18                  JCBreak breakStmt = make.Break(null);
   38.19                  breakStmt.target = switch1;
   38.20                  lb.append(elsepart).append(breakStmt);
   38.21 @@ -3764,7 +3764,7 @@
   38.22              // with corresponding integer ones from the label to
   38.23              // position map.
   38.24  
   38.25 -            ListBuffer<JCCase> lb = ListBuffer.lb();
   38.26 +            ListBuffer<JCCase> lb = new ListBuffer<>();
   38.27              JCSwitch switch2 = make.Switch(make.Ident(dollar_tmp), lb.toList());
   38.28              for(JCCase oneCase : caseList ) {
   38.29                  // Rewire up old unlabeled break statements to the
    39.1 --- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Sep 24 14:20:33 2013 -0700
    39.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Sep 24 14:35:24 2013 -0700
    39.3 @@ -213,7 +213,7 @@
    39.4  
    39.5          int pos = 0;
    39.6          int mostSpecificPos = -1;
    39.7 -        ListBuffer<JCDiagnostic> subDiags = ListBuffer.lb();
    39.8 +        ListBuffer<JCDiagnostic> subDiags = new ListBuffer<>();
    39.9          for (Candidate c : currentResolutionContext.candidates) {
   39.10              if (currentResolutionContext.step != c.step ||
   39.11                      (c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.APPLICABLE)) ||
   39.12 @@ -783,7 +783,7 @@
   39.13      };
   39.14  
   39.15      List<Type> dummyArgs(int length) {
   39.16 -        ListBuffer<Type> buf = ListBuffer.lb();
   39.17 +        ListBuffer<Type> buf = new ListBuffer<>();
   39.18          for (int i = 0 ; i < length ; i++) {
   39.19              buf.append(Type.noType);
   39.20          }
   39.21 @@ -3173,7 +3173,7 @@
   39.22      }
   39.23      //where
   39.24      private List<Type> pruneInterfaces(Type t) {
   39.25 -        ListBuffer<Type> result = ListBuffer.lb();
   39.26 +        ListBuffer<Type> result = new ListBuffer<>();
   39.27          for (Type t1 : types.interfaces(t)) {
   39.28              boolean shouldAdd = true;
   39.29              for (Type t2 : types.interfaces(t)) {
   39.30 @@ -3286,7 +3286,7 @@
   39.31          if (argtypes == null || argtypes.isEmpty()) {
   39.32              return noArgs;
   39.33          } else {
   39.34 -            ListBuffer<Object> diagArgs = ListBuffer.lb();
   39.35 +            ListBuffer<Object> diagArgs = new ListBuffer<>();
   39.36              for (Type t : argtypes) {
   39.37                  if (t.hasTag(DEFERRED)) {
   39.38                      diagArgs.append(((DeferredAttr.DeferredType)t).tree);
    40.1 --- a/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Tue Sep 24 14:20:33 2013 -0700
    40.2 +++ b/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Tue Sep 24 14:35:24 2013 -0700
    40.3 @@ -887,7 +887,7 @@
    40.4  
    40.5      private List<JCTree> addOverrideBridgesIfNeeded(DiagnosticPosition pos,
    40.6                                      final ClassSymbol c) {
    40.7 -        ListBuffer<JCTree> buf = ListBuffer.lb();
    40.8 +        ListBuffer<JCTree> buf = new ListBuffer<>();
    40.9          if (c.isInterface() || !boundsRestricted(c))
   40.10              return buf.toList();
   40.11          Type t = types.supertype(c.type);
    41.1 --- a/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java	Tue Sep 24 14:20:33 2013 -0700
    41.2 +++ b/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java	Tue Sep 24 14:35:24 2013 -0700
    41.3 @@ -40,6 +40,7 @@
    41.4  import java.nio.CharBuffer;
    41.5  import java.nio.charset.CharsetDecoder;
    41.6  import javax.tools.JavaFileObject;
    41.7 +import java.text.Normalizer;
    41.8  
    41.9  /**
   41.10   * A subclass of JavaFileObject representing regular files.
   41.11 @@ -57,6 +58,7 @@
   41.12      private String name;
   41.13      final File file;
   41.14      private Reference<File> absFileRef;
   41.15 +    final static boolean isMacOS = System.getProperty("os.name", "").contains("OS X");
   41.16  
   41.17      public RegularFileObject(JavacFileManager fileManager, File f) {
   41.18          this(fileManager, f.getName(), f);
   41.19 @@ -180,7 +182,19 @@
   41.20          if (name.equals(n)) {
   41.21              return true;
   41.22          }
   41.23 -        if (name.equalsIgnoreCase(n)) {
   41.24 +        if (isMacOS && Normalizer.isNormalized(name, Normalizer.Form.NFD)
   41.25 +            && Normalizer.isNormalized(n, Normalizer.Form.NFC)) {
   41.26 +            // On Mac OS X it is quite possible to file name and class
   41.27 +            // name normalized in a different way - in that case we have to normalize file name
   41.28 +            // to the Normal Form Compised (NFC)
   41.29 +            String normName = Normalizer.normalize(name, Normalizer.Form.NFC);
   41.30 +            if (normName.equals(n)) {
   41.31 +                this.name = normName;
   41.32 +                return true;
   41.33 +            }
   41.34 +        }
   41.35 +
   41.36 +            if (name.equalsIgnoreCase(n)) {
   41.37              try {
   41.38                  // allow for Windows
   41.39                  return file.getCanonicalFile().getName().equals(n);
    42.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Tue Sep 24 14:20:33 2013 -0700
    42.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Tue Sep 24 14:35:24 2013 -0700
    42.3 @@ -56,6 +56,7 @@
    42.4  import static com.sun.tools.javac.code.Flags.*;
    42.5  import static com.sun.tools.javac.code.Kinds.*;
    42.6  import static com.sun.tools.javac.code.TypeTag.CLASS;
    42.7 +import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
    42.8  import static com.sun.tools.javac.jvm.ClassFile.*;
    42.9  import static com.sun.tools.javac.jvm.ClassFile.Version.*;
   42.10  
   42.11 @@ -703,6 +704,12 @@
   42.12                  sigp++;
   42.13                  thrown = thrown.prepend(sigToType());
   42.14              }
   42.15 +            // if there is a typevar in the throws clause we should state it.
   42.16 +            for (List<Type> l = thrown; l.nonEmpty(); l = l.tail) {
   42.17 +                if (l.head.hasTag(TYPEVAR)) {
   42.18 +                    l.head.tsym.flags_field |= THROWS;
   42.19 +                }
   42.20 +            }
   42.21              return new MethodType(argtypes,
   42.22                                    restype,
   42.23                                    thrown.reverse(),
   42.24 @@ -1439,8 +1446,7 @@
   42.25      void attachTypeAnnotations(final Symbol sym) {
   42.26          int numAttributes = nextChar();
   42.27          if (numAttributes != 0) {
   42.28 -            ListBuffer<TypeAnnotationProxy> proxies =
   42.29 -                ListBuffer.lb();
   42.30 +            ListBuffer<TypeAnnotationProxy> proxies = new ListBuffer<>();
   42.31              for (int i = 0; i < numAttributes; i++)
   42.32                  proxies.append(readTypeAnnotation());
   42.33              annotate.normal(new TypeAnnotationCompleter(sym, proxies.toList()));
   42.34 @@ -1589,7 +1595,7 @@
   42.35  
   42.36          { // See whether there is location info and read it
   42.37              int len = nextByte();
   42.38 -            ListBuffer<Integer> loc = ListBuffer.lb();
   42.39 +            ListBuffer<Integer> loc = new ListBuffer<>();
   42.40              for (int i = 0; i < len * TypeAnnotationPosition.TypePathEntry.bytesPerEntry; ++i)
   42.41                  loc = loc.append(nextByte());
   42.42              position.location = TypeAnnotationPosition.getTypePathFromBinary(loc.toList());
   42.43 @@ -1939,7 +1945,7 @@
   42.44          }
   42.45  
   42.46          List<Attribute.TypeCompound> deproxyTypeCompoundList(List<TypeAnnotationProxy> proxies) {
   42.47 -            ListBuffer<Attribute.TypeCompound> buf = ListBuffer.lb();
   42.48 +            ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
   42.49              for (TypeAnnotationProxy proxy: proxies) {
   42.50                  Attribute.Compound compound = deproxyCompound(proxy.compound);
   42.51                  Attribute.TypeCompound typeCompound = new Attribute.TypeCompound(compound, proxy.position);
   42.52 @@ -2026,7 +2032,7 @@
   42.53          boolean isVarargs = (flags & VARARGS) != 0;
   42.54          if (isVarargs) {
   42.55              Type varargsElem = args.last();
   42.56 -            ListBuffer<Type> adjustedArgs = ListBuffer.lb();
   42.57 +            ListBuffer<Type> adjustedArgs = new ListBuffer<>();
   42.58              for (Type t : args) {
   42.59                  adjustedArgs.append(t != varargsElem ?
   42.60                      t :
    43.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Tue Sep 24 14:20:33 2013 -0700
    43.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Tue Sep 24 14:35:24 2013 -0700
    43.3 @@ -766,8 +766,8 @@
    43.4      int writeTypeAnnotations(List<Attribute.TypeCompound> typeAnnos, boolean inCode) {
    43.5          if (typeAnnos.isEmpty()) return 0;
    43.6  
    43.7 -        ListBuffer<Attribute.TypeCompound> visibles = ListBuffer.lb();
    43.8 -        ListBuffer<Attribute.TypeCompound> invisibles = ListBuffer.lb();
    43.9 +        ListBuffer<Attribute.TypeCompound> visibles = new ListBuffer<>();
   43.10 +        ListBuffer<Attribute.TypeCompound> invisibles = new ListBuffer<>();
   43.11  
   43.12          for (Attribute.TypeCompound tc : typeAnnos) {
   43.13              if (tc.hasUnknownPosition()) {
    44.1 --- a/src/share/classes/com/sun/tools/javac/jvm/Code.java	Tue Sep 24 14:20:33 2013 -0700
    44.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/Code.java	Tue Sep 24 14:35:24 2013 -0700
    44.3 @@ -1595,7 +1595,7 @@
    44.4  
    44.5  
    44.6      public void compressCatchTable() {
    44.7 -        ListBuffer<char[]> compressedCatchInfo = ListBuffer.lb();
    44.8 +        ListBuffer<char[]> compressedCatchInfo = new ListBuffer<>();
    44.9          List<Integer> handlerPcs = List.nil();
   44.10          for (char[] catchEntry : catchInfo) {
   44.11              handlerPcs = handlerPcs.prepend((int)catchEntry[2]);
    45.1 --- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Tue Sep 24 14:20:33 2013 -0700
    45.2 +++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Tue Sep 24 14:35:24 2013 -0700
    45.3 @@ -67,7 +67,6 @@
    45.4  import static com.sun.tools.javac.code.TypeTag.CLASS;
    45.5  import static com.sun.tools.javac.main.Option.*;
    45.6  import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*;
    45.7 -import static com.sun.tools.javac.util.ListBuffer.lb;
    45.8  
    45.9  
   45.10  /** This class could be the main entry point for GJC when GJC is used as a
   45.11 @@ -586,7 +585,7 @@
   45.12      }
   45.13  
   45.14      protected final <T> Queue<T> stopIfError(CompileState cs, Queue<T> queue) {
   45.15 -        return shouldStop(cs) ? ListBuffer.<T>lb() : queue;
   45.16 +        return shouldStop(cs) ? new ListBuffer<T>() : queue;
   45.17      }
   45.18  
   45.19      protected final <T> List<T> stopIfError(CompileState cs, List<T> list) {
   45.20 @@ -952,7 +951,7 @@
   45.21             return List.nil();
   45.22  
   45.23          //parse all files
   45.24 -        ListBuffer<JCCompilationUnit> trees = lb();
   45.25 +        ListBuffer<JCCompilationUnit> trees = new ListBuffer<>();
   45.26          Set<JavaFileObject> filesSoFar = new HashSet<JavaFileObject>();
   45.27          for (JavaFileObject fileObject : fileObjects) {
   45.28              if (!filesSoFar.contains(fileObject)) {
   45.29 @@ -1002,7 +1001,7 @@
   45.30          // then remember the classes declared in
   45.31          // the original compilation units listed on the command line.
   45.32          if (needRootClasses || sourceOutput || stubOutput) {
   45.33 -            ListBuffer<JCClassDecl> cdefs = lb();
   45.34 +            ListBuffer<JCClassDecl> cdefs = new ListBuffer<>();
   45.35              for (JCCompilationUnit unit : roots) {
   45.36                  for (List<JCTree> defs = unit.defs;
   45.37                       defs.nonEmpty();
   45.38 @@ -1226,7 +1225,7 @@
   45.39       * @returns a list of environments for attributd classes.
   45.40       */
   45.41      public Queue<Env<AttrContext>> attribute(Queue<Env<AttrContext>> envs) {
   45.42 -        ListBuffer<Env<AttrContext>> results = lb();
   45.43 +        ListBuffer<Env<AttrContext>> results = new ListBuffer<>();
   45.44          while (!envs.isEmpty())
   45.45              results.append(attribute(envs.remove()));
   45.46          return stopIfError(CompileState.ATTR, results);
   45.47 @@ -1291,7 +1290,7 @@
   45.48       * @returns the list of attributed parse trees
   45.49       */
   45.50      public Queue<Env<AttrContext>> flow(Queue<Env<AttrContext>> envs) {
   45.51 -        ListBuffer<Env<AttrContext>> results = lb();
   45.52 +        ListBuffer<Env<AttrContext>> results = new ListBuffer<>();
   45.53          for (Env<AttrContext> env: envs) {
   45.54              flow(env, results);
   45.55          }
   45.56 @@ -1302,7 +1301,7 @@
   45.57       * Perform dataflow checks on an attributed parse tree.
   45.58       */
   45.59      public Queue<Env<AttrContext>> flow(Env<AttrContext> env) {
   45.60 -        ListBuffer<Env<AttrContext>> results = lb();
   45.61 +        ListBuffer<Env<AttrContext>> results = new ListBuffer<>();
   45.62          flow(env, results);
   45.63          return stopIfError(CompileState.FLOW, results);
   45.64      }
   45.65 @@ -1356,7 +1355,7 @@
   45.66       * @returns a list containing the classes to be generated
   45.67       */
   45.68      public Queue<Pair<Env<AttrContext>, JCClassDecl>> desugar(Queue<Env<AttrContext>> envs) {
   45.69 -        ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = lb();
   45.70 +        ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = new ListBuffer<>();
   45.71          for (Env<AttrContext> env: envs)
   45.72              desugar(env, results);
   45.73          return stopIfError(CompileState.FLOW, results);
   45.74 @@ -1605,7 +1604,7 @@
   45.75                  }
   45.76                  @Override
   45.77                  public void visitClassDef(JCClassDecl tree) {
   45.78 -                    ListBuffer<JCTree> newdefs = lb();
   45.79 +                    ListBuffer<JCTree> newdefs = new ListBuffer<>();
   45.80                      for (List<JCTree> it = tree.defs; it.tail != null; it = it.tail) {
   45.81                          JCTree t = it.head;
   45.82                          switch (t.getTag()) {
    46.1 --- a/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java	Tue Sep 24 14:20:33 2013 -0700
    46.2 +++ b/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java	Tue Sep 24 14:35:24 2013 -0700
    46.3 @@ -207,7 +207,7 @@
    46.4          Attribute[] contained0 = null;
    46.5          if (container != null)
    46.6              contained0 = unpackAttributes(container);
    46.7 -        ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
    46.8 +        ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
    46.9          if (contained0 != null) {
   46.10              for (Attribute a : contained0)
   46.11                  if (a instanceof Attribute.Compound)
   46.12 @@ -328,7 +328,7 @@
   46.13          Attribute[] contained0 = null;
   46.14          if (container != null)
   46.15              contained0 = unpackAttributes(container);
   46.16 -        ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
   46.17 +        ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
   46.18          if (contained0 != null) {
   46.19              for (Attribute a : contained0)
   46.20                  if (a instanceof Attribute.Compound)
    47.1 --- a/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Tue Sep 24 14:20:33 2013 -0700
    47.2 +++ b/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Tue Sep 24 14:35:24 2013 -0700
    47.3 @@ -116,11 +116,7 @@
    47.4  
    47.5      public List<Type> directSupertypes(TypeMirror t) {
    47.6          validateTypeNotIn(t, EXEC_OR_PKG);
    47.7 -        Type type = (Type) t;
    47.8 -        Type sup = types.supertype(type);
    47.9 -        return (sup == Type.noType || sup == type || sup == null)
   47.10 -              ? types.interfaces(type)
   47.11 -              : types.interfaces(type).prepend(sup);
   47.12 +        return types.directSupertypes((Type) t);
   47.13      }
   47.14  
   47.15      public TypeMirror erasure(TypeMirror t) {
    48.1 --- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Sep 24 14:20:33 2013 -0700
    48.2 +++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Sep 24 14:35:24 2013 -0700
    48.3 @@ -48,7 +48,6 @@
    48.4  import static com.sun.tools.javac.parser.Tokens.TokenKind.IMPORT;
    48.5  import static com.sun.tools.javac.parser.Tokens.TokenKind.LT;
    48.6  import static com.sun.tools.javac.tree.JCTree.Tag.*;
    48.7 -import static com.sun.tools.javac.util.ListBuffer.lb;
    48.8  
    48.9  /** The parser maps a token sequence into an abstract syntax
   48.10   *  tree. It operates by recursive descent, with code derived
   48.11 @@ -1767,7 +1766,7 @@
   48.12      /** Arguments = "(" [Expression { COMMA Expression }] ")"
   48.13       */
   48.14      List<JCExpression> arguments() {
   48.15 -        ListBuffer<JCExpression> args = lb();
   48.16 +        ListBuffer<JCExpression> args = new ListBuffer<>();
   48.17          if (token.kind == LPAREN) {
   48.18              nextToken();
   48.19              if (token.kind != RPAREN) {
   48.20 @@ -1834,7 +1833,7 @@
   48.21                  nextToken();
   48.22                  return List.nil();
   48.23              } else {
   48.24 -                ListBuffer<JCExpression> args = ListBuffer.lb();
   48.25 +                ListBuffer<JCExpression> args = new ListBuffer<>();
   48.26                  args.append(((mode & EXPR) == 0) ? typeArgument() : parseType());
   48.27                  while (token.kind == COMMA) {
   48.28                      nextToken();
   48.29 @@ -2175,7 +2174,7 @@
   48.30              ListBuffer<JCExpression> dims = new ListBuffer<JCExpression>();
   48.31  
   48.32              // maintain array dimension type annotations
   48.33 -            ListBuffer<List<JCAnnotation>> dimAnnotations = ListBuffer.lb();
   48.34 +            ListBuffer<List<JCAnnotation>> dimAnnotations = new ListBuffer<>();
   48.35              dimAnnotations.append(annos);
   48.36  
   48.37              dims.append(parseExpression());
   48.38 @@ -2626,7 +2625,7 @@
   48.39      }
   48.40  
   48.41      List<JCExpression> catchTypes() {
   48.42 -        ListBuffer<JCExpression> catchTypes = ListBuffer.lb();
   48.43 +        ListBuffer<JCExpression> catchTypes = new ListBuffer<>();
   48.44          catchTypes.add(parseType());
   48.45          while (token.kind == BAR) {
   48.46              checkMulticatch();
   48.47 @@ -2708,7 +2707,7 @@
   48.48       *           |  { FINAL | '@' Annotation } Type VariableDeclarators
   48.49       */
   48.50      List<JCStatement> forInit() {
   48.51 -        ListBuffer<JCStatement> stats = lb();
   48.52 +        ListBuffer<JCStatement> stats = new ListBuffer<>();
   48.53          int pos = token.pos;
   48.54          if (token.kind == FINAL || token.kind == MONKEYS_AT) {
   48.55              return variableDeclarators(optFinal(0), parseType(), stats).toList();
    49.1 --- a/src/share/classes/com/sun/tools/javac/parser/Tokens.java	Tue Sep 24 14:20:33 2013 -0700
    49.2 +++ b/src/share/classes/com/sun/tools/javac/parser/Tokens.java	Tue Sep 24 14:35:24 2013 -0700
    49.3 @@ -1,5 +1,5 @@
    49.4  /*
    49.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
    49.6 + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    49.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    49.8   *
    49.9   * This code is free software; you can redistribute it and/or modify it
   49.10 @@ -402,7 +402,7 @@
   49.11              if (comments == null) {
   49.12                  return List.nil();
   49.13              } else {
   49.14 -                ListBuffer<Comment> buf = ListBuffer.lb();
   49.15 +                ListBuffer<Comment> buf = new ListBuffer<>();
   49.16                  for (Comment c : comments) {
   49.17                      if (c.getStyle() == style) {
   49.18                          buf.add(c);
    50.1 --- a/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Tue Sep 24 14:20:33 2013 -0700
    50.2 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Tue Sep 24 14:35:24 2013 -0700
    50.3 @@ -234,7 +234,7 @@
    50.4      public JCTree visitLabeledStatement(LabeledStatementTree node, P p) {
    50.5          JCLabeledStatement t = (JCLabeledStatement) node;
    50.6          JCStatement body = copy(t.body, p);
    50.7 -        return M.at(t.pos).Labelled(t.label, t.body);
    50.8 +        return M.at(t.pos).Labelled(t.label, body);
    50.9      }
   50.10  
   50.11      public JCTree visitLiteral(LiteralTree node, P p) {
    51.1 --- a/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Tue Sep 24 14:20:33 2013 -0700
    51.2 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Tue Sep 24 14:35:24 2013 -0700
    51.3 @@ -946,6 +946,7 @@
    51.4      boolean isUnqualifiable(Symbol sym) {
    51.5          if (sym.name == names.empty ||
    51.6              sym.owner == null ||
    51.7 +            sym.owner == syms.rootPackage ||
    51.8              sym.owner.kind == MTH || sym.owner.kind == VAR) {
    51.9              return true;
   51.10          } else if (sym.kind == TYP && toplevel != null) {
    52.1 --- a/src/share/classes/com/sun/tools/javac/util/GraphUtils.java	Tue Sep 24 14:20:33 2013 -0700
    52.2 +++ b/src/share/classes/com/sun/tools/javac/util/GraphUtils.java	Tue Sep 24 14:35:24 2013 -0700
    52.3 @@ -103,8 +103,8 @@
    52.4       * directed graph in linear time. Works on TarjanNode.
    52.5       */
    52.6      public static <D, N extends TarjanNode<D>> List<? extends List<? extends N>> tarjan(Iterable<? extends N> nodes) {
    52.7 -        ListBuffer<List<N>> cycles = ListBuffer.lb();
    52.8 -        ListBuffer<N> stack = ListBuffer.lb();
    52.9 +        ListBuffer<List<N>> cycles = new ListBuffer<>();
   52.10 +        ListBuffer<N> stack = new ListBuffer<>();
   52.11          int index = 0;
   52.12          for (N node: nodes) {
   52.13              if (node.index == -1) {
   52.14 @@ -132,7 +132,7 @@
   52.15          }
   52.16          if (v.lowlink == v.index) {
   52.17              N n;
   52.18 -            ListBuffer<N> cycle = ListBuffer.lb();
   52.19 +            ListBuffer<N> cycle = new ListBuffer<>();
   52.20              do {
   52.21                  n = stack.remove();
   52.22                  n.active = false;
    53.1 --- a/src/share/classes/com/sun/tools/javac/util/List.java	Tue Sep 24 14:20:33 2013 -0700
    53.2 +++ b/src/share/classes/com/sun/tools/javac/util/List.java	Tue Sep 24 14:35:24 2013 -0700
    53.3 @@ -97,7 +97,7 @@
    53.4      }
    53.5  
    53.6      public List<A> intersect(List<A> that) {
    53.7 -        ListBuffer<A> buf = ListBuffer.lb();
    53.8 +        ListBuffer<A> buf = new ListBuffer<>();
    53.9          for (A el : this) {
   53.10              if (that.contains(el)) {
   53.11                  buf.append(el);
   53.12 @@ -107,7 +107,7 @@
   53.13      }
   53.14  
   53.15      public List<A> diff(List<A> that) {
   53.16 -        ListBuffer<A> buf = ListBuffer.lb();
   53.17 +        ListBuffer<A> buf = new ListBuffer<>();
   53.18          for (A el : this) {
   53.19              if (!that.contains(el)) {
   53.20                  buf.append(el);
   53.21 @@ -120,7 +120,7 @@
   53.22       * Create a new list from the first {@code n} elements of this list
   53.23       */
   53.24      public List<A> take(int n) {
   53.25 -        ListBuffer<A> buf = ListBuffer.lb();
   53.26 +        ListBuffer<A> buf = new ListBuffer<>();
   53.27          int count = 0;
   53.28          for (A el : this) {
   53.29              if (count++ == n) break;
   53.30 @@ -167,7 +167,7 @@
   53.31      }
   53.32  
   53.33      public static <A> List<A> from(Iterable<? extends A> coll) {
   53.34 -        ListBuffer<A> xs = ListBuffer.lb();
   53.35 +        ListBuffer<A> xs = new ListBuffer<>();
   53.36          for (A a : coll) {
   53.37              xs.append(a);
   53.38          }
    54.1 --- a/src/share/classes/com/sun/tools/javac/util/ListBuffer.java	Tue Sep 24 14:20:33 2013 -0700
    54.2 +++ b/src/share/classes/com/sun/tools/javac/util/ListBuffer.java	Tue Sep 24 14:35:24 2013 -0700
    54.3 @@ -1,5 +1,5 @@
    54.4  /*
    54.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
    54.6 + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    54.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    54.8   *
    54.9   * This code is free software; you can redistribute it and/or modify it
   54.10 @@ -40,10 +40,6 @@
   54.11   */
   54.12  public class ListBuffer<A> extends AbstractQueue<A> {
   54.13  
   54.14 -    public static <T> ListBuffer<T> lb() {
   54.15 -        return new ListBuffer<T>();
   54.16 -    }
   54.17 -
   54.18      public static <T> ListBuffer<T> of(T x) {
   54.19          ListBuffer<T> lb = new ListBuffer<T>();
   54.20          lb.add(x);
    55.1 --- a/src/share/classes/com/sun/tools/javac/util/Log.java	Tue Sep 24 14:20:33 2013 -0700
    55.2 +++ b/src/share/classes/com/sun/tools/javac/util/Log.java	Tue Sep 24 14:35:24 2013 -0700
    55.3 @@ -123,7 +123,7 @@
    55.4       * active diagnostic handler.
    55.5       */
    55.6      public static class DeferredDiagnosticHandler extends DiagnosticHandler {
    55.7 -        private Queue<JCDiagnostic> deferred = ListBuffer.lb();
    55.8 +        private Queue<JCDiagnostic> deferred = new ListBuffer<>();
    55.9          private final Filter<JCDiagnostic> filter;
   55.10  
   55.11          public DeferredDiagnosticHandler(Log log) {
    56.1 --- a/src/share/classes/com/sun/tools/javap/CodeWriter.java	Tue Sep 24 14:20:33 2013 -0700
    56.2 +++ b/src/share/classes/com/sun/tools/javap/CodeWriter.java	Tue Sep 24 14:35:24 2013 -0700
    56.3 @@ -208,7 +208,7 @@
    56.4  
    56.5  
    56.6      public void writeExceptionTable(Code_attribute attr) {
    56.7 -        if (attr.exception_table_langth > 0) {
    56.8 +        if (attr.exception_table_length > 0) {
    56.9              println("Exception table:");
   56.10              indent(+1);
   56.11              println(" from    to  target type");
    57.1 --- a/src/share/classes/com/sun/tools/sjavac/BuildState.java	Tue Sep 24 14:20:33 2013 -0700
    57.2 +++ b/src/share/classes/com/sun/tools/sjavac/BuildState.java	Tue Sep 24 14:35:24 2013 -0700
    57.3 @@ -1,5 +1,5 @@
    57.4  /*
    57.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    57.6 + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
    57.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    57.8   *
    57.9   * This code is free software; you can redistribute it and/or modify it
   57.10 @@ -81,12 +81,13 @@
   57.11      }
   57.12  
   57.13      /**
   57.14 -     * Collect all packages, sources and artifacts for all modules
   57.15 -     * into the build state.
   57.16 +     * Store references to all packages, sources and artifacts for all modules
   57.17 +     * into the build state. I.e. flatten the module tree structure
   57.18 +     * into global maps stored in the BuildState for easy access.
   57.19       *
   57.20       * @param m The set of modules.
   57.21       */
   57.22 -    public void collectPackagesSourcesAndArtifacts(Map<String,Module> m) {
   57.23 +    public void flattenPackagesSourcesAndArtifacts(Map<String,Module> m) {
   57.24          modules = m;
   57.25          // Extract all the found packages.
   57.26          for (Module i : modules.values()) {
   57.27 @@ -121,11 +122,12 @@
   57.28      }
   57.29  
   57.30      /**
   57.31 -     * Collect all the artifacts of all modules and packages.
   57.32 +     * Store references to all artifacts found in the module tree into the maps
   57.33 +     * stored in the build state.
   57.34       *
   57.35       * @param m The set of modules.
   57.36       */
   57.37 -    public void collectArtifacts(Map<String,Module> m) {
   57.38 +    public void flattenArtifacts(Map<String,Module> m) {
   57.39          modules = m;
   57.40          // Extract all the found packages.
   57.41          for (Module i : modules.values()) {
   57.42 @@ -270,6 +272,8 @@
   57.43              Module mnew = findModuleFromPackageName(pkg);
   57.44              Package pprev = prev.packages().get(pkg);
   57.45              mnew.addPackage(pprev);
   57.46 +            // Do not forget to update the flattened data.
   57.47 +            packages.put(pkg, pprev);
   57.48          }
   57.49      }
   57.50  }
    58.1 --- a/src/share/classes/com/sun/tools/sjavac/Main.java	Tue Sep 24 14:20:33 2013 -0700
    58.2 +++ b/src/share/classes/com/sun/tools/sjavac/Main.java	Tue Sep 24 14:35:24 2013 -0700
    58.3 @@ -274,7 +274,7 @@
    58.4  //          findFiles(args, "-modulepath", Util.set(".class"), modules_to_link_to, modules, current_module, true);
    58.5  
    58.6              // Add the set of sources to the build database.
    58.7 -            javac_state.now().collectPackagesSourcesAndArtifacts(modules);
    58.8 +            javac_state.now().flattenPackagesSourcesAndArtifacts(modules);
    58.9              javac_state.now().checkInternalState("checking sources", false, sources);
   58.10              javac_state.now().checkInternalState("checking linked sources", true, sources_to_link_to);
   58.11              javac_state.setVisibleSources(sources_to_link_to);
   58.12 @@ -311,7 +311,7 @@
   58.13              Map<String,Source> generated_sources = new HashMap<String,Source>();
   58.14              Source.scanRoot(gensrc_dir, Util.set(".java"), null, null, null, null,
   58.15                     generated_sources, modules, current_module, false, true, false);
   58.16 -            javac_state.now().collectPackagesSourcesAndArtifacts(modules);
   58.17 +            javac_state.now().flattenPackagesSourcesAndArtifacts(modules);
   58.18              // Recheck the the source files and their timestamps again.
   58.19              javac_state.checkSourceStatus(true);
   58.20  
   58.21 @@ -336,8 +336,8 @@
   58.22              // Only update the state if the compile went well.
   58.23              if (rc[0]) {
   58.24                  javac_state.save();
   58.25 -                // Collect all the artifacts.
   58.26 -                javac_state.now().collectArtifacts(modules);
   58.27 +                // Reflatten only the artifacts.
   58.28 +                javac_state.now().flattenArtifacts(modules);
   58.29                  // Remove artifacts that were generated during the last compile, but not this one.
   58.30                  javac_state.removeSuperfluousArtifacts(recently_compiled);
   58.31              }
    59.1 --- a/src/share/classes/com/sun/tools/sjavac/server/JavacServer.java	Tue Sep 24 14:20:33 2013 -0700
    59.2 +++ b/src/share/classes/com/sun/tools/sjavac/server/JavacServer.java	Tue Sep 24 14:35:24 2013 -0700
    59.3 @@ -464,7 +464,7 @@
    59.4              PrintStream err) {
    59.5          int rc = -3;
    59.6          try {
    59.7 -            int port = portFile.getPort();
    59.8 +            int port = portFile.containsPortInfo() ? portFile.getPort() : 0;
    59.9              if (port == 0) {
   59.10                  return ERROR_BUT_TRY_AGAIN;
   59.11              }
    60.1 --- a/test/com/sun/javadoc/lib/JavadocTester.java	Tue Sep 24 14:20:33 2013 -0700
    60.2 +++ b/test/com/sun/javadoc/lib/JavadocTester.java	Tue Sep 24 14:35:24 2013 -0700
    60.3 @@ -1,5 +1,5 @@
    60.4  /*
    60.5 - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
    60.6 + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
    60.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    60.8   *
    60.9   * This code is free software; you can redistribute it and/or modify it
   60.10 @@ -57,6 +57,7 @@
   60.11      protected static final String SRC_DIR = System.getProperty("test.src", ".");
   60.12      protected static final String JAVA_VERSION = System.getProperty("java.version");
   60.13      protected static final String[][] NO_TEST = new String[][] {};
   60.14 +    protected static final String[] NO_FILE_TEST = new String[] {};
   60.15  
   60.16      /**
   60.17       * Use this as the file name in the test array when you want to search
   60.18 @@ -166,6 +167,26 @@
   60.19      }
   60.20  
   60.21      /**
   60.22 +     * Execute the tests.
   60.23 +     *
   60.24 +     * @param tester               the tester to execute
   60.25 +     * @param args                 the arguments to pass to Javadoc
   60.26 +     * @param testArray            the array of tests
   60.27 +     * @param negatedTestArray     the array of negated tests
   60.28 +     * @param fileTestArray        the array of file tests
   60.29 +     * @param negatedFileTestArray the array of negated file tests
   60.30 +     * @return                     the return code for the execution of Javadoc
   60.31 +     */
   60.32 +    public static int run(JavadocTester tester, String[] args,
   60.33 +            String[][] testArray, String[][] negatedTestArray, String[] fileTestArray,
   60.34 +            String[] negatedFileTestArray) {
   60.35 +        int returnCode = tester.runJavadoc(args);
   60.36 +        tester.runTestsOnHTML(testArray, negatedTestArray);
   60.37 +        tester.runTestsOnFile(fileTestArray, negatedFileTestArray);
   60.38 +        return returnCode;
   60.39 +    }
   60.40 +
   60.41 +    /**
   60.42       * Execute Javadoc using the default doclet.
   60.43       *
   60.44       * @param args  the arguments to pass to Javadoc
   60.45 @@ -244,6 +265,19 @@
   60.46      }
   60.47  
   60.48      /**
   60.49 +     * Run array of tests on the generated files.
   60.50 +     * This method accepts a fileTestArray for testing if a file is generated
   60.51 +     * and a negatedFileTestArray for testing if a file is not found.
   60.52 +     *
   60.53 +     * @param testArray         the array of file tests
   60.54 +     * @param negatedTestArray  the array of negated file tests
   60.55 +     */
   60.56 +    public void runTestsOnFile(String[] fileTestArray, String[] negatedFileTestArray) {
   60.57 +        runTestsOnFile(fileTestArray, false);
   60.58 +        runTestsOnFile(negatedFileTestArray, true);
   60.59 +    }
   60.60 +
   60.61 +    /**
   60.62       * Run the array of tests on the resulting HTML.
   60.63       *
   60.64       * @param testArray the array of tests
   60.65 @@ -265,9 +299,11 @@
   60.66                  fileString = readFileToString(testArray[i][0]);
   60.67              } catch (Error e) {
   60.68                  if (isNegated) {
   60.69 -                  numTestsPassed += 1;
   60.70 -                  System.out.println("Passed\n not found:\n"
   60.71 -                    + stringToFind + " in non-existent " + testArray[i][0] + "\n");
   60.72 +                  System.out.println( "FAILED" + "\n"
   60.73 +                                    + "for bug " + getBugId()
   60.74 +                                    + " (" + getBugName() + ") "
   60.75 +                                    + "due to "
   60.76 +                                    + e + "\n");
   60.77                    continue;
   60.78                  }
   60.79                  throw e;
   60.80 @@ -291,6 +327,39 @@
   60.81      }
   60.82  
   60.83      /**
   60.84 +     * Run the array of file tests on the generated files.
   60.85 +     *
   60.86 +     * @param testArray the array of file tests
   60.87 +     * @param isNegated true if test is negated; false otherwise
   60.88 +     */
   60.89 +    private void runTestsOnFile(String[] testArray, boolean isNegated) {
   60.90 +        String fileName;
   60.91 +        String failedString;
   60.92 +        String passedString;
   60.93 +        for (int i = 0; i < testArray.length; i++) {
   60.94 +            numTestsRun++;
   60.95 +            fileName = testArray[i];
   60.96 +            failedString = "FAILED" + "\n"
   60.97 +                    + "for bug " + getBugId() + " (" + getBugName() + ") "
   60.98 +                    + "file (" + fileName + ") found" + "\n";
   60.99 +            passedString = "Passed" + "\n" +
  60.100 +                        "file (" + fileName + ") not found" + "\n";
  60.101 +            System.out.print("Running subtest #" + numTestsRun + "... ");
  60.102 +            try {
  60.103 +                File file = new File(fileName);
  60.104 +                if ((file.exists() && !isNegated) || (!file.exists() && isNegated)) {
  60.105 +                    numTestsPassed += 1;
  60.106 +                    System.out.println(passedString);
  60.107 +                } else {
  60.108 +                    System.out.println(failedString);
  60.109 +                }
  60.110 +            } catch (Error e) {
  60.111 +                System.err.println(e);
  60.112 +            }
  60.113 +        }
  60.114 +    }
  60.115 +
  60.116 +    /**
  60.117       * Iterate through the list of given file pairs and diff each file.
  60.118       *
  60.119       * @param filePairs the pairs of files to diff.
    61.1 --- a/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java	Tue Sep 24 14:20:33 2013 -0700
    61.2 +++ b/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java	Tue Sep 24 14:35:24 2013 -0700
    61.3 @@ -1,5 +1,5 @@
    61.4  /*
    61.5 - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
    61.6 + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
    61.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    61.8   *
    61.9   * This code is free software; you can redistribute it and/or modify it
   61.10 @@ -23,20 +23,19 @@
   61.11  
   61.12  /*
   61.13   * @test
   61.14 - * @bug      4973609
   61.15 + * @bug      4973609 8015249
   61.16   * @summary  Make sure that annotation types with 0 members does not have
   61.17   *           extra HR tags.
   61.18   * @author   jamieh
   61.19   * @library  ../lib/
   61.20 - * @build    JavadocTester
   61.21 - * @build    TestAnnotationTypes
   61.22 + * @build    JavadocTester TestAnnotationTypes
   61.23   * @run main TestAnnotationTypes
   61.24   */
   61.25  
   61.26  public class TestAnnotationTypes extends JavadocTester {
   61.27  
   61.28      //Test information.
   61.29 -    private static final String BUG_ID = "4973609";
   61.30 +    private static final String BUG_ID = "4973609-8015249";
   61.31  
   61.32      //Javadoc arguments.
   61.33      private static final String[] ARGS = new String[] {
   61.34 @@ -44,7 +43,31 @@
   61.35      };
   61.36  
   61.37      //Input for string search tests.
   61.38 -    private static final String[][] TEST = NO_TEST;
   61.39 +    private static final String[][] TEST = {
   61.40 +        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
   61.41 +            "<li>Summary:&nbsp;</li>" + NL + "<li><a href=\"#annotation_type_" +
   61.42 +            "field_summary\">Field</a>&nbsp;|&nbsp;</li>"},
   61.43 +        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
   61.44 +            "<li>Detail:&nbsp;</li>" + NL + "<li><a href=\"#annotation_type_" +
   61.45 +            "field_detail\">Field</a>&nbsp;|&nbsp;</li>"},
   61.46 +        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
   61.47 +            "<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->"},
   61.48 +        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
   61.49 +            "<h3>Field Summary</h3>"},
   61.50 +        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
   61.51 +            "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../" +
   61.52 +            "pkg/AnnotationTypeField.html#DEFAULT_NAME\">DEFAULT_NAME</a></span>" +
   61.53 +            "</code>&nbsp;</td>"},
   61.54 +        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
   61.55 +            "<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->"},
   61.56 +        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
   61.57 +            "<h4>DEFAULT_NAME</h4>" + NL + "<pre>public static final&nbsp;java." +
   61.58 +            "lang.String&nbsp;DEFAULT_NAME</pre>"},
   61.59 +        {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   61.60 +            "<li>Summary:&nbsp;</li>" + NL + "<li>Field&nbsp;|&nbsp;</li>"},
   61.61 +        {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   61.62 +            "<li>Detail:&nbsp;</li>" + NL + "<li>Field&nbsp;|&nbsp;</li>"},
   61.63 +    };
   61.64      private static final String[][] NEGATED_TEST = {
   61.65          {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   61.66              "<HR>" + NL + NL + "<P>" + NL + NL + "<P>" +
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/test/com/sun/javadoc/testAnnotationTypes/pkg/AnnotationTypeField.java	Tue Sep 24 14:35:24 2013 -0700
    62.3 @@ -0,0 +1,35 @@
    62.4 +/*
    62.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    62.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    62.7 + *
    62.8 + * This code is free software; you can redistribute it and/or modify it
    62.9 + * under the terms of the GNU General Public License version 2 only, as
   62.10 + * published by the Free Software Foundation.
   62.11 + *
   62.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   62.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   62.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   62.15 + * version 2 for more details (a copy is included in the LICENSE file that
   62.16 + * accompanied this code).
   62.17 + *
   62.18 + * You should have received a copy of the GNU General Public License version
   62.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   62.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   62.21 + *
   62.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   62.23 + * or visit www.oracle.com if you need additional information or have any
   62.24 + * questions.
   62.25 + */
   62.26 +
   62.27 +package pkg;
   62.28 +
   62.29 +import java.lang.annotation.*;
   62.30 +
   62.31 +/**
   62.32 + * This is just a test for annotation type fields.
   62.33 + */
   62.34 +@Documented public @interface AnnotationTypeField {
   62.35 +    String DEFAULT_NAME = "test";
   62.36 +
   62.37 +    String name() default DEFAULT_NAME;
   62.38 +}
    63.1 --- a/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java	Tue Sep 24 14:20:33 2013 -0700
    63.2 +++ b/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java	Tue Sep 24 14:35:24 2013 -0700
    63.3 @@ -1,5 +1,5 @@
    63.4  /*
    63.5 - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
    63.6 + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
    63.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    63.8   *
    63.9   * This code is free software; you can redistribute it and/or modify it
   63.10 @@ -25,7 +25,7 @@
   63.11  
   63.12  /*
   63.13   * @test
   63.14 - * @bug 4258405 4973606
   63.15 + * @bug 4258405 4973606 8024096
   63.16   * @summary This test verifies that the doc-file directory does not
   63.17   *          get overwritten when the sourcepath is equal to the destination
   63.18   *          directory.
   63.19 @@ -47,25 +47,17 @@
   63.20          };
   63.21      private static final String[][] NEGATED_TEST1 = NO_TEST;
   63.22  
   63.23 -    private static final String[][] TEST2 = {
   63.24 -        {BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-used1" +
   63.25 +    private static final String[] FILE_TEST2 = {
   63.26 +        BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-used1" +
   63.27              FS + "testfile.txt",
   63.28 -            "passed"
   63.29 -        },
   63.30 -        {BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-used2" +
   63.31 +        BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-used2" +
   63.32 +            FS + "testfile.txt"
   63.33 +    };
   63.34 +    private static final String[] FILE_NEGATED_TEST2 = {
   63.35 +        BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-excluded1" +
   63.36              FS + "testfile.txt",
   63.37 -            "passed"
   63.38 -        },
   63.39 -    };
   63.40 -    private static final String[][] NEGATED_TEST2 = {
   63.41 -        {BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-excluded1" +
   63.42 -            FS + "testfile.txt",
   63.43 -            "passed"
   63.44 -        },
   63.45 -        {BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-excluded2" +
   63.46 -            FS + "testfile.txt",
   63.47 -            "passed"
   63.48 -        },
   63.49 +        BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-excluded2" +
   63.50 +            FS + "testfile.txt"
   63.51      };
   63.52  
   63.53      private static final String[][] TEST0 = {
   63.54 @@ -106,7 +98,7 @@
   63.55          run(tester, ARGS0, TEST0, NEGATED_TEST0);
   63.56          copyDir(SRC_DIR + FS + "pkg", BUG_ID + "-1");
   63.57          run(tester, ARGS1, TEST1, NEGATED_TEST1);
   63.58 -        run(tester, ARGS2, TEST2, NEGATED_TEST2);
   63.59 +        run(tester, ARGS2, NO_TEST, NO_TEST, FILE_TEST2, FILE_NEGATED_TEST2);
   63.60          tester.printSummary();
   63.61      }
   63.62  
    64.1 --- a/test/com/sun/javadoc/testEncoding/EncodeTest.java	Tue Sep 24 14:20:33 2013 -0700
    64.2 +++ b/test/com/sun/javadoc/testEncoding/EncodeTest.java	Tue Sep 24 14:35:24 2013 -0700
    64.3 @@ -1,5 +1,5 @@
    64.4  /*
    64.5 - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
    64.6 + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
    64.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    64.8   *
    64.9   * This code is free software; you can redistribute it and/or modify it
   64.10 @@ -23,7 +23,9 @@
   64.11  
   64.12  
   64.13  /**
   64.14 - * ±ñÉ¿í ¹©¢!
   64.15 + * Testing en\u00e7\u00f4ded string.
   64.16 + * In the encoded comment string, Unicode U+00E7 is "Latin small letter C with cedilla"
   64.17 + * and Unicode U+00F4 is "Latin small letter O with circumflex"
   64.18   */
   64.19  public class EncodeTest {
   64.20  }
    65.1 --- a/test/com/sun/javadoc/testEncoding/TestEncoding.java	Tue Sep 24 14:20:33 2013 -0700
    65.2 +++ b/test/com/sun/javadoc/testEncoding/TestEncoding.java	Tue Sep 24 14:35:24 2013 -0700
    65.3 @@ -1,5 +1,5 @@
    65.4  /*
    65.5 - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
    65.6 + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
    65.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    65.8   *
    65.9   * This code is free software; you can redistribute it and/or modify it
   65.10 @@ -23,7 +23,7 @@
   65.11  
   65.12  /*
   65.13   * @test
   65.14 - * @bug 4661481
   65.15 + * @bug 4661481 8024096
   65.16   * @summary This test determines if the value of the -encoding option is
   65.17   * properly passed from Javadoc to the source file parser.
   65.18   * @author jamieh
   65.19 @@ -40,12 +40,12 @@
   65.20  
   65.21      //If ??? is found in the output, the source file was not read with the correct encoding setting.
   65.22      private static final String[][] NEGATED_TEST = {
   65.23 -        {BUG_ID + FS + "EncodeTest.html", "???"}
   65.24 +        {BUG_ID + FS + "EncodeTest.html", "??"}
   65.25      };
   65.26      private static final String[] ARGS =
   65.27          new String[] {
   65.28              "-d", BUG_ID, "-sourcepath", SRC_DIR,
   65.29 -            "-encoding", "SJIS", SRC_DIR + FS + "EncodeTest.java"
   65.30 +            "-encoding", "iso-8859-1", SRC_DIR + FS + "EncodeTest.java"
   65.31          };
   65.32  
   65.33      /**
    66.1 --- a/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java	Tue Sep 24 14:20:33 2013 -0700
    66.2 +++ b/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java	Tue Sep 24 14:35:24 2013 -0700
    66.3 @@ -1,5 +1,5 @@
    66.4  /*
    66.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    66.6 + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
    66.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    66.8   *
    66.9   * This code is free software; you can redistribute it and/or modify it
   66.10 @@ -23,7 +23,7 @@
   66.11  
   66.12  /*
   66.13   * @test
   66.14 - * @bug      8002304
   66.15 + * @bug      8002304 8024096
   66.16   * @summary  Test for various method types in the method summary table
   66.17   * @author   Bhavesh Patel
   66.18   * @library  ../lib/
   66.19 @@ -107,7 +107,7 @@
   66.20              "</caption>"
   66.21          },
   66.22  
   66.23 -        {BUG_ID + FS + "pkg" + FS + "D.html",
   66.24 +        {BUG_ID + FS + "pkg1" + FS + "D.html",
   66.25              "<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span>" +
   66.26              "</caption>"
   66.27          },
    67.1 --- a/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Tue Sep 24 14:20:33 2013 -0700
    67.2 +++ b/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Tue Sep 24 14:35:24 2013 -0700
    67.3 @@ -155,13 +155,13 @@
    67.4              //=================================
    67.5              //Make sure the summary links are correct.
    67.6              {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
    67.7 -                "<li>Summary:&nbsp;</li>" + NL +
    67.8 +                "<li>Summary:&nbsp;</li>" + NL + "<li>Field&nbsp;|&nbsp;</li>" + NL +
    67.9                  "<li><a href=\"#annotation_type_required_element_summary\">" +
   67.10                  "Required</a>&nbsp;|&nbsp;</li>" + NL + "<li>" +
   67.11                  "<a href=\"#annotation_type_optional_element_summary\">Optional</a></li>"},
   67.12              //Make sure the detail links are correct.
   67.13              {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   67.14 -                "<li>Detail:&nbsp;</li>" + NL +
   67.15 +                "<li>Detail:&nbsp;</li>" + NL + "<li>Field&nbsp;|&nbsp;</li>" + NL +
   67.16                  "<li><a href=\"#annotation_type_element_detail\">Element</a></li>"},
   67.17              //Make sure the heading is correct.
   67.18              {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
    68.1 --- a/test/com/sun/javadoc/testProfiles/TestProfiles.java	Tue Sep 24 14:20:33 2013 -0700
    68.2 +++ b/test/com/sun/javadoc/testProfiles/TestProfiles.java	Tue Sep 24 14:35:24 2013 -0700
    68.3 @@ -23,7 +23,7 @@
    68.4  
    68.5  /*
    68.6   * @test
    68.7 - * @bug      8006124 8009684 8016921 8023700
    68.8 + * @bug      8006124 8009684 8016921 8023700 8024096
    68.9   * @summary  Test javadoc support for profiles.
   68.10   * @author   Bhavesh Patel, Evgeniya Stepanova
   68.11   * @library  ../lib/
   68.12 @@ -187,26 +187,6 @@
   68.13          }
   68.14      };
   68.15      private static final String[][] PACKAGES_NEGATED_TEST = {
   68.16 -        {PACKAGE_BUG_ID + FS + "profile-overview-frame.html",
   68.17 -            "<span><a href=\"overview-frame.html\" "
   68.18 -            + "target=\"packageListFrame\">All&nbsp;Packages</a></span>"
   68.19 -        },
   68.20 -        {PACKAGE_BUG_ID + FS + "compact2-frame.html",
   68.21 -            "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
   68.22 -            + "All&nbsp;Packages</a></span><span><a href=\"profile-overview-frame.html\" "
   68.23 -            + "target=\"packageListFrame\">All&nbsp;Profiles</a></span>"
   68.24 -        },
   68.25 -        {PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
   68.26 -            "<a href=\"../compact2-summary.html\" target=\"classFrame\">"
   68.27 -            + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" "
   68.28 -            + "target=\"classFrame\">pkg2</a>"
   68.29 -        },
   68.30 -        {PACKAGE_BUG_ID + FS + "compact2-summary.html",
   68.31 -            "<h1 title=\"Profile\" class=\"title\">Profile&nbsp;compact2</h1>"
   68.32 -        },
   68.33 -        {PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
   68.34 -            "<div class=\"subTitle\">compact3</div>"
   68.35 -        },
   68.36          {PACKAGE_BUG_ID + FS + "overview-frame.html",
   68.37              "<span><a href=\"profile-overview-frame.html\" "
   68.38              + "target=\"packageListFrame\">All&nbsp;Profiles</a></span>"
   68.39 @@ -222,6 +202,13 @@
   68.40              "</ul>"
   68.41          }
   68.42      };
   68.43 +    private static final String[] PACKAGES_NEGATED_FILE_TEST = {
   68.44 +        PACKAGE_BUG_ID + FS + "profile-overview-frame.html",
   68.45 +        PACKAGE_BUG_ID + FS + "compact2-frame.html",
   68.46 +        PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
   68.47 +        PACKAGE_BUG_ID + FS + "compact2-summary.html",
   68.48 +        PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html"
   68.49 +    };
   68.50  
   68.51      /**
   68.52       * The entry point of the test.
   68.53 @@ -231,7 +218,7 @@
   68.54      public static void main(String[] args) {
   68.55          TestProfiles tester = new TestProfiles();
   68.56          run(tester, ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST);
   68.57 -        run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST);
   68.58 +        run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST, NO_FILE_TEST, PACKAGES_NEGATED_FILE_TEST);
   68.59          tester.printSummary();
   68.60      }
   68.61  
    69.1 --- a/test/tools/doclint/ReferenceTest.java	Tue Sep 24 14:20:33 2013 -0700
    69.2 +++ b/test/tools/doclint/ReferenceTest.java	Tue Sep 24 14:35:24 2013 -0700
    69.3 @@ -1,6 +1,6 @@
    69.4  /*
    69.5   * @test /nodynamiccopyright/
    69.6 - * @bug 8004832 8020556
    69.7 + * @bug 8004832 8020556 8002154
    69.8   * @summary Add new doclint package
    69.9   * @build DocLintTester
   69.10   * @run main DocLintTester -Xmsgs:-reference ReferenceTest.java
   69.11 @@ -54,5 +54,13 @@
   69.12       * @throws T description
   69.13       */
   69.14      public <T extends Throwable> void valid_throws_generic() throws T { }
   69.15 +
   69.16 +    /**
   69.17 +     * {@link java.util.List<String>}
   69.18 +     * {@link java.util.List<String>#equals}
   69.19 +     * @see java.util.List<String>
   69.20 +     * @see java.util.List<String>#equals
   69.21 +     */
   69.22 +    public void invalid_type_args() { }
   69.23  }
   69.24  
    70.1 --- a/test/tools/doclint/ReferenceTest.out	Tue Sep 24 14:20:33 2013 -0700
    70.2 +++ b/test/tools/doclint/ReferenceTest.out	Tue Sep 24 14:35:24 2013 -0700
    70.3 @@ -25,6 +25,18 @@
    70.4  ReferenceTest.java:48: error: exception not thrown: java.lang.Exception
    70.5       * @throws Exception description
    70.6                 ^
    70.7 -8 errors
    70.8 +ReferenceTest.java:59: error: type arguments not allowed here
    70.9 +     * {@link java.util.List<String>}
   70.10 +              ^
   70.11 +ReferenceTest.java:60: error: type arguments not allowed here
   70.12 +     * {@link java.util.List<String>#equals}
   70.13 +              ^
   70.14 +ReferenceTest.java:61: error: type arguments not allowed here
   70.15 +     * @see java.util.List<String>
   70.16 +            ^
   70.17 +ReferenceTest.java:62: error: type arguments not allowed here
   70.18 +     * @see java.util.List<String>#equals
   70.19 +            ^
   70.20 +12 errors
   70.21  1 warning
   70.22  
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/test/tools/doclint/ValueTest.java	Tue Sep 24 14:35:24 2013 -0700
    71.3 @@ -0,0 +1,67 @@
    71.4 +/*
    71.5 + * @test /nodynamiccopyright/
    71.6 + * @bug 8025272
    71.7 + * @summary doclint needs to check for valid usage of at-value tag
    71.8 + * @build DocLintTester
    71.9 + * @run main DocLintTester -ref ValueTest.out ValueTest.java
   71.10 + */
   71.11 +
   71.12 +/** */
   71.13 +public class ValueTest {
   71.14 +    /*
   71.15 +     * Tests for {@value} without a reference
   71.16 +     */
   71.17 +
   71.18 +    /** valid: {@value} */
   71.19 +    public static final boolean cBoolean = false;
   71.20 +
   71.21 +    /** valid: {@value} */
   71.22 +    public static final byte cByte = 0;
   71.23 +
   71.24 +    /** valid: {@value} */
   71.25 +    public static final short cShort = 0;
   71.26 +
   71.27 +    /** valid: {@value} */
   71.28 +    public static final int cInt = 0;
   71.29 +
   71.30 +    /** valid: {@value} */
   71.31 +    public static final long cLong = 0L;
   71.32 +
   71.33 +    /** valid: {@value} */
   71.34 +    public static final float cFloat = 0.0f;
   71.35 +
   71.36 +    /** valid: {@value} */
   71.37 +    public static final double cDouble = 0.0;
   71.38 +
   71.39 +    /** valid: {@value} */
   71.40 +    public static final String cString = "";
   71.41 +
   71.42 +    /** invalid class C: {@value} */
   71.43 +    public class C { }
   71.44 +
   71.45 +    /** invalid enum E: {@value} */
   71.46 +    public enum E {
   71.47 +        /** invalid enum constant E1: {@value} */
   71.48 +        E1
   71.49 +    }
   71.50 +
   71.51 +    /** invalid field 1: {@value} */
   71.52 +    public int f1;
   71.53 +
   71.54 +    /** invalid field 2: {@value} */
   71.55 +    public int f2 = 3;
   71.56 +
   71.57 +
   71.58 +    /*
   71.59 +     * Tests for {@value} with a reference
   71.60 +     */
   71.61 +
   71.62 +    /** valid: {@value Integer#SIZE} */
   71.63 +    public int intRef;
   71.64 +
   71.65 +    /** invalid method: {@value Object#toString} */
   71.66 +    public int badMethod;
   71.67 +
   71.68 +    /** invalid enum constant: {@value Thread.State#NEW} */
   71.69 +    public int badEnum;
   71.70 +}
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/test/tools/doclint/ValueTest.out	Tue Sep 24 14:35:24 2013 -0700
    72.3 @@ -0,0 +1,22 @@
    72.4 +ValueTest.java:39: error: {@value} not allowed here
    72.5 +    /** invalid class C: {@value} */
    72.6 +                         ^
    72.7 +ValueTest.java:42: error: {@value} not allowed here
    72.8 +    /** invalid enum E: {@value} */
    72.9 +                        ^
   72.10 +ValueTest.java:44: error: {@value} not allowed here
   72.11 +        /** invalid enum constant E1: {@value} */
   72.12 +                                      ^
   72.13 +ValueTest.java:48: error: {@value} not allowed here
   72.14 +    /** invalid field 1: {@value} */
   72.15 +                         ^
   72.16 +ValueTest.java:51: error: {@value} not allowed here
   72.17 +    /** invalid field 2: {@value} */
   72.18 +                         ^
   72.19 +ValueTest.java:62: error: value does not refer to a constant
   72.20 +    /** invalid method: {@value Object#toString} */
   72.21 +                        ^
   72.22 +ValueTest.java:65: error: value does not refer to a constant
   72.23 +    /** invalid enum constant: {@value Thread.State#NEW} */
   72.24 +                               ^
   72.25 +7 errors
    73.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.2 +++ b/test/tools/doclint/anchorTests/p/Test.java	Tue Sep 24 14:35:24 2013 -0700
    73.3 @@ -0,0 +1,53 @@
    73.4 +/* @test /nodynamiccopyright/
    73.5 + * @bug 8025246
    73.6 + * @summary doclint is showing error on anchor already defined when it's not
    73.7 + * @library ../..
    73.8 + * @build DocLintTester
    73.9 + * @run main DocLintTester -ref Test.out Test.java
   73.10 + * @compile/fail/ref=Test.javac.out -XDrawDiagnostics -Werror -Xdoclint:all Test.java
   73.11 + */
   73.12 +
   73.13 +package p;
   73.14 +
   73.15 +/**
   73.16 + * <a name="dupTest">dupTest</a>
   73.17 + * <a name="dupTest">dupTest again</a>
   73.18 + *
   73.19 + * <a name="dupTestField">dupTestField</a>
   73.20 + * <a name="dupTestMethod">dupTestMethod</a>
   73.21 +
   73.22 + * <a name="okClass">okClass</a>
   73.23 + * <a name="okField">okField</a>
   73.24 + * <a name="okMethod">okMethod</a>
   73.25 + */
   73.26 +public class Test {
   73.27 +    /** <a name="dupTestField">dupTestField again</a> */
   73.28 +    public int f;
   73.29 +
   73.30 +    /** <a name="dupTestMethod">dupTestMethod again</a> */
   73.31 +    public void m() { }
   73.32 +
   73.33 +    /**
   73.34 +     * <a name="dupNested">dupNested</a>
   73.35 +     * <a name="dupNested">dupNested again</a>
   73.36 +     * <a name="dupNestedField">dupNestedField</a>
   73.37 +     * <a name="dupNestedMethod">dupNestedMethod</a>
   73.38 +     *
   73.39 +     * <a name="okClass">okClass again</a>
   73.40 +     */
   73.41 +    public class Nested {
   73.42 +        /**
   73.43 +         * <a name="dupNestedField">dupNestedField</a>
   73.44 +         *
   73.45 +         * <a name="okField">okField again</a>
   73.46 +         */
   73.47 +        public int f;
   73.48 +
   73.49 +        /**
   73.50 +         * <a name="dupNestedMethod">dupNestedMethod</a>
   73.51 +         *
   73.52 +         * <a name="okMethod">okMethod again</a>
   73.53 +         */
   73.54 +        public void m() { }
   73.55 +    }
   73.56 +}
    74.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.2 +++ b/test/tools/doclint/anchorTests/p/Test.javac.out	Tue Sep 24 14:35:24 2013 -0700
    74.3 @@ -0,0 +1,7 @@
    74.4 +Test.java:14:7: compiler.err.proc.messager: anchor already defined: dupTest
    74.5 +Test.java:24:12: compiler.err.proc.messager: anchor already defined: dupTestField
    74.6 +Test.java:27:12: compiler.err.proc.messager: anchor already defined: dupTestMethod
    74.7 +Test.java:32:11: compiler.err.proc.messager: anchor already defined: dupNested
    74.8 +Test.java:40:15: compiler.err.proc.messager: anchor already defined: dupNestedField
    74.9 +Test.java:47:15: compiler.err.proc.messager: anchor already defined: dupNestedMethod
   74.10 +6 errors
    75.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.2 +++ b/test/tools/doclint/anchorTests/p/Test.out	Tue Sep 24 14:35:24 2013 -0700
    75.3 @@ -0,0 +1,19 @@
    75.4 +Test.java:14: error: anchor already defined: dupTest
    75.5 + * <a name="dupTest">dupTest again</a>
    75.6 +      ^
    75.7 +Test.java:24: error: anchor already defined: dupTestField
    75.8 +    /** <a name="dupTestField">dupTestField again</a> */
    75.9 +           ^
   75.10 +Test.java:27: error: anchor already defined: dupTestMethod
   75.11 +    /** <a name="dupTestMethod">dupTestMethod again</a> */
   75.12 +           ^
   75.13 +Test.java:32: error: anchor already defined: dupNested
   75.14 +     * <a name="dupNested">dupNested again</a>
   75.15 +          ^
   75.16 +Test.java:40: error: anchor already defined: dupNestedField
   75.17 +         * <a name="dupNestedField">dupNestedField</a>
   75.18 +              ^
   75.19 +Test.java:47: error: anchor already defined: dupNestedMethod
   75.20 +         * <a name="dupNestedMethod">dupNestedMethod</a>
   75.21 +              ^
   75.22 +6 errors
    76.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.2 +++ b/test/tools/doclint/anchorTests/p/package-info.java	Tue Sep 24 14:35:24 2013 -0700
    76.3 @@ -0,0 +1,15 @@
    76.4 +/* @test /nodynamiccopyright/
    76.5 + * @bug 8025246
    76.6 + * @summary doclint is showing error on anchor already defined when it's not
    76.7 + * @library ../..
    76.8 + * @build DocLintTester
    76.9 + * @run main DocLintTester -ref package-info.out package-info.java
   76.10 + * @compile/fail/ref=package-info.javac.out -XDrawDiagnostics -Werror -Xdoclint:all package-info.java
   76.11 + */
   76.12 +
   76.13 +/**
   76.14 + * <a name=here>here</a>
   76.15 + * <a name=here>here again</a>
   76.16 + */
   76.17 +package p;
   76.18 +
    77.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.2 +++ b/test/tools/doclint/anchorTests/p/package-info.javac.out	Tue Sep 24 14:35:24 2013 -0700
    77.3 @@ -0,0 +1,2 @@
    77.4 +package-info.java:12:7: compiler.err.proc.messager: anchor already defined: here
    77.5 +1 error
    78.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.2 +++ b/test/tools/doclint/anchorTests/p/package-info.out	Tue Sep 24 14:35:24 2013 -0700
    78.3 @@ -0,0 +1,4 @@
    78.4 +package-info.java:12: error: anchor already defined: here
    78.5 + * <a name=here>here again</a>
    78.6 +      ^
    78.7 +1 error
    79.1 --- a/test/tools/doclint/html/InlineTagsTest.java	Tue Sep 24 14:20:33 2013 -0700
    79.2 +++ b/test/tools/doclint/html/InlineTagsTest.java	Tue Sep 24 14:35:24 2013 -0700
    79.3 @@ -39,6 +39,7 @@
    79.4       *  <br>
    79.5       *  <cite> abc </cite>
    79.6       *  <code> abc </code>
    79.7 +     *  <dfn> abc </dfn>
    79.8       *  <em> abc </em>
    79.9       *  <font> abc </font>
   79.10       *  <i> abc </i>
    80.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.2 +++ b/test/tools/javac/T4881267.java	Tue Sep 24 14:35:24 2013 -0700
    80.3 @@ -0,0 +1,12 @@
    80.4 +/*
    80.5 + * @test /nodynamiccopyright/
    80.6 + * @bug 4881267
    80.7 + * @summary improve diagnostic for "instanceof T" for type parameter T
    80.8 + * @compile/fail/ref=T4881267.out -XDrawDiagnostics T4881267.java
    80.9 + */
   80.10 +
   80.11 +class T4881267 {
   80.12 +    <T> void m(Object o) {
   80.13 +        boolean b = o instanceof T;
   80.14 +    }
   80.15 +}
    81.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.2 +++ b/test/tools/javac/T4881267.out	Tue Sep 24 14:35:24 2013 -0700
    81.3 @@ -0,0 +1,2 @@
    81.4 +T4881267.java:10:34: compiler.err.illegal.generic.type.for.instof
    81.5 +1 error
    82.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.2 +++ b/test/tools/javac/T7090499.java	Tue Sep 24 14:35:24 2013 -0700
    82.3 @@ -0,0 +1,14 @@
    82.4 +/*
    82.5 + * @test /nodynamiccopyright/
    82.6 + * @bug 7090499
    82.7 + * @summary missing rawtypes warnings in anonymous inner class
    82.8 + * @compile/ref=T7090499.out -Xlint:rawtypes -XDrawDiagnostics T7090499.java
    82.9 + */
   82.10 +
   82.11 +class T7090499<X> {
   82.12 +    {
   82.13 +        new Object() {
   82.14 +            T7090499 x;
   82.15 +        };
   82.16 +    }
   82.17 +}
    83.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.2 +++ b/test/tools/javac/T7090499.out	Tue Sep 24 14:35:24 2013 -0700
    83.3 @@ -0,0 +1,2 @@
    83.4 +T7090499.java:11:13: compiler.warn.raw.class.use: T7090499, T7090499<X>
    83.5 +1 warning
    84.1 --- a/test/tools/javac/T7093325.java	Tue Sep 24 14:20:33 2013 -0700
    84.2 +++ b/test/tools/javac/T7093325.java	Tue Sep 24 14:35:24 2013 -0700
    84.3 @@ -208,7 +208,7 @@
    84.4              }
    84.5  
    84.6              int actualGapsCount = 0;
    84.7 -            for (int i = 0; i < code.exception_table_langth ; i++) {
    84.8 +            for (int i = 0; i < code.exception_table_length ; i++) {
    84.9                  int catchType = code.exception_table[i].catch_type;
   84.10                  if (catchType == 0) { //any
   84.11                      actualGapsCount++;
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/test/tools/javac/T7120463.java	Tue Sep 24 14:35:24 2013 -0700
    85.3 @@ -0,0 +1,11 @@
    85.4 +/*
    85.5 + * @test /nodynamiccopyright/
    85.6 + * @bug 7120463
    85.7 + * @summary Fix method reference parser support in order to avoid ambiguities
    85.8 + * @compile/fail/ref=T7120463.out -XDrawDiagnostics T7120463.java
    85.9 + */
   85.10 +
   85.11 +class T7120463 {
   85.12 +    void test() { that(i < len, "oopmap"); }
   85.13 +    void that(int i, String s) { };
   85.14 +}
    86.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.2 +++ b/test/tools/javac/T7120463.out	Tue Sep 24 14:35:24 2013 -0700
    86.3 @@ -0,0 +1,3 @@
    86.4 +T7120463.java:9:24: compiler.err.cant.resolve.location: kindname.variable, i, , , (compiler.misc.location: kindname.class, T7120463, null)
    86.5 +T7120463.java:9:28: compiler.err.cant.resolve.location: kindname.variable, len, , , (compiler.misc.location: kindname.class, T7120463, null)
    86.6 +2 errors
    87.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.2 +++ b/test/tools/javac/T7126754.java	Tue Sep 24 14:35:24 2013 -0700
    87.3 @@ -0,0 +1,19 @@
    87.4 +/*
    87.5 + * @test /nodynamiccopyright/
    87.6 + * @bug 7126754
    87.7 + * @summary Generics compilation failure casting List<? extends Set...> to List<Set...>
    87.8 + * @compile T7126754.java
    87.9 + */
   87.10 +
   87.11 +import java.util.List;
   87.12 +import java.util.Set;
   87.13 +
   87.14 +public class T7126754 {
   87.15 +  public static void main(String[] args) {
   87.16 +    List<Set<? extends String>> a = null;
   87.17 +    List<? extends Set<? extends String>> b = a;
   87.18 +
   87.19 +    List<? extends Set<? extends String>> c = null;
   87.20 +    List<Set<? extends String>> d = (List<Set<? extends String>>)c;
   87.21 +  }
   87.22 +}
    88.1 --- a/test/tools/javac/T8024039/NoDeadCodeGenerationOnTrySmtTest.java	Tue Sep 24 14:20:33 2013 -0700
    88.2 +++ b/test/tools/javac/T8024039/NoDeadCodeGenerationOnTrySmtTest.java	Tue Sep 24 14:35:24 2013 -0700
    88.3 @@ -100,7 +100,7 @@
    88.4                  if (method.getName(classFile.constant_pool).equals(methodToFind)) {
    88.5                      numberOfmethodsFound++;
    88.6                      Code_attribute code = (Code_attribute) method.attributes.get("Code");
    88.7 -                    Assert.check(code.exception_table_langth == expectedExceptionTable.length,
    88.8 +                    Assert.check(code.exception_table_length == expectedExceptionTable.length,
    88.9                              "The ExceptionTable found has a length different to the expected one");
   88.10                      int i = 0;
   88.11                      for (Exception_data entry: code.exception_table) {
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/test/tools/javac/T8024437/ExceptionInferenceFromClassFileTest.java	Tue Sep 24 14:35:24 2013 -0700
    89.3 @@ -0,0 +1,74 @@
    89.4 +/*
    89.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    89.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    89.7 + *
    89.8 + * This code is free software; you can redistribute it and/or modify it
    89.9 + * under the terms of the GNU General Public License version 2 only, as
   89.10 + * published by the Free Software Foundation.  Oracle designates this
   89.11 + * particular file as subject to the "Classpath" exception as provided
   89.12 + * by Oracle in the LICENSE file that accompanied this code.
   89.13 + *
   89.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   89.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   89.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   89.17 + * version 2 for more details (a copy is included in the LICENSE file that
   89.18 + * accompanied this code).
   89.19 + *
   89.20 + * You should have received a copy of the GNU General Public License version
   89.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   89.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   89.23 + *
   89.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   89.25 + * or visit www.oracle.com if you need additional information or have any
   89.26 + * questions.
   89.27 + */
   89.28 +
   89.29 +/*
   89.30 + * @test
   89.31 + * @bug 8024437
   89.32 + * @summary Inferring the exception thrown by a lambda: sometimes fails to compile
   89.33 + * @library /tools/javac/lib
   89.34 + * @build ToolBox
   89.35 + * @run main ExceptionInferenceFromClassFileTest
   89.36 + */
   89.37 +
   89.38 +import java.nio.file.Files;
   89.39 +import java.nio.file.Paths;
   89.40 +
   89.41 +public class ExceptionInferenceFromClassFileTest {
   89.42 +
   89.43 +    static final String ABSrc =
   89.44 +            "class B {\n" +
   89.45 +            "    public static <E extends Throwable> void t(A<E> a) throws E {\n" +
   89.46 +            "        a.run();\n" +
   89.47 +            "    }\n" +
   89.48 +            "}\n" +
   89.49 +
   89.50 +            "interface A<E extends Throwable> {\n" +
   89.51 +            "    void run() throws E;\n" +
   89.52 +            "}";
   89.53 +
   89.54 +    static final String CSrc =
   89.55 +            "class C {\n" +
   89.56 +            "    public void d() {\n" +
   89.57 +            "        B.t(null);\n" +
   89.58 +            "    }\n" +
   89.59 +            "}";
   89.60 +
   89.61 +    public static void main(String[] args) throws Exception {
   89.62 +        Files.createDirectory(Paths.get("out"));
   89.63 +
   89.64 +        ToolBox.JavaToolArgs compileABParams =
   89.65 +                new ToolBox.JavaToolArgs()
   89.66 +                .setOptions("-d", "out")
   89.67 +                .setSources(ABSrc);
   89.68 +        ToolBox.javac(compileABParams);
   89.69 +
   89.70 +        ToolBox.JavaToolArgs compileCParams =
   89.71 +                new ToolBox.JavaToolArgs()
   89.72 +                .setOptions("-d", "out", "-cp", "out")
   89.73 +                .setSources(CSrc);
   89.74 +        ToolBox.javac(compileCParams);
   89.75 +    }
   89.76 +
   89.77 +}
    90.1 --- a/test/tools/javac/cast/intersection/IntersectionTypeCastTest.java	Tue Sep 24 14:20:33 2013 -0700
    90.2 +++ b/test/tools/javac/cast/intersection/IntersectionTypeCastTest.java	Tue Sep 24 14:35:24 2013 -0700
    90.3 @@ -237,7 +237,7 @@
    90.4      }
    90.5  
    90.6      static List<CastInfo> allCastInfo() {
    90.7 -        ListBuffer<CastInfo> buf = ListBuffer.lb();
    90.8 +        ListBuffer<CastInfo> buf = new ListBuffer<>();
    90.9          for (CastKind kind : CastKind.values()) {
   90.10              for (ClassKind clazz : ClassKind.values()) {
   90.11                  if (kind == CastKind.INTERFACE && clazz != ClassKind.OBJECT) {
    91.1 --- a/test/tools/javac/cast/intersection/model/Model01.java	Tue Sep 24 14:20:33 2013 -0700
    91.2 +++ b/test/tools/javac/cast/intersection/model/Model01.java	Tue Sep 24 14:35:24 2013 -0700
    91.3 @@ -23,7 +23,7 @@
    91.4  
    91.5  /*
    91.6   * @test
    91.7 - * @bug 8002099
    91.8 + * @bug 8002099 6499673
    91.9   * @summary Add support for intersection types in cast expression
   91.10   * @library /tools/javac/lib
   91.11   * @build JavacTestingAbstractProcessor ModelChecker
   91.12 @@ -46,7 +46,7 @@
   91.13      }
   91.14  
   91.15      void test(){
   91.16 -        @IntersectionTypeInfo({"java.lang.Object", "Test.A", "Test.B"})
   91.17 +        @IntersectionTypeInfo({"Test.A", "Test.B"})
   91.18          Object o = (A & B)null;
   91.19      }
   91.20  }
    92.1 --- a/test/tools/javac/cast/intersection/model/ModelChecker.java	Tue Sep 24 14:20:33 2013 -0700
    92.2 +++ b/test/tools/javac/cast/intersection/model/ModelChecker.java	Tue Sep 24 14:35:24 2013 -0700
    92.3 @@ -97,7 +97,7 @@
    92.4                  }
    92.5              }
    92.6  
    92.7 -            assertTrue(assertionCount == 10, "Expected 10 assertions - found " + assertionCount);
    92.8 +            assertTrue(assertionCount == 9, "Expected 9 assertions - found " + assertionCount);
    92.9              return super.visitVariable(node, p);
   92.10          }
   92.11      }
    93.1 --- a/test/tools/javac/flow/LVTHarness.java	Tue Sep 24 14:20:33 2013 -0700
    93.2 +++ b/test/tools/javac/flow/LVTHarness.java	Tue Sep 24 14:35:24 2013 -0700
    93.3 @@ -64,6 +64,7 @@
    93.4  
    93.5  import static javax.tools.StandardLocation.*;
    93.6  import static com.sun.tools.classfile.LocalVariableTable_attribute.Entry;
    93.7 +import static javax.tools.JavaFileObject.Kind.SOURCE;
    93.8  
    93.9  public class LVTHarness {
   93.10  
   93.11 @@ -73,10 +74,14 @@
   93.12      static final StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
   93.13  
   93.14      public static void main(String[] args) throws Exception {
   93.15 -        fm.setLocation(SOURCE_PATH,
   93.16 -                Arrays.asList(new File(System.getProperty("test.src"), "tests")));
   93.17 -        for (JavaFileObject jfo : fm.list(SOURCE_PATH, "",
   93.18 -                Collections.singleton(JavaFileObject.Kind.SOURCE), true)) {
   93.19 +
   93.20 +        String testDir = System.getProperty("test.src");
   93.21 +        fm.setLocation(SOURCE_PATH, Arrays.asList(new File(testDir, "tests")));
   93.22 +
   93.23 +        // Make sure classes are written to scratch dir.
   93.24 +        fm.setLocation(CLASS_OUTPUT, Arrays.asList(new File(".")));
   93.25 +
   93.26 +        for (JavaFileObject jfo : fm.list(SOURCE_PATH, "", Collections.singleton(SOURCE), true)) {
   93.27              new LVTHarness(jfo).check();
   93.28          }
   93.29          if (nerrors > 0) {
   93.30 @@ -86,8 +91,7 @@
   93.31  
   93.32  
   93.33      JavaFileObject jfo;
   93.34 -    Map<ElementKey, AliveRanges> aliveRangeMap =
   93.35 -            new HashMap<ElementKey, AliveRanges>();
   93.36 +    Map<ElementKey, AliveRanges> aliveRangeMap = new HashMap<>();
   93.37      Set<String> declaredKeys = new HashSet<>();
   93.38      List<ElementKey> seenAliveRanges = new ArrayList<>();
   93.39  
   93.40 @@ -96,15 +100,19 @@
   93.41      }
   93.42  
   93.43      protected void check() throws Exception {
   93.44 -        JavacTask ct = (JavacTask)comp.getTask(null, fm, null, Arrays.asList("-g"),
   93.45 -                null, Arrays.asList(jfo));
   93.46 -        System.err.println("compiling code " + jfo.toString());
   93.47 +
   93.48 +        JavacTask ct = (JavacTask) comp.getTask(null, fm, null, Arrays.asList("-g"),
   93.49 +                                                null, Arrays.asList(jfo));
   93.50 +        System.err.println("compiling code " + jfo);
   93.51          ct.setProcessors(Collections.singleton(new AliveRangeFinder()));
   93.52          if (!ct.call()) {
   93.53              throw new AssertionError("Error during compilation");
   93.54          }
   93.55  
   93.56 -        checkClassFile(new File(jfo.getName().replace(".java", ".class")));
   93.57 +
   93.58 +        File javaFile = new File(jfo.getName());
   93.59 +        File classFile = new File(javaFile.getName().replace(".java", ".class"));
   93.60 +        checkClassFile(classFile);
   93.61  
   93.62          //check all candidates have been used up
   93.63          for (Map.Entry<ElementKey, AliveRanges> entry : aliveRangeMap.entrySet()) {
    94.1 --- a/test/tools/javac/lambda/8023558/T8023558a.java	Tue Sep 24 14:20:33 2013 -0700
    94.2 +++ b/test/tools/javac/lambda/8023558/T8023558a.java	Tue Sep 24 14:35:24 2013 -0700
    94.3 @@ -31,8 +31,14 @@
    94.4          T get();
    94.5      }
    94.6  
    94.7 +    static class K<T> implements SAM<T> {
    94.8 +        public T get() {
    94.9 +            return (T)this;
   94.10 +        }
   94.11 +    }
   94.12 +
   94.13      public static void main(String[] args) {
   94.14 -        SAM<SAM> sam = new SAM<SAM>() { public SAM get() { return null; } };
   94.15 +        SAM<SAM> sam = new SAM<SAM>() { public SAM get() { return new K<>(); } };
   94.16          SAM temp = sam.get()::get;
   94.17      }
   94.18  }
    95.1 --- a/test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java	Tue Sep 24 14:20:33 2013 -0700
    95.2 +++ b/test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java	Tue Sep 24 14:35:24 2013 -0700
    95.3 @@ -1,5 +1,5 @@
    95.4  /*
    95.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    95.6 + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
    95.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    95.8   *
    95.9   * This code is free software; you can redistribute it and/or modify it
   95.10 @@ -196,7 +196,7 @@
   95.11      }
   95.12  
   95.13      static List<CastInfo> allCastInfo() {
   95.14 -        ListBuffer<CastInfo> buf = ListBuffer.lb();
   95.15 +        ListBuffer<CastInfo> buf = new ListBuffer<>();
   95.16          for (CastKind kind : CastKind.values()) {
   95.17              for (TypeKind b1 : TypeKind.values()) {
   95.18                  if (kind.nbounds == 1) {
    96.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.2 +++ b/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceNullCheckTest.java	Tue Sep 24 14:35:24 2013 -0700
    96.3 @@ -0,0 +1,47 @@
    96.4 +/*
    96.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    96.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    96.7 + *
    96.8 + * This code is free software; you can redistribute it and/or modify it
    96.9 + * under the terms of the GNU General Public License version 2 only, as
   96.10 + * published by the Free Software Foundation.  Oracle designates this
   96.11 + * particular file as subject to the "Classpath" exception as provided
   96.12 + * by Oracle in the LICENSE file that accompanied this code.
   96.13 + *
   96.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   96.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   96.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   96.17 + * version 2 for more details (a copy is included in the LICENSE file that
   96.18 + * accompanied this code).
   96.19 + *
   96.20 + * You should have received a copy of the GNU General Public License version
   96.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   96.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   96.23 + *
   96.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   96.25 + * or visit www.oracle.com if you need additional information or have any
   96.26 + * questions.
   96.27 + */
   96.28 +
   96.29 +/**
   96.30 + * @test
   96.31 + * @bug 8024696
   96.32 + * @summary Missing null check in bound method reference capture
   96.33 + */
   96.34 +
   96.35 +import com.sun.tools.javac.util.Assert;
   96.36 +import java.util.function.*;
   96.37 +
   96.38 +public class MethodReferenceNullCheckTest {
   96.39 +    public static void main(String[] args) {
   96.40 +        String s = null;
   96.41 +        boolean npeFired = false;
   96.42 +        try {
   96.43 +            Supplier<Boolean> ss = s::isEmpty;
   96.44 +        } catch (NullPointerException npe) {
   96.45 +            npeFired = true;
   96.46 +        } finally {
   96.47 +            Assert.check(npeFired, "NPE should have been thrown");
   96.48 +        }
   96.49 +    }
   96.50 +}
    97.1 --- a/test/tools/javac/multicatch/Pos05.java	Tue Sep 24 14:20:33 2013 -0700
    97.2 +++ b/test/tools/javac/multicatch/Pos05.java	Tue Sep 24 14:35:24 2013 -0700
    97.3 @@ -95,7 +95,7 @@
    97.4                  throw new Error("Code attribute for test() method not found");
    97.5              }
    97.6              Exception_data firstExceptionTable = null;
    97.7 -            for (int i = 0 ; i < ea.exception_table_langth; i++) {
    97.8 +            for (int i = 0 ; i < ea.exception_table_length; i++) {
    97.9                  if (firstExceptionTable == null) {
   97.10                      firstExceptionTable = ea.exception_table[i];
   97.11                  }
    98.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.2 +++ b/test/tools/javac/processing/model/type/BoundsTest.java	Tue Sep 24 14:35:24 2013 -0700
    98.3 @@ -0,0 +1,200 @@
    98.4 +/*
    98.5 + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
    98.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    98.7 + *
    98.8 + * This code is free software; you can redistribute it and/or modify it
    98.9 + * under the terms of the GNU General Public License version 2 only, as
   98.10 + * published by the Free Software Foundation.
   98.11 + *
   98.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   98.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   98.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   98.15 + * version 2 for more details (a copy is included in the LICENSE file that
   98.16 + * accompanied this code).
   98.17 + *
   98.18 + * You should have received a copy of the GNU General Public License version
   98.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   98.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   98.21 + *
   98.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   98.23 + * or visit www.oracle.com if you need additional information or have any
   98.24 + * questions.
   98.25 + */
   98.26 +
   98.27 +/*
   98.28 + * @test
   98.29 + * @bug 6499673
   98.30 + * @library /tools/javac/lib
   98.31 + * @build JavacTestingAbstractProcessor BoundsTest
   98.32 + * @run main BoundsTest
   98.33 + * @summary Assertion check for TypeVariable.getUpperBound() fails
   98.34 + */
   98.35 +
   98.36 +import com.sun.source.util.*;
   98.37 +import com.sun.tools.javac.api.*;
   98.38 +import com.sun.tools.javac.file.*;
   98.39 +import javax.annotation.processing.*;
   98.40 +import javax.lang.model.SourceVersion;
   98.41 +import javax.lang.model.type.*;
   98.42 +import javax.lang.model.util.ElementFilter;
   98.43 +import javax.lang.model.element.*;
   98.44 +import javax.tools.*;
   98.45 +import java.util.*;
   98.46 +import java.io.*;
   98.47 +
   98.48 +public class BoundsTest {
   98.49 +
   98.50 +    private int errors = 0;
   98.51 +    private static final String Intersection_name = "IntersectionTest.java";
   98.52 +    private static final String Intersection_contents =
   98.53 +        "import java.util.List;\n" +
   98.54 +        "import java.io.Serializable;\t" +
   98.55 +        "public class IntersectionTest<S extends List & Serializable> {\n" +
   98.56 +        "  void method(S s) { }\n" +
   98.57 +        "}";
   98.58 +    private static final String[] Intersection_bounds = {
   98.59 +        "java.util.List",
   98.60 +        "java.io.Serializable"
   98.61 +    };
   98.62 +    private static final String[] Intersection_supers = {
   98.63 +        "java.util.List",
   98.64 +        "java.io.Serializable"
   98.65 +    };
   98.66 +
   98.67 +    private static final String Single_name = "SingleTest.java";
   98.68 +    private static final String Single_contents =
   98.69 +        "import java.util.List;\n" +
   98.70 +        "public class SingleTest<S extends List> {\n" +
   98.71 +        "  void method(S s) { }\n" +
   98.72 +        "}";
   98.73 +    private static final String[] Single_bounds = {
   98.74 +        "java.util.List",
   98.75 +    };
   98.76 +    private static final String[] Single_supers = {
   98.77 +        "java.lang.Object",
   98.78 +        "java.util.Collection"
   98.79 +    };
   98.80 +
   98.81 +    private static final String NoBounds_name = "NoBoundsTest.java";
   98.82 +    private static final String NoBounds_contents =
   98.83 +        "public class NoBoundsTest<S> {\n" +
   98.84 +        "  void method(S s) { }\n" +
   98.85 +        "}";
   98.86 +    private static final String[] NoBounds_bounds = {
   98.87 +        "java.lang.Object",
   98.88 +    };
   98.89 +    private static final String[] NoBounds_supers = {};
   98.90 +
   98.91 +    private HashSet<CharSequence> expected_bounds;
   98.92 +    private HashSet<CharSequence> expected_supers;
   98.93 +
   98.94 +    private static final File classesdir = new File("intersectionproperties");
   98.95 +    private static final JavaCompiler comp =
   98.96 +        ToolProvider.getSystemJavaCompiler();
   98.97 +    private static final StandardJavaFileManager fm =
   98.98 +        comp.getStandardFileManager(null, null, null);
   98.99 +
  98.100 +    public void runOne(final String Test_name, final String Test_contents,
  98.101 +                       final String[] Test_bounds, final String[] Test_supers)
  98.102 +        throws IOException {
  98.103 +        System.err.println("Testing " + Test_name);
  98.104 +        expected_bounds = new HashSet<CharSequence>(Arrays.asList(Test_bounds));
  98.105 +        expected_supers = new HashSet<CharSequence>(Arrays.asList(Test_supers));
  98.106 +        final Iterable<? extends JavaFileObject> files =
  98.107 +            fm.getJavaFileObjectsFromFiles(Collections.singleton(writeFile(classesdir, Test_name, Test_contents)));
  98.108 +        final JavacTask ct =
  98.109 +            (JavacTask)comp.getTask(null, fm, null, null, null, files);
  98.110 +        ct.setProcessors(Collections.singleton(new TestProcessor()));
  98.111 +
  98.112 +        if (!ct.call()) {
  98.113 +            System.err.println("Compilation unexpectedly failed");
  98.114 +            errors++;
  98.115 +        }
  98.116 +    }
  98.117 +
  98.118 +    public void run() throws IOException {
  98.119 +        runOne(Intersection_name, Intersection_contents,
  98.120 +               Intersection_bounds, Intersection_supers);
  98.121 +        runOne(Single_name, Single_contents,
  98.122 +               Single_bounds, Single_supers);
  98.123 +        runOne(NoBounds_name, NoBounds_contents,
  98.124 +               NoBounds_bounds, NoBounds_supers);
  98.125 +
  98.126 +        if (0 != errors)
  98.127 +            throw new RuntimeException(errors + " errors occurred");
  98.128 +    }
  98.129 +
  98.130 +    public static void main(String... args) throws IOException {
  98.131 +        new IntersectionPropertiesTest().run();
  98.132 +    }
  98.133 +
  98.134 +    private static File writeFile(File dir, String path, String body)
  98.135 +        throws IOException {
  98.136 +        File f = new File(dir, path);
  98.137 +        f.getParentFile().mkdirs();
  98.138 +        try (FileWriter out = new FileWriter(f)) {
  98.139 +            out.write(body);
  98.140 +        }
  98.141 +        return f;
  98.142 +    }
  98.143 +
  98.144 +    private class TestProcessor extends JavacTestingAbstractProcessor {
  98.145 +
  98.146 +        private Set<? extends Element> rootElements;
  98.147 +
  98.148 +        public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  98.149 +            rootElements = roundEnv.getRootElements();
  98.150 +            if (!rootElements.isEmpty()) {
  98.151 +                performCheck();
  98.152 +            }
  98.153 +            return true;
  98.154 +        }
  98.155 +
  98.156 +        private void performCheck() {
  98.157 +            TypeElement typeElement = (TypeElement) rootElements.iterator().next();
  98.158 +            ExecutableElement method = ElementFilter.methodsIn(typeElement.getEnclosedElements()).get(0);
  98.159 +            TypeVariable typeVariable = (TypeVariable) method.getParameters().get(0).asType();
  98.160 +
  98.161 +            final TypeMirror upperBound = typeVariable.getUpperBound();
  98.162 +
  98.163 +            TypeParameterElement typeParameterElement = ((TypeParameterElement) typeVariable.asElement());
  98.164 +            final List<? extends TypeMirror> bounds = typeParameterElement.getBounds();
  98.165 +            final List<? extends TypeMirror> supers = processingEnv.getTypeUtils().directSupertypes(upperBound);
  98.166 +
  98.167 +            final HashSet<CharSequence> actual_bounds = new HashSet<CharSequence>();
  98.168 +            final HashSet<CharSequence> actual_supers = new HashSet<CharSequence>();
  98.169 +
  98.170 +            for(TypeMirror ty : bounds) {
  98.171 +                actual_bounds.add(((TypeElement)((DeclaredType)ty).asElement()).getQualifiedName());
  98.172 +            }
  98.173 +
  98.174 +            for(TypeMirror ty : supers) {
  98.175 +                actual_supers.add(((TypeElement)((DeclaredType)ty).asElement()).getQualifiedName());
  98.176 +            }
  98.177 +
  98.178 +
  98.179 +            if (!expected_bounds.equals(actual_bounds)) {
  98.180 +                System.err.println("Mismatched expected and actual bounds.");
  98.181 +                System.err.println("Expected:");
  98.182 +                for(CharSequence tm : expected_bounds)
  98.183 +                    System.err.println("  " + tm);
  98.184 +                System.err.println("Actual:");
  98.185 +                for(CharSequence tm : actual_bounds)
  98.186 +                    System.err.println("  " + tm);
  98.187 +                errors++;
  98.188 +            }
  98.189 +
  98.190 +            if (!expected_supers.equals(actual_supers)) {
  98.191 +                System.err.println("Mismatched expected and actual bounds.");
  98.192 +                System.err.println("Expected:");
  98.193 +                for(CharSequence tm : expected_supers)
  98.194 +                    System.err.println("  " + tm);
  98.195 +                System.err.println("Actual:");
  98.196 +                for(CharSequence tm : actual_supers)
  98.197 +                    System.err.println("  " + tm);
  98.198 +                errors++;
  98.199 +            }
  98.200 +        }
  98.201 +    }
  98.202 +
  98.203 +}
    99.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.2 +++ b/test/tools/javac/processing/model/type/IntersectionPropertiesTest.java	Tue Sep 24 14:35:24 2013 -0700
    99.3 @@ -0,0 +1,135 @@
    99.4 +/*
    99.5 + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
    99.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    99.7 + *
    99.8 + * This code is free software; you can redistribute it and/or modify it
    99.9 + * under the terms of the GNU General Public License version 2 only, as
   99.10 + * published by the Free Software Foundation.
   99.11 + *
   99.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   99.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   99.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   99.15 + * version 2 for more details (a copy is included in the LICENSE file that
   99.16 + * accompanied this code).
   99.17 + *
   99.18 + * You should have received a copy of the GNU General Public License version
   99.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   99.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   99.21 + *
   99.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   99.23 + * or visit www.oracle.com if you need additional information or have any
   99.24 + * questions.
   99.25 + */
   99.26 +
   99.27 +/*
   99.28 + * @test
   99.29 + * @bug 6499673
   99.30 + * @library /tools/javac/lib
   99.31 + * @build JavacTestingAbstractProcessor IntersectionPropertiesTest
   99.32 + * @run main IntersectionPropertiesTest
   99.33 + * @summary Assertion check for TypeVariable.getUpperBound() fails
   99.34 + */
   99.35 +
   99.36 +import com.sun.source.util.*;
   99.37 +import com.sun.tools.javac.api.*;
   99.38 +import com.sun.tools.javac.file.*;
   99.39 +import javax.annotation.processing.*;
   99.40 +import javax.lang.model.SourceVersion;
   99.41 +import javax.lang.model.type.*;
   99.42 +import javax.lang.model.util.ElementFilter;
   99.43 +import javax.lang.model.element.*;
   99.44 +import javax.tools.*;
   99.45 +import java.util.*;
   99.46 +import java.io.*;
   99.47 +
   99.48 +public class IntersectionPropertiesTest {
   99.49 +
   99.50 +    private int errors = 0;
   99.51 +    private static final String Intersection_name = "IntersectionTest.java";
   99.52 +    private static final String Intersection_contents =
   99.53 +        "import java.util.List;\n" +
   99.54 +        "import java.io.Serializable;\t" +
   99.55 +        "public class IntersectionTest<S extends List & Serializable> {\n" +
   99.56 +        "  void method(S s) { }\n" +
   99.57 +        "}";
   99.58 +
   99.59 +    private static final File classesdir = new File("intersectionproperties");
   99.60 +    private static final JavaCompiler comp =
   99.61 +        ToolProvider.getSystemJavaCompiler();
   99.62 +    private static final StandardJavaFileManager fm =
   99.63 +        comp.getStandardFileManager(null, null, null);
   99.64 +
   99.65 +    public void runOne(final String Test_name, final String Test_contents)
   99.66 +        throws IOException {
   99.67 +        System.err.println("Testing " + Test_name);
   99.68 +        final Iterable<? extends JavaFileObject> files =
   99.69 +            fm.getJavaFileObjectsFromFiles(Collections.singleton(writeFile(classesdir, Test_name, Test_contents)));
   99.70 +        final JavacTask ct =
   99.71 +            (JavacTask)comp.getTask(null, fm, null, null, null, files);
   99.72 +        ct.setProcessors(Collections.singleton(new TestProcessor()));
   99.73 +
   99.74 +        if (!ct.call()) {
   99.75 +            System.err.println("Compilation unexpectedly failed");
   99.76 +            errors++;
   99.77 +        }
   99.78 +    }
   99.79 +
   99.80 +    public void run() throws IOException {
   99.81 +        runOne(Intersection_name, Intersection_contents);
   99.82 +
   99.83 +        if (0 != errors)
   99.84 +            throw new RuntimeException(errors + " errors occurred");
   99.85 +    }
   99.86 +
   99.87 +    public static void main(String... args) throws IOException {
   99.88 +        new IntersectionPropertiesTest().run();
   99.89 +    }
   99.90 +
   99.91 +    private static File writeFile(File dir, String path, String body)
   99.92 +        throws IOException {
   99.93 +        File f = new File(dir, path);
   99.94 +        f.getParentFile().mkdirs();
   99.95 +        try (FileWriter out = new FileWriter(f)) {
   99.96 +            out.write(body);
   99.97 +        }
   99.98 +        return f;
   99.99 +    }
  99.100 +
  99.101 +    private class TestProcessor extends JavacTestingAbstractProcessor {
  99.102 +
  99.103 +        private Set<? extends Element> rootElements;
  99.104 +
  99.105 +        public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  99.106 +            rootElements = roundEnv.getRootElements();
  99.107 +            if (!rootElements.isEmpty()) {
  99.108 +                performCheck();
  99.109 +            }
  99.110 +            return true;
  99.111 +        }
  99.112 +
  99.113 +        private void performCheck() {
  99.114 +            TypeElement typeElement = (TypeElement) rootElements.iterator().next();
  99.115 +            ExecutableElement method = ElementFilter.methodsIn(typeElement.getEnclosedElements()).get(0);
  99.116 +            TypeVariable typeVariable = (TypeVariable) method.getParameters().get(0).asType();
  99.117 +
  99.118 +            final TypeMirror upperBound = typeVariable.getUpperBound();
  99.119 +
  99.120 +            TypeParameterElement typeParameterElement = ((TypeParameterElement) typeVariable.asElement());
  99.121 +            final List<? extends TypeMirror> bounds = typeParameterElement.getBounds();
  99.122 +            final HashSet<TypeMirror> actual = new HashSet<TypeMirror>(processingEnv.getTypeUtils().directSupertypes(upperBound));
  99.123 +            final HashSet<TypeMirror> expected = new HashSet<TypeMirror>(bounds);
  99.124 +            if (!expected.equals(actual)) {
  99.125 +                System.err.println("Mismatched expected and actual bounds.");
  99.126 +                System.err.println("Expected:");
  99.127 +                for(TypeMirror tm : expected)
  99.128 +                    System.err.println("  " + tm);
  99.129 +                System.err.println("Actual:");
  99.130 +                for(TypeMirror tm : actual)
  99.131 +                    System.err.println("  " + tm);
  99.132 +                errors++;
  99.133 +            }
  99.134 +        }
  99.135 +
  99.136 +    }
  99.137 +
  99.138 +}
   100.1 --- a/test/tools/javac/scope/7017664/CompoundScopeTest.java	Tue Sep 24 14:20:33 2013 -0700
   100.2 +++ b/test/tools/javac/scope/7017664/CompoundScopeTest.java	Tue Sep 24 14:35:24 2013 -0700
   100.3 @@ -176,7 +176,7 @@
   100.4           */
   100.5          void checkElems(CompoundScope cs, Filter<Symbol> sf) {
   100.6              int count = 0;
   100.7 -            ListBuffer<Symbol> found = ListBuffer.lb();
   100.8 +            ListBuffer<Symbol> found = new ListBuffer<>();
   100.9              List<Symbol> allSymbols = sf == null ?
  100.10                      elems :
  100.11                      filter(elems, sf);
  100.12 @@ -216,7 +216,7 @@
  100.13          }
  100.14  
  100.15          List<Symbol> filter(List<Symbol> elems, Filter<Symbol> sf) {
  100.16 -            ListBuffer<Symbol> res = ListBuffer.lb();
  100.17 +            ListBuffer<Symbol> res = new ListBuffer<>();
  100.18              for (Symbol s : elems) {
  100.19                  if (sf.accepts(s)) {
  100.20                      res.append(s);
   101.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.2 +++ b/test/tools/javac/tree/MakeQualIdent.java	Tue Sep 24 14:35:24 2013 -0700
   101.3 @@ -0,0 +1,77 @@
   101.4 +/*
   101.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
   101.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   101.7 + *
   101.8 + * This code is free software; you can redistribute it and/or modify it
   101.9 + * under the terms of the GNU General Public License version 2 only, as
  101.10 + * published by the Free Software Foundation.
  101.11 + *
  101.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
  101.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  101.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  101.15 + * version 2 for more details (a copy is included in the LICENSE file that
  101.16 + * accompanied this code).
  101.17 + *
  101.18 + * You should have received a copy of the GNU General Public License version
  101.19 + * 2 along with this work; if not, write to the Free Software Foundation,
  101.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  101.21 + *
  101.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  101.23 + * or visit www.oracle.com if you need additional information or have any
  101.24 + * questions.
  101.25 + */
  101.26 +
  101.27 +/*
  101.28 + * @test
  101.29 + * @bug     8023835
  101.30 + * @summary Verify that TreeMaker.QualIdent(Symbol) field access cascade ends with
  101.31 + *          the top-level package (when no toplevel is set in TreeMaker)
  101.32 + * @run main MakeQualIdent
  101.33 + */
  101.34 +
  101.35 +import com.sun.source.tree.IdentifierTree;
  101.36 +import com.sun.source.tree.MemberSelectTree;
  101.37 +import com.sun.source.tree.Tree;
  101.38 +import com.sun.source.util.JavacTask;
  101.39 +import com.sun.source.util.TreeScanner;
  101.40 +import com.sun.tools.javac.api.JavacTaskImpl;
  101.41 +import com.sun.tools.javac.api.JavacTool;
  101.42 +import com.sun.tools.javac.code.Symtab;
  101.43 +import com.sun.tools.javac.tree.TreeMaker;
  101.44 +import com.sun.tools.javac.util.Context;
  101.45 +import java.util.ArrayList;
  101.46 +
  101.47 +public class MakeQualIdent {
  101.48 +    public static void main(String... args) throws Exception {
  101.49 +        JavacTool tool = JavacTool.create();
  101.50 +        JavacTask task = tool.getTask(null, null, null, new ArrayList<String>(), null, null);
  101.51 +        Context ctx = ((JavacTaskImpl)task).getContext();
  101.52 +        TreeMaker treeMaker = TreeMaker.instance(ctx);
  101.53 +        Symtab syms = Symtab.instance(ctx);
  101.54 +
  101.55 +        String stringTree = printTree(treeMaker.QualIdent(syms.stringType.tsym));
  101.56 +
  101.57 +        if (!"java.lang.String".equals(stringTree)) {
  101.58 +            throw new IllegalStateException(stringTree);
  101.59 +        }
  101.60 +    }
  101.61 +
  101.62 +    private static String printTree(Tree tree) {
  101.63 +        final StringBuilder result = new StringBuilder();
  101.64 +
  101.65 +        new TreeScanner<Void, Void>() {
  101.66 +            @Override public Void visitIdentifier(IdentifierTree node, Void p) {
  101.67 +                result.append(node.getName());
  101.68 +                return super.visitIdentifier(node, p);
  101.69 +            }
  101.70 +            @Override public Void visitMemberSelect(MemberSelectTree node, Void p) {
  101.71 +                scan(node.getExpression(), null);
  101.72 +                result.append(".");
  101.73 +                result.append(node.getIdentifier());
  101.74 +                return null;
  101.75 +            }
  101.76 +        }.scan(tree, null);
  101.77 +
  101.78 +        return result.toString();
  101.79 +    }
  101.80 +}
   102.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.2 +++ b/test/tools/javac/tree/ScopeTest.java	Tue Sep 24 14:35:24 2013 -0700
   102.3 @@ -0,0 +1,114 @@
   102.4 +/*
   102.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
   102.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   102.7 + *
   102.8 + * This code is free software; you can redistribute it and/or modify it
   102.9 + * under the terms of the GNU General Public License version 2 only, as
  102.10 + * published by the Free Software Foundation.
  102.11 + *
  102.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
  102.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  102.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  102.15 + * version 2 for more details (a copy is included in the LICENSE file that
  102.16 + * accompanied this code).
  102.17 + *
  102.18 + * You should have received a copy of the GNU General Public License version
  102.19 + * 2 along with this work; if not, write to the Free Software Foundation,
  102.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  102.21 + *
  102.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  102.23 + * or visit www.oracle.com if you need additional information or have any
  102.24 + * questions.
  102.25 + */
  102.26 +
  102.27 +/*
  102.28 + * @test
  102.29 + * @bug     8023835
  102.30 + * @summary Verify that implicit type of lambda parameter is correctly attributed
  102.31 + *          in Scope
  102.32 + * @run main ScopeTest
  102.33 + */
  102.34 +
  102.35 +import com.sun.source.tree.CompilationUnitTree;
  102.36 +import com.sun.source.tree.MemberSelectTree;
  102.37 +import com.sun.source.tree.Scope;
  102.38 +import com.sun.source.util.JavacTask;
  102.39 +import com.sun.source.util.TreePath;
  102.40 +import com.sun.source.util.TreePathScanner;
  102.41 +import com.sun.source.util.Trees;
  102.42 +import com.sun.tools.javac.api.JavacTaskImpl;
  102.43 +import com.sun.tools.javac.api.JavacTool;
  102.44 +import com.sun.tools.javac.model.JavacTypes;
  102.45 +import java.io.IOException;
  102.46 +import java.net.URI;
  102.47 +import java.util.ArrayList;
  102.48 +import java.util.Collections;
  102.49 +import javax.lang.model.element.Element;
  102.50 +import javax.lang.model.type.TypeMirror;
  102.51 +import javax.lang.model.util.Types;
  102.52 +import javax.tools.JavaFileObject;
  102.53 +import javax.tools.JavaFileObject.Kind;
  102.54 +import javax.tools.SimpleJavaFileObject;
  102.55 +
  102.56 +public class ScopeTest {
  102.57 +
  102.58 +    private static final String SOURCE_CODE =
  102.59 +            "public class Test {\n" +
  102.60 +            "    private static void test() {\n" +
  102.61 +            "        InvokeOn f = null;\n" +
  102.62 +            "        f.run(x -> { x.correct(); });\n" +
  102.63 +            "    }\n" +
  102.64 +            "    public static final class FooBar {\n" +
  102.65 +            "        public void dontRun() { }\n" +
  102.66 +            "    }\n" +
  102.67 +            "}\n" +
  102.68 +            "class InvokeOn {\n" +
  102.69 +            "    public void run(I i) { }\n" +
  102.70 +            "}\n" +
  102.71 +            "class FooBar {\n" +
  102.72 +            "    public void correct() { }\n" +
  102.73 +            "}\n" +
  102.74 +            "interface I {\n" +
  102.75 +            "    public void run(FooBar f);\n" +
  102.76 +            "}";
  102.77 +
  102.78 +    public static void main(String... args) throws Exception {
  102.79 +        verifyLambdaScopeCorrect("");
  102.80 +        verifyLambdaScopeCorrect("package test;");
  102.81 +    }
  102.82 +
  102.83 +    private static void verifyLambdaScopeCorrect(final String packageClause) throws Exception {
  102.84 +        JavacTool tool = JavacTool.create();
  102.85 +        JavaFileObject source = new SimpleJavaFileObject(URI.create("mem://Test.java"), Kind.SOURCE) {
  102.86 +            @Override public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  102.87 +                return packageClause + SOURCE_CODE;
  102.88 +            }
  102.89 +            @Override public boolean isNameCompatible(String simpleName, Kind kind) {
  102.90 +                return true;
  102.91 +            }
  102.92 +        };
  102.93 +        Iterable<? extends JavaFileObject> fos = Collections.singletonList(source);
  102.94 +        JavacTask task = tool.getTask(null, null, null, new ArrayList<String>(), null, fos);
  102.95 +        final Types types = JavacTypes.instance(((JavacTaskImpl) task).getContext());
  102.96 +        final Trees trees = Trees.instance(task);
  102.97 +        CompilationUnitTree cu = task.parse().iterator().next();
  102.98 +
  102.99 +        task.analyze();
 102.100 +
 102.101 +        new TreePathScanner<Void, Void>() {
 102.102 +            @Override public Void visitMemberSelect(MemberSelectTree node, Void p) {
 102.103 +                if (node.getIdentifier().contentEquals("correct")) {
 102.104 +                    TypeMirror xType = trees.getTypeMirror(new TreePath(getCurrentPath(), node.getExpression()));
 102.105 +                    Scope scope = trees.getScope(getCurrentPath());
 102.106 +                    for (Element l : scope.getLocalElements()) {
 102.107 +                        if (!l.getSimpleName().contentEquals("x")) continue;
 102.108 +                        if (!types.isSameType(xType, l.asType())) {
 102.109 +                            throw new IllegalStateException("Incorrect variable type in scope: " + l.asType() + "; should be: " + xType);
 102.110 +                        }
 102.111 +                    }
 102.112 +                }
 102.113 +                return super.visitMemberSelect(node, p);
 102.114 +            }
 102.115 +        }.scan(cu, null);
 102.116 +    }
 102.117 +}
   103.1 --- a/test/tools/javac/types/TypeHarness.java	Tue Sep 24 14:20:33 2013 -0700
   103.2 +++ b/test/tools/javac/types/TypeHarness.java	Tue Sep 24 14:35:24 2013 -0700
   103.3 @@ -213,8 +213,8 @@
   103.4  
   103.5      /** compute a type substitution on 't' given a list of type mappings */
   103.6      public Type subst(Type t, Mapping... maps) {
   103.7 -        ListBuffer<Type> from = ListBuffer.lb();
   103.8 -        ListBuffer<Type> to = ListBuffer.lb();
   103.9 +        ListBuffer<Type> from = new ListBuffer<>();
  103.10 +        ListBuffer<Type> to = new ListBuffer<>();
  103.11          for (Mapping tm : maps) {
  103.12              from.append(tm.from);
  103.13              to.append(tm.to);
   104.1 --- a/test/tools/javac/warnings/6747671/T6747671.java	Tue Sep 24 14:20:33 2013 -0700
   104.2 +++ b/test/tools/javac/warnings/6747671/T6747671.java	Tue Sep 24 14:35:24 2013 -0700
   104.3 @@ -1,6 +1,6 @@
   104.4  /**
   104.5   * @test /nodynamiccopyright/
   104.6 - * @bug 6747671
   104.7 + * @bug 6747671 8022567
   104.8   * @summary -Xlint:rawtypes
   104.9   * @compile/ref=T6747671.out -XDrawDiagnostics -Xlint:rawtypes T6747671.java
  104.10   */
  104.11 @@ -32,4 +32,11 @@
  104.12          A a2 = new A() {};//raw warning (2)
  104.13          a2.new Z() {};//raw warning
  104.14      }
  104.15 +
  104.16 +    @TA B @TA[] arr = new @TA B @TA [0];//JDK-8022567: raw warning (2)
  104.17 +    Class<B[]> classes1;//no warning
  104.18 +    Class<B>[] classes2;//no warning
  104.19 +
  104.20 +    @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE)
  104.21 +    @interface TA { }
  104.22  }
   105.1 --- a/test/tools/javac/warnings/6747671/T6747671.out	Tue Sep 24 14:20:33 2013 -0700
   105.2 +++ b/test/tools/javac/warnings/6747671/T6747671.out	Tue Sep 24 14:35:24 2013 -0700
   105.3 @@ -7,4 +7,6 @@
   105.4  T6747671.java:32:9: compiler.warn.raw.class.use: T6747671.A, T6747671<E>.A<X>
   105.5  T6747671.java:32:20: compiler.warn.raw.class.use: T6747671.A, T6747671<E>.A<X>
   105.6  T6747671.java:33:16: compiler.warn.raw.class.use: T6747671.A.Z, T6747671<E>.A<X>.Z<Y>
   105.7 -9 warnings
   105.8 +T6747671.java:36:9: compiler.warn.raw.class.use: @T6747671.TA T6747671.B, T6747671.B<X>
   105.9 +T6747671.java:36:27: compiler.warn.raw.class.use: T6747671.B, T6747671.B<X>
  105.10 +11 warnings

mercurial