Merge jdk8-b120

Thu, 05 Dec 2013 10:34:49 -0800

author
lana
date
Thu, 05 Dec 2013 10:34:49 -0800
changeset 2215
b3d7e86a0647
parent 2209
1670108bec25
parent 2214
4a2ed1900428
child 2216
afe63d41c699

Merge

     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed Dec 04 23:11:45 2013 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Thu Dec 05 10:34:49 2013 -0800
     1.3 @@ -148,43 +148,28 @@
     1.4          StringBuilder buf = new StringBuilder();
     1.5          int previndex = 0;
     1.6          while (true) {
     1.7 -            if (configuration.docrootparent.length() > 0) {
     1.8 -                final String docroot_parent = "{@docroot}/..";
     1.9 -                // Search for lowercase version of {@docRoot}/..
    1.10 -                index = lowerHtml.indexOf(docroot_parent, previndex);
    1.11 -                // If next {@docRoot}/.. pattern not found, append rest of htmlstr and exit loop
    1.12 -                if (index < 0) {
    1.13 -                    buf.append(htmlstr.substring(previndex));
    1.14 -                    break;
    1.15 -                }
    1.16 -                // If next {@docroot}/.. pattern found, append htmlstr up to start of tag
    1.17 -                buf.append(htmlstr.substring(previndex, index));
    1.18 -                previndex = index + docroot_parent.length();
    1.19 -                // Insert docrootparent absolute path where {@docRoot}/.. was located
    1.20 -
    1.21 +            final String docroot = "{@docroot}";
    1.22 +            // Search for lowercase version of {@docRoot}
    1.23 +            index = lowerHtml.indexOf(docroot, previndex);
    1.24 +            // If next {@docRoot} tag not found, append rest of htmlstr and exit loop
    1.25 +            if (index < 0) {
    1.26 +                buf.append(htmlstr.substring(previndex));
    1.27 +                break;
    1.28 +            }
    1.29 +            // If next {@docroot} tag found, append htmlstr up to start of tag
    1.30 +            buf.append(htmlstr.substring(previndex, index));
    1.31 +            previndex = index + docroot.length();
    1.32 +            if (configuration.docrootparent.length() > 0 && htmlstr.startsWith("/..", previndex)) {
    1.33 +                // Insert the absolute link if {@docRoot} is followed by "/..".
    1.34                  buf.append(configuration.docrootparent);
    1.35 -                // Append slash if next character is not a slash
    1.36 -                if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') {
    1.37 -                    buf.append('/');
    1.38 -                }
    1.39 +                previndex += 3;
    1.40              } else {
    1.41 -                final String docroot = "{@docroot}";
    1.42 -                // Search for lowercase version of {@docRoot}
    1.43 -                index = lowerHtml.indexOf(docroot, previndex);
    1.44 -                // If next {@docRoot} tag not found, append rest of htmlstr and exit loop
    1.45 -                if (index < 0) {
    1.46 -                    buf.append(htmlstr.substring(previndex));
    1.47 -                    break;
    1.48 -                }
    1.49 -                // If next {@docroot} tag found, append htmlstr up to start of tag
    1.50 -                buf.append(htmlstr.substring(previndex, index));
    1.51 -                previndex = index + docroot.length();
    1.52                  // Insert relative path where {@docRoot} was located
    1.53                  buf.append(pathToRoot.isEmpty() ? "." : pathToRoot.getPath());
    1.54 -                // Append slash if next character is not a slash
    1.55 -                if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') {
    1.56 -                    buf.append('/');
    1.57 -                }
    1.58 +            }
    1.59 +            // Append slash if next character is not a slash
    1.60 +            if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') {
    1.61 +                buf.append('/');
    1.62              }
    1.63          }
    1.64          return buf.toString();
    1.65 @@ -1604,26 +1589,30 @@
    1.66                  result.addContent(seeTagToContent((SeeTag) tagelem));
    1.67              } else if (! tagName.equals("Text")) {
    1.68                  boolean wasEmpty = result.isEmpty();
    1.69 -                Content output = TagletWriter.getInlineTagOuput(
    1.70 -                    configuration.tagletManager, holderTag,
    1.71 -                    tagelem, getTagletWriterInstance(isFirstSentence));
    1.72 +                Content output;
    1.73 +                if (configuration.docrootparent.length() > 0
    1.74 +                        && tagelem.name().equals("@docRoot")
    1.75 +                        && ((tags[i + 1]).text()).startsWith("/..")) {
    1.76 +                    // If Xdocrootparent switch ON, set the flag to remove the /.. occurrence after
    1.77 +                    // {@docRoot} tag in the very next Text tag.
    1.78 +                    textTagChange = true;
    1.79 +                    // Replace the occurrence of {@docRoot}/.. with the absolute link.
    1.80 +                    output = new StringContent(configuration.docrootparent);
    1.81 +                } else {
    1.82 +                    output = TagletWriter.getInlineTagOuput(
    1.83 +                            configuration.tagletManager, holderTag,
    1.84 +                            tagelem, getTagletWriterInstance(isFirstSentence));
    1.85 +                }
    1.86                  if (output != null)
    1.87                      result.addContent(output);
    1.88                  if (wasEmpty && isFirstSentence && tagelem.name().equals("@inheritDoc") && !result.isEmpty()) {
    1.89                      break;
    1.90 -                } else if (configuration.docrootparent.length() > 0 &&
    1.91 -                        tagelem.name().equals("@docRoot") &&
    1.92 -                        ((tags[i + 1]).text()).startsWith("/..")) {
    1.93 -                    //If Xdocrootparent switch ON, set the flag to remove the /.. occurance after
    1.94 -                    //{@docRoot} tag in the very next Text tag.
    1.95 -                    textTagChange = true;
    1.96 -                    continue;
    1.97                  } else {
    1.98                      continue;
    1.99                  }
   1.100              } else {
   1.101                  String text = tagelem.text();
   1.102 -                //If Xdocrootparent switch ON, remove the /.. occurance after {@docRoot} tag.
   1.103 +                //If Xdocrootparent switch ON, remove the /.. occurrence after {@docRoot} tag.
   1.104                  if (textTagChange) {
   1.105                      text = text.replaceFirst("/..", "");
   1.106                      textTagChange = false;
     2.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Wed Dec 04 23:11:45 2013 -0800
     2.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Thu Dec 05 10:34:49 2013 -0800
     2.3 @@ -80,9 +80,7 @@
     2.4       */
     2.5      public Content getDocRootOutput() {
     2.6          String path;
     2.7 -        if (configuration.docrootparent.length() > 0)
     2.8 -            path = configuration.docrootparent;
     2.9 -        else if (htmlWriter.pathToRoot.isEmpty())
    2.10 +        if (htmlWriter.pathToRoot.isEmpty())
    2.11              path = ".";
    2.12          else
    2.13              path = htmlWriter.pathToRoot.getPath();
     3.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Dec 04 23:11:45 2013 -0800
     3.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Dec 05 10:34:49 2013 -0800
     3.3 @@ -28,7 +28,6 @@
     3.4  import java.util.*;
     3.5  
     3.6  import javax.lang.model.element.ElementKind;
     3.7 -import javax.lang.model.type.TypeKind;
     3.8  import javax.tools.JavaFileObject;
     3.9  
    3.10  import com.sun.source.tree.IdentifierTree;
    3.11 @@ -2164,11 +2163,6 @@
    3.12                      tree.constructor,
    3.13                      localEnv,
    3.14                      new ResultInfo(pkind, newMethodTemplate(syms.voidType, argtypes, typeargtypes)));
    3.15 -            } else {
    3.16 -                if (tree.clazz.hasTag(ANNOTATED_TYPE)) {
    3.17 -                    checkForDeclarationAnnotations(((JCAnnotatedType) tree.clazz).annotations,
    3.18 -                            tree.clazz.type.tsym);
    3.19 -                }
    3.20              }
    3.21  
    3.22              if (tree.constructor != null && tree.constructor.kind == MTH)
    3.23 @@ -2230,21 +2224,6 @@
    3.24                  }
    3.25              }
    3.26  
    3.27 -    private void checkForDeclarationAnnotations(List<? extends JCAnnotation> annotations,
    3.28 -            Symbol sym) {
    3.29 -        // Ensure that no declaration annotations are present.
    3.30 -        // Note that a tree type might be an AnnotatedType with
    3.31 -        // empty annotations, if only declaration annotations were given.
    3.32 -        // This method will raise an error for such a type.
    3.33 -        for (JCAnnotation ai : annotations) {
    3.34 -            if (!ai.type.isErroneous() &&
    3.35 -                typeAnnotations.annotationType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) {
    3.36 -                log.error(ai.pos(), "annotation.type.not.applicable");
    3.37 -            }
    3.38 -        }
    3.39 -    }
    3.40 -
    3.41 -
    3.42      /** Make an attributed null check tree.
    3.43       */
    3.44      public JCExpression makeNullCheck(JCExpression arg) {
    3.45 @@ -2271,10 +2250,6 @@
    3.46                  attribExpr(l.head, localEnv, syms.intType);
    3.47                  owntype = new ArrayType(owntype, syms.arrayClass);
    3.48              }
    3.49 -            if (tree.elemtype.hasTag(ANNOTATED_TYPE)) {
    3.50 -                checkForDeclarationAnnotations(((JCAnnotatedType) tree.elemtype).annotations,
    3.51 -                        tree.elemtype.type.tsym);
    3.52 -            }
    3.53          } else {
    3.54              // we are seeing an untyped aggregate { ... }
    3.55              // this is allowed only if the prototype is an array
    3.56 @@ -4419,7 +4394,7 @@
    3.57          }
    3.58          public void visitMethodDef(JCMethodDecl tree) {
    3.59              if (tree.recvparam != null &&
    3.60 -                    tree.recvparam.vartype.type.getKind() != TypeKind.ERROR) {
    3.61 +                    !tree.recvparam.vartype.type.isErroneous()) {
    3.62                  checkForDeclarationAnnotations(tree.recvparam.mods.annotations,
    3.63                          tree.recvparam.vartype.type.tsym);
    3.64              }
    3.65 @@ -4458,17 +4433,28 @@
    3.66              super.visitTypeTest(tree);
    3.67          }
    3.68          public void visitNewClass(JCNewClass tree) {
    3.69 -            if (tree.clazz.type != null)
    3.70 +            if (tree.clazz.hasTag(ANNOTATED_TYPE)) {
    3.71 +                checkForDeclarationAnnotations(((JCAnnotatedType) tree.clazz).annotations,
    3.72 +                        tree.clazz.type.tsym);
    3.73 +            }
    3.74 +            if (tree.def != null) {
    3.75 +                checkForDeclarationAnnotations(tree.def.mods.annotations, tree.clazz.type.tsym);
    3.76 +            }
    3.77 +            if (tree.clazz.type != null) {
    3.78                  validateAnnotatedType(tree.clazz, tree.clazz.type);
    3.79 +            }
    3.80              super.visitNewClass(tree);
    3.81          }
    3.82          public void visitNewArray(JCNewArray tree) {
    3.83 -            if (tree.elemtype != null && tree.elemtype.type != null)
    3.84 +            if (tree.elemtype != null && tree.elemtype.type != null) {
    3.85 +                if (tree.elemtype.hasTag(ANNOTATED_TYPE)) {
    3.86 +                    checkForDeclarationAnnotations(((JCAnnotatedType) tree.elemtype).annotations,
    3.87 +                            tree.elemtype.type.tsym);
    3.88 +                }
    3.89                  validateAnnotatedType(tree.elemtype, tree.elemtype.type);
    3.90 +            }
    3.91              super.visitNewArray(tree);
    3.92          }
    3.93 -
    3.94 -        @Override
    3.95          public void visitClassDef(JCClassDecl tree) {
    3.96              if (sigOnly) {
    3.97                  scan(tree.mods);
    3.98 @@ -4483,8 +4469,6 @@
    3.99                  scan(member);
   3.100              }
   3.101          }
   3.102 -
   3.103 -        @Override
   3.104          public void visitBlock(JCBlock tree) {
   3.105              if (!sigOnly) {
   3.106                  scan(tree.stats);
   3.107 @@ -4590,6 +4574,20 @@
   3.108                  }
   3.109              }
   3.110          }
   3.111 +
   3.112 +        private void checkForDeclarationAnnotations(List<? extends JCAnnotation> annotations,
   3.113 +                Symbol sym) {
   3.114 +            // Ensure that no declaration annotations are present.
   3.115 +            // Note that a tree type might be an AnnotatedType with
   3.116 +            // empty annotations, if only declaration annotations were given.
   3.117 +            // This method will raise an error for such a type.
   3.118 +            for (JCAnnotation ai : annotations) {
   3.119 +                if (!ai.type.isErroneous() &&
   3.120 +                        typeAnnotations.annotationType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) {
   3.121 +                    log.error(ai.pos(), "annotation.type.not.applicable");
   3.122 +                }
   3.123 +            }
   3.124 +        }
   3.125      };
   3.126  
   3.127      // <editor-fold desc="post-attribution visitor">
     4.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Dec 04 23:11:45 2013 -0800
     4.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Dec 05 10:34:49 2013 -0800
     4.3 @@ -2985,6 +2985,7 @@
     4.4      boolean annotationApplicable(JCAnnotation a, Symbol s) {
     4.5          Attribute.Array arr = getAttributeTargetAttribute(a.annotationType.type.tsym);
     4.6          Name[] targets;
     4.7 +
     4.8          if (arr == null) {
     4.9              targets = defaultTargetMetaInfo(a, s);
    4.10          } else {
    4.11 @@ -3001,7 +3002,7 @@
    4.12          }
    4.13          for (Name target : targets) {
    4.14              if (target == names.TYPE)
    4.15 -                { if (s.kind == TYP && !s.isAnonymous()) return true; }
    4.16 +                { if (s.kind == TYP) return true; }
    4.17              else if (target == names.FIELD)
    4.18                  { if (s.kind == VAR && s.owner.kind != MTH) return true; }
    4.19              else if (target == names.METHOD)
     5.1 --- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed Dec 04 23:11:45 2013 -0800
     5.2 +++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu Dec 05 10:34:49 2013 -0800
     5.3 @@ -1596,6 +1596,7 @@
     5.4                          // Identifier, ')' '->' -> implicit lambda
     5.5                          return ParensResult.IMPLICIT_LAMBDA;
     5.6                      }
     5.7 +                    type = false;
     5.8                      break;
     5.9                  case FINAL:
    5.10                  case ELLIPSIS:
     6.1 --- a/src/share/classes/com/sun/tools/jdeps/JdepsTask.java	Wed Dec 04 23:11:45 2013 -0800
     6.2 +++ b/src/share/classes/com/sun/tools/jdeps/JdepsTask.java	Thu Dec 05 10:34:49 2013 -0800
     6.3 @@ -180,6 +180,15 @@
     6.4                  task.options.depth = 0;
     6.5              }
     6.6          },
     6.7 +        new Option(false, "-jdkinternals") {
     6.8 +            void process(JdepsTask task, String opt, String arg) {
     6.9 +                task.options.findJDKInternals = true;
    6.10 +                task.options.verbose = Analyzer.Type.CLASS;
    6.11 +                if (task.options.includePattern == null) {
    6.12 +                    task.options.includePattern = Pattern.compile(".*");
    6.13 +                }
    6.14 +            }
    6.15 +        },
    6.16          new Option(false, "-version") {
    6.17              void process(JdepsTask task, String opt, String arg) {
    6.18                  task.options.version = true;
    6.19 @@ -248,6 +257,11 @@
    6.20                  showHelp();
    6.21                  return EXIT_CMDERR;
    6.22              }
    6.23 +            if (options.findJDKInternals &&
    6.24 +                   (options.regex != null || options.packageNames.size() > 0 || options.showSummary)) {
    6.25 +                showHelp();
    6.26 +                return EXIT_CMDERR;
    6.27 +            }
    6.28              if (options.showSummary && options.verbose != Analyzer.Type.SUMMARY) {
    6.29                  showHelp();
    6.30                  return EXIT_CMDERR;
    6.31 @@ -571,6 +585,7 @@
    6.32          boolean wildcard;
    6.33          boolean apiOnly;
    6.34          boolean showLabel;
    6.35 +        boolean findJDKInternals;
    6.36          String dotOutputDir;
    6.37          String classpath = "";
    6.38          int depth = 1;
    6.39 @@ -681,11 +696,22 @@
    6.40          @Override
    6.41          public void visitDependence(String origin, Archive source,
    6.42                                      String target, Archive archive, Profile profile) {
    6.43 -            if (!origin.equals(pkg)) {
    6.44 -                pkg = origin;
    6.45 -                writer.format("   %s (%s)%n", origin, source.getFileName());
    6.46 +            if (options.findJDKInternals &&
    6.47 +                    !(archive instanceof JDKArchive && profile == null)) {
    6.48 +                // filter dependences other than JDK internal APIs
    6.49 +                return;
    6.50              }
    6.51 -            writer.format("      -> %-50s %s%n", target, getProfileArchiveInfo(archive, profile));
    6.52 +            if (options.verbose == Analyzer.Type.VERBOSE) {
    6.53 +                writer.format("   %-50s -> %-50s %s%n",
    6.54 +                              origin, target, getProfileArchiveInfo(archive, profile));
    6.55 +            } else {
    6.56 +                if (!origin.equals(pkg)) {
    6.57 +                    pkg = origin;
    6.58 +                    writer.format("   %s (%s)%n", origin, source.getFileName());
    6.59 +                }
    6.60 +                writer.format("      -> %-50s %s%n",
    6.61 +                              target, getProfileArchiveInfo(archive, profile));
    6.62 +            }
    6.63          }
    6.64  
    6.65          @Override
    6.66 @@ -717,6 +743,11 @@
    6.67          @Override
    6.68          public void visitDependence(String origin, Archive source,
    6.69                                      String target, Archive archive, Profile profile) {
    6.70 +            if (options.findJDKInternals &&
    6.71 +                    !(archive instanceof JDKArchive && profile == null)) {
    6.72 +                // filter dependences other than JDK internal APIs
    6.73 +                return;
    6.74 +            }
    6.75              // if -P option is specified, package name -> profile will
    6.76              // be shown and filter out multiple same edges.
    6.77              String name = getProfileArchiveInfo(archive, profile);
     7.1 --- a/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties	Wed Dec 04 23:11:45 2013 -0800
     7.2 +++ b/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties	Thu Dec 05 10:34:49 2013 -0800
     7.3 @@ -59,10 +59,19 @@
     7.4  main.opt.dotoutput=\
     7.5  \  -dotoutput <dir>                   Destination directory for DOT file output
     7.6  
     7.7 +main.opt.jdkinternals=\
     7.8 +\  -jdkinternals                      Finds class-level dependences on JDK internal APIs.\n\
     7.9 +\                                     By default, it analyzes all classes on -classpath\n\
    7.10 +\                                     and input files unless -include option is specified.\n\
    7.11 +\                                     This option cannot be used with -p, -e and -s options.\n\
    7.12 +\                                     WARNING: JDK internal APIs may not be accessible in\n\
    7.13 +\                                     the next release.
    7.14 +
    7.15  main.opt.depth=\
    7.16  \  -depth=<depth>                     Specify the depth of the transitive\n\
    7.17  \                                     dependency analysis
    7.18  
    7.19 +
    7.20  err.unknown.option=unknown option: {0}
    7.21  err.missing.arg=no value given for {0}
    7.22  err.internal.error=internal error: {0} {1} {2}
     8.1 --- a/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java	Wed Dec 04 23:11:45 2013 -0800
     8.2 +++ b/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java	Thu Dec 05 10:34:49 2013 -0800
     8.3 @@ -1,5 +1,5 @@
     8.4  /*
     8.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     8.6 + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     8.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     8.8   *
     8.9   * This code is free software; you can redistribute it and/or modify it
    8.10 @@ -23,7 +23,7 @@
    8.11  
    8.12  /*
    8.13   * @test
    8.14 - * @bug 6553182
    8.15 + * @bug 6553182 8025416
    8.16   * @summary This test verifies the -Xdocrootparent option.
    8.17   * @author Bhavesh Patel
    8.18   * @library ../lib/
    8.19 @@ -35,43 +35,87 @@
    8.20      private static final String BUG_ID = "6553182";
    8.21      private static final String[][] TEST1 = {
    8.22          {BUG_ID + FS + "pkg1" + FS + "C1.html",
    8.23 -            "<a href=\"../../technotes/guides/index.html\">"
    8.24 +            "Refer <a href=\"../../technotes/guides/index.html\">Here</a>"
    8.25 +        },
    8.26 +        {BUG_ID + FS + "pkg1" + FS + "C1.html",
    8.27 +            "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced" + NL +
    8.28 +            " with an absolute link."
    8.29 +        },
    8.30 +        {BUG_ID + FS + "pkg1" + FS + "C1.html",
    8.31 +            "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL +
    8.32 +            " <a href=\"../pkg2/C2.html\">Link 2</a>."
    8.33          },
    8.34          {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    8.35 -            "<a href=\"../../technotes/guides/index.html\">"
    8.36 +            "<a href=\"../../technotes/guides/index.html\">" + NL +
    8.37 +            "            Test document 1</a>"
    8.38 +        },
    8.39 +        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    8.40 +            "<a href=\"../pkg2/C2.html\">" + NL +
    8.41 +            "            Another Test document 1</a>"
    8.42 +        },
    8.43 +        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    8.44 +            "<a href=\"../technotes/guides/index.html\">" + NL +
    8.45 +            "            Another Test document 2.</a>"
    8.46          }
    8.47      };
    8.48      private static final String[][] NEGATED_TEST1 = {
    8.49          {BUG_ID + FS + "pkg1" + FS + "C1.html",
    8.50              "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    8.51          },
    8.52 +        {BUG_ID + FS + "pkg1" + FS + "C1.html",
    8.53 +            "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
    8.54 +        },
    8.55          {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    8.56              "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    8.57 +        },
    8.58 +        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    8.59 +            "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
    8.60          }
    8.61      };
    8.62      private static final String[][] TEST2 = {
    8.63 -        {BUG_ID + FS + "pkg2" + FS + "C2.html",
    8.64 -            "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    8.65 +        {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    8.66 +            "Refer <a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>"
    8.67          },
    8.68 -        {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
    8.69 -            "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    8.70 +        {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    8.71 +            "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced" + NL +
    8.72 +            " with an absolute link."
    8.73 +        },
    8.74 +        {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    8.75 +            "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL +
    8.76 +            " <a href=\"../pkg1/C1.html\">Link 2</a>."
    8.77 +        },
    8.78 +        {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
    8.79 +            "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" + NL +
    8.80 +            "            Test document 1</a>"
    8.81 +        },
    8.82 +        {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
    8.83 +            "<a href=\"../pkg1/C1.html\">" + NL + "            Another Test document 1</a>"
    8.84 +        },
    8.85 +        {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
    8.86 +            "<a href=\"../technotes/guides/index.html\">" + NL + "            Another Test document 2.</a>"
    8.87          }
    8.88      };
    8.89      private static final String[][] NEGATED_TEST2 = {
    8.90 -        {BUG_ID + FS + "pkg2" + FS + "C2.html",
    8.91 +        {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    8.92              "<a href=\"../../technotes/guides/index.html\">"
    8.93          },
    8.94 -        {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
    8.95 +        {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    8.96 +            "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
    8.97 +        },
    8.98 +        {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
    8.99              "<a href=\"../../technotes/guides/index.html\">"
   8.100 +        },
   8.101 +        {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
   8.102 +            "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
   8.103          }
   8.104      };
   8.105      private static final String[] ARGS1 =
   8.106              new String[]{
   8.107 -        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
   8.108 +        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2"
   8.109      };
   8.110      private static final String[] ARGS2 =
   8.111              new String[]{
   8.112 -        "-d", BUG_ID, "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg2"
   8.113 +        "-d", BUG_ID + "-1", "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg1", "pkg2"
   8.114      };
   8.115  
   8.116      /**
     9.1 --- a/test/com/sun/javadoc/testDocRootLink/pkg1/C1.java	Wed Dec 04 23:11:45 2013 -0800
     9.2 +++ b/test/com/sun/javadoc/testDocRootLink/pkg1/C1.java	Thu Dec 05 10:34:49 2013 -0800
     9.3 @@ -25,7 +25,12 @@
     9.4  
     9.5  /**
     9.6   * Class 1. This is a test.
     9.7 - * Refer <a href="{@docRoot}/../technotes/guides/index.html">Here</a>. Lets see if this works
     9.8 - * or not.
     9.9 + * Refer <a href="{@docRoot}/../technotes/guides/index.html">Here</a>. This link should
    9.10 + * not be replaced with an absolute link.
    9.11 + * This <a href="{@docRoot}/pkg2/C2.html">Here</a> should not be replaced
    9.12 + * with an absolute link.
    9.13 + * Testing <a href="{@docRoot}/technotes/guides/index.html">Link 1</a> and
    9.14 + * <a href="{@docRoot}/pkg2/C2.html">Link 2</a>. 2 back-to-back links using
    9.15 + * docroot. These should not be replaced with an absolute link.
    9.16   */
    9.17  public class C1 {}
    10.1 --- a/test/com/sun/javadoc/testDocRootLink/pkg1/package.html	Wed Dec 04 23:11:45 2013 -0800
    10.2 +++ b/test/com/sun/javadoc/testDocRootLink/pkg1/package.html	Thu Dec 05 10:34:49 2013 -0800
    10.3 @@ -3,16 +3,16 @@
    10.4  <title>javax.management package</title>
    10.5  </head>
    10.6  <body bgcolor="white">
    10.7 -This is a test.
    10.8 -      <p id="spec">
    10.9 -    @see <a href="{@docRoot}/../technotes/guides/index.html">
   10.10 -      Test document 1</a>
   10.11 -      in particular the
   10.12 -      <a href="{@docRoot}/../technotes/guides/index.html">
   10.13 +    This is a test.
   10.14 +    <p id="spec">
   10.15 +        @see <a href="{@docRoot}/../technotes/guides/index.html">
   10.16 +            Test document 1</a> should not be replaced with an absolute link.
   10.17 +        @see <a href="{@docRoot}/pkg2/C2.html">
   10.18 +            Another Test document 1</a> which should not be replaced with an absolute link.
   10.19 +        <a href="{@docRoot}/technotes/guides/index.html">
   10.20 +            Another Test document 2.</a> which should not be replaced with an absolute link.
   10.21  
   10.22 -      Test document 2.</a>
   10.23 -
   10.24 -	@since 1.5
   10.25 +        @since 1.5
   10.26  
   10.27  </body>
   10.28  </html>
    11.1 --- a/test/com/sun/javadoc/testDocRootLink/pkg2/C2.java	Wed Dec 04 23:11:45 2013 -0800
    11.2 +++ b/test/com/sun/javadoc/testDocRootLink/pkg2/C2.java	Thu Dec 05 10:34:49 2013 -0800
    11.3 @@ -24,8 +24,13 @@
    11.4  package pkg2;
    11.5  
    11.6  /**
    11.7 - * Class 1. This is a test.
    11.8 - * Refer <a href="{@docRoot}/../technotes/guides/index.html">Here</a>. Lets see if this works
    11.9 - * or not.
   11.10 + * Class 2. This is a test.
   11.11 + * Refer <a href="{@docRoot}/../technotes/guides/index.html">Here</a> should be
   11.12 + * replaced with an absolute link.
   11.13 + * This <a href="{@docRoot}/pkg1/C1.html">Here</a> should not be replaced
   11.14 + * with an absolute link.
   11.15 + * Testing <a href="{@docRoot}/technotes/guides/index.html">Link 1</a> and
   11.16 + * <a href="{@docRoot}/pkg1/C1.html">Link 2</a>. Both should not be replaced with
   11.17 + * an absolute link.
   11.18   */
   11.19  public class C2 {}
    12.1 --- a/test/com/sun/javadoc/testDocRootLink/pkg2/package.html	Wed Dec 04 23:11:45 2013 -0800
    12.2 +++ b/test/com/sun/javadoc/testDocRootLink/pkg2/package.html	Thu Dec 05 10:34:49 2013 -0800
    12.3 @@ -3,16 +3,16 @@
    12.4  <title>javax.management package</title>
    12.5  </head>
    12.6  <body bgcolor="white">
    12.7 -This is a test.
    12.8 -      <p id="spec">
    12.9 -    @see <a href="{@docRoot}/../technotes/guides/index.html">
   12.10 -      Test document 1</a>
   12.11 -      in particular the
   12.12 -      <a href="{@docRoot}/../technotes/guides/index.html">
   12.13 +    This is a test.
   12.14 +    <p id="spec">
   12.15 +        @see <a href="{@docRoot}/../technotes/guides/index.html">
   12.16 +            Test document 1</a> should be replaced with an absolute link.
   12.17 +        @see <a href="{@docRoot}/pkg1/C1.html">
   12.18 +            Another Test document 1</a> which should not be replaced with an absolute link.
   12.19 +        <a href="{@docRoot}/technotes/guides/index.html">
   12.20 +            Another Test document 2.</a> which should not be replaced with an absolute link.
   12.21  
   12.22 -      Test document 2.</a>
   12.23 -
   12.24 -	@since 1.5
   12.25 +        @since 1.5
   12.26  
   12.27  </body>
   12.28  </html>
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/test/tools/javac/T8029179/CompileErrorForValidBooleanExpTest.java	Thu Dec 05 10:34:49 2013 -0800
    13.3 @@ -0,0 +1,56 @@
    13.4 +/*
    13.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    13.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    13.7 + *
    13.8 + * This code is free software; you can redistribute it and/or modify it
    13.9 + * under the terms of the GNU General Public License version 2 only, as
   13.10 + * published by the Free Software Foundation.
   13.11 + *
   13.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   13.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   13.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   13.15 + * version 2 for more details (a copy is included in the LICENSE file that
   13.16 + * accompanied this code).
   13.17 + *
   13.18 + * You should have received a copy of the GNU General Public License version
   13.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   13.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   13.21 + *
   13.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   13.23 + * or visit www.oracle.com if you need additional information or have any
   13.24 + * questions.
   13.25 + */
   13.26 +
   13.27 +/*
   13.28 + * @test
   13.29 + * @bug 8029179
   13.30 + * @summary javac produces a compile error for valid boolean expressions
   13.31 + * @compile CompileErrorForValidBooleanExpTest.java
   13.32 + */
   13.33 +
   13.34 +public class CompileErrorForValidBooleanExpTest {
   13.35 +    static int a, b, c, d;
   13.36 +
   13.37 +    static void m() {
   13.38 +        boolean cond1 = (a < b & c > d);
   13.39 +        boolean cond2 = (f1() < f2() & c > d);
   13.40 +        boolean cond3 = (f1() < b & f3() > d);
   13.41 +        boolean cond4 = (f1() < b & f3() > 1);
   13.42 +    }
   13.43 +
   13.44 +    static int f1() {
   13.45 +        return 0;
   13.46 +    }
   13.47 +
   13.48 +    static int f2() {
   13.49 +        return 0;
   13.50 +    }
   13.51 +
   13.52 +    static int f3() {
   13.53 +        return 0;
   13.54 +    }
   13.55 +
   13.56 +    static int f4() {
   13.57 +        return 0;
   13.58 +    }
   13.59 +}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/test/tools/javac/annotations/typeAnnotations/failures/CheckForDeclAnnoNPE.java	Thu Dec 05 10:34:49 2013 -0800
    14.3 @@ -0,0 +1,43 @@
    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.
   14.11 + *
   14.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   14.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   14.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   14.15 + * version 2 for more details (a copy is included in the LICENSE file that
   14.16 + * accompanied this code).
   14.17 + *
   14.18 + * You should have received a copy of the GNU General Public License version
   14.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   14.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   14.21 + *
   14.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   14.23 + * or visit www.oracle.com if you need additional information or have any
   14.24 + * questions.
   14.25 + */
   14.26 +
   14.27 +/*
   14.28 + * @test
   14.29 + * @bug 8028699
   14.30 + * @summary Ensure there is no NPE in checking for decl. annotations in this example
   14.31 + * @author Werner Dietl
   14.32 + * @compile -doe CheckForDeclAnnoNPE.java
   14.33 + */
   14.34 +
   14.35 +import java.lang.annotation.ElementType;
   14.36 +import java.lang.annotation.Target;
   14.37 +
   14.38 +
   14.39 +class CheckForDeclAnnoNPE {
   14.40 +    void test(String s) {
   14.41 +        test(new @TA String().toString());
   14.42 +    }
   14.43 +}
   14.44 +
   14.45 +@Target(ElementType.TYPE_USE)
   14.46 +@interface TA {}
    15.1 --- a/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java	Wed Dec 04 23:11:45 2013 -0800
    15.2 +++ b/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java	Thu Dec 05 10:34:49 2013 -0800
    15.3 @@ -10,9 +10,6 @@
    15.4      Object e1 = new @DA int[5];
    15.5      Object e2 = new @DA String[42];
    15.6      Object e3 = new @DA Object();
    15.7 -
    15.8 -    // The declaration annotation is only allowed for
    15.9 -    // an anonymous class creation.
   15.10      Object ok = new @DA Object() { };
   15.11  }
   15.12  
    16.1 --- a/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out	Wed Dec 04 23:11:45 2013 -0800
    16.2 +++ b/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out	Thu Dec 05 10:34:49 2013 -0800
    16.3 @@ -1,5 +1,5 @@
    16.4  DeclarationAnnotation.java:10:21: compiler.err.annotation.type.not.applicable
    16.5  DeclarationAnnotation.java:11:21: compiler.err.annotation.type.not.applicable
    16.6  DeclarationAnnotation.java:12:21: compiler.err.annotation.type.not.applicable
    16.7 -DeclarationAnnotation.java:16:21: compiler.err.annotation.type.not.applicable
    16.8 +DeclarationAnnotation.java:13:21: compiler.err.annotation.type.not.applicable
    16.9  4 errors
    17.1 --- a/test/tools/jdeps/APIDeps.java	Wed Dec 04 23:11:45 2013 -0800
    17.2 +++ b/test/tools/jdeps/APIDeps.java	Thu Dec 05 10:34:49 2013 -0800
    17.3 @@ -23,8 +23,8 @@
    17.4  
    17.5  /*
    17.6   * @test
    17.7 - * @bug 8015912
    17.8 - * @summary find API dependencies
    17.9 + * @bug 8015912 8029216
   17.10 + * @summary Test -apionly and -jdkinternals options
   17.11   * @build m.Bar m.Foo m.Gee b.B c.C c.I d.D e.E f.F g.G
   17.12   * @run main APIDeps
   17.13   */
   17.14 @@ -88,6 +88,19 @@
   17.15               new String[] {"g.G", "sun.misc.Lock"},
   17.16               new String[] {testDirBasename, "JDK internal API"},
   17.17               new String[] {"-classpath", testDir.getPath(), "-verbose"});
   17.18 +
   17.19 +        // -jdkinternals
   17.20 +        test(new File(mDir, "Gee.class"),
   17.21 +             new String[] {"sun.misc.Lock"},
   17.22 +             new String[] {"JDK internal API"},
   17.23 +             new String[] {"-jdkinternals"});
   17.24 +        // -jdkinternals parses all classes on -classpath and the input arguments
   17.25 +        test(new File(mDir, "Gee.class"),
   17.26 +             new String[] {"sun.misc.Lock", "sun.misc.Unsafe"},
   17.27 +             new String[] {"JDK internal API"},
   17.28 +             new String[] {"-classpath", testDir.getPath(), "-jdkinternals"});
   17.29 +
   17.30 +        // parse only APIs
   17.31          // parse only APIs
   17.32          test(mDir,
   17.33               new String[] {"java.lang.Object", "java.lang.String",

mercurial