mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8024538: -Xdoclint + -Xprefer:source + incremental compilation == FAIL
Reviewed-by: darcy
This commit is contained in:
parent
315696de00
commit
7cc012b008
4 changed files with 80 additions and 3 deletions
|
@ -29,9 +29,14 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.lang.model.element.Name;
|
||||
import javax.tools.JavaFileObject;
|
||||
import javax.tools.StandardLocation;
|
||||
|
||||
import com.sun.source.doctree.DocCommentTree;
|
||||
|
@ -278,15 +283,25 @@ public class DocLint implements Plugin {
|
|||
TaskListener tl = new TaskListener() {
|
||||
@Override
|
||||
public void started(TaskEvent e) {
|
||||
switch (e.getKind()) {
|
||||
case ANALYZE:
|
||||
CompilationUnitTree tree;
|
||||
while ((tree = todo.poll()) != null)
|
||||
ds.scan(tree, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finished(TaskEvent e) {
|
||||
switch (e.getKind()) {
|
||||
case ENTER:
|
||||
ds.scan(e.getCompilationUnit(), null);
|
||||
case PARSE:
|
||||
todo.add(e.getCompilationUnit());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Queue<CompilationUnitTree> todo = new LinkedList<CompilationUnitTree>();
|
||||
};
|
||||
|
||||
task.addTaskListener(tl);
|
||||
|
|
|
@ -288,7 +288,9 @@ public class Enter extends JCTree.Visitor {
|
|||
JavaFileObject.Kind.SOURCE);
|
||||
if (tree.pid != null) {
|
||||
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) {
|
||||
addEnv = true;
|
||||
} else if (tree.packageAnnotations.nonEmpty()){
|
||||
|
|
|
@ -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;
|
||||
}
|
25
langtools/test/tools/javac/doclint/implicitSource/Other.java
Normal file
25
langtools/test/tools/javac/doclint/implicitSource/Other.java
Normal 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 { }
|
Loading…
Add table
Add a link
Reference in a new issue