Fri, 13 Dec 2013 17:24:01 -0800
Merge
1.1 --- a/.hgtags Sun Dec 08 22:04:41 2013 -0800 1.2 +++ b/.hgtags Fri Dec 13 17:24:01 2013 -0800 1.3 @@ -241,3 +241,4 @@ 1.4 19de039a03a619b99f1a8b454e1618c9fa9dae66 jdk8-b117 1.5 4fd6a7ff8c068eceaaaf8bf12a394195203b99b3 jdk8-b118 1.6 43a80d75d06ed22d6942f25f067587a3be3a129d jdk8-b119 1.7 +b3d7e86a06474fe5100a7b15a95eaa10d41509a6 jdk8-b120
2.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Sun Dec 08 22:04:41 2013 -0800 2.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Fri Dec 13 17:24:01 2013 -0800 2.3 @@ -148,43 +148,28 @@ 2.4 StringBuilder buf = new StringBuilder(); 2.5 int previndex = 0; 2.6 while (true) { 2.7 - if (configuration.docrootparent.length() > 0) { 2.8 - final String docroot_parent = "{@docroot}/.."; 2.9 - // Search for lowercase version of {@docRoot}/.. 2.10 - index = lowerHtml.indexOf(docroot_parent, previndex); 2.11 - // If next {@docRoot}/.. pattern not found, append rest of htmlstr and exit loop 2.12 - if (index < 0) { 2.13 - buf.append(htmlstr.substring(previndex)); 2.14 - break; 2.15 - } 2.16 - // If next {@docroot}/.. pattern found, append htmlstr up to start of tag 2.17 - buf.append(htmlstr.substring(previndex, index)); 2.18 - previndex = index + docroot_parent.length(); 2.19 - // Insert docrootparent absolute path where {@docRoot}/.. was located 2.20 - 2.21 + final String docroot = "{@docroot}"; 2.22 + // Search for lowercase version of {@docRoot} 2.23 + index = lowerHtml.indexOf(docroot, previndex); 2.24 + // If next {@docRoot} tag not found, append rest of htmlstr and exit loop 2.25 + if (index < 0) { 2.26 + buf.append(htmlstr.substring(previndex)); 2.27 + break; 2.28 + } 2.29 + // If next {@docroot} tag found, append htmlstr up to start of tag 2.30 + buf.append(htmlstr.substring(previndex, index)); 2.31 + previndex = index + docroot.length(); 2.32 + if (configuration.docrootparent.length() > 0 && htmlstr.startsWith("/..", previndex)) { 2.33 + // Insert the absolute link if {@docRoot} is followed by "/..". 2.34 buf.append(configuration.docrootparent); 2.35 - // Append slash if next character is not a slash 2.36 - if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') { 2.37 - buf.append('/'); 2.38 - } 2.39 + previndex += 3; 2.40 } else { 2.41 - final String docroot = "{@docroot}"; 2.42 - // Search for lowercase version of {@docRoot} 2.43 - index = lowerHtml.indexOf(docroot, previndex); 2.44 - // If next {@docRoot} tag not found, append rest of htmlstr and exit loop 2.45 - if (index < 0) { 2.46 - buf.append(htmlstr.substring(previndex)); 2.47 - break; 2.48 - } 2.49 - // If next {@docroot} tag found, append htmlstr up to start of tag 2.50 - buf.append(htmlstr.substring(previndex, index)); 2.51 - previndex = index + docroot.length(); 2.52 // Insert relative path where {@docRoot} was located 2.53 buf.append(pathToRoot.isEmpty() ? "." : pathToRoot.getPath()); 2.54 - // Append slash if next character is not a slash 2.55 - if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') { 2.56 - buf.append('/'); 2.57 - } 2.58 + } 2.59 + // Append slash if next character is not a slash 2.60 + if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') { 2.61 + buf.append('/'); 2.62 } 2.63 } 2.64 return buf.toString(); 2.65 @@ -1604,26 +1589,30 @@ 2.66 result.addContent(seeTagToContent((SeeTag) tagelem)); 2.67 } else if (! tagName.equals("Text")) { 2.68 boolean wasEmpty = result.isEmpty(); 2.69 - Content output = TagletWriter.getInlineTagOuput( 2.70 - configuration.tagletManager, holderTag, 2.71 - tagelem, getTagletWriterInstance(isFirstSentence)); 2.72 + Content output; 2.73 + if (configuration.docrootparent.length() > 0 2.74 + && tagelem.name().equals("@docRoot") 2.75 + && ((tags[i + 1]).text()).startsWith("/..")) { 2.76 + // If Xdocrootparent switch ON, set the flag to remove the /.. occurrence after 2.77 + // {@docRoot} tag in the very next Text tag. 2.78 + textTagChange = true; 2.79 + // Replace the occurrence of {@docRoot}/.. with the absolute link. 2.80 + output = new StringContent(configuration.docrootparent); 2.81 + } else { 2.82 + output = TagletWriter.getInlineTagOuput( 2.83 + configuration.tagletManager, holderTag, 2.84 + tagelem, getTagletWriterInstance(isFirstSentence)); 2.85 + } 2.86 if (output != null) 2.87 result.addContent(output); 2.88 if (wasEmpty && isFirstSentence && tagelem.name().equals("@inheritDoc") && !result.isEmpty()) { 2.89 break; 2.90 - } else if (configuration.docrootparent.length() > 0 && 2.91 - tagelem.name().equals("@docRoot") && 2.92 - ((tags[i + 1]).text()).startsWith("/..")) { 2.93 - //If Xdocrootparent switch ON, set the flag to remove the /.. occurance after 2.94 - //{@docRoot} tag in the very next Text tag. 2.95 - textTagChange = true; 2.96 - continue; 2.97 } else { 2.98 continue; 2.99 } 2.100 } else { 2.101 String text = tagelem.text(); 2.102 - //If Xdocrootparent switch ON, remove the /.. occurance after {@docRoot} tag. 2.103 + //If Xdocrootparent switch ON, remove the /.. occurrence after {@docRoot} tag. 2.104 if (textTagChange) { 2.105 text = text.replaceFirst("/..", ""); 2.106 textTagChange = false;
3.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Sun Dec 08 22:04:41 2013 -0800 3.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Fri Dec 13 17:24:01 2013 -0800 3.3 @@ -80,9 +80,7 @@ 3.4 */ 3.5 public Content getDocRootOutput() { 3.6 String path; 3.7 - if (configuration.docrootparent.length() > 0) 3.8 - path = configuration.docrootparent; 3.9 - else if (htmlWriter.pathToRoot.isEmpty()) 3.10 + if (htmlWriter.pathToRoot.isEmpty()) 3.11 path = "."; 3.12 else 3.13 path = htmlWriter.pathToRoot.getPath();
4.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Sun Dec 08 22:04:41 2013 -0800 4.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Fri Dec 13 17:24:01 2013 -0800 4.3 @@ -28,7 +28,6 @@ 4.4 import java.util.*; 4.5 4.6 import javax.lang.model.element.ElementKind; 4.7 -import javax.lang.model.type.TypeKind; 4.8 import javax.tools.JavaFileObject; 4.9 4.10 import com.sun.source.tree.IdentifierTree; 4.11 @@ -2164,11 +2163,6 @@ 4.12 tree.constructor, 4.13 localEnv, 4.14 new ResultInfo(pkind, newMethodTemplate(syms.voidType, argtypes, typeargtypes))); 4.15 - } else { 4.16 - if (tree.clazz.hasTag(ANNOTATED_TYPE)) { 4.17 - checkForDeclarationAnnotations(((JCAnnotatedType) tree.clazz).annotations, 4.18 - tree.clazz.type.tsym); 4.19 - } 4.20 } 4.21 4.22 if (tree.constructor != null && tree.constructor.kind == MTH) 4.23 @@ -2230,21 +2224,6 @@ 4.24 } 4.25 } 4.26 4.27 - private void checkForDeclarationAnnotations(List<? extends JCAnnotation> annotations, 4.28 - Symbol sym) { 4.29 - // Ensure that no declaration annotations are present. 4.30 - // Note that a tree type might be an AnnotatedType with 4.31 - // empty annotations, if only declaration annotations were given. 4.32 - // This method will raise an error for such a type. 4.33 - for (JCAnnotation ai : annotations) { 4.34 - if (!ai.type.isErroneous() && 4.35 - typeAnnotations.annotationType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) { 4.36 - log.error(ai.pos(), "annotation.type.not.applicable"); 4.37 - } 4.38 - } 4.39 - } 4.40 - 4.41 - 4.42 /** Make an attributed null check tree. 4.43 */ 4.44 public JCExpression makeNullCheck(JCExpression arg) { 4.45 @@ -2271,10 +2250,6 @@ 4.46 attribExpr(l.head, localEnv, syms.intType); 4.47 owntype = new ArrayType(owntype, syms.arrayClass); 4.48 } 4.49 - if (tree.elemtype.hasTag(ANNOTATED_TYPE)) { 4.50 - checkForDeclarationAnnotations(((JCAnnotatedType) tree.elemtype).annotations, 4.51 - tree.elemtype.type.tsym); 4.52 - } 4.53 } else { 4.54 // we are seeing an untyped aggregate { ... } 4.55 // this is allowed only if the prototype is an array 4.56 @@ -4419,7 +4394,7 @@ 4.57 } 4.58 public void visitMethodDef(JCMethodDecl tree) { 4.59 if (tree.recvparam != null && 4.60 - tree.recvparam.vartype.type.getKind() != TypeKind.ERROR) { 4.61 + !tree.recvparam.vartype.type.isErroneous()) { 4.62 checkForDeclarationAnnotations(tree.recvparam.mods.annotations, 4.63 tree.recvparam.vartype.type.tsym); 4.64 } 4.65 @@ -4458,17 +4433,28 @@ 4.66 super.visitTypeTest(tree); 4.67 } 4.68 public void visitNewClass(JCNewClass tree) { 4.69 - if (tree.clazz.type != null) 4.70 + if (tree.clazz.hasTag(ANNOTATED_TYPE)) { 4.71 + checkForDeclarationAnnotations(((JCAnnotatedType) tree.clazz).annotations, 4.72 + tree.clazz.type.tsym); 4.73 + } 4.74 + if (tree.def != null) { 4.75 + checkForDeclarationAnnotations(tree.def.mods.annotations, tree.clazz.type.tsym); 4.76 + } 4.77 + if (tree.clazz.type != null) { 4.78 validateAnnotatedType(tree.clazz, tree.clazz.type); 4.79 + } 4.80 super.visitNewClass(tree); 4.81 } 4.82 public void visitNewArray(JCNewArray tree) { 4.83 - if (tree.elemtype != null && tree.elemtype.type != null) 4.84 + if (tree.elemtype != null && tree.elemtype.type != null) { 4.85 + if (tree.elemtype.hasTag(ANNOTATED_TYPE)) { 4.86 + checkForDeclarationAnnotations(((JCAnnotatedType) tree.elemtype).annotations, 4.87 + tree.elemtype.type.tsym); 4.88 + } 4.89 validateAnnotatedType(tree.elemtype, tree.elemtype.type); 4.90 + } 4.91 super.visitNewArray(tree); 4.92 } 4.93 - 4.94 - @Override 4.95 public void visitClassDef(JCClassDecl tree) { 4.96 if (sigOnly) { 4.97 scan(tree.mods); 4.98 @@ -4483,8 +4469,6 @@ 4.99 scan(member); 4.100 } 4.101 } 4.102 - 4.103 - @Override 4.104 public void visitBlock(JCBlock tree) { 4.105 if (!sigOnly) { 4.106 scan(tree.stats); 4.107 @@ -4590,6 +4574,20 @@ 4.108 } 4.109 } 4.110 } 4.111 + 4.112 + private void checkForDeclarationAnnotations(List<? extends JCAnnotation> annotations, 4.113 + Symbol sym) { 4.114 + // Ensure that no declaration annotations are present. 4.115 + // Note that a tree type might be an AnnotatedType with 4.116 + // empty annotations, if only declaration annotations were given. 4.117 + // This method will raise an error for such a type. 4.118 + for (JCAnnotation ai : annotations) { 4.119 + if (!ai.type.isErroneous() && 4.120 + typeAnnotations.annotationType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) { 4.121 + log.error(ai.pos(), "annotation.type.not.applicable"); 4.122 + } 4.123 + } 4.124 + } 4.125 }; 4.126 4.127 // <editor-fold desc="post-attribution visitor">
5.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java Sun Dec 08 22:04:41 2013 -0800 5.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java Fri Dec 13 17:24:01 2013 -0800 5.3 @@ -2985,6 +2985,7 @@ 5.4 boolean annotationApplicable(JCAnnotation a, Symbol s) { 5.5 Attribute.Array arr = getAttributeTargetAttribute(a.annotationType.type.tsym); 5.6 Name[] targets; 5.7 + 5.8 if (arr == null) { 5.9 targets = defaultTargetMetaInfo(a, s); 5.10 } else { 5.11 @@ -3001,7 +3002,7 @@ 5.12 } 5.13 for (Name target : targets) { 5.14 if (target == names.TYPE) 5.15 - { if (s.kind == TYP && !s.isAnonymous()) return true; } 5.16 + { if (s.kind == TYP) return true; } 5.17 else if (target == names.FIELD) 5.18 { if (s.kind == VAR && s.owner.kind != MTH) return true; } 5.19 else if (target == names.METHOD)
6.1 --- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Sun Dec 08 22:04:41 2013 -0800 6.2 +++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Fri Dec 13 17:24:01 2013 -0800 6.3 @@ -1596,6 +1596,7 @@ 6.4 // Identifier, ')' '->' -> implicit lambda 6.5 return ParensResult.IMPLICIT_LAMBDA; 6.6 } 6.7 + type = false; 6.8 break; 6.9 case FINAL: 6.10 case ELLIPSIS:
7.1 --- a/src/share/classes/com/sun/tools/jdeps/JdepsTask.java Sun Dec 08 22:04:41 2013 -0800 7.2 +++ b/src/share/classes/com/sun/tools/jdeps/JdepsTask.java Fri Dec 13 17:24:01 2013 -0800 7.3 @@ -180,6 +180,15 @@ 7.4 task.options.depth = 0; 7.5 } 7.6 }, 7.7 + new Option(false, "-jdkinternals") { 7.8 + void process(JdepsTask task, String opt, String arg) { 7.9 + task.options.findJDKInternals = true; 7.10 + task.options.verbose = Analyzer.Type.CLASS; 7.11 + if (task.options.includePattern == null) { 7.12 + task.options.includePattern = Pattern.compile(".*"); 7.13 + } 7.14 + } 7.15 + }, 7.16 new Option(false, "-version") { 7.17 void process(JdepsTask task, String opt, String arg) { 7.18 task.options.version = true; 7.19 @@ -248,6 +257,11 @@ 7.20 showHelp(); 7.21 return EXIT_CMDERR; 7.22 } 7.23 + if (options.findJDKInternals && 7.24 + (options.regex != null || options.packageNames.size() > 0 || options.showSummary)) { 7.25 + showHelp(); 7.26 + return EXIT_CMDERR; 7.27 + } 7.28 if (options.showSummary && options.verbose != Analyzer.Type.SUMMARY) { 7.29 showHelp(); 7.30 return EXIT_CMDERR; 7.31 @@ -571,6 +585,7 @@ 7.32 boolean wildcard; 7.33 boolean apiOnly; 7.34 boolean showLabel; 7.35 + boolean findJDKInternals; 7.36 String dotOutputDir; 7.37 String classpath = ""; 7.38 int depth = 1; 7.39 @@ -681,11 +696,22 @@ 7.40 @Override 7.41 public void visitDependence(String origin, Archive source, 7.42 String target, Archive archive, Profile profile) { 7.43 - if (!origin.equals(pkg)) { 7.44 - pkg = origin; 7.45 - writer.format(" %s (%s)%n", origin, source.getFileName()); 7.46 + if (options.findJDKInternals && 7.47 + !(archive instanceof JDKArchive && profile == null)) { 7.48 + // filter dependences other than JDK internal APIs 7.49 + return; 7.50 } 7.51 - writer.format(" -> %-50s %s%n", target, getProfileArchiveInfo(archive, profile)); 7.52 + if (options.verbose == Analyzer.Type.VERBOSE) { 7.53 + writer.format(" %-50s -> %-50s %s%n", 7.54 + origin, target, getProfileArchiveInfo(archive, profile)); 7.55 + } else { 7.56 + if (!origin.equals(pkg)) { 7.57 + pkg = origin; 7.58 + writer.format(" %s (%s)%n", origin, source.getFileName()); 7.59 + } 7.60 + writer.format(" -> %-50s %s%n", 7.61 + target, getProfileArchiveInfo(archive, profile)); 7.62 + } 7.63 } 7.64 7.65 @Override 7.66 @@ -717,6 +743,11 @@ 7.67 @Override 7.68 public void visitDependence(String origin, Archive source, 7.69 String target, Archive archive, Profile profile) { 7.70 + if (options.findJDKInternals && 7.71 + !(archive instanceof JDKArchive && profile == null)) { 7.72 + // filter dependences other than JDK internal APIs 7.73 + return; 7.74 + } 7.75 // if -P option is specified, package name -> profile will 7.76 // be shown and filter out multiple same edges. 7.77 String name = getProfileArchiveInfo(archive, profile);
8.1 --- a/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties Sun Dec 08 22:04:41 2013 -0800 8.2 +++ b/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties Fri Dec 13 17:24:01 2013 -0800 8.3 @@ -59,10 +59,19 @@ 8.4 main.opt.dotoutput=\ 8.5 \ -dotoutput <dir> Destination directory for DOT file output 8.6 8.7 +main.opt.jdkinternals=\ 8.8 +\ -jdkinternals Finds class-level dependences on JDK internal APIs.\n\ 8.9 +\ By default, it analyzes all classes on -classpath\n\ 8.10 +\ and input files unless -include option is specified.\n\ 8.11 +\ This option cannot be used with -p, -e and -s options.\n\ 8.12 +\ WARNING: JDK internal APIs may not be accessible in\n\ 8.13 +\ the next release. 8.14 + 8.15 main.opt.depth=\ 8.16 \ -depth=<depth> Specify the depth of the transitive\n\ 8.17 \ dependency analysis 8.18 8.19 + 8.20 err.unknown.option=unknown option: {0} 8.21 err.missing.arg=no value given for {0} 8.22 err.internal.error=internal error: {0} {1} {2}
9.1 --- a/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java Sun Dec 08 22:04:41 2013 -0800 9.2 +++ b/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java Fri Dec 13 17:24:01 2013 -0800 9.3 @@ -1,5 +1,5 @@ 9.4 /* 9.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 9.6 + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 9.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9.8 * 9.9 * This code is free software; you can redistribute it and/or modify it 9.10 @@ -23,7 +23,7 @@ 9.11 9.12 /* 9.13 * @test 9.14 - * @bug 6553182 9.15 + * @bug 6553182 8025416 9.16 * @summary This test verifies the -Xdocrootparent option. 9.17 * @author Bhavesh Patel 9.18 * @library ../lib/ 9.19 @@ -35,43 +35,87 @@ 9.20 private static final String BUG_ID = "6553182"; 9.21 private static final String[][] TEST1 = { 9.22 {BUG_ID + FS + "pkg1" + FS + "C1.html", 9.23 - "<a href=\"../../technotes/guides/index.html\">" 9.24 + "Refer <a href=\"../../technotes/guides/index.html\">Here</a>" 9.25 + }, 9.26 + {BUG_ID + FS + "pkg1" + FS + "C1.html", 9.27 + "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced" + NL + 9.28 + " with an absolute link." 9.29 + }, 9.30 + {BUG_ID + FS + "pkg1" + FS + "C1.html", 9.31 + "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL + 9.32 + " <a href=\"../pkg2/C2.html\">Link 2</a>." 9.33 }, 9.34 {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 9.35 - "<a href=\"../../technotes/guides/index.html\">" 9.36 + "<a href=\"../../technotes/guides/index.html\">" + NL + 9.37 + " Test document 1</a>" 9.38 + }, 9.39 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 9.40 + "<a href=\"../pkg2/C2.html\">" + NL + 9.41 + " Another Test document 1</a>" 9.42 + }, 9.43 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 9.44 + "<a href=\"../technotes/guides/index.html\">" + NL + 9.45 + " Another Test document 2.</a>" 9.46 } 9.47 }; 9.48 private static final String[][] NEGATED_TEST1 = { 9.49 {BUG_ID + FS + "pkg1" + FS + "C1.html", 9.50 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" 9.51 }, 9.52 + {BUG_ID + FS + "pkg1" + FS + "C1.html", 9.53 + "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">" 9.54 + }, 9.55 {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 9.56 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" 9.57 + }, 9.58 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 9.59 + "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">" 9.60 } 9.61 }; 9.62 private static final String[][] TEST2 = { 9.63 - {BUG_ID + FS + "pkg2" + FS + "C2.html", 9.64 - "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" 9.65 + {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", 9.66 + "Refer <a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>" 9.67 }, 9.68 - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", 9.69 - "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" 9.70 + {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", 9.71 + "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced" + NL + 9.72 + " with an absolute link." 9.73 + }, 9.74 + {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", 9.75 + "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL + 9.76 + " <a href=\"../pkg1/C1.html\">Link 2</a>." 9.77 + }, 9.78 + {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", 9.79 + "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" + NL + 9.80 + " Test document 1</a>" 9.81 + }, 9.82 + {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", 9.83 + "<a href=\"../pkg1/C1.html\">" + NL + " Another Test document 1</a>" 9.84 + }, 9.85 + {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", 9.86 + "<a href=\"../technotes/guides/index.html\">" + NL + " Another Test document 2.</a>" 9.87 } 9.88 }; 9.89 private static final String[][] NEGATED_TEST2 = { 9.90 - {BUG_ID + FS + "pkg2" + FS + "C2.html", 9.91 + {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", 9.92 "<a href=\"../../technotes/guides/index.html\">" 9.93 }, 9.94 - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", 9.95 + {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", 9.96 + "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">" 9.97 + }, 9.98 + {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", 9.99 "<a href=\"../../technotes/guides/index.html\">" 9.100 + }, 9.101 + {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", 9.102 + "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">" 9.103 } 9.104 }; 9.105 private static final String[] ARGS1 = 9.106 new String[]{ 9.107 - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1" 9.108 + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2" 9.109 }; 9.110 private static final String[] ARGS2 = 9.111 new String[]{ 9.112 - "-d", BUG_ID, "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg2" 9.113 + "-d", BUG_ID + "-1", "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg1", "pkg2" 9.114 }; 9.115 9.116 /**
10.1 --- a/test/com/sun/javadoc/testDocRootLink/pkg1/C1.java Sun Dec 08 22:04:41 2013 -0800 10.2 +++ b/test/com/sun/javadoc/testDocRootLink/pkg1/C1.java Fri Dec 13 17:24:01 2013 -0800 10.3 @@ -25,7 +25,12 @@ 10.4 10.5 /** 10.6 * Class 1. This is a test. 10.7 - * Refer <a href="{@docRoot}/../technotes/guides/index.html">Here</a>. Lets see if this works 10.8 - * or not. 10.9 + * Refer <a href="{@docRoot}/../technotes/guides/index.html">Here</a>. This link should 10.10 + * not be replaced with an absolute link. 10.11 + * This <a href="{@docRoot}/pkg2/C2.html">Here</a> should not be replaced 10.12 + * with an absolute link. 10.13 + * Testing <a href="{@docRoot}/technotes/guides/index.html">Link 1</a> and 10.14 + * <a href="{@docRoot}/pkg2/C2.html">Link 2</a>. 2 back-to-back links using 10.15 + * docroot. These should not be replaced with an absolute link. 10.16 */ 10.17 public class C1 {}
11.1 --- a/test/com/sun/javadoc/testDocRootLink/pkg1/package.html Sun Dec 08 22:04:41 2013 -0800 11.2 +++ b/test/com/sun/javadoc/testDocRootLink/pkg1/package.html Fri Dec 13 17:24:01 2013 -0800 11.3 @@ -3,16 +3,16 @@ 11.4 <title>javax.management package</title> 11.5 </head> 11.6 <body bgcolor="white"> 11.7 -This is a test. 11.8 - <p id="spec"> 11.9 - @see <a href="{@docRoot}/../technotes/guides/index.html"> 11.10 - Test document 1</a> 11.11 - in particular the 11.12 - <a href="{@docRoot}/../technotes/guides/index.html"> 11.13 + This is a test. 11.14 + <p id="spec"> 11.15 + @see <a href="{@docRoot}/../technotes/guides/index.html"> 11.16 + Test document 1</a> should not be replaced with an absolute link. 11.17 + @see <a href="{@docRoot}/pkg2/C2.html"> 11.18 + Another Test document 1</a> which should not be replaced with an absolute link. 11.19 + <a href="{@docRoot}/technotes/guides/index.html"> 11.20 + Another Test document 2.</a> which should not be replaced with an absolute link. 11.21 11.22 - Test document 2.</a> 11.23 - 11.24 - @since 1.5 11.25 + @since 1.5 11.26 11.27 </body> 11.28 </html>
12.1 --- a/test/com/sun/javadoc/testDocRootLink/pkg2/C2.java Sun Dec 08 22:04:41 2013 -0800 12.2 +++ b/test/com/sun/javadoc/testDocRootLink/pkg2/C2.java Fri Dec 13 17:24:01 2013 -0800 12.3 @@ -24,8 +24,13 @@ 12.4 package pkg2; 12.5 12.6 /** 12.7 - * Class 1. This is a test. 12.8 - * Refer <a href="{@docRoot}/../technotes/guides/index.html">Here</a>. Lets see if this works 12.9 - * or not. 12.10 + * Class 2. This is a test. 12.11 + * Refer <a href="{@docRoot}/../technotes/guides/index.html">Here</a> should be 12.12 + * replaced with an absolute link. 12.13 + * This <a href="{@docRoot}/pkg1/C1.html">Here</a> should not be replaced 12.14 + * with an absolute link. 12.15 + * Testing <a href="{@docRoot}/technotes/guides/index.html">Link 1</a> and 12.16 + * <a href="{@docRoot}/pkg1/C1.html">Link 2</a>. Both should not be replaced with 12.17 + * an absolute link. 12.18 */ 12.19 public class C2 {}
13.1 --- a/test/com/sun/javadoc/testDocRootLink/pkg2/package.html Sun Dec 08 22:04:41 2013 -0800 13.2 +++ b/test/com/sun/javadoc/testDocRootLink/pkg2/package.html Fri Dec 13 17:24:01 2013 -0800 13.3 @@ -3,16 +3,16 @@ 13.4 <title>javax.management package</title> 13.5 </head> 13.6 <body bgcolor="white"> 13.7 -This is a test. 13.8 - <p id="spec"> 13.9 - @see <a href="{@docRoot}/../technotes/guides/index.html"> 13.10 - Test document 1</a> 13.11 - in particular the 13.12 - <a href="{@docRoot}/../technotes/guides/index.html"> 13.13 + This is a test. 13.14 + <p id="spec"> 13.15 + @see <a href="{@docRoot}/../technotes/guides/index.html"> 13.16 + Test document 1</a> should be replaced with an absolute link. 13.17 + @see <a href="{@docRoot}/pkg1/C1.html"> 13.18 + Another Test document 1</a> which should not be replaced with an absolute link. 13.19 + <a href="{@docRoot}/technotes/guides/index.html"> 13.20 + Another Test document 2.</a> which should not be replaced with an absolute link. 13.21 13.22 - Test document 2.</a> 13.23 - 13.24 - @since 1.5 13.25 + @since 1.5 13.26 13.27 </body> 13.28 </html>
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 14.2 +++ b/test/tools/javac/T8029179/CompileErrorForValidBooleanExpTest.java Fri Dec 13 17:24:01 2013 -0800 14.3 @@ -0,0 +1,56 @@ 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 8029179 14.30 + * @summary javac produces a compile error for valid boolean expressions 14.31 + * @compile CompileErrorForValidBooleanExpTest.java 14.32 + */ 14.33 + 14.34 +public class CompileErrorForValidBooleanExpTest { 14.35 + static int a, b, c, d; 14.36 + 14.37 + static void m() { 14.38 + boolean cond1 = (a < b & c > d); 14.39 + boolean cond2 = (f1() < f2() & c > d); 14.40 + boolean cond3 = (f1() < b & f3() > d); 14.41 + boolean cond4 = (f1() < b & f3() > 1); 14.42 + } 14.43 + 14.44 + static int f1() { 14.45 + return 0; 14.46 + } 14.47 + 14.48 + static int f2() { 14.49 + return 0; 14.50 + } 14.51 + 14.52 + static int f3() { 14.53 + return 0; 14.54 + } 14.55 + 14.56 + static int f4() { 14.57 + return 0; 14.58 + } 14.59 +}
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 15.2 +++ b/test/tools/javac/annotations/typeAnnotations/failures/CheckForDeclAnnoNPE.java Fri Dec 13 17:24:01 2013 -0800 15.3 @@ -0,0 +1,43 @@ 15.4 +/* 15.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 15.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 15.7 + * 15.8 + * This code is free software; you can redistribute it and/or modify it 15.9 + * under the terms of the GNU General Public License version 2 only, as 15.10 + * published by the Free Software Foundation. 15.11 + * 15.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 15.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15.15 + * version 2 for more details (a copy is included in the LICENSE file that 15.16 + * accompanied this code). 15.17 + * 15.18 + * You should have received a copy of the GNU General Public License version 15.19 + * 2 along with this work; if not, write to the Free Software Foundation, 15.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 15.21 + * 15.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 15.23 + * or visit www.oracle.com if you need additional information or have any 15.24 + * questions. 15.25 + */ 15.26 + 15.27 +/* 15.28 + * @test 15.29 + * @bug 8028699 15.30 + * @summary Ensure there is no NPE in checking for decl. annotations in this example 15.31 + * @author Werner Dietl 15.32 + * @compile -doe CheckForDeclAnnoNPE.java 15.33 + */ 15.34 + 15.35 +import java.lang.annotation.ElementType; 15.36 +import java.lang.annotation.Target; 15.37 + 15.38 + 15.39 +class CheckForDeclAnnoNPE { 15.40 + void test(String s) { 15.41 + test(new @TA String().toString()); 15.42 + } 15.43 +} 15.44 + 15.45 +@Target(ElementType.TYPE_USE) 15.46 +@interface TA {}
16.1 --- a/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java Sun Dec 08 22:04:41 2013 -0800 16.2 +++ b/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java Fri Dec 13 17:24:01 2013 -0800 16.3 @@ -10,9 +10,6 @@ 16.4 Object e1 = new @DA int[5]; 16.5 Object e2 = new @DA String[42]; 16.6 Object e3 = new @DA Object(); 16.7 - 16.8 - // The declaration annotation is only allowed for 16.9 - // an anonymous class creation. 16.10 Object ok = new @DA Object() { }; 16.11 } 16.12
17.1 --- a/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out Sun Dec 08 22:04:41 2013 -0800 17.2 +++ b/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out Fri Dec 13 17:24:01 2013 -0800 17.3 @@ -1,5 +1,5 @@ 17.4 DeclarationAnnotation.java:10:21: compiler.err.annotation.type.not.applicable 17.5 DeclarationAnnotation.java:11:21: compiler.err.annotation.type.not.applicable 17.6 DeclarationAnnotation.java:12:21: compiler.err.annotation.type.not.applicable 17.7 -DeclarationAnnotation.java:16:21: compiler.err.annotation.type.not.applicable 17.8 +DeclarationAnnotation.java:13:21: compiler.err.annotation.type.not.applicable 17.9 4 errors
18.1 --- a/test/tools/jdeps/APIDeps.java Sun Dec 08 22:04:41 2013 -0800 18.2 +++ b/test/tools/jdeps/APIDeps.java Fri Dec 13 17:24:01 2013 -0800 18.3 @@ -23,8 +23,8 @@ 18.4 18.5 /* 18.6 * @test 18.7 - * @bug 8015912 18.8 - * @summary find API dependencies 18.9 + * @bug 8015912 8029216 18.10 + * @summary Test -apionly and -jdkinternals options 18.11 * @build m.Bar m.Foo m.Gee b.B c.C c.I d.D e.E f.F g.G 18.12 * @run main APIDeps 18.13 */ 18.14 @@ -88,6 +88,19 @@ 18.15 new String[] {"g.G", "sun.misc.Lock"}, 18.16 new String[] {testDirBasename, "JDK internal API"}, 18.17 new String[] {"-classpath", testDir.getPath(), "-verbose"}); 18.18 + 18.19 + // -jdkinternals 18.20 + test(new File(mDir, "Gee.class"), 18.21 + new String[] {"sun.misc.Lock"}, 18.22 + new String[] {"JDK internal API"}, 18.23 + new String[] {"-jdkinternals"}); 18.24 + // -jdkinternals parses all classes on -classpath and the input arguments 18.25 + test(new File(mDir, "Gee.class"), 18.26 + new String[] {"sun.misc.Lock", "sun.misc.Unsafe"}, 18.27 + new String[] {"JDK internal API"}, 18.28 + new String[] {"-classpath", testDir.getPath(), "-jdkinternals"}); 18.29 + 18.30 + // parse only APIs 18.31 // parse only APIs 18.32 test(mDir, 18.33 new String[] {"java.lang.Object", "java.lang.String",