# HG changeset patch # User lana # Date 1455831779 28800 # Node ID 8d48ff7e2cf201c385e8095c12918eae74f3619a # Parent 8f8123d7ecd7c0b984a881bcb4ee25139cf6ece4# Parent 0a4c7a4fde8d19cb0d7b4a769a28ea3d0545e5ba Merge diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java --- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Thu Feb 18 13:42:59 2016 -0800 @@ -212,13 +212,6 @@ * used.Default is don't show version information. */ public boolean showversion = false; - - /** - * Sourcepath from where to read the source files. Default is classpath. - * - */ - public String sourcepath = ""; - /** * Argument for command line option "-Xprofilespath". */ @@ -492,11 +485,6 @@ showversion = true; } else if (opt.equals("-nodeprecated")) { nodeprecated = true; - } else if (opt.equals("-sourcepath")) { - sourcepath = os[1]; - } else if ((opt.equals("-classpath") || opt.equals("-cp")) && - sourcepath.length() == 0) { - sourcepath = os[1]; } else if (opt.equals("-excludedocfilessubdir")) { addToSet(excludedDocFileDirs, os[1]); } else if (opt.equals("-noqualifier")) { @@ -541,10 +529,6 @@ extern.link(url, pkglisturl, root, true); } } - if (sourcepath.length() == 0) { - sourcepath = System.getProperty("env.class.path") == null ? "" : - System.getProperty("env.class.path"); - } if (docencoding == null) { docencoding = encoding; } diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties --- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Thu Feb 18 13:42:59 2016 -0800 @@ -23,7 +23,6 @@ doclet.Copying_File_0_To_Dir_1=Copying file {0} to directory {1}... doclet.Copying_File_0_To_File_1=Copying file {0} to file {1}... doclet.No_Public_Classes_To_Document=No public or protected classes found to document. -doclet.Unable_to_create_directory_0=Unable to create directory {0} doclet.destination_directory_not_directory_0=Destination directory is not a directory {0} doclet.destination_directory_not_writable_0=Destination directory not writable {0} doclet.Encoding_not_supported=Encoding not supported: {0} diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java --- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java Thu Feb 18 13:42:59 2016 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -257,8 +257,8 @@ try { if (file.exists() && file.canRead()) { boolean pathIsRelative = - !DocFile.createFileForInput(configuration, path).isAbsolute() - && !isUrl(path); + !isUrl(path) + && !DocFile.createFileForInput(configuration, path).isAbsolute(); readPackageList(file.openInputStream(), path, pathIsRelative); } else { throw new Fault(configuration.getText("doclet.File_error", file.getPath()), null); diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/SimpleDocFileFactory.java --- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/SimpleDocFileFactory.java Thu Feb 18 11:30:21 2016 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,292 +0,0 @@ -/* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.util; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; -import java.io.Writer; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import javax.tools.DocumentationTool; -import javax.tools.JavaFileManager.Location; -import javax.tools.StandardLocation; - -import com.sun.tools.doclets.internal.toolkit.Configuration; - -/** - * Implementation of DocFileFactory that just uses java.io.File API, - * and does not use a JavaFileManager.. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @since 1.8 - */ -class SimpleDocFileFactory extends DocFileFactory { - - public SimpleDocFileFactory(Configuration configuration) { - super(configuration); - } - - public DocFile createFileForDirectory(String file) { - return new SimpleDocFile(new File(file)); - } - - public DocFile createFileForInput(String file) { - return new SimpleDocFile(new File(file)); - } - - public DocFile createFileForOutput(DocPath path) { - return new SimpleDocFile(DocumentationTool.Location.DOCUMENTATION_OUTPUT, path); - } - - @Override - Iterable list(Location location, DocPath path) { - if (location != StandardLocation.SOURCE_PATH) - throw new IllegalArgumentException(); - - Set files = new LinkedHashSet<>(); - for (String s : configuration.sourcepath.split(File.pathSeparator)) { - if (s.isEmpty()) - continue; - File f = new File(s); - if (f.isDirectory()) { - f = new File(f, path.getPath()); - if (f.exists()) - files.add(new SimpleDocFile(f)); - } - } - return files; - } - - class SimpleDocFile extends DocFile { - private File file; - - /** Create a DocFile for a given file. */ - private SimpleDocFile(File file) { - super(configuration); - this.file = file; - } - - /** Create a DocFile for a given location and relative path. */ - private SimpleDocFile(Location location, DocPath path) { - super(configuration, location, path); - String destDirName = configuration.destDirName; - this.file = destDirName.isEmpty() ? new File(path.getPath()) - : new File(destDirName, path.getPath()); - } - - /** Open an input stream for the file. */ - public InputStream openInputStream() throws FileNotFoundException { - return new BufferedInputStream(new FileInputStream(file)); - } - - /** - * Open an output stream for the file. - * The file must have been created with a location of - * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} and a corresponding relative path. - */ - public OutputStream openOutputStream() throws IOException, UnsupportedEncodingException { - if (location != DocumentationTool.Location.DOCUMENTATION_OUTPUT) - throw new IllegalStateException(); - - createDirectoryForFile(file); - return new BufferedOutputStream(new FileOutputStream(file)); - } - - /** - * Open an writer for the file, using the encoding (if any) given in the - * doclet configuration. - * The file must have been created with a location of - * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} and a corresponding relative path. - */ - public Writer openWriter() throws IOException, UnsupportedEncodingException { - if (location != DocumentationTool.Location.DOCUMENTATION_OUTPUT) - throw new IllegalStateException(); - - createDirectoryForFile(file); - FileOutputStream fos = new FileOutputStream(file); - if (configuration.docencoding == null) { - return new BufferedWriter(new OutputStreamWriter(fos)); - } else { - return new BufferedWriter(new OutputStreamWriter(fos, configuration.docencoding)); - } - } - - /** Return true if the file can be read. */ - public boolean canRead() { - return file.canRead(); - } - - /** Return true if the file can be written. */ - public boolean canWrite() { - return file.canRead(); - } - - /** Return true if the file exists. */ - public boolean exists() { - return file.exists(); - } - - /** Return the base name (last component) of the file name. */ - public String getName() { - return file.getName(); - } - - /** Return the file system path for this file. */ - public String getPath() { - return file.getPath(); - } - - /** Return true is file has an absolute path name. */ - public boolean isAbsolute() { - return file.isAbsolute(); - } - - /** Return true is file identifies a directory. */ - public boolean isDirectory() { - return file.isDirectory(); - } - - /** Return true is file identifies a file. */ - public boolean isFile() { - return file.isFile(); - } - - /** Return true if this file is the same as another. */ - public boolean isSameFile(DocFile other) { - if (!(other instanceof SimpleDocFile)) - return false; - - try { - return file.exists() - && file.getCanonicalFile().equals(((SimpleDocFile)other).file.getCanonicalFile()); - } catch (IOException e) { - return false; - } - } - - /** If the file is a directory, list its contents. */ - public Iterable list() { - List files = new ArrayList<>(); - for (File f: file.listFiles()) { - files.add(new SimpleDocFile(f)); - } - return files; - } - - /** Create the file as a directory, including any parent directories. */ - public boolean mkdirs() { - return file.mkdirs(); - } - - /** - * Derive a new file by resolving a relative path against this file. - * The new file will inherit the configuration and location of this file - * If this file has a path set, the new file will have a corresponding - * new path. - */ - public DocFile resolve(DocPath p) { - return resolve(p.getPath()); - } - - /** - * Derive a new file by resolving a relative path against this file. - * The new file will inherit the configuration and location of this file - * If this file has a path set, the new file will have a corresponding - * new path. - */ - public DocFile resolve(String p) { - if (location == null && path == null) { - return new SimpleDocFile(new File(file, p)); - } else { - return new SimpleDocFile(location, path.resolve(p)); - } - } - - /** - * Resolve a relative file against the given output location. - * @param locn Currently, only - * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} is supported. - */ - public DocFile resolveAgainst(Location locn) { - if (locn != DocumentationTool.Location.DOCUMENTATION_OUTPUT) - throw new IllegalArgumentException(); - return new SimpleDocFile( - new File(configuration.destDirName, file.getPath())); - } - - /** - * Given a path string create all the directories in the path. For example, - * if the path string is "java/applet", the method will create directory - * "java" and then "java/applet" if they don't exist. The file separator - * string "/" is platform dependent system property. - * - * @param path Directory path string. - */ - private void createDirectoryForFile(File file) { - File dir = file.getParentFile(); - if (dir == null || dir.exists() || dir.mkdirs()) - return; - - configuration.message.error( - "doclet.Unable_to_create_directory_0", dir.getPath()); - throw new DocletAbortException("can't create directory"); - } - - /** Return a string to identify the contents of this object, - * for debugging purposes. - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("DocFile["); - if (location != null) - sb.append("locn:").append(location).append(","); - if (path != null) - sb.append("path:").append(path.getPath()).append(","); - sb.append("file:").append(file); - sb.append("]"); - return sb.toString(); - } - - } -} diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/StandardDocFileFactory.java --- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/StandardDocFileFactory.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/StandardDocFileFactory.java Thu Feb 18 13:42:59 2016 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,13 +28,16 @@ import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedWriter; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -63,37 +66,37 @@ */ class StandardDocFileFactory extends DocFileFactory { private final StandardJavaFileManager fileManager; - private File destDir; + private Path destDir; public StandardDocFileFactory(Configuration configuration) { super(configuration); fileManager = (StandardJavaFileManager) configuration.getFileManager(); } - private File getDestDir() { + private Path getDestDir() { if (destDir == null) { if (!configuration.destDirName.isEmpty() || !fileManager.hasLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT)) { try { String dirName = configuration.destDirName.isEmpty() ? "." : configuration.destDirName; - File dir = new File(dirName); - fileManager.setLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT, Arrays.asList(dir)); + Path dir = Paths.get(dirName); + fileManager.setLocationFromPaths(DocumentationTool.Location.DOCUMENTATION_OUTPUT, Arrays.asList(dir)); } catch (IOException e) { throw new DocletAbortException(e); } } - destDir = fileManager.getLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT).iterator().next(); + destDir = fileManager.getLocationAsPaths(DocumentationTool.Location.DOCUMENTATION_OUTPUT).iterator().next(); } return destDir; } public DocFile createFileForDirectory(String file) { - return new StandardDocFile(new File(file)); + return new StandardDocFile(Paths.get(file)); } public DocFile createFileForInput(String file) { - return new StandardDocFile(new File(file)); + return new StandardDocFile(Paths.get(file)); } public DocFile createFileForOutput(DocPath path) { @@ -108,26 +111,25 @@ Set files = new LinkedHashSet<>(); Location l = fileManager.hasLocation(StandardLocation.SOURCE_PATH) ? StandardLocation.SOURCE_PATH : StandardLocation.CLASS_PATH; - for (File f: fileManager.getLocation(l)) { - if (f.isDirectory()) { - f = new File(f, path.getPath()); - if (f.exists()) + for (Path f: fileManager.getLocationAsPaths(l)) { + if (Files.isDirectory(f)) { + f = f.resolve(path.getPath()); + if (Files.exists(f)) files.add(new StandardDocFile(f)); } } return files; } - private static File newFile(File dir, String path) { - return (dir == null) ? new File(path) : new File(dir, path); + private static Path newFile(Path dir, String path) { + return (dir == null) ? Paths.get(path) : dir.resolve(path); } class StandardDocFile extends DocFile { - private File file; - + private Path file; /** Create a StandardDocFile for a given file. */ - private StandardDocFile(File file) { + private StandardDocFile(Path file) { super(configuration); this.file = file; } @@ -178,27 +180,27 @@ /** Return true if the file can be read. */ public boolean canRead() { - return file.canRead(); + return Files.isReadable(file); } /** Return true if the file can be written. */ public boolean canWrite() { - return file.canWrite(); + return Files.isWritable(file); } /** Return true if the file exists. */ public boolean exists() { - return file.exists(); + return Files.exists(file); } /** Return the base name (last component) of the file name. */ public String getName() { - return file.getName(); + return file.getFileName().toString(); } /** Return the file system path for this file. */ public String getPath() { - return file.getPath(); + return file.toString(); } /** Return true is file has an absolute path name. */ @@ -208,12 +210,12 @@ /** Return true is file identifies a directory. */ public boolean isDirectory() { - return file.isDirectory(); + return Files.isDirectory(file); } /** Return true is file identifies a file. */ public boolean isFile() { - return file.isFile(); + return Files.isRegularFile(file); } /** Return true if this file is the same as another. */ @@ -222,25 +224,31 @@ return false; try { - return file.exists() - && file.getCanonicalFile().equals(((StandardDocFile) other).file.getCanonicalFile()); + return Files.isSameFile(file, ((StandardDocFile) other).file); } catch (IOException e) { return false; } } /** If the file is a directory, list its contents. */ - public Iterable list() { - List files = new ArrayList<>(); - for (File f: file.listFiles()) { - files.add(new StandardDocFile(f)); + public Iterable list() throws IOException { + List files = new ArrayList(); + try (DirectoryStream ds = Files.newDirectoryStream(file)) { + for (Path f: ds) { + files.add(new StandardDocFile(f)); + } } return files; } /** Create the file as a directory, including any parent directories. */ public boolean mkdirs() { - return file.mkdirs(); + try { + Files.createDirectories(file); + return true; + } catch (IOException e) { + return false; + } } /** @@ -261,7 +269,7 @@ */ public DocFile resolve(String p) { if (location == null && path == null) { - return new StandardDocFile(new File(file, p)); + return new StandardDocFile(file.resolve(p)); } else { return new StandardDocFile(location, path.resolve(p)); } @@ -270,12 +278,12 @@ /** * Resolve a relative file against the given output location. * @param locn Currently, only - * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} is supported. + * {@link DocumentationTool.Location.DOCUMENTATION_OUTPUT} is supported. */ public DocFile resolveAgainst(Location locn) { if (locn != DocumentationTool.Location.DOCUMENTATION_OUTPUT) throw new IllegalArgumentException(); - return new StandardDocFile(newFile(getDestDir(), file.getPath())); + return new StandardDocFile(getDestDir().resolve(file)); } /** Return a string to identify the contents of this object, @@ -284,7 +292,7 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("StandardDocFile["); + sb.append("PathDocFile["); if (location != null) sb.append("locn:").append(location).append(","); if (path != null) @@ -294,7 +302,7 @@ return sb.toString(); } - private JavaFileObject getJavaFileObjectForInput(File file) { + private JavaFileObject getJavaFileObjectForInput(Path file) { return fileManager.getJavaFileObjects(file).iterator().next(); } diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Thu Feb 18 13:42:59 2016 -0800 @@ -261,10 +261,13 @@ // According to JLS, we should not be showing public modifier for // interface methods. if ((utils.isField(member) || utils.isMethod(member)) - && writer instanceof ClassWriterImpl - && utils.isInterface(((ClassWriterImpl) writer).getTypeElement())) { + && ((writer instanceof ClassWriterImpl + && utils.isInterface(((ClassWriterImpl) writer).getTypeElement()) || + writer instanceof AnnotationTypeWriterImpl) )) { // Remove the implicit abstract and public modifiers - if (utils.isMethod(member) && utils.isInterface(member.getEnclosingElement())) { + if (utils.isMethod(member) && + (utils.isInterface(member.getEnclosingElement()) || + utils.isAnnotationType(member.getEnclosingElement()))) { set.remove(ABSTRACT); set.remove(PUBLIC); } diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Thu Feb 18 13:42:59 2016 -0800 @@ -2363,7 +2363,9 @@ if (!map.isEmpty()) { annotation.addContent("("); boolean isFirst = true; - for (ExecutableElement element : map.keySet()) { + Set keys = map.keySet(); + boolean multipleValues = keys.size() > 1; + for (ExecutableElement element : keys) { if (isFirst) { isFirst = false; } else { @@ -2376,9 +2378,12 @@ } } } - annotation.addContent(getDocLink(LinkInfoImpl.Kind.ANNOTATION, - element, element.getSimpleName().toString(), false)); - annotation.addContent("="); + String simpleName = element.getSimpleName().toString(); + if (multipleValues || !"value".equals(simpleName)) { // Omit "value=" where unnecessary + annotation.addContent(getDocLink(LinkInfoImpl.Kind.ANNOTATION, + element, simpleName, false)); + annotation.addContent("="); + } AnnotationValue annotationValue = map.get(element); List annotationTypeValues = new ArrayList<>(); new SimpleAnnotationValueVisitor9() { diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java Thu Feb 18 13:42:59 2016 -0800 @@ -240,12 +240,6 @@ public boolean showversion = false; /** - * Sourcepath from where to read the source files. Default is classpath. - * - */ - public String sourcepath = ""; - - /** * Don't generate deprecated API information at all, if -nodeprecated * option is used. nodepracted is set to true if * -nodeprecated option is used. Default is generate deprected API @@ -389,26 +383,6 @@ return true; } }, - new Hidden(this, "classpath", 1) { - @Override - public boolean process(String opt, ListIterator args) { - if (sourcepath.length() == 0) { - optionsProcessed.add(this); - sourcepath = args.next(); - } - return true; - } - }, - new Hidden(this, "cp", 1) { - @Override - public boolean process(String opt, ListIterator args) { - if (sourcepath.length() == 0) { - optionsProcessed.add(this); - sourcepath = args.next(); - } - return true; - } - }, new Option(this, "d", 1) { @Override public boolean process(String opt, ListIterator args) { @@ -555,14 +529,6 @@ return true; } }, - new Hidden(this, "sourcepath", 1) { - @Override - public boolean process(String opt, ListIterator args) { - optionsProcessed.add(this); - sourcepath = args.next(); - return true; - } - }, new Option(this, "sourcetab", 1) { @Override public boolean process(String opt, ListIterator args) { @@ -638,9 +604,6 @@ extern.link(urlForLink, pkglistUrlForLink, reporter, false); if (urlForLinkOffline != null && pkglistUrlForLinkOffline != null) extern.link(urlForLinkOffline, pkglistUrlForLinkOffline, reporter, true); - if (sourcepath.length() == 0) { - sourcepath = System.getProperty("env.class.path", ""); - } if (docencoding == null) { docencoding = encoding; } diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties Thu Feb 18 13:42:59 2016 -0800 @@ -23,7 +23,6 @@ doclet.Copying_File_0_To_Dir_1=Copying file {0} to directory {1}... doclet.Copying_File_0_To_File_1=Copying file {0} to file {1}... doclet.No_Public_Classes_To_Document=No public or protected classes found to document. -doclet.Unable_to_create_directory_0=Unable to create directory {0} doclet.destination_directory_not_directory_0=Destination directory is not a directory {0} doclet.destination_directory_not_writable_0=Destination directory not writable {0} doclet.Encoding_not_supported=Encoding not supported: {0} diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java Thu Feb 18 13:42:59 2016 -0800 @@ -261,8 +261,8 @@ try { if (file.exists() && file.canRead()) { boolean pathIsRelative = - !DocFile.createFileForInput(configuration, path).isAbsolute() - && !isUrl(path); + !isUrl(path) + && !DocFile.createFileForInput(configuration, path).isAbsolute(); readPackageList(file.openInputStream(), path, pathIsRelative); } else { throw new Fault(configuration.getText("doclet.File_error", file.getPath()), null); diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/SimpleDocFileFactory.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/SimpleDocFileFactory.java Thu Feb 18 11:30:21 2016 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,291 +0,0 @@ -/* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package jdk.javadoc.internal.doclets.toolkit.util; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; -import java.io.Writer; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import javax.tools.DocumentationTool; -import javax.tools.JavaFileManager.Location; -import javax.tools.StandardLocation; - -import jdk.javadoc.internal.doclets.toolkit.Configuration; - -/** - * Implementation of DocFileFactory that just uses java.io.File API, - * and does not use a JavaFileManager.. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - */ -class SimpleDocFileFactory extends DocFileFactory { - - public SimpleDocFileFactory(Configuration configuration) { - super(configuration); - } - - public DocFile createFileForDirectory(String file) { - return new SimpleDocFile(new File(file)); - } - - public DocFile createFileForInput(String file) { - return new SimpleDocFile(new File(file)); - } - - public DocFile createFileForOutput(DocPath path) { - return new SimpleDocFile(DocumentationTool.Location.DOCUMENTATION_OUTPUT, path); - } - - @Override - Iterable list(Location location, DocPath path) { - if (location != StandardLocation.SOURCE_PATH) - throw new IllegalArgumentException(); - - Set files = new LinkedHashSet<>(); - for (String s : configuration.sourcepath.split(File.pathSeparator)) { - if (s.isEmpty()) - continue; - File f = new File(s); - if (f.isDirectory()) { - f = new File(f, path.getPath()); - if (f.exists()) - files.add(new SimpleDocFile(f)); - } - } - return files; - } - - class SimpleDocFile extends DocFile { - private File file; - - /** Create a DocFile for a given file. */ - private SimpleDocFile(File file) { - super(configuration); - this.file = file; - } - - /** Create a DocFile for a given location and relative path. */ - private SimpleDocFile(Location location, DocPath path) { - super(configuration, location, path); - String destDirName = configuration.destDirName; - this.file = destDirName.isEmpty() ? new File(path.getPath()) - : new File(destDirName, path.getPath()); - } - - /** Open an input stream for the file. */ - public InputStream openInputStream() throws FileNotFoundException { - return new BufferedInputStream(new FileInputStream(file)); - } - - /** - * Open an output stream for the file. - * The file must have been created with a location of - * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} and a corresponding relative path. - */ - public OutputStream openOutputStream() throws IOException, UnsupportedEncodingException { - if (location != DocumentationTool.Location.DOCUMENTATION_OUTPUT) - throw new IllegalStateException(); - - createDirectoryForFile(file); - return new BufferedOutputStream(new FileOutputStream(file)); - } - - /** - * Open an writer for the file, using the encoding (if any) given in the - * doclet configuration. - * The file must have been created with a location of - * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} and a corresponding relative path. - */ - public Writer openWriter() throws IOException, UnsupportedEncodingException { - if (location != DocumentationTool.Location.DOCUMENTATION_OUTPUT) - throw new IllegalStateException(); - - createDirectoryForFile(file); - FileOutputStream fos = new FileOutputStream(file); - if (configuration.docencoding == null) { - return new BufferedWriter(new OutputStreamWriter(fos)); - } else { - return new BufferedWriter(new OutputStreamWriter(fos, configuration.docencoding)); - } - } - - /** Return true if the file can be read. */ - public boolean canRead() { - return file.canRead(); - } - - /** Return true if the file can be written. */ - public boolean canWrite() { - return file.canRead(); - } - - /** Return true if the file exists. */ - public boolean exists() { - return file.exists(); - } - - /** Return the base name (last component) of the file name. */ - public String getName() { - return file.getName(); - } - - /** Return the file system path for this file. */ - public String getPath() { - return file.getPath(); - } - - /** Return true is file has an absolute path name. */ - public boolean isAbsolute() { - return file.isAbsolute(); - } - - /** Return true is file identifies a directory. */ - public boolean isDirectory() { - return file.isDirectory(); - } - - /** Return true is file identifies a file. */ - public boolean isFile() { - return file.isFile(); - } - - /** Return true if this file is the same as another. */ - public boolean isSameFile(DocFile other) { - if (!(other instanceof SimpleDocFile)) - return false; - - try { - return file.exists() - && file.getCanonicalFile().equals(((SimpleDocFile)other).file.getCanonicalFile()); - } catch (IOException e) { - return false; - } - } - - /** If the file is a directory, list its contents. */ - public Iterable list() { - List files = new ArrayList<>(); - for (File f: file.listFiles()) { - files.add(new SimpleDocFile(f)); - } - return files; - } - - /** Create the file as a directory, including any parent directories. */ - public boolean mkdirs() { - return file.mkdirs(); - } - - /** - * Derive a new file by resolving a relative path against this file. - * The new file will inherit the configuration and location of this file - * If this file has a path set, the new file will have a corresponding - * new path. - */ - public DocFile resolve(DocPath p) { - return resolve(p.getPath()); - } - - /** - * Derive a new file by resolving a relative path against this file. - * The new file will inherit the configuration and location of this file - * If this file has a path set, the new file will have a corresponding - * new path. - */ - public DocFile resolve(String p) { - if (location == null && path == null) { - return new SimpleDocFile(new File(file, p)); - } else { - return new SimpleDocFile(location, path.resolve(p)); - } - } - - /** - * Resolve a relative file against the given output location. - * @param locn Currently, only - * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} is supported. - */ - public DocFile resolveAgainst(Location locn) { - if (locn != DocumentationTool.Location.DOCUMENTATION_OUTPUT) - throw new IllegalArgumentException(); - return new SimpleDocFile( - new File(configuration.destDirName, file.getPath())); - } - - /** - * Given a path string create all the directories in the path. For example, - * if the path string is "java/applet", the method will create directory - * "java" and then "java/applet" if they don't exist. The file separator - * string "/" is platform dependent system property. - * - * @param path Directory path string. - */ - private void createDirectoryForFile(File file) { - File dir = file.getParentFile(); - if (dir == null || dir.exists() || dir.mkdirs()) - return; - - configuration.message.error( - "doclet.Unable_to_create_directory_0", dir.getPath()); - throw new DocletAbortException("can't create directory"); - } - - /** Return a string to identify the contents of this object, - * for debugging purposes. - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("DocFile["); - if (location != null) - sb.append("locn:").append(location).append(","); - if (path != null) - sb.append("path:").append(path.getPath()).append(","); - sb.append("file:").append(file); - sb.append("]"); - return sb.toString(); - } - - } -} diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/StandardDocFileFactory.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/StandardDocFileFactory.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/StandardDocFileFactory.java Thu Feb 18 13:42:59 2016 -0800 @@ -28,13 +28,16 @@ import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedWriter; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -48,6 +51,7 @@ import javax.tools.StandardJavaFileManager; import javax.tools.StandardLocation; +import com.sun.tools.javac.util.Assert; import jdk.javadoc.internal.doclets.toolkit.Configuration; /** @@ -61,37 +65,37 @@ */ class StandardDocFileFactory extends DocFileFactory { private final StandardJavaFileManager fileManager; - private File destDir; + private Path destDir; public StandardDocFileFactory(Configuration configuration) { super(configuration); fileManager = (StandardJavaFileManager) configuration.getFileManager(); } - private File getDestDir() { + private Path getDestDir() { if (destDir == null) { if (!configuration.destDirName.isEmpty() || !fileManager.hasLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT)) { try { String dirName = configuration.destDirName.isEmpty() ? "." : configuration.destDirName; - File dir = new File(dirName); - fileManager.setLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT, Arrays.asList(dir)); + Path dir = Paths.get(dirName); + fileManager.setLocationFromPaths(DocumentationTool.Location.DOCUMENTATION_OUTPUT, Arrays.asList(dir)); } catch (IOException e) { throw new DocletAbortException(e); } } - destDir = fileManager.getLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT).iterator().next(); + destDir = fileManager.getLocationAsPaths(DocumentationTool.Location.DOCUMENTATION_OUTPUT).iterator().next(); } return destDir; } public DocFile createFileForDirectory(String file) { - return new StandardDocFile(new File(file)); + return new StandardDocFile(Paths.get(file)); } public DocFile createFileForInput(String file) { - return new StandardDocFile(new File(file)); + return new StandardDocFile(Paths.get(file)); } public DocFile createFileForOutput(DocPath path) { @@ -106,26 +110,25 @@ Set files = new LinkedHashSet<>(); Location l = fileManager.hasLocation(StandardLocation.SOURCE_PATH) ? StandardLocation.SOURCE_PATH : StandardLocation.CLASS_PATH; - for (File f: fileManager.getLocation(l)) { - if (f.isDirectory()) { - f = new File(f, path.getPath()); - if (f.exists()) + for (Path f: fileManager.getLocationAsPaths(l)) { + if (Files.isDirectory(f)) { + f = f.resolve(path.getPath()); + if (Files.exists(f)) files.add(new StandardDocFile(f)); } } return files; } - private static File newFile(File dir, String path) { - return (dir == null) ? new File(path) : new File(dir, path); + private static Path newFile(Path dir, String path) { + return (dir == null) ? Paths.get(path) : dir.resolve(path); } class StandardDocFile extends DocFile { - private File file; - + private Path file; /** Create a StandardDocFile for a given file. */ - private StandardDocFile(File file) { + private StandardDocFile(Path file) { super(configuration); this.file = file; } @@ -133,9 +136,7 @@ /** Create a StandardDocFile for a given location and relative path. */ private StandardDocFile(Location location, DocPath path) { super(configuration, location, path); - if (location != DocumentationTool.Location.DOCUMENTATION_OUTPUT) { - throw new AssertionError("invalid location output"); - } + Assert.check(location == DocumentationTool.Location.DOCUMENTATION_OUTPUT); this.file = newFile(getDestDir(), path.getPath()); } @@ -178,27 +179,27 @@ /** Return true if the file can be read. */ public boolean canRead() { - return file.canRead(); + return Files.isReadable(file); } /** Return true if the file can be written. */ public boolean canWrite() { - return file.canWrite(); + return Files.isWritable(file); } /** Return true if the file exists. */ public boolean exists() { - return file.exists(); + return Files.exists(file); } /** Return the base name (last component) of the file name. */ public String getName() { - return file.getName(); + return file.getFileName().toString(); } /** Return the file system path for this file. */ public String getPath() { - return file.getPath(); + return file.toString(); } /** Return true is file has an absolute path name. */ @@ -208,12 +209,12 @@ /** Return true is file identifies a directory. */ public boolean isDirectory() { - return file.isDirectory(); + return Files.isDirectory(file); } /** Return true is file identifies a file. */ public boolean isFile() { - return file.isFile(); + return Files.isRegularFile(file); } /** Return true if this file is the same as another. */ @@ -222,25 +223,31 @@ return false; try { - return file.exists() - && file.getCanonicalFile().equals(((StandardDocFile) other).file.getCanonicalFile()); + return Files.isSameFile(file, ((StandardDocFile) other).file); } catch (IOException e) { return false; } } /** If the file is a directory, list its contents. */ - public Iterable list() { - List files = new ArrayList<>(); - for (File f: file.listFiles()) { - files.add(new StandardDocFile(f)); + public Iterable list() throws IOException { + List files = new ArrayList(); + try (DirectoryStream ds = Files.newDirectoryStream(file)) { + for (Path f: ds) { + files.add(new StandardDocFile(f)); + } } return files; } /** Create the file as a directory, including any parent directories. */ public boolean mkdirs() { - return file.mkdirs(); + try { + Files.createDirectories(file); + return true; + } catch (IOException e) { + return false; + } } /** @@ -261,7 +268,7 @@ */ public DocFile resolve(String p) { if (location == null && path == null) { - return new StandardDocFile(new File(file, p)); + return new StandardDocFile(file.resolve(p)); } else { return new StandardDocFile(location, path.resolve(p)); } @@ -270,12 +277,12 @@ /** * Resolve a relative file against the given output location. * @param locn Currently, only - * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} is supported. + * {@link DocumentationTool.Location.DOCUMENTATION_OUTPUT} is supported. */ public DocFile resolveAgainst(Location locn) { if (locn != DocumentationTool.Location.DOCUMENTATION_OUTPUT) throw new IllegalArgumentException(); - return new StandardDocFile(newFile(getDestDir(), file.getPath())); + return new StandardDocFile(getDestDir().resolve(file)); } /** Return a string to identify the contents of this object, @@ -294,7 +301,7 @@ return sb.toString(); } - private JavaFileObject getJavaFileObjectForInput(File file) { + private JavaFileObject getJavaFileObjectForInput(Path file) { return fileManager.getJavaFileObjects(file).iterator().next(); } diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Thu Feb 18 13:42:59 2016 -0800 @@ -176,7 +176,7 @@ List excludeList = members.stream() .filter((member) -> (!isDeprecated(member))) .sorted(makeGeneralPurposeComparator()) - .collect(Collectors.toCollection(ArrayList::new)); + .collect(Collectors.>toCollection(ArrayList::new)); return excludeList; } diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/DocEnv.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/DocEnv.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/DocEnv.java Thu Feb 18 13:42:59 2016 -0800 @@ -706,21 +706,18 @@ } @Override @DefinedBy(Api.LANGUAGE_MODEL) - public Boolean defaultAction(Element e, Void p) { - if (includedSet.contains(e) || shouldDocument(e)) { - return true; - } - return false; - } - - @Override @DefinedBy(Api.LANGUAGE_MODEL) public Boolean visitPackage(PackageElement e, Void p) { return includedSet.contains(e); } @Override @DefinedBy(Api.LANGUAGE_MODEL) public Boolean visitUnknown(Element e, Void p) { - throw new AssertionError("got element: " + e); + throw new AssertionError("unknown element: " + e); + } + + @Override @DefinedBy(Api.LANGUAGE_MODEL) + public Boolean defaultAction(Element e, Void p) { + return visit(e.getEnclosingElement()) && shouldDocument(e); } }; } diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/RootDocImpl.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/RootDocImpl.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/RootDocImpl.java Thu Feb 18 13:42:59 2016 -0800 @@ -272,7 +272,7 @@ public List getSelectedElements(List elements) { return elements.stream() .filter(e -> isIncluded(e)) - .collect(Collectors.toList()); + .collect(Collectors.toList()); } @Override diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/test/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java --- a/langtools/test/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/test/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java Thu Feb 18 13:42:59 2016 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 4973609 8015249 8025633 8026567 + * @bug 4973609 8015249 8025633 8026567 6469561 * @summary Make sure that annotation types with 0 members does not have * extra HR tags. * @author jamieh @@ -61,7 +61,7 @@ + " ", "", "

