提交 1007e4fa 编写于 作者: A asaha

Merge

...@@ -434,3 +434,4 @@ a136ed2f3041e48f340d891208cc8ac0171a7816 jdk8u60-b14 ...@@ -434,3 +434,4 @@ a136ed2f3041e48f340d891208cc8ac0171a7816 jdk8u60-b14
248db113703a917fd38b637d384848a5e458ebcc jdk8u60-b15 248db113703a917fd38b637d384848a5e458ebcc jdk8u60-b15
ecb7e46b820f293bb644f92bc1af3ede53bceced jdk8u60-b16 ecb7e46b820f293bb644f92bc1af3ede53bceced jdk8u60-b16
87dcdc1fd75bf827c8a4596b183de7ea73cb75e1 jdk8u60-b17 87dcdc1fd75bf827c8a4596b183de7ea73cb75e1 jdk8u60-b17
e7e42c79861ea1ab7495de5f238c01f98035a8a8 jdk8u60-b18
...@@ -113,7 +113,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter { ...@@ -113,7 +113,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
Content captionSpan; Content captionSpan;
Content span; Content span;
if (type.isDefaultTab()) { if (type.isDefaultTab()) {
captionSpan = HtmlTree.SPAN(new StringContent(type.text())); captionSpan = HtmlTree.SPAN(configuration.getResource(type.resourceKey()));
span = HtmlTree.SPAN(type.tabId(), span = HtmlTree.SPAN(type.tabId(),
HtmlStyle.activeTableTab, captionSpan); HtmlStyle.activeTableTab, captionSpan);
} else { } else {
...@@ -136,7 +136,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter { ...@@ -136,7 +136,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
*/ */
public Content getMethodTypeLinks(MethodTypes methodType) { public Content getMethodTypeLinks(MethodTypes methodType) {
String jsShow = "javascript:show(" + methodType.value() +");"; String jsShow = "javascript:show(" + methodType.value() +");";
HtmlTree link = HtmlTree.A(jsShow, new StringContent(methodType.text())); HtmlTree link = HtmlTree.A(jsShow, configuration.getResource(methodType.resourceKey()));
return link; return link;
} }
......
...@@ -471,10 +471,10 @@ public class HtmlWriter { ...@@ -471,10 +471,10 @@ public class HtmlWriter {
for (Map.Entry<String,Integer> entry : typeMap.entrySet()) { for (Map.Entry<String,Integer> entry : typeMap.entrySet()) {
vars.append(sep); vars.append(sep);
sep = ","; sep = ",";
vars.append("\""); vars.append("\"")
vars.append(entry.getKey()); .append(entry.getKey())
vars.append("\":"); .append("\":")
vars.append(entry.getValue()); .append(entry.getValue());
} }
vars.append("};").append(DocletConstants.NL); vars.append("};").append(DocletConstants.NL);
sep = ""; sep = "";
...@@ -482,11 +482,19 @@ public class HtmlWriter { ...@@ -482,11 +482,19 @@ public class HtmlWriter {
for (MethodTypes entry : methodTypes) { for (MethodTypes entry : methodTypes) {
vars.append(sep); vars.append(sep);
sep = ","; sep = ",";
vars.append(entry.value()).append(":"); vars.append(entry.value())
vars.append("[").append("\"").append(entry.tabId()); .append(":")
vars.append("\"").append(sep).append("\"").append(entry.text()).append("\"]"); .append("[")
.append("\"")
.append(entry.tabId())
.append("\"")
.append(sep)
.append("\"")
.append(configuration.getText(entry.resourceKey()))
.append("\"]");
} }
vars.append("};").append(DocletConstants.NL); vars.append("};")
.append(DocletConstants.NL);
addStyles(HtmlStyle.altColor, vars); addStyles(HtmlStyle.altColor, vars);
addStyles(HtmlStyle.rowColor, vars); addStyles(HtmlStyle.rowColor, vars);
addStyles(HtmlStyle.tableTab, vars); addStyles(HtmlStyle.tableTab, vars);
......
...@@ -150,6 +150,13 @@ doclet.constructors=constructors ...@@ -150,6 +150,13 @@ doclet.constructors=constructors
doclet.Constructors=Constructors doclet.Constructors=Constructors
doclet.methods=methods doclet.methods=methods
doclet.Methods=Methods doclet.Methods=Methods
doclet.All_Methods=All Methods
doclet.Static_Methods=Static Methods
doclet.Instance_Methods=Instance Methods
doclet.Abstract_Methods=Abstract Methods
doclet.Concrete_Methods=Concrete Methods
doclet.Default_Methods=Default Methods
doclet.Deprecated_Methods=Deprecated Methods
doclet.annotation_type_optional_members=optional elements doclet.annotation_type_optional_members=optional elements
doclet.Annotation_Type_Optional_Members=Optional Elements doclet.Annotation_Type_Optional_Members=Optional Elements
doclet.annotation_type_required_members=required elements doclet.annotation_type_required_members=required elements
......
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -31,22 +31,22 @@ package com.sun.tools.doclets.internal.toolkit.util; ...@@ -31,22 +31,22 @@ package com.sun.tools.doclets.internal.toolkit.util;
* @author Bhavesh Patel * @author Bhavesh Patel
*/ */
public enum MethodTypes { public enum MethodTypes {
ALL(0xffff, "All Methods", "t0", true), ALL(0xffff, "doclet.All_Methods", "t0", true),
STATIC(0x1, "Static Methods", "t1", false), STATIC(0x1, "doclet.Static_Methods", "t1", false),
INSTANCE(0x2, "Instance Methods", "t2", false), INSTANCE(0x2, "doclet.Instance_Methods", "t2", false),
ABSTRACT(0x4, "Abstract Methods", "t3", false), ABSTRACT(0x4, "doclet.Abstract_Methods", "t3", false),
CONCRETE(0x8, "Concrete Methods", "t4", false), CONCRETE(0x8, "doclet.Concrete_Methods", "t4", false),
DEFAULT(0x10, "Default Methods", "t5", false), DEFAULT(0x10, "doclet.Default_Methods", "t5", false),
DEPRECATED(0x20, "Deprecated Methods", "t6", false); DEPRECATED(0x20, "doclet.Deprecated_Methods", "t6", false);
private final int value; private final int value;
private final String text; private final String resourceKey;
private final String tabId; private final String tabId;
private final boolean isDefaultTab; private final boolean isDefaultTab;
MethodTypes(int v, String t, String id, boolean dt) { MethodTypes(int v, String k, String id, boolean dt) {
this.value = v; this.value = v;
this.text = t; this.resourceKey = k;
this.tabId = id; this.tabId = id;
this.isDefaultTab = dt; this.isDefaultTab = dt;
} }
...@@ -55,8 +55,8 @@ public enum MethodTypes { ...@@ -55,8 +55,8 @@ public enum MethodTypes {
return value; return value;
} }
public String text() { public String resourceKey() {
return text; return resourceKey;
} }
public String tabId() { public String tabId() {
......
...@@ -315,11 +315,9 @@ public class Infer { ...@@ -315,11 +315,9 @@ public class Infer {
for (Type aLowerBound : from.getBounds(InferenceBound.LOWER)) { for (Type aLowerBound : from.getBounds(InferenceBound.LOWER)) {
for (Type anotherLowerBound : from.getBounds(InferenceBound.LOWER)) { for (Type anotherLowerBound : from.getBounds(InferenceBound.LOWER)) {
if (aLowerBound != anotherLowerBound && if (aLowerBound != anotherLowerBound &&
commonSuperWithDiffParameterization(aLowerBound, anotherLowerBound)) { !inferenceContext.free(aLowerBound) &&
/* self comment check if any lower bound may be and undetVar, !inferenceContext.free(anotherLowerBound) &&
* in that case the result of this call may be a false positive. commonSuperWithDiffParameterization(aLowerBound, anotherLowerBound)) {
* Should this be restricted to non free types?
*/
return generateReferenceToTargetConstraint(tree, from, to, return generateReferenceToTargetConstraint(tree, from, to,
resultInfo, inferenceContext); resultInfo, inferenceContext);
} }
......
...@@ -223,7 +223,7 @@ public class Analyzer { ...@@ -223,7 +223,7 @@ public class Analyzer {
Archive targetArchive = findArchive(t); Archive targetArchive = findArchive(t);
if (filter.accepts(o, archive, t, targetArchive)) { if (filter.accepts(o, archive, t, targetArchive)) {
addDep(o, t); addDep(o, t);
if (!requires.contains(targetArchive)) { if (archive != targetArchive && !requires.contains(targetArchive)) {
requires.add(targetArchive); requires.add(targetArchive);
} }
} }
......
...@@ -489,9 +489,11 @@ class JdepsTask { ...@@ -489,9 +489,11 @@ class JdepsTask {
List<Archive> archives = new ArrayList<>(); List<Archive> archives = new ArrayList<>();
Deque<String> roots = new LinkedList<>(); Deque<String> roots = new LinkedList<>();
List<Path> paths = new ArrayList<>();
for (String s : classes) { for (String s : classes) {
Path p = Paths.get(s); Path p = Paths.get(s);
if (Files.exists(p)) { if (Files.exists(p)) {
paths.add(p);
archives.add(Archive.getInstance(p)); archives.add(Archive.getInstance(p));
} else { } else {
if (isValidClassName(s)) { if (isValidClassName(s)) {
...@@ -504,7 +506,7 @@ class JdepsTask { ...@@ -504,7 +506,7 @@ class JdepsTask {
sourceLocations.addAll(archives); sourceLocations.addAll(archives);
List<Archive> classpaths = new ArrayList<>(); // for class file lookup List<Archive> classpaths = new ArrayList<>(); // for class file lookup
classpaths.addAll(getClassPathArchives(options.classpath)); classpaths.addAll(getClassPathArchives(options.classpath, paths));
if (options.includePattern != null) { if (options.includePattern != null) {
archives.addAll(classpaths); archives.addAll(classpaths);
} }
...@@ -545,6 +547,9 @@ class JdepsTask { ...@@ -545,6 +547,9 @@ class JdepsTask {
deque.add(cn); deque.add(cn);
} }
a.addClass(d.getOrigin(), d.getTarget()); a.addClass(d.getOrigin(), d.getTarget());
} else {
// ensure that the parsed class is added the archive
a.addClass(d.getOrigin());
} }
} }
for (String name : a.reader().skippedEntries()) { for (String name : a.reader().skippedEntries()) {
...@@ -592,6 +597,9 @@ class JdepsTask { ...@@ -592,6 +597,9 @@ class JdepsTask {
if (!doneClasses.contains(cn) && !deque.contains(cn)) { if (!doneClasses.contains(cn) && !deque.contains(cn)) {
deque.add(cn); deque.add(cn);
} }
} else {
// ensure that the parsed class is added the archive
a.addClass(d.getOrigin());
} }
} }
} }
...@@ -743,36 +751,52 @@ class JdepsTask { ...@@ -743,36 +751,52 @@ class JdepsTask {
} }
} }
private List<Archive> getClassPathArchives(String paths) throws IOException { /*
* Returns the list of Archive specified in cpaths and not included
* initialArchives
*/
private List<Archive> getClassPathArchives(String cpaths, List<Path> initialArchives)
throws IOException
{
List<Archive> result = new ArrayList<>(); List<Archive> result = new ArrayList<>();
if (paths.isEmpty()) { if (cpaths.isEmpty()) {
return result; return result;
} }
for (String p : paths.split(File.pathSeparator)) {
List<Path> paths = new ArrayList<>();
for (String p : cpaths.split(File.pathSeparator)) {
if (p.length() > 0) { if (p.length() > 0) {
List<Path> files = new ArrayList<>();
// wildcard to parse all JAR files e.g. -classpath dir/* // wildcard to parse all JAR files e.g. -classpath dir/*
int i = p.lastIndexOf(".*"); int i = p.lastIndexOf(".*");
if (i > 0) { if (i > 0) {
Path dir = Paths.get(p.substring(0, i)); Path dir = Paths.get(p.substring(0, i));
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.jar")) { try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.jar")) {
for (Path entry : stream) { for (Path entry : stream) {
files.add(entry); paths.add(entry);
} }
} }
} else { } else {
files.add(Paths.get(p)); paths.add(Paths.get(p));
}
for (Path f : files) {
if (Files.exists(f)) {
result.add(Archive.getInstance(f));
}
} }
} }
} }
for (Path p : paths) {
if (Files.exists(p) && !hasSameFile(initialArchives, p)) {
result.add(Archive.getInstance(p));
}
}
return result; return result;
} }
private boolean hasSameFile(List<Path> paths, Path p2) throws IOException {
for (Path p1 : paths) {
if (Files.isSameFile(p1, p2)) {
return true;
}
}
return false;
}
class RawOutputFormatter implements Analyzer.Visitor { class RawOutputFormatter implements Analyzer.Visitor {
private final PrintWriter writer; private final PrintWriter writer;
private String pkg = ""; private String pkg = "";
......
...@@ -46,7 +46,7 @@ import static com.sun.tools.classfile.Attribute.*; ...@@ -46,7 +46,7 @@ import static com.sun.tools.classfile.Attribute.*;
*/ */
class PlatformClassPath { class PlatformClassPath {
private static final List<String> NON_PLATFORM_JARFILES = private static final List<String> NON_PLATFORM_JARFILES =
Arrays.asList("alt-rt.jar", "jfxrt.jar", "ant-javafx.jar", "javafx-mx.jar"); Arrays.asList("alt-rt.jar", "ant-javafx.jar", "javafx-mx.jar");
private static final List<Archive> javaHomeArchives = init(); private static final List<Archive> javaHomeArchives = init();
static List<Archive> getArchives() { static List<Archive> getArchives() {
...@@ -124,6 +124,14 @@ class PlatformClassPath { ...@@ -124,6 +124,14 @@ class PlatformClassPath {
*/ */
static class JDKArchive extends Archive { static class JDKArchive extends Archive {
private static List<String> PROFILE_JARS = Arrays.asList("rt.jar", "jce.jar"); private static List<String> PROFILE_JARS = Arrays.asList("rt.jar", "jce.jar");
// Workaround: The following packages are not annotated as jdk.Exported
private static List<String> EXPORTED_PACKAGES = Arrays.asList(
"javax.jnlp",
"org.w3c.dom.css",
"org.w3c.dom.html",
"org.w3c.dom.stylesheets",
"org.w3c.dom.xpath"
);
public static boolean isProfileArchive(Archive archive) { public static boolean isProfileArchive(Archive archive) {
if (archive instanceof JDKArchive) { if (archive instanceof JDKArchive) {
return PROFILE_JARS.contains(archive.getName()); return PROFILE_JARS.contains(archive.getName());
...@@ -155,7 +163,11 @@ class PlatformClassPath { ...@@ -155,7 +163,11 @@ class PlatformClassPath {
* Tests if a given package name is exported. * Tests if a given package name is exported.
*/ */
public boolean isExportedPackage(String pn) { public boolean isExportedPackage(String pn) {
if (Profile.getProfile(pn) != null || "javax.jnlp".equals(pn)) { if (Profile.getProfile(pn) != null) {
return true;
}
// special case for JavaFX and APIs that are not annotated with @jdk.Exported)
if (EXPORTED_PACKAGES.contains(pn) || pn.startsWith("javafx.")) {
return true; return true;
} }
return exportedPackages.containsKey(pn) ? exportedPackages.get(pn) : false; return exportedPackages.containsKey(pn) ? exportedPackages.get(pn) : false;
......
...@@ -21,7 +21,6 @@ OSNAME = $(shell uname -s) ...@@ -21,7 +21,6 @@ OSNAME = $(shell uname -s)
ifeq ($(OSNAME), SunOS) ifeq ($(OSNAME), SunOS)
SLASH_JAVA = /java SLASH_JAVA = /java
PLATFORM = solaris PLATFORM = solaris
JT_PLATFORM = solaris
ARCH = $(shell uname -p) ARCH = $(shell uname -p)
ifeq ($(ARCH), i386) ifeq ($(ARCH), i386)
ARCH=i586 ARCH=i586
...@@ -30,7 +29,6 @@ endif ...@@ -30,7 +29,6 @@ endif
ifeq ($(OSNAME), Linux) ifeq ($(OSNAME), Linux)
SLASH_JAVA = /java SLASH_JAVA = /java
PLATFORM = linux PLATFORM = linux
JT_PLATFORM = linux
ARCH = $(shell uname -m) ARCH = $(shell uname -m)
ifeq ($(ARCH), i386) ifeq ($(ARCH), i386)
ARCH=i586 ARCH=i586
...@@ -38,7 +36,6 @@ ifeq ($(OSNAME), Linux) ...@@ -38,7 +36,6 @@ ifeq ($(OSNAME), Linux)
endif endif
ifeq ($(OSNAME), Darwin) ifeq ($(OSNAME), Darwin)
PLATFORM = bsd PLATFORM = bsd
JT_PLATFORM = linux
ARCH = $(shell uname -m) ARCH = $(shell uname -m)
ifeq ($(ARCH), i386) ifeq ($(ARCH), i386)
ARCH=i586 ARCH=i586
...@@ -55,7 +52,6 @@ endif ...@@ -55,7 +52,6 @@ endif
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
SLASH_JAVA = J: SLASH_JAVA = J:
JT_PLATFORM = win32
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64) ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
ARCH=ia64 ARCH=ia64
else else
...@@ -93,8 +89,8 @@ ifdef JPRT_JTREG_HOME ...@@ -93,8 +89,8 @@ ifdef JPRT_JTREG_HOME
else else
JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
endif endif
JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg JTREG = $(JTREG_HOME)/bin/jtreg
JTDIFF = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtdiff JTDIFF = $(JTREG_HOME)/bin/jtdiff
# Default JCK to run # Default JCK to run
ifdef JPRT_JCK_HOME ifdef JPRT_JCK_HOME
......
/* /*
* Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
......
/* /*
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * 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 * version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code). * accompanied this code).
* *
......
/*
* Copyright (c) 2014, 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.
*/
/**
* @test
* @bug 8055963
* @summary Inference failure with nested invocation
* @compile T8055963.java
*/
class T8055963 {
static class C<T> {}
<T> T choose(T first, T second) { return null; }
void test() {
C<String> cs = choose(new C<String>(), new C<>());
}
}
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * 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 * version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code). * accompanied this code).
* *
......
/* /*
* Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
......
/* /*
* Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
......
...@@ -90,8 +90,9 @@ public class APIDeps { ...@@ -90,8 +90,9 @@ public class APIDeps {
new String[] {"-classpath", testDir.getPath(), "-verbose:class", "-filter:none", "-P"}); new String[] {"-classpath", testDir.getPath(), "-verbose:class", "-filter:none", "-P"});
test(new File(mDir, "Gee.class"), test(new File(mDir, "Gee.class"),
new String[] {"g.G", "sun.misc.Lock", "com.sun.tools.classfile.ClassFile", new String[] {"g.G", "sun.misc.Lock", "com.sun.tools.classfile.ClassFile",
"com.sun.management.ThreadMXBean", "com.sun.source.tree.BinaryTree"}, "com.sun.management.ThreadMXBean", "com.sun.source.tree.BinaryTree",
new String[] {testDirBasename, "JDK internal API", "compact3", ""}, "org.w3c.dom.css.CSSValue"},
new String[] {testDirBasename, "JDK internal API", "compact2", "compact3", ""},
new String[] {"-classpath", testDir.getPath(), "-verbose", "-P"}); new String[] {"-classpath", testDir.getPath(), "-verbose", "-P"});
// -jdkinternals // -jdkinternals
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
/* /*
* @test * @test
* @bug 8003562 8005428 8015912 8027481 8048063 * @bug 8003562 8005428 8015912 8027481 8048063 8068937
* @summary Basic tests for jdeps tool * @summary Basic tests for jdeps tool
* @build Test p.Foo p.Bar javax.activity.NotCompactProfile * @build Test p.Foo p.Bar p.C p.SubClass q.Gee javax.activity.NotCompactProfile
* @run main Basic * @run main Basic
*/ */
...@@ -111,6 +111,19 @@ public class Basic { ...@@ -111,6 +111,19 @@ public class Basic {
new String[] {"compact1"}, new String[] {"compact1"},
new String[] {"-verbose:package", "-e", "java\\.lang\\..*"}); new String[] {"-verbose:package", "-e", "java\\.lang\\..*"});
// parse p.C, p.SubClass and q.*
// p.SubClass have no dependency other than p.C
// q.Gee depends on p.SubClass that should be found
test(testDir,
new String[] {"java.lang", "p"},
new String[] {"compact1", testDir.getName()},
new String[] {"-include", "p.C|p.SubClass|q\\..*"});
test(testDir,
new String[] {"java.lang", "p"},
new String[] {"compact1", testDir.getName()},
new String[] {"-classpath", testDir.getPath(), "-include", "p.C|p.SubClass|q\\..*"});
// test -classpath and -include options // test -classpath and -include options
test(null, test(null,
new String[] {"java.lang", "java.util", "java.lang.management", new String[] {"java.lang", "java.util", "java.lang.management",
......
...@@ -29,4 +29,5 @@ class Gee extends g.G { ...@@ -29,4 +29,5 @@ class Gee extends g.G {
public com.sun.tools.classfile.ClassFile cf; // @jdk.Exported(false) public com.sun.tools.classfile.ClassFile cf; // @jdk.Exported(false)
public com.sun.source.tree.BinaryTree tree; // @jdk.Exported public com.sun.source.tree.BinaryTree tree; // @jdk.Exported
public com.sun.management.ThreadMXBean mxbean; // @jdk.Exported on package-info public com.sun.management.ThreadMXBean mxbean; // @jdk.Exported on package-info
public org.w3c.dom.css.CSSValue value; // special case
} }
/*
* Copyright (c) 2015, 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.
*/
package p;
public class C {
public String name() {
return "C";
}
}
/*
* Copyright (c) 2015, 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.
*/
package p;
// SubClass only references types in package p
public class SubClass extends C {
}
/*
* Copyright (c) 2015, 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.
*/
package q;
public class Gee extends p.SubClass {
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册