8024538: -Xdoclint + -Xprefer:source + incremental compilation == FAIL

Reviewed-by: darcy
This commit is contained in:
Jonathan Gibbons 2013-09-17 14:17:13 -07:00
parent 315696de00
commit 7cc012b008
4 changed files with 80 additions and 3 deletions

View file

@ -29,9 +29,14 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Queue;
import java.util.Set;
import javax.lang.model.element.Name; import javax.lang.model.element.Name;
import javax.tools.JavaFileObject;
import javax.tools.StandardLocation; import javax.tools.StandardLocation;
import com.sun.source.doctree.DocCommentTree; import com.sun.source.doctree.DocCommentTree;
@ -278,15 +283,25 @@ public class DocLint implements Plugin {
TaskListener tl = new TaskListener() { TaskListener tl = new TaskListener() {
@Override @Override
public void started(TaskEvent e) { public void started(TaskEvent e) {
switch (e.getKind()) {
case ANALYZE:
CompilationUnitTree tree;
while ((tree = todo.poll()) != null)
ds.scan(tree, null);
break;
}
} }
@Override @Override
public void finished(TaskEvent e) { public void finished(TaskEvent e) {
switch (e.getKind()) { switch (e.getKind()) {
case ENTER: case PARSE:
ds.scan(e.getCompilationUnit(), null); todo.add(e.getCompilationUnit());
break;
} }
} }
Queue<CompilationUnitTree> todo = new LinkedList<CompilationUnitTree>();
}; };
task.addTaskListener(tl); task.addTaskListener(tl);

View file

@ -288,7 +288,9 @@ public class Enter extends JCTree.Visitor {
JavaFileObject.Kind.SOURCE); JavaFileObject.Kind.SOURCE);
if (tree.pid != null) { if (tree.pid != null) {
tree.packge = reader.enterPackage(TreeInfo.fullName(tree.pid)); tree.packge = reader.enterPackage(TreeInfo.fullName(tree.pid));
if (tree.packageAnnotations.nonEmpty() || pkginfoOpt == PkgInfo.ALWAYS) { if (tree.packageAnnotations.nonEmpty()
|| pkginfoOpt == PkgInfo.ALWAYS
|| tree.docComments != null) {
if (isPkgInfo) { if (isPkgInfo) {
addEnv = true; addEnv = true;
} else if (tree.packageAnnotations.nonEmpty()){ } else if (tree.packageAnnotations.nonEmpty()){

View file

@ -0,0 +1,35 @@
/*
* Copyright (c) 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.
*
* 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.
*/
/*
* @test
* @bug 8024538
* @summary -Xdoclint + -Xprefer:source + incremental compilation == FAIL
* @compile -Xdoclint -Xprefer:source ImplicitSourceTest.java
*/
/** ImplicitSourceTest. */
class ImplicitSourceTest {
/** <p> {@link Other} </p> */
int i;
}

View file

@ -0,0 +1,25 @@
/*
* Copyright (c) 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.
*
* 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.
*/
/** Other. */
class Other { }