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

Merge

......@@ -434,3 +434,4 @@ a136ed2f3041e48f340d891208cc8ac0171a7816 jdk8u60-b14
248db113703a917fd38b637d384848a5e458ebcc jdk8u60-b15
ecb7e46b820f293bb644f92bc1af3ede53bceced jdk8u60-b16
87dcdc1fd75bf827c8a4596b183de7ea73cb75e1 jdk8u60-b17
e7e42c79861ea1ab7495de5f238c01f98035a8a8 jdk8u60-b18
......@@ -113,7 +113,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
Content captionSpan;
Content span;
if (type.isDefaultTab()) {
captionSpan = HtmlTree.SPAN(new StringContent(type.text()));
captionSpan = HtmlTree.SPAN(configuration.getResource(type.resourceKey()));
span = HtmlTree.SPAN(type.tabId(),
HtmlStyle.activeTableTab, captionSpan);
} else {
......@@ -136,7 +136,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
*/
public Content getMethodTypeLinks(MethodTypes methodType) {
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;
}
......
......@@ -471,10 +471,10 @@ public class HtmlWriter {
for (Map.Entry<String,Integer> entry : typeMap.entrySet()) {
vars.append(sep);
sep = ",";
vars.append("\"");
vars.append(entry.getKey());
vars.append("\":");
vars.append(entry.getValue());
vars.append("\"")
.append(entry.getKey())
.append("\":")
.append(entry.getValue());
}
vars.append("};").append(DocletConstants.NL);
sep = "";
......@@ -482,11 +482,19 @@ public class HtmlWriter {
for (MethodTypes entry : methodTypes) {
vars.append(sep);
sep = ",";
vars.append(entry.value()).append(":");
vars.append("[").append("\"").append(entry.tabId());
vars.append("\"").append(sep).append("\"").append(entry.text()).append("\"]");
vars.append(entry.value())
.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.rowColor, vars);
addStyles(HtmlStyle.tableTab, vars);
......
......@@ -150,6 +150,13 @@ doclet.constructors=constructors
doclet.Constructors=Constructors
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_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.
*
* 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;
* @author Bhavesh Patel
*/
public enum MethodTypes {
ALL(0xffff, "All Methods", "t0", true),
STATIC(0x1, "Static Methods", "t1", false),
INSTANCE(0x2, "Instance Methods", "t2", false),
ABSTRACT(0x4, "Abstract Methods", "t3", false),
CONCRETE(0x8, "Concrete Methods", "t4", false),
DEFAULT(0x10, "Default Methods", "t5", false),
DEPRECATED(0x20, "Deprecated Methods", "t6", false);
ALL(0xffff, "doclet.All_Methods", "t0", true),
STATIC(0x1, "doclet.Static_Methods", "t1", false),
INSTANCE(0x2, "doclet.Instance_Methods", "t2", false),
ABSTRACT(0x4, "doclet.Abstract_Methods", "t3", false),
CONCRETE(0x8, "doclet.Concrete_Methods", "t4", false),
DEFAULT(0x10, "doclet.Default_Methods", "t5", false),
DEPRECATED(0x20, "doclet.Deprecated_Methods", "t6", false);
private final int value;
private final String text;
private final String resourceKey;
private final String tabId;
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.text = t;
this.resourceKey = k;
this.tabId = id;
this.isDefaultTab = dt;
}
......@@ -55,8 +55,8 @@ public enum MethodTypes {
return value;
}
public String text() {
return text;
public String resourceKey() {
return resourceKey;
}
public String tabId() {
......
......@@ -315,11 +315,9 @@ public class Infer {
for (Type aLowerBound : from.getBounds(InferenceBound.LOWER)) {
for (Type anotherLowerBound : from.getBounds(InferenceBound.LOWER)) {
if (aLowerBound != anotherLowerBound &&
commonSuperWithDiffParameterization(aLowerBound, anotherLowerBound)) {
/* self comment check if any lower bound may be and undetVar,
* in that case the result of this call may be a false positive.
* Should this be restricted to non free types?
*/
!inferenceContext.free(aLowerBound) &&
!inferenceContext.free(anotherLowerBound) &&
commonSuperWithDiffParameterization(aLowerBound, anotherLowerBound)) {
return generateReferenceToTargetConstraint(tree, from, to,
resultInfo, inferenceContext);
}
......
......@@ -223,7 +223,7 @@ public class Analyzer {
Archive targetArchive = findArchive(t);
if (filter.accepts(o, archive, t, targetArchive)) {
addDep(o, t);
if (!requires.contains(targetArchive)) {
if (archive != targetArchive && !requires.contains(targetArchive)) {
requires.add(targetArchive);
}
}
......
......@@ -489,9 +489,11 @@ class JdepsTask {
List<Archive> archives = new ArrayList<>();
Deque<String> roots = new LinkedList<>();
List<Path> paths = new ArrayList<>();
for (String s : classes) {
Path p = Paths.get(s);
if (Files.exists(p)) {
paths.add(p);
archives.add(Archive.getInstance(p));
} else {
if (isValidClassName(s)) {
......@@ -504,7 +506,7 @@ class JdepsTask {
sourceLocations.addAll(archives);
List<Archive> classpaths = new ArrayList<>(); // for class file lookup
classpaths.addAll(getClassPathArchives(options.classpath));
classpaths.addAll(getClassPathArchives(options.classpath, paths));
if (options.includePattern != null) {
archives.addAll(classpaths);
}
......@@ -545,6 +547,9 @@ class JdepsTask {
deque.add(cn);
}
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()) {
......@@ -592,6 +597,9 @@ class JdepsTask {
if (!doneClasses.contains(cn) && !deque.contains(cn)) {
deque.add(cn);
}
} else {
// ensure that the parsed class is added the archive
a.addClass(d.getOrigin());
}
}
}
......@@ -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<>();
if (paths.isEmpty()) {
if (cpaths.isEmpty()) {
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) {
List<Path> files = new ArrayList<>();
// wildcard to parse all JAR files e.g. -classpath dir/*
int i = p.lastIndexOf(".*");
if (i > 0) {
Path dir = Paths.get(p.substring(0, i));
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.jar")) {
for (Path entry : stream) {
files.add(entry);
paths.add(entry);
}
}
} else {
files.add(Paths.get(p));
}
for (Path f : files) {
if (Files.exists(f)) {
result.add(Archive.getInstance(f));
}
paths.add(Paths.get(p));
}
}
}
for (Path p : paths) {
if (Files.exists(p) && !hasSameFile(initialArchives, p)) {
result.add(Archive.getInstance(p));
}
}
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 {
private final PrintWriter writer;
private String pkg = "";
......
......@@ -46,7 +46,7 @@ import static com.sun.tools.classfile.Attribute.*;
*/
class PlatformClassPath {
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();
static List<Archive> getArchives() {
......@@ -124,6 +124,14 @@ class PlatformClassPath {
*/
static class JDKArchive extends Archive {
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) {
if (archive instanceof JDKArchive) {
return PROFILE_JARS.contains(archive.getName());
......@@ -155,7 +163,11 @@ class PlatformClassPath {
* Tests if a given package name is exported.
*/
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 exportedPackages.containsKey(pn) ? exportedPackages.get(pn) : false;
......
......@@ -21,7 +21,6 @@ OSNAME = $(shell uname -s)
ifeq ($(OSNAME), SunOS)
SLASH_JAVA = /java
PLATFORM = solaris
JT_PLATFORM = solaris
ARCH = $(shell uname -p)
ifeq ($(ARCH), i386)
ARCH=i586
......@@ -30,7 +29,6 @@ endif
ifeq ($(OSNAME), Linux)
SLASH_JAVA = /java
PLATFORM = linux
JT_PLATFORM = linux
ARCH = $(shell uname -m)
ifeq ($(ARCH), i386)
ARCH=i586
......@@ -38,7 +36,6 @@ ifeq ($(OSNAME), Linux)
endif
ifeq ($(OSNAME), Darwin)
PLATFORM = bsd
JT_PLATFORM = linux
ARCH = $(shell uname -m)
ifeq ($(ARCH), i386)
ARCH=i586
......@@ -55,7 +52,6 @@ endif
ifeq ($(PLATFORM), windows)
SLASH_JAVA = J:
JT_PLATFORM = win32
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
ARCH=ia64
else
......@@ -93,8 +89,8 @@ ifdef JPRT_JTREG_HOME
else
JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
endif
JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg
JTDIFF = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtdiff
JTREG = $(JTREG_HOME)/bin/jtreg
JTDIFF = $(JTREG_HOME)/bin/jtdiff
# Default JCK to run
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.
*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
......
......@@ -8,7 +8,7 @@
*
* 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
* 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).
*
......
/*
* 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 @@
*
* 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
* 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).
*
......
/*
* 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.
*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
......
......@@ -90,8 +90,9 @@ public class APIDeps {
new String[] {"-classpath", testDir.getPath(), "-verbose:class", "-filter:none", "-P"});
test(new File(mDir, "Gee.class"),
new String[] {"g.G", "sun.misc.Lock", "com.sun.tools.classfile.ClassFile",
"com.sun.management.ThreadMXBean", "com.sun.source.tree.BinaryTree"},
new String[] {testDirBasename, "JDK internal API", "compact3", ""},
"com.sun.management.ThreadMXBean", "com.sun.source.tree.BinaryTree",
"org.w3c.dom.css.CSSValue"},
new String[] {testDirBasename, "JDK internal API", "compact2", "compact3", ""},
new String[] {"-classpath", testDir.getPath(), "-verbose", "-P"});
// -jdkinternals
......
......@@ -23,9 +23,9 @@
/*
* @test
* @bug 8003562 8005428 8015912 8027481 8048063
* @bug 8003562 8005428 8015912 8027481 8048063 8068937
* @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
*/
......@@ -111,6 +111,19 @@ public class Basic {
new String[] {"compact1"},
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(null,
new String[] {"java.lang", "java.util", "java.lang.management",
......
......@@ -29,4 +29,5 @@ class Gee extends g.G {
public com.sun.tools.classfile.ClassFile cf; // @jdk.Exported(false)
public com.sun.source.tree.BinaryTree tree; // @jdk.Exported
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.
先完成此消息的编辑!
想要评论请 注册