Tue, 17 Sep 2013 14:17:13 -0700
8024538: -Xdoclint + -Xprefer:source + incremental compilation == FAIL
Reviewed-by: darcy
1.1 --- a/src/share/classes/com/sun/tools/doclint/DocLint.java Mon Sep 16 14:13:44 2013 +0200 1.2 +++ b/src/share/classes/com/sun/tools/doclint/DocLint.java Tue Sep 17 14:17:13 2013 -0700 1.3 @@ -29,9 +29,14 @@ 1.4 import java.io.IOException; 1.5 import java.io.PrintWriter; 1.6 import java.util.ArrayList; 1.7 +import java.util.HashSet; 1.8 +import java.util.LinkedList; 1.9 import java.util.List; 1.10 +import java.util.Queue; 1.11 +import java.util.Set; 1.12 1.13 import javax.lang.model.element.Name; 1.14 +import javax.tools.JavaFileObject; 1.15 import javax.tools.StandardLocation; 1.16 1.17 import com.sun.source.doctree.DocCommentTree; 1.18 @@ -278,15 +283,25 @@ 1.19 TaskListener tl = new TaskListener() { 1.20 @Override 1.21 public void started(TaskEvent e) { 1.22 + switch (e.getKind()) { 1.23 + case ANALYZE: 1.24 + CompilationUnitTree tree; 1.25 + while ((tree = todo.poll()) != null) 1.26 + ds.scan(tree, null); 1.27 + break; 1.28 + } 1.29 } 1.30 1.31 @Override 1.32 public void finished(TaskEvent e) { 1.33 switch (e.getKind()) { 1.34 - case ENTER: 1.35 - ds.scan(e.getCompilationUnit(), null); 1.36 + case PARSE: 1.37 + todo.add(e.getCompilationUnit()); 1.38 + break; 1.39 } 1.40 } 1.41 + 1.42 + Queue<CompilationUnitTree> todo = new LinkedList<CompilationUnitTree>(); 1.43 }; 1.44 1.45 task.addTaskListener(tl);
2.1 --- a/src/share/classes/com/sun/tools/javac/comp/Enter.java Mon Sep 16 14:13:44 2013 +0200 2.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Enter.java Tue Sep 17 14:17:13 2013 -0700 2.3 @@ -288,7 +288,9 @@ 2.4 JavaFileObject.Kind.SOURCE); 2.5 if (tree.pid != null) { 2.6 tree.packge = reader.enterPackage(TreeInfo.fullName(tree.pid)); 2.7 - if (tree.packageAnnotations.nonEmpty() || pkginfoOpt == PkgInfo.ALWAYS) { 2.8 + if (tree.packageAnnotations.nonEmpty() 2.9 + || pkginfoOpt == PkgInfo.ALWAYS 2.10 + || tree.docComments != null) { 2.11 if (isPkgInfo) { 2.12 addEnv = true; 2.13 } else if (tree.packageAnnotations.nonEmpty()){
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/test/tools/javac/doclint/implicitSource/ImplicitSourceTest.java Tue Sep 17 14:17:13 2013 -0700 3.3 @@ -0,0 +1,35 @@ 3.4 +/* 3.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 3.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.7 + * 3.8 + * This code is free software; you can redistribute it and/or modify it 3.9 + * under the terms of the GNU General Public License version 2 only, as 3.10 + * published by the Free Software Foundation. 3.11 + * 3.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 3.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3.15 + * version 2 for more details (a copy is included in the LICENSE file that 3.16 + * accompanied this code). 3.17 + * 3.18 + * You should have received a copy of the GNU General Public License version 3.19 + * 2 along with this work; if not, write to the Free Software Foundation, 3.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3.21 + * 3.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 3.23 + * or visit www.oracle.com if you need additional information or have any 3.24 + * questions. 3.25 + */ 3.26 + 3.27 +/* 3.28 + * @test 3.29 + * @bug 8024538 3.30 + * @summary -Xdoclint + -Xprefer:source + incremental compilation == FAIL 3.31 + * @compile -Xdoclint -Xprefer:source ImplicitSourceTest.java 3.32 + */ 3.33 + 3.34 +/** ImplicitSourceTest. */ 3.35 +class ImplicitSourceTest { 3.36 + /** <p> {@link Other} </p> */ 3.37 + int i; 3.38 +}
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/test/tools/javac/doclint/implicitSource/Other.java Tue Sep 17 14:17:13 2013 -0700 4.3 @@ -0,0 +1,25 @@ 4.4 +/* 4.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 4.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.7 + * 4.8 + * This code is free software; you can redistribute it and/or modify it 4.9 + * under the terms of the GNU General Public License version 2 only, as 4.10 + * published by the Free Software Foundation. 4.11 + * 4.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 4.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 4.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 4.15 + * version 2 for more details (a copy is included in the LICENSE file that 4.16 + * accompanied this code). 4.17 + * 4.18 + * You should have received a copy of the GNU General Public License version 4.19 + * 2 along with this work; if not, write to the Free Software Foundation, 4.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 4.21 + * 4.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4.23 + * or visit www.oracle.com if you need additional information or have any 4.24 + * questions. 4.25 + */ 4.26 + 4.27 +/** Other. */ 4.28 +class Other { }