DEFAULT_NAME

\n" - + "
public static final java."
+                + "
static final java."
                 + "lang.String DEFAULT_NAME
"); checkOutput("pkg/AnnotationType.html", true, @@ -70,6 +70,21 @@ "
  • Detail: 
  • \n" + "
  • Field | 
  • "); + checkOutput("pkg/AnnotationType.html", true, + "", + "
    ", "
    void twoExceptions()\n"
                     + "            throws @ThrB(value=\"m\") java.lang.RuntimeException,\n"
    +                + "annotation in typeannos\">@ThrB("
    +                + "\"m\") java.lang.RuntimeException,\n"
                     + "                   @ThrA java.lang.Exception
    "); @@ -293,14 +293,14 @@ checkOutput("typeannos/BoundWithValue.html", true, "
    void wcSuper(MyList<? super @WldB(value=\"m\") java.lang."
    +                + "WldB.html\" title=\"annotation in typeannos\">@WldB("
    +                + "\"m\") java.lang."
                     + "String> l)
    ", "
    MyList<? extends @WldB(value=\"m\") java.lang.String"
    +                + "html\" title=\"annotation in typeannos\">@WldB("
    +                + "\"m\") java.lang.String"
                     + "> returnWcExtends()
    "); // Test for receiver annotations (Receivers.java). @@ -314,7 +314,7 @@ "
    java.lang.String nonVoid(@RcvrA @RcvrB"
    -                + "(value=\"m\")"
    +                + "(\"m\")"
                     + " DefaultUnmodified this)
    ", "
    <T extends java.lang.Runnable> void accept("
    @@ -337,15 +337,15 @@
             checkOutput("typeannos/WithValue.html", true,
                     "
    <T extends java.lang.Runnable> void accept("
                     + "@RcvrB("
    -                + "value=\"m\") WithValue this,\n"
    +                + "typeannos\">@RcvrB("
    +                + "\"m\") WithValue this,\n"
                     + "                                           T r)\n"
                     + "                                    throws java.lang.Exception
    "); checkOutput("typeannos/WithFinal.html", true, "
    java.lang.String nonVoid(@RcvrB(value=\"m\") WithFinal"
    +                + "html\" title=\"annotation in typeannos\">@RcvrB("
    +                + "\"m\") WithFinal"
                     + " this)
    "); checkOutput("typeannos/WithBody.html", true, diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/Throws.java --- a/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/Throws.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/Throws.java Thu Feb 18 13:42:59 2016 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ class ThrWithValue { void oneException() throws @ThrB("m") Exception {} - void twoExceptions() throws @ThrB(value="m") RuntimeException, @ThrA Exception {} + void twoExceptions() throws @ThrB("m") RuntimeException, @ThrA Exception {} } @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/Wildcards.java --- a/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/Wildcards.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/Wildcards.java Thu Feb 18 13:42:59 2016 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,10 +39,10 @@ class BoundWithValue { void wcExtends(MyList l) { } - void wcSuper(MyList l) { } + void wcSuper(MyList l) { } MyList returnWcExtends() { return null; } - MyList returnWcSuper() { return null; } + MyList returnWcSuper() { return null; } MyList> complex() { return null; } } @@ -57,10 +57,10 @@ class SelfWithValue { void wcExtends(MyList<@WldB("m") ?> l) { } - void wcSuper(MyList<@WldB(value="m") ?> l) { } + void wcSuper(MyList<@WldB("m") ?> l) { } MyList<@WldB("m") ?> returnWcExtends() { return null; } - MyList<@WldB(value="m") ?> returnWcSuper() { return null; } + MyList<@WldB("m") ?> returnWcSuper() { return null; } MyList<@WldB("m") ? extends MyList<@WldB("m") ? super String>> complex() { return null; } } diff -r 8f8123d7ecd7 -r 8d48ff7e2cf2 langtools/test/tools/javac/TestIndyStringConcat.java --- a/langtools/test/tools/javac/TestIndyStringConcat.java Thu Feb 18 11:30:21 2016 -0800 +++ b/langtools/test/tools/javac/TestIndyStringConcat.java Thu Feb 18 13:42:59 2016 -0800 @@ -60,7 +60,7 @@ boolean indifiedStringConcat = false; ex.printStackTrace(); for (StackTraceElement e : ex.getStackTrace()) { - if (e.getClassName().startsWith("java.lang.String$Concat") && + if (e.getClassName().contains("$$StringConcat") && e.getMethodName().equals("concat")) { indifiedStringConcat = true; break;