This commit is contained in:
Phil Race 2017-10-25 12:41:24 -07:00
commit 62fa58101a
61 changed files with 39808 additions and 64348 deletions

View File

@ -205,6 +205,8 @@ ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
) \
$(call CacheFind, $(SYMBOLS_IMAGE_DIR))
TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_IMAGE_HOMEDIR)/demo/%, $(ALL_JDK_FILES))
ALL_JRE_FILES := $(call CacheFind, $(JRE_IMAGE_DIR))
# Create special filter rules when dealing with unzipped .dSYM directories on
@ -264,6 +266,17 @@ ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
PRODUCT_TARGETS += $(BUILD_JRE_SYMBOLS_BUNDLE)
# The demo bundle is only created to support client tests. Ideally it should
# be built with the main test bundle, but since the prerequisites match
# better with the product build, it makes more sense to keep it there for now.
$(eval $(call SetupBundleFile, BUILD_TEST_DEMOS_BUNDLE, \
BUNDLE_NAME := $(TEST_DEMOS_BUNDLE_NAME), \
FILES := $(TEST_DEMOS_BUNDLE_FILES), \
BASE_DIRS := $(JDK_IMAGE_DIR), \
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
))
PRODUCT_TARGETS += $(BUILD_TEST_DEMOS_BUNDLE)
endif
################################################################################

View File

@ -831,6 +831,7 @@ JRE_COMPACT3_BUNDLE_NAME := \
jre-$(VERSION_SHORT)+$(VERSION_BUILD)-compact3_$(OPENJDK_TARGET_BUNDLE_PLATFORM)_bin$(DEBUG_PART).tar.gz
JDK_SYMBOLS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
JRE_SYMBOLS_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
TEST_DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests-demos$(DEBUG_PART).tar.gz
TEST_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests$(DEBUG_PART).tar.gz
DOCS_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
@ -838,6 +839,7 @@ JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME)
JRE_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JRE_BUNDLE_NAME)
JDK_SYMBOLS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_SYMBOLS_BUNDLE_NAME)
JRE_SYMBOLS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JRE_SYMBOLS_BUNDLE_NAME)
TEST_DEMOS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(TEST_DEMOS_BUNDLE_NAME)
TEST_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME)
DOCS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DOCS_BUNDLE_NAME)

View File

@ -300,6 +300,14 @@ var getJibProfilesCommon = function (input, data) {
],
exploded: "images/test"
},
test_demos: {
local: "bundles/\\(jdk.*bin-tests-demos.tar.gz\\)",
remote: [
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-tests-demos.tar.gz",
"bundles/" + pf + "/\\1"
],
exploded: "images/test"
},
jdk_symbols: {
local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
remote: [

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,10 @@
<name>Solaris_64</name>
<type>0</type>
</confElem>
<confElem>
<name>Windws64</name>
<type>0</type>
</confElem>
</confList>
<formatting>
<project-formatting-style>false</project-formatting-style>

View File

@ -2166,7 +2166,7 @@ public abstract class ClassLoader {
* @spec JPMS
*
* @jvms 5.3 Run-time package
* @see <a href="{@docRoot}/../specs/jar/jar.html#sealing">
* @see <a href="{@docRoot}/../specs/jar/jar.html#package-sealing">
* The JAR File Specification: Package Sealing</a>
*/
protected Package definePackage(String name, String specTitle,

View File

@ -109,7 +109,7 @@ import jdk.internal.reflect.Reflection;
* and have no specification and implementation versioning information.
*
* @jvms 5.3 Run-time package
* @see <a href="{@docRoot}/../specs/jar/jar.html#sealing">
* @see <a href="{@docRoot}/../specs/jar/jar.html#package-sealing">
* The JAR File Specification: Package Sealing</a>
* @see ClassLoader#definePackage(String, String, String, String, String, String, String, URL)
*

View File

@ -568,7 +568,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
/**
* {@code Name} object for {@code Sealed} manifest attribute
* used for sealing.
* @see <a href="{@docRoot}/../specs/jar/jar.html#sealing">
* @see <a href="{@docRoot}/../specs/jar/jar.html#package-sealing">
* Package Sealing</a>
*/
public static final Name SEALED = new Name("Sealed");

View File

@ -27,6 +27,7 @@ package sun.util.cldr;
import java.security.AccessController;
import java.security.AccessControlException;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.text.spi.BreakIteratorProvider;
import java.text.spi.CollatorProvider;
@ -83,11 +84,8 @@ public class CLDRLocaleProviderAdapter extends JRELocaleProviderAdapter {
return null;
}
});
} catch (Exception e) {
// Catch any exception, and continue as if only CLDR's base locales exist.
} catch (ServiceConfigurationError sce) {
Throwable cause = sce.getCause();
if (!(cause instanceof AccessControlException)) throw sce;
} catch (PrivilegedActionException pae) {
throw new InternalError(pae.getCause());
}
nonBaseMetaInfo = nbmi;

View File

@ -28,6 +28,7 @@ package sun.util.locale.provider;
import java.security.AccessController;
import java.security.AccessControlException;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.text.spi.BreakIteratorProvider;
import java.text.spi.CollatorProvider;
@ -478,11 +479,8 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
if (nonBaseTags != null) {
supportedLocaleString += " " + nonBaseTags;
}
} catch (Exception e) {
// catch any exception, and ignore them as if non-EN locales do not exist.
} catch (ServiceConfigurationError sce) {
Throwable cause = sce.getCause();
if (!(cause instanceof AccessControlException)) throw sce;
} catch (PrivilegedActionException pae) {
throw new InternalError(pae.getCause());
}
return supportedLocaleString;

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -26,6 +26,7 @@ package com.sun.org.apache.xalan.internal.utils;
*/
public final class ConfigurationError
extends Error {
private static final long serialVersionUID = 749136645488750664L;
//
// Data

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -26,6 +26,8 @@ package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
* state from which it cannot recover.
*/
public class InternalError extends Error {
private static final long serialVersionUID = -6690855975016554786L;
/**
* Construct an <code>InternalError</code> with the specified error message.
* @param msg the error message

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -27,6 +27,7 @@ package com.sun.org.apache.xalan.internal.xsltc.runtime;
* As java.lang.AssertionError was introduced in JDK 1.4 we can't use that yet.
*/
public class InternalRuntimeError extends Error {
private static final long serialVersionUID = 2802784919179095307L;
public InternalRuntimeError(String message) {
super(message);

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2009, 2017 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
@ -22,10 +23,6 @@
* questions.
*/
/*
* Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
*/
package com.sun.org.apache.xerces.internal.jaxp.datatype;
@ -52,6 +49,7 @@ import javax.xml.datatype.DatatypeConstants;
class DurationDayTimeImpl
extends DurationImpl {
private static final long serialVersionUID = 844792794952655204L;
public DurationDayTimeImpl(
boolean isPositive,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2017 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
@ -48,7 +48,7 @@ import javax.xml.datatype.DatatypeConstants;
class DurationYearMonthImpl
extends DurationImpl {
private static final long serialVersionUID = -4430140662861507958L;
/**
* <p>Constructs a new Duration object by specifying each field individually.</p>

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -40,6 +40,8 @@ import org.xml.sax.SAXException;
* Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/
public class WrappedSAXException extends RuntimeException {
private static final long serialVersionUID = -3201986204982729962L;
public final SAXException exception;
WrappedSAXException( SAXException e ) {

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -24,8 +24,8 @@ package com.sun.org.apache.xerces.internal.utils;
/**
* A configuration error. This was an internal class in ObjectFactory previously
*/
public final class ConfigurationError
extends Error {
public final class ConfigurationError extends Error {
private static final long serialVersionUID = 8095902236393167968L;
//
// Data

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -73,6 +73,7 @@ final class URI
*/
public static class MalformedURIException extends IOException
{
private static final long serialVersionUID = 4651455286983598951L;
/**
* Constructs a <code>MalformedURIException</code> with no specified

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -61,7 +61,7 @@ import java.util.Objects;
*/
public class URI implements Serializable
{
static final long serialVersionUID = 7096266377907081897L;
private static final long serialVersionUID = 7096266377907081897L;
/**
* MalformedURIExceptions are thrown in the process of building a URI
@ -71,6 +71,7 @@ public class URI implements Serializable
*/
public static class MalformedURIException extends IOException
{
private static final long serialVersionUID = -8498313684991136829L;
/**
* Constructs a <code>MalformedURIException</code> with no specified

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2017, 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
@ -33,6 +33,7 @@ package javax.xml.datatype;
*/
public class DatatypeConfigurationException extends Exception {
private static final long serialVersionUID = -1699373159027047238L;
/**
* <p>Create a new <code>DatatypeConfigurationException</code> with

View File

@ -70,57 +70,8 @@ import jdk.xml.internal.SecuritySupport;
*/
public class QName implements Serializable {
/**
* <p>Stream Unique Identifier.</p>
*
* <p>Due to a historical defect, QName was released with multiple
* serialVersionUID values even though its serialization was the
* same.</p>
*
* <p>To workaround this issue, serialVersionUID is set with either
* a default value or a compatibility value. To use the
* compatibility value, set the system property:</p>
*
* <code>com.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0</code>
*
* <p>This workaround was inspired by classes in the javax.management
* package, e.g. ObjectName, etc.
* See CR6267224 for original defect report.</p>
*/
private static final long serialVersionUID;
/**
* <p>Default <code>serialVersionUID</code> value.</p>
*/
private static final long defaultSerialVersionUID = -9120448754896609940L;
/**
* <p>Compatibility <code>serialVersionUID</code> value.</p>
*/
private static final long compatibleSerialVersionUID = 4418622981026545151L;
/**
* <p>Flag to use default or campatible serialVersionUID.</p>
*/
private static boolean useDefaultSerialVersionUID = true;
static {
try {
// use a privileged block as reading a system property
String valueUseCompatibleSerialVersionUID = SecuritySupport.getSystemProperty(
"com.sun.xml.namespace.QName.useCompatibleSerialVersionUID");
useDefaultSerialVersionUID = (valueUseCompatibleSerialVersionUID != null
&& valueUseCompatibleSerialVersionUID.equals("1.0")) ? false : true;
} catch (Exception exception) {
// use default if any Exceptions
useDefaultSerialVersionUID = true;
}
// set serialVersionUID to desired value
if (useDefaultSerialVersionUID) {
serialVersionUID = defaultSerialVersionUID;
} else {
serialVersionUID = compatibleSerialVersionUID;
}
}
// tests show that the ID is the same from JDK 1.5 through JDK 9
private static final long serialVersionUID = -9120448754896609940L;
/**
* <p>Namespace URI of this <code>QName</code>.</p>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, 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
@ -33,7 +33,7 @@ package javax.xml.parsers;
*/
public class ParserConfigurationException extends Exception {
private static final long serialVersionUID = -3688849216575373917L;
/**
* Create a new <code>ParserConfigurationException</code> with no
* detail message.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2017 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
@ -35,6 +35,7 @@ package javax.xml.stream;
*/
public class XMLStreamException extends Exception {
private static final long serialVersionUID = 2018819321811497362L;
protected Throwable nested;
protected Location location;

View File

@ -48,6 +48,8 @@ package org.w3c.dom.events;
* @since 1.5, DOM Level 2
*/
public class EventException extends RuntimeException {
private static final long serialVersionUID = 242753408332692061L;
public EventException(short code, String message) {
super(message);
this.code = code;

View File

@ -58,6 +58,8 @@ and Save Specification</a>.
* @since 1.5
*/
public class LSException extends RuntimeException {
private static final long serialVersionUID = 5371691160978884690L;
public LSException(short code, String message) {
super(message);
this.code = code;

View File

@ -48,6 +48,8 @@ package org.w3c.dom.ranges;
* @since 9, DOM Level 2
*/
public class RangeException extends RuntimeException {
private static final long serialVersionUID = 2427563372446661889L;
public RangeException(short code, String message) {
super(message);
this.code = code;

View File

@ -304,7 +304,6 @@ public abstract class BaseFileManager implements JavaFileManager {
return (encodingName != null) ? encodingName : getDefaultEncodingName();
}
@SuppressWarnings("cast")
public CharBuffer decode(ByteBuffer inbuf, boolean ignoreEncodingErrors) {
String encName = getEncodingName();
CharsetDecoder decoder;
@ -312,7 +311,7 @@ public abstract class BaseFileManager implements JavaFileManager {
decoder = getDecoder(encName, ignoreEncodingErrors);
} catch (IllegalCharsetNameException | UnsupportedCharsetException e) {
log.error(Errors.UnsupportedEncoding(encName));
return (CharBuffer)CharBuffer.allocate(1).flip();
return CharBuffer.allocate(1).flip();
}
// slightly overestimate the buffer size to avoid reallocation.
@ -389,7 +388,6 @@ public abstract class BaseFileManager implements JavaFileManager {
* @return a byte buffer containing the contents of the stream
* @throws IOException if an error occurred while reading the stream
*/
@SuppressWarnings("cast")
public ByteBuffer makeByteBuffer(InputStream in)
throws IOException {
int limit = in.available();
@ -401,14 +399,14 @@ public abstract class BaseFileManager implements JavaFileManager {
// expand buffer
result = ByteBuffer.
allocate(limit <<= 1).
put((ByteBuffer)result.flip());
put(result.flip());
int count = in.read(result.array(),
position,
limit - position);
if (count < 0) break;
result.position(position += count);
}
return (ByteBuffer)result.flip();
return result.flip();
}
public void recycleByteBuffer(ByteBuffer bb) {
@ -418,14 +416,13 @@ public abstract class BaseFileManager implements JavaFileManager {
/**
* A single-element cache of direct byte buffers.
*/
@SuppressWarnings("cast")
private static class ByteBufferCache {
private ByteBuffer cached;
ByteBuffer get(int capacity) {
if (capacity < 20480) capacity = 20480;
ByteBuffer result =
(cached != null && cached.capacity() >= capacity)
? (ByteBuffer)cached.clear()
? cached.clear()
: ByteBuffer.allocate(capacity + capacity>>1);
cached = null;
return result;

View File

@ -98,10 +98,9 @@ import static javax.tools.StandardLocation.*;
*/
public class JavacFileManager extends BaseFileManager implements StandardJavaFileManager {
@SuppressWarnings("cast")
public static char[] toArray(CharBuffer buffer) {
if (buffer.hasArray())
return ((CharBuffer)buffer.compact().flip()).array();
return buffer.compact().flip().array();
else
return buffer.toString().toCharArray();
}

View File

@ -2396,9 +2396,8 @@ public class JavacParser implements Parser {
int pos = token.pos;
List<JCStatement> stats = blockStatement();
if (stats.isEmpty()) {
JCErroneous e = F.at(pos).Erroneous();
error(e, "illegal.start.of.stmt");
return F.at(pos).Exec(e);
JCErroneous e = syntaxError(pos, "illegal.start.of.stmt");
return toP(F.at(pos).Exec(e));
} else {
JCStatement first = stats.head;
String error = null;

View File

@ -97,13 +97,9 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
/**
* Adds the modules list to the documentation tree.
*
* @param modules the set of modules
* @param text caption for the table
* @param tableSummary summary for the table
* @param body the document tree to which the modules list will be added
*/
protected abstract void addModulesList(Collection<ModuleElement> modules, String text,
String tableSummary, Content body);
protected abstract void addModulesList(Content body);
/**
* Adds the module packages list to the documentation tree.
@ -213,7 +209,7 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
addAllPackagesLink(ul);
htmlTree.addContent(ul);
body.addContent(htmlTree);
addModulesList(modules, text, tableSummary, body);
addModulesList(body);
}
/**

View File

@ -94,13 +94,9 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
/**
* Adds the packages list to the documentation tree.
*
* @param packages a collection of packagedoc objects
* @param text caption for the table
* @param tableSummary summary for the table
* @param body the document tree to which the packages list will be added
*/
protected abstract void addPackagesList(Collection<PackageElement> packages, String text,
String tableSummary, Content body);
protected abstract void addPackagesList(Content body);
/**
* Generate and prints the contents in the package index file. Call appropriate
@ -136,23 +132,16 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
* @param body the document tree to which the index will be added
*/
protected void addIndex(Content body) {
addIndexContents(packages, "doclet.Package_Summary",
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Package_Summary"),
configuration.getText("doclet.packages")), body);
addIndexContents(body);
}
/**
* Adds package index contents. Call appropriate methods from
* the sub-classes. Adds it to the body HtmlTree
*
* @param packages a collection of packages to be documented
* @param text string which will be used as the heading
* @param tableSummary summary for the table
* @param body the document tree to which the index contents will be added
*/
protected void addIndexContents(Collection<PackageElement> packages, String text,
String tableSummary, Content body) {
protected void addIndexContents(Content body) {
if (!packages.isEmpty()) {
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
? HtmlTree.NAV()
@ -165,7 +154,7 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
}
htmlTree.addContent(ul);
body.addContent(htmlTree);
addPackagesList(packages, text, tableSummary, body);
addPackagesList(body);
}
}

View File

@ -92,7 +92,9 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocLink;
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
import jdk.javadoc.internal.doclets.toolkit.util.GroupTypes;
import jdk.javadoc.internal.doclets.toolkit.util.ImplementedMethods;
import jdk.javadoc.internal.doclets.toolkit.util.TableTabTypes.TableTabs;
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
@ -911,6 +913,73 @@ public class HtmlDocletWriter extends HtmlDocWriter {
return caption;
}
/**
* Get table header.
*
* @param caption the table caption
* @param tableSummary the summary for the table
* @param tableStyle the table style
* @return a content object
*/
public Content getTableHeader(Content caption, String tableSummary, HtmlStyle tableStyle) {
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(tableStyle, caption)
: HtmlTree.TABLE(tableStyle, tableSummary, caption);
return table;
}
/**
* Get the summary table caption.
*
* @param groupTypes the group types for table tabs
* @return the caption for the summary table
*/
public Content getTableCaption(GroupTypes groupTypes) {
Content tabbedCaption = new HtmlTree(HtmlTag.CAPTION);
Map<String, TableTabs> groups = groupTypes.getGroupTypes();
for (String group : groups.keySet()) {
Content captionSpan;
Content span;
TableTabs tab = groups.get(group);
if (tab.isDefaultTab()) {
captionSpan = HtmlTree.SPAN(new StringContent(tab.resourceKey()));
span = HtmlTree.SPAN(tab.tabId(),
HtmlStyle.activeTableTab, captionSpan);
} else {
captionSpan = HtmlTree.SPAN(getGroupTypeLinks(groupTypes, group));
span = HtmlTree.SPAN(tab.tabId(),
HtmlStyle.tableTab, captionSpan);
}
Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, Contents.SPACE);
span.addContent(tabSpan);
tabbedCaption.addContent(span);
}
return tabbedCaption;
}
/**
* Get the group type links for the table caption.
*
* @param groupTypes the group types for table tabs
* @param groupName the group name to be displayed as link
* @return the content tree for the group type link
*/
public Content getGroupTypeLinks(GroupTypes groupTypes, String groupName) {
String jsShow = "javascript:showGroups(" + groupTypes.getTableTab(groupName).value() + ");";
HtmlTree link = HtmlTree.A(jsShow, new StringContent(groupTypes.getTableTab(groupName).resourceKey()));
return link;
}
/**
* Returns true if the table tabs needs to be displayed.
*
* @param groupTypes the group types for table tabs
* @return true if the tabs should be displayed
*/
public boolean showTabs(GroupTypes groupTypes) {
return groupTypes.getGroupTypes().size() > 1;
}
/**
* Get the marker anchor which will be added to the documentation tree.
*

View File

@ -25,7 +25,6 @@
package jdk.javadoc.internal.doclets.formats.html;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
@ -82,8 +81,7 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
/**
* {@inheritDoc}
*/
protected void addModulesList(Collection<ModuleElement> modules, String text,
String tableSummary, Content body) {
protected void addModulesList(Content body) {
Content heading = HtmlTree.HEADING(HtmlConstants.MODULE_HEADING, true,
contents.modulesLabel);
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
@ -91,7 +89,7 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
: HtmlTree.DIV(HtmlStyle.indexContainer, heading);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.setTitle(contents.modulesLabel);
for (ModuleElement mdle: modules) {
for (ModuleElement mdle: configuration.modules) {
ul.addContent(getModuleLink(mdle));
}
htmlTree.addContent(ul);

View File

@ -30,16 +30,18 @@ import java.util.*;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
import jdk.javadoc.internal.doclets.toolkit.util.Group;
import jdk.javadoc.internal.doclets.toolkit.util.GroupTypes;
/**
* Generate the module index page "overview-summary.html" for the right-hand
@ -62,9 +64,19 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
private final Map<String, SortedSet<ModuleElement>> groupModuleMap;
/**
* List to store the order groups as specified on the command line.
* List to store the order groups, which has elements to be displayed, as specified on the command line.
*/
private final List<String> groupList;
private final List<String> groupList = new ArrayList<>();
private final GroupTypes groupTypes;
private int groupTypesOr = 0;
protected Map<String, Integer> groupTypeMap = new LinkedHashMap<>();
boolean altColor = true;
int counter = 0;
/**
* HTML tree for main tag.
@ -79,7 +91,10 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
public ModuleIndexWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename);
groupModuleMap = configuration.group.groupModules(configuration.modules);
groupList = configuration.group.getGroupList();
configuration.group.getGroupList().stream()
.filter(groupModuleMap::containsKey)
.forEach(groupList::add);
groupTypes = new GroupTypes(groupList, resources.getText("doclet.All_Modules"));
}
/**
@ -101,24 +116,15 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
*/
@Override
protected void addIndex(Content body) {
for (String groupname : groupList) {
SortedSet<ModuleElement> list = groupModuleMap.get(groupname);
if (list != null && !list.isEmpty()) {
addIndexContents(list,
groupname, configuration.getText("doclet.Member_Table_Summary",
groupname, configuration.getText("doclet.modules")), body);
}
}
addIndexContents(body);
}
/**
* Adds module index contents.
*
* @param title the title of the section
* @param tableSummary summary for the table
* @param body the document tree to which the index contents will be added
*/
protected void addIndexContents(Collection<ModuleElement> modules, String title, String tableSummary, Content body) {
protected void addIndexContents(Content body) {
HtmlTree htmltree = (configuration.allowTag(HtmlTag.NAV))
? HtmlTree.NAV()
: new HtmlTree(HtmlTag.DIV);
@ -130,44 +136,59 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
}
htmltree.addContent(ul);
body.addContent(htmltree);
addModulesList(modules, title, tableSummary, body);
addModulesList(body);
}
/**
* Add the list of modules.
*
* @param text The table caption
* @param tableSummary the summary of the table tag
* @param body the content tree to which the module list will be added
*/
protected void addModulesList(Collection<ModuleElement> modules, String text, String tableSummary, Content body) {
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.overviewSummary, getTableCaption(new RawHtml(text)))
: HtmlTree.TABLE(HtmlStyle.overviewSummary, tableSummary, getTableCaption(new RawHtml(text)));
Content header = new TableHeader(contents.moduleLabel, contents.descriptionLabel).toContent();
table.addContent(header);
Content tbody = new HtmlTree(HtmlTag.TBODY);
addModulesList(modules, tbody);
table.addContent(tbody);
Content anchor = getMarkerAnchor(text);
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, anchor);
div.addContent(table);
if (configuration.allowTag(HtmlTag.MAIN)) {
htmlTree.addContent(div);
} else {
body.addContent(div);
protected void addModulesList(Content body) {
if (!groupList.isEmpty()) {
Content caption;
TreeMap<ModuleElement, String> groupMap = new TreeMap<>(utils.makeModuleComparator());
Content tbody = new HtmlTree(HtmlTag.TBODY);
String tableSummary = configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Module_Summary"), configuration.getText("doclet.modules"));
for (String groupname : groupList) {
for (ModuleElement mdle : groupModuleMap.get(groupname)) {
groupMap.put(mdle, groupname);
}
}
if (!groupMap.isEmpty()) {
addModulesList(groupMap, tbody);
}
if (showTabs(groupTypes)) {
caption = getTableCaption(groupTypes);
generateGroupTypesScript(groupTypeMap, groupTypes.getGroupTypes());
} else {
caption = getTableCaption((groupList.size() == 1) ? new StringContent(groupList.get(0)) : contents.modulesLabel);
}
Content table = getTableHeader(caption, tableSummary, HtmlStyle.overviewSummary);
Content header = new TableHeader(contents.moduleLabel, contents.descriptionLabel).toContent();
table.addContent(header);
table.addContent(tbody);
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table);
if (configuration.allowTag(HtmlTag.MAIN)) {
htmlTree.addContent(div);
} else {
body.addContent(div);
}
}
}
/**
* Adds list of modules in the index table. Generate link to each module.
*
* @param map map of module elements and group names
* @param tbody the documentation tree to which the list will be added
*/
protected void addModulesList(Collection<ModuleElement> modules, Content tbody) {
boolean altColor = true;
for (ModuleElement mdle : modules) {
protected void addModulesList(TreeMap<ModuleElement, String> map, Content tbody) {
String groupname;
for (ModuleElement mdle : map.keySet()) {
if (!mdle.isUnnamed()) {
groupname = map.get(mdle);
Content moduleLinkContent = getModuleLink(mdle, new StringContent(mdle.getQualifiedName().toString()));
Content thModule = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, moduleLinkContent);
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
@ -176,6 +197,12 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
HtmlTree tr = HtmlTree.TR(thModule);
tr.addContent(tdSummary);
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
int groupType = groupTypes.getTableTab(groupname).value();
groupTypesOr = groupTypesOr | groupType;
String tableId = "i" + counter;
counter++;
groupTypeMap.put(tableId, groupType);
tr.addAttr(HtmlAttr.ID, tableId);
tbody.addContent(tr);
}
altColor = !altColor;

View File

@ -26,7 +26,6 @@
package jdk.javadoc.internal.doclets.formats.html;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -176,8 +175,10 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
protected void addOverviewHeader(Content body) {
}
protected void addModulesList(Collection<ModuleElement> modules, String text,
String tableSummary, Content body) {
/**
* Do nothing as there is no modules list on this page.
*/
protected void addModulesList(Content body) {
}
/**

View File

@ -78,8 +78,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
* {@inheritDoc}
*/
@Override
protected void addPackagesList(Collection<PackageElement> packages, String text,
String tableSummary, Content body) {
protected void addPackagesList(Content body) {
Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
contents.packagesLabel);
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))

View File

@ -29,17 +29,17 @@ import java.util.*;
import javax.lang.model.element.PackageElement;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
import jdk.javadoc.internal.doclets.toolkit.util.Group;
import jdk.javadoc.internal.doclets.toolkit.util.GroupTypes;
/**
* Generate the package index page "overview-summary.html" for the right-hand
@ -65,9 +65,19 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
private final Map<String, SortedSet<PackageElement>> groupPackageMap;
/**
* List to store the order groups as specified on the command line.
* List to store the order groups, which has elements to be displayed, as specified on the command line.
*/
private final List<String> groupList;
private final List<String> groupList = new ArrayList<>();
private final GroupTypes groupTypes;
private int groupTypesOr = 0;
protected Map<String, Integer> groupTypeMap = new LinkedHashMap<>();
boolean altColor = true;
int counter = 0;
/**
* HTML tree for main tag.
@ -86,7 +96,10 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
public PackageIndexWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename);
groupPackageMap = configuration.group.groupPackages(packages);
groupList = configuration.group.getGroupList();
configuration.group.getGroupList().stream()
.filter(groupPackageMap::containsKey)
.forEachOrdered(groupList::add);
groupTypes = new GroupTypes(groupList, resources.getText("doclet.All_Packages"));
}
/**
@ -109,50 +122,58 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
*/
@Override
protected void addIndex(Content body) {
for (String groupname : groupList) {
SortedSet<PackageElement> list = groupPackageMap.get(groupname);
if (list != null && !list.isEmpty()) {
addIndexContents(list,
groupname, configuration.getText("doclet.Member_Table_Summary",
groupname, configuration.getText("doclet.packages")), body);
}
}
addIndexContents(body);
}
/**
* {@inheritDoc}
*/
@Override
protected void addPackagesList(Collection<PackageElement> packages, String text,
String tableSummary, Content body) {
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.overviewSummary, getTableCaption(new RawHtml(text)))
: HtmlTree.TABLE(HtmlStyle.overviewSummary, tableSummary, getTableCaption(new RawHtml(text)));
table.addContent(getPackageTableHeader().toContent());
Content tbody = new HtmlTree(HtmlTag.TBODY);
addPackagesList(packages, tbody);
table.addContent(tbody);
Content anchor = getMarkerAnchor(text);
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, anchor);
div.addContent(table);
if (configuration.allowTag(HtmlTag.MAIN)) {
htmlTree.addContent(div);
} else {
body.addContent(div);
protected void addPackagesList(Content body) {
if (!groupList.isEmpty()) {
Content caption;
TreeMap<PackageElement, String> groupMap = new TreeMap<>(utils.makePackageComparator());
Content tbody = new HtmlTree(HtmlTag.TBODY);
String tableSummary = configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Package_Summary"), configuration.getText("doclet.packages"));
for (String groupname : groupList) {
for (PackageElement pkg : groupPackageMap.get(groupname)) {
groupMap.put(pkg, groupname);
}
}
if (!groupMap.isEmpty()) {
addPackagesList(groupMap, tbody);
}
if (showTabs(groupTypes)) {
caption = getTableCaption(groupTypes);
generateGroupTypesScript(groupTypeMap, groupTypes.getGroupTypes());
} else {
caption = getTableCaption((groupList.size() == 1) ? new StringContent(groupList.get(0)) : contents.packagesLabel);
}
Content table = getTableHeader(caption, tableSummary, HtmlStyle.overviewSummary);
table.addContent(getPackageTableHeader().toContent());
table.addContent(tbody);
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table);
if (configuration.allowTag(HtmlTag.MAIN)) {
htmlTree.addContent(div);
} else {
body.addContent(div);
}
}
}
/**
* Adds list of packages in the index table. Generate link to each package.
*
* @param packages Packages to which link is to be generated
* @param map map of package elements and group names
* @param tbody the documentation tree to which the list will be added
*/
protected void addPackagesList(Collection<PackageElement> packages, Content tbody) {
boolean altColor = true;
for (PackageElement pkg : packages) {
protected void addPackagesList(TreeMap<PackageElement, String> map, Content tbody) {
String groupname;
for (PackageElement pkg : map.keySet()) {
if (!pkg.isUnnamed()) {
if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) {
groupname = map.get(pkg);
Content packageLinkContent = getPackageLink(pkg, getPackageName(pkg));
Content thPackage = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, packageLinkContent);
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
@ -161,6 +182,12 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
HtmlTree tr = HtmlTree.TR(thPackage);
tr.addContent(tdSummary);
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
int groupType = groupTypes.getTableTab(groupname).value();
groupTypesOr = groupTypesOr | groupType;
String tableId = "i" + counter;
counter++;
groupTypeMap.put(tableId, groupType);
tr.addAttr(HtmlAttr.ID, tableId);
tbody.addContent(tr);
}
}

View File

@ -36,6 +36,7 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
import jdk.javadoc.internal.doclets.toolkit.util.TableTabTypes;
import jdk.javadoc.internal.doclets.toolkit.util.TableTabTypes.TableTabs;
/**
@ -297,6 +298,52 @@ public class HtmlWriter {
script.addContent(new RawHtml(vars));
}
/**
* Generated javascript variables for the document.
*
* @param groupTypeMap map comprising of group relationship
* @param groupTypes map comprising of all table tab types
*/
public void generateGroupTypesScript(Map<String,Integer> groupTypeMap,
Map<String,TableTabs> groupTypes) {
String sep = "";
StringBuilder vars = new StringBuilder("var groups");
vars.append(" = {");
for (Map.Entry<String,Integer> entry : groupTypeMap.entrySet()) {
vars.append(sep);
sep = ",";
vars.append("\"")
.append(entry.getKey())
.append("\":")
.append(entry.getValue());
}
vars.append("};").append(DocletConstants.NL);
sep = "";
vars.append("var tabs = {");
for (String group : groupTypes.keySet()) {
TableTabs tab = groupTypes.get(group);
vars.append(sep);
sep = ",";
vars.append(tab.value())
.append(":")
.append("[")
.append("\"")
.append(tab.tabId())
.append("\"")
.append(sep)
.append("\"")
.append(new StringContent(tab.resourceKey()))
.append("\"]");
}
vars.append("};")
.append(DocletConstants.NL);
addStyles(HtmlStyle.altColor, vars);
addStyles(HtmlStyle.rowColor, vars);
addStyles(HtmlStyle.tableTab, vars);
addStyles(HtmlStyle.activeTableTab, vars);
script.addContent(new RawHtml(vars));
}
/**
* Adds javascript style variables to the document.
*

View File

@ -45,7 +45,9 @@ Use --allow-script-in-comments to allow use of JavaScript.
doclet.JavaScript_in_option=option {0} contains JavaScript.\n\
Use --allow-script-in-comments to allow use of JavaScript.
doclet.Packages=Packages
doclet.All_Packages=All Packages
doclet.Modules=Modules
doclet.All_Modules=All Modules
doclet.Other_Packages=Other Packages
doclet.Other_Modules=Other Modules
doclet.Notice_taglet_registered=Registered Taglet {0} ...

View File

@ -134,6 +134,21 @@ function showPkgs(type)
updatePkgsTabs(type);
}
function showGroups(type)
{
count = 0;
for (var key in groups) {
var row = document.getElementById(key);
if ((groups[key] & type) !== 0) {
row.style.display = '';
row.className = (count++ % 2) ? rowColor : altColor;
}
else
row.style.display = 'none';
}
updateGroupsTabs(type);
}
function updateTabs(type)
{
for (var value in tabs) {
@ -171,3 +186,19 @@ function updatePkgsTabs(type)
}
}
}
function updateGroupsTabs(type)
{
for (var value in tabs) {
var sNode = document.getElementById(tabs[value][0]);
var spanNode = sNode.firstChild;
if (value == type) {
sNode.className = activeTableTab;
spanNode.innerHTML = tabs[value][1];
}
else {
sNode.className = tableTab;
spanNode.innerHTML = "<a href=\"javascript:showGroups(" + value + ");\">" + tabs[value][1] + "</a>";
}
}
}

View File

@ -433,21 +433,25 @@ Table styles
white-space:pre;
}
.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link,
.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link,
.constantsSummary caption a:link, .deprecatedSummary caption a:link,
.requiresSummary caption a:link, .packagesSummary caption a:link, .providesSummary caption a:link,
.usesSummary caption a:link,
.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover,
.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover,
.constantsSummary caption a:hover, .deprecatedSummary caption a:hover,
.requiresSummary caption a:hover, .packagesSummary caption a:hover, .providesSummary caption a:hover,
.usesSummary caption a:hover,
.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active,
.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active,
.constantsSummary caption a:active, .deprecatedSummary caption a:active,
.requiresSummary caption a:active, .packagesSummary caption a:active, .providesSummary caption a:active,
.usesSummary caption a:active,
.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited,
.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited,
.constantsSummary caption a:visited, .deprecatedSummary caption a:visited,
.requiresSummary caption a:visited, .packagesSummary caption a:visited, .providesSummary caption a:visited,
.usesSummary caption a:visited {
color:#FFFFFF;
}
.useSummary caption a:link, .useSummary caption a:hover, .useSummary caption a:active,
.useSummary caption a:visited {
color:#1f389c;
}
.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span,
@ -465,7 +469,8 @@ Table styles
border: none;
height:16px;
}
.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span {
.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span,
.overviewSummary caption span.activeTableTab span {
white-space:nowrap;
padding-top:5px;
padding-left:12px;
@ -476,7 +481,8 @@ Table styles
background-color:#F8981D;
height:16px;
}
.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span {
.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span,
.overviewSummary caption span.tableTab span {
white-space:nowrap;
padding-top:5px;
padding-left:12px;
@ -488,7 +494,8 @@ Table styles
height:16px;
}
.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab,
.packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab {
.packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab,
.overviewSummary caption span.tableTab, .overviewSummary caption span.activeTableTab {
padding-top:0px;
padding-left:0px;
padding-right:0px;
@ -505,7 +512,8 @@ Table styles
float:left;
background-color:#F8981D;
}
.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd {
.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd,
.overviewSummary .activeTableTab .tabEnd {
display:none;
width:5px;
margin-right:3px;
@ -513,7 +521,8 @@ Table styles
float:left;
background-color:#F8981D;
}
.memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd {
.memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd,
.overviewSummary .tableTab .tabEnd {
display:none;
width:5px;
margin-right:3px;

View File

@ -0,0 +1,67 @@
/*
* Copyright (c) 2017, 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.
*/
package jdk.javadoc.internal.doclets.toolkit.util;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import jdk.javadoc.internal.doclets.toolkit.util.TableTabTypes.TableTabs;
/**
* Enum representing group types.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*
* @author Bhavesh Patel
*/
public class GroupTypes {
private final Map<String,TableTabs> tabs = new LinkedHashMap<>();
private int value = 1;
public GroupTypes(List<String> groupList, String allLabel) {
if (groupList.size() > 1) {
tabs.put(allLabel, TableTabs.tab(65535, allLabel, "t0", true));
}
groupList.forEach((groupname) -> {
tabs.put(groupname, TableTabs.tab(value, groupname, "t" + value, false));
value = 2 * value;
});
}
public Map<String,TableTabs> getGroupTypes() {
return tabs;
}
public TableTabs getTableTab(String groupName) {
return tabs.get(groupName);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, 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
@ -42,6 +42,7 @@ import java.util.function.Supplier;
* StackWalker::getCallerClass can't be called from @CallerSensitive method.
*/
public class CallerSensitiveTest {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
private static final String NON_CSM_CALLER_METHOD = "getCallerClass";
private static final String CSM_CALLER_METHOD = "caller";
@ -54,7 +55,8 @@ public class CallerSensitiveTest {
Policy.setPolicy(new Policy() {
@Override
public boolean implies(ProtectionDomain domain, Permission p) {
return perms.implies(p);
return perms.implies(p) ||
DEFAULT_POLICY.implies(domain, p);
}
});
System.setSecurityManager(new SecurityManager());

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, 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
@ -23,7 +23,7 @@
/*
* @test
* @bug 8140450 8152893
* @bug 8140450 8152893 8189291
* @summary Basic test for StackWalker.getCallerClass()
* @run main/othervm GetCallerClassTest
* @run main/othervm GetCallerClassTest sm
@ -45,6 +45,7 @@ import java.util.EnumSet;
import java.util.List;
public class GetCallerClassTest {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
private final StackWalker walker;
private final boolean expectUOE;
@ -59,7 +60,8 @@ public class GetCallerClassTest {
Policy.setPolicy(new Policy() {
@Override
public boolean implies(ProtectionDomain domain, Permission p) {
return perms.implies(p);
return perms.implies(p) ||
DEFAULT_POLICY.implies(domain, p);
}
});
System.setSecurityManager(new SecurityManager());

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, 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
@ -58,7 +58,7 @@ import sun.util.logging.PlatformLogger;
/**
* @test
* @bug 8140364 8145686
* @bug 8140364 8145686 8189291
* @summary JDK implementation specific unit test for the base DefaultLoggerFinder.
* Tests the behavior of DefaultLoggerFinder and SimpleConsoleLogger
* implementation.
@ -75,6 +75,7 @@ import sun.util.logging.PlatformLogger;
*/
public class BaseDefaultLoggerFinderTest {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
static final RuntimePermission LOGGERFINDER_PERMISSION =
new RuntimePermission("loggerFinder");
final static boolean VERBOSE = false;
@ -959,7 +960,8 @@ public class BaseDefaultLoggerFinderTest {
@Override
public boolean implies(ProtectionDomain domain, Permission permission) {
return getPermissions().implies(permission);
return getPermissions().implies(permission) ||
DEFAULT_POLICY.implies(domain, permission);
}
@Override

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2017, 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
@ -46,7 +46,7 @@ import jdk.internal.logger.LazyLoggers;
/*
* @test
* @bug 8140364
* @bug 8140364 8189291
* @author danielfuchs
* @summary JDK implementation specific unit test for JDK internal artifacts.
Tests the behavior of bootstrap loggers (and SimpleConsoleLoggers
@ -60,6 +60,7 @@ import jdk.internal.logger.LazyLoggers;
*/
public class BootstrapLoggerTest {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
static final Method isAlive;
static final Field logManagerInitialized;
static {
@ -365,7 +366,8 @@ public class BootstrapLoggerTest {
@Override
public boolean implies(ProtectionDomain domain, Permission permission) {
return getPermissions(domain).implies(permission);
return getPermissions(domain).implies(permission) ||
DEFAULT_POLICY.implies(domain, permission);
}
@Override

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, 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
@ -56,7 +56,7 @@ import jdk.internal.logger.SimpleConsoleLogger;
/**
* @test
* @bug 8140364
* @bug 8140364 8189291
* @summary JDK implementation specific unit test for LoggerFinderLoader.
* Tests the behavior of LoggerFinderLoader with respect to the
* value of the internal diagnosability switches. Also test the
@ -96,6 +96,7 @@ import jdk.internal.logger.SimpleConsoleLogger;
*/
public class LoggerFinderLoaderTest {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
static final RuntimePermission LOGGERFINDER_PERMISSION =
new RuntimePermission("loggerFinder");
final static boolean VERBOSE = false;
@ -866,7 +867,8 @@ public class LoggerFinderLoaderTest {
@Override
public boolean implies(ProtectionDomain domain, Permission permission) {
return getPermissions().implies(permission);
return getPermissions().implies(permission) ||
DEFAULT_POLICY.implies(domain, permission);
}
@Override

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2017, 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
@ -39,7 +39,7 @@ import java.util.*;
/*
* @test
* @bug 8004260
* @bug 8004260 8189291
* @summary Test proxy classes that implement non-public interface
*
* @build p.Foo
@ -48,6 +48,8 @@ import java.util.*;
* @run main/othervm NonPublicProxyClass
*/
public class NonPublicProxyClass {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
public interface PublicInterface {
void foo();
}
@ -200,7 +202,8 @@ public class NonPublicProxyClass {
}
public boolean implies(ProtectionDomain domain, Permission perm) {
return permissions.implies(perm);
return permissions.implies(perm) ||
DEFAULT_POLICY.implies(domain, perm);
}
public String toString() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2017, 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
@ -54,6 +54,7 @@ import static java.nio.charset.StandardCharsets.US_ASCII;
public class LookupTest {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
static int port;
static volatile ServerSocket serverSocket;
@ -210,7 +211,7 @@ public class LookupTest {
}
public boolean implies(ProtectionDomain domain, Permission perm) {
return perms.implies(perm);
return perms.implies(perm) || DEFAULT_POLICY.implies(domain, perm);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2017, 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
@ -23,7 +23,7 @@
/*
* @test
* @bug 7103570
* @bug 7103570 8189291
* @author David Holmes
* @run main/othervm AtomicUpdaters
* @run main/othervm AtomicUpdaters UseSM
@ -47,6 +47,8 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
public class AtomicUpdaters {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
enum TYPE { INT, LONG, REF }
static class Config {
@ -216,7 +218,8 @@ public class AtomicUpdaters {
@Override
public boolean implies(ProtectionDomain pd, Permission p) {
return Policy.UNSUPPORTED_EMPTY_COLLECTION.implies(p);
return Policy.UNSUPPORTED_EMPTY_COLLECTION.implies(p) ||
DEFAULT_POLICY.implies(pd, p);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, 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
@ -50,13 +50,14 @@ import java.util.logging.LoggingPermission;
/**
* @test
* @bug 8033661
* @bug 8033661 8189291
* @summary tests LogManager.updateConfiguration(InputStream, Function) method
* @run main/othervm SimpleUpdateConfigWithInputStreamTest UNSECURE
* @run main/othervm SimpleUpdateConfigWithInputStreamTest SECURE
* @author danielfuchs
*/
public class SimpleUpdateConfigWithInputStreamTest {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
/**
* We will test updateConfiguration in
@ -655,7 +656,8 @@ public class SimpleUpdateConfigWithInputStreamTest {
@Override
public boolean implies(ProtectionDomain domain, Permission permission) {
return getPermissions(domain).implies(permission);
return getPermissions(domain).implies(permission) ||
DEFAULT_POLICY.implies(domain, permission);
}
public PermissionCollection permissions() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, 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
@ -59,7 +59,7 @@ import java.util.stream.Stream;
/**
* @test
* @bug 8033661
* @bug 8033661 8189291
* @summary tests LogManager.updateConfiguration(bin)
* @modules java.logging/java.util.logging:open
* @run main/othervm UpdateConfigurationTest UNSECURE
@ -68,6 +68,8 @@ import java.util.stream.Stream;
*/
public class UpdateConfigurationTest {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
/**
* We will test the handling of abstract logger nodes with file handlers in
* two configurations:
@ -594,7 +596,8 @@ public class UpdateConfigurationTest {
@Override
public boolean implies(ProtectionDomain domain, Permission permission) {
if (allowAll.get().get()) return allPermissions.implies(permission);
return permissions.implies(permission);
return permissions.implies(permission) ||
DEFAULT_POLICY.implies(domain, permission);
}
@Override

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2017, 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
@ -39,7 +39,7 @@ import resources.ListBundle;
/**
* @test
* @bug 8013839
* @bug 8013839 8189291
* @summary tests Logger.setResourceBundle;
* @build TestSetResourceBundle resources.ListBundle resources.ListBundle_fr
* @run main/othervm TestSetResourceBundle UNSECURE
@ -49,6 +49,7 @@ import resources.ListBundle;
*/
public class TestSetResourceBundle {
static final Policy DEFAULT_POLICY = Policy.getPolicy();
static final String LIST_BUNDLE_NAME = "resources.ListBundle";
static final String PROPERTY_BUNDLE_NAME = "resources.PropertyBundle";
@ -479,7 +480,8 @@ public class TestSetResourceBundle {
@Override
public boolean implies(ProtectionDomain domain, Permission permission) {
return permissions.implies(permission);
return permissions.implies(permission) ||
DEFAULT_POLICY.implies(domain, permission);
}
}

View File

@ -23,13 +23,12 @@
/*
* @test
* @bug 8038436 8158504 8065555 8167143 8167273
* @bug 8038436 8158504 8065555 8167143 8167273 8189272
* @summary Test for changes in 8038436
* @modules java.base/sun.util.locale.provider
* java.base/sun.util.spi
* jdk.localedata
* @compile -XDignore.symbol.file Bug8038436.java
* @run main/othervm --limit-modules java.base Bug8038436 security
* @run main/othervm -Djava.locale.providers=COMPAT Bug8038436 availlocs
*/
@ -52,9 +51,6 @@ public class Bug8038436 {
switch (args[0]) {
case "security":
securityTests();
break;
case "availlocs":
availableLocalesTests();
break;
@ -64,52 +60,6 @@ public class Bug8038436 {
}
private static void securityTests() {
Policy.setPolicy(new MyPolicy());
System.setSecurityManager(new SecurityManager());
/*
* Test for AccessClassInPackage security exception. Confirms that
* exeption won't be thrown if an application sets a Permission that
* does not allow any RuntimePermission, on loading LocaleDataMetaInfo
* from jdk.localedata module.
*/
System.out.println(new Formatter(Locale.JAPAN).format("%1$tB %1$te, %1$tY",
new GregorianCalendar()));
/*
* Check only English/ROOT locales are returned if the jdk.localedata
* module is not loaded (implied by "--limit-modules java.base").
*/
List<Locale> nonEnglishLocales= (Arrays.stream(Locale.getAvailableLocales())
.filter(l -> (l != Locale.ROOT && !(l.getLanguage() == "en" && (l.getCountry() == "US" || l.getCountry() == "" ))))
.collect(Collectors.toList()));
if (!nonEnglishLocales.isEmpty()) {
throw new RuntimeException("non English locale(s)" + nonEnglishLocales + " included in available locales");
}
}
static class MyPolicy extends Policy {
final PermissionCollection perms = new Permissions();
MyPolicy() {
// allows no RuntimePermission
}
public PermissionCollection getPermissions(ProtectionDomain domain) {
return perms;
}
public PermissionCollection getPermissions(CodeSource codesource) {
return perms;
}
public boolean implies(ProtectionDomain domain, Permission perm) {
return perms.implies(perm);
}
}
static final String[] bipLocs = ("ar, ar-JO, ar-LB, ar-SY, be, be-BY, bg, " +
"bg-BG, ca, ca-ES, cs, cs-CZ, da, da-DK, de, de-AT, de-CH, de-DE, " +

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2017, 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
@ -23,7 +23,7 @@
/*
* @test
* @bug 4637604 4775148
* @bug 4637604 4775148 8183037
* @summary Test the tables for summary attribute
* @author dkramer
* @library ../lib
@ -48,7 +48,7 @@ public class AccessSummary extends JavadocTester {
javadoc("-d", "out", "-sourcepath", testSrc, "p1", "p2");
checkExit(Exit.OK);
checkOutput("overview-summary.html", true,
"summary=\"Packages table, listing packages, and an explanation\"");
"summary=\"Package Summary table, listing packages, and an explanation\"");
// Test that the summary attribute appears
checkOutput("p1/C1.html", true,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2017, 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
@ -23,7 +23,7 @@
/*
* @test
* @bug 8008164 8169819
* @bug 8008164 8169819 8183037
* @summary Test styles on HTML tables generated by javadoc.
* @author Bhavesh Patel
* @library ../lib
@ -65,7 +65,7 @@ public class TestHtmlTableStyles extends JavadocTester {
checkOutput("overview-summary.html", true,
"<table class=\"overviewSummary\" "
+ "summary=\"Packages table, listing packages, and an explanation\">");
+ "summary=\"Package Summary table, listing packages, and an explanation\">");
checkOutput("deprecated-list.html", true,
"<table class=\"deprecatedSummary\" summary=\"Methods table, listing " +

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 6786688 8008164 8162363 8169819
* @bug 6786688 8008164 8162363 8169819 8183037
* @summary HTML tables should have table summary, caption and table headers.
* @author Bhavesh Patel
* @library ../lib
@ -142,7 +142,7 @@ public class TestHtmlTableTags extends JavadocTester {
// Overview Summary
checkOutput("overview-summary.html", true,
"<table class=\"overviewSummary\" "
+ "summary=\"Packages table, listing packages, and an explanation\">");
+ "summary=\"Package Summary table, listing packages, and an explanation\">");
}
/*

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8072945 8081854 8141492 8148985 8150188 4649116 8173707 8151743 8169819
* @bug 8072945 8081854 8141492 8148985 8150188 4649116 8173707 8151743 8169819 8183037
* @summary Test the version of HTML generated by the javadoc tool.
* @author bpatel
* @library ../lib
@ -656,7 +656,7 @@ public class TestHtmlVersion extends JavadocTester {
"<a name=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n"
+ "</a>",
"<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
"<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">\n"
+ "<caption>",
"</noscript>\n"
+ "<div class=\"fixedNav\">\n"
@ -1089,7 +1089,7 @@ public class TestHtmlVersion extends JavadocTester {
"<a name=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n"
+ "</a>",
"<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
"<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">\n"
+ "<caption>",
"</noscript>\n"
+ "<div class=\"fixedNav\">\n"

View File

@ -25,7 +25,7 @@
* @test
* @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363
* 8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218 8175823 8166306
* 8178043 8181622 8183511 8169819 8074407
* 8178043 8181622 8183511 8169819 8074407 8183037
* @summary Test modules support in javadoc.
* @author bpatel
* @library ../lib
@ -346,6 +346,28 @@ public class TestModules extends JavadocTester {
checkGroupOption();
}
/**
* Test -group option for modules and the ordering of module groups.
* The overview-summary.html page should group the modules accordingly and display the group tabs in
* the order it was provided on the command-line.
*/
@Test
void testGroupOptionOrdering() {
javadoc("-d", "out-groupOrder", "--show-module-contents=all",
"-tag", "regular:a:Regular Tag:",
"-tag", "moduletag:s:Module Tag:",
"--module-source-path", testSrc,
"-group", "B Group", "moduleB*",
"-group", "C Group", "moduleC*",
"-group", "A Group", "moduleA*",
"-group", "Java SE Modules", "java*",
"--module", "moduleA,moduleB,moduleC,moduletags",
"moduleA/concealedpkgmdlA", "testpkgmdlA", "testpkg2mdlB", "testpkgmdlB", "testpkgmdlC",
"testpkgmdltags");
checkExit(Exit.OK);
checkGroupOptionOrdering();
}
/**
* Test -group option for unnamed modules. The overview-summary.html page should group the packages accordingly.
*/
@ -361,6 +383,23 @@ public class TestModules extends JavadocTester {
checkUnnamedModuleGroupOption();
}
/**
* Test -group option for unnamed modules and the ordering of package groups.
* The overview-summary.html page should group the packages accordingly and display the group tabs in
* the order it was provided on the command-line.
*/
@Test
void testGroupOptionPackageOrdering() {
javadoc("-d", "out-groupPkgOrder", "-use",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc,
"-group", "Z Group", "testpkgnomodule",
"-group", "A Group", "testpkgnomodule1",
"testpkgnomodule", "testpkgnomodule1");
checkExit(Exit.OK);
checkGroupOptionPackageOrdering();
}
/**
* Test -group option for a single module.
*/
@ -408,10 +447,8 @@ public class TestModules extends JavadocTester {
+ "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\"><a name=\"Modules\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
+ "<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+ "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
checkOutput("overview-summary.html", false,
"</table>\n"
@ -419,10 +456,8 @@ public class TestModules extends JavadocTester {
+ "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\"><a name=\"Modules\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
+ "<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+ "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
}
@ -471,9 +506,7 @@ public class TestModules extends JavadocTester {
+ "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\"><a id=\"Modules\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\">\n"
+ "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
checkOutput("overview-summary.html", false,
@ -484,9 +517,7 @@ public class TestModules extends JavadocTester {
+ "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\"><a id=\"Modules\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\">\n"
+ "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
}
@ -565,14 +596,14 @@ public class TestModules extends JavadocTester {
void checkOverviewSummaryModules() {
checkOutput("overview-summary.html", true,
"<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
"<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+ "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+ "</tr>");
checkOutput("overview-summary.html", false,
"<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
"<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">\n"
+ "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
@ -582,7 +613,7 @@ public class TestModules extends JavadocTester {
void checkOverviewSummaryPackages() {
checkOutput("overview-summary.html", false,
"<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
"<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+ "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
@ -593,13 +624,11 @@ public class TestModules extends JavadocTester {
+ "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\"><a name=\"Packages\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
+ "<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">\n"
+ "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
checkOutput("overview-summary.html", true,
"<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
"<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">\n"
+ "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
@ -609,10 +638,8 @@ public class TestModules extends JavadocTester {
+ "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\"><a name=\"Packages\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
+ "<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">\n"
+ "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
}
@ -667,9 +694,7 @@ public class TestModules extends JavadocTester {
+ "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\"><a id=\"Packages\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\">\n"
+ "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
}
@ -1066,51 +1091,87 @@ public class TestModules extends JavadocTester {
void checkGroupOption() {
checkOutput("overview-summary.html", true,
"<div class=\"contentContainer\"><a name=\"ModuleGroupA\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<table class=\"overviewSummary\" summary=\"Module Group A table, listing modules, and an explanation\">\n"
+ "<caption><span>Module Group A</span><span class=\"tabEnd\">&nbsp;</span></caption>",
"<div class=\"contentContainer\"><a name=\"ModuleGroupB&amp;C\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<table class=\"overviewSummary\" summary=\"Module Group B &amp; C table, listing modules, and an explanation\">\n"
+ "<caption><span>Module Group B & C</span><span class=\"tabEnd\">&nbsp;</span></caption>",
"<div class=\"contentContainer\"><a name=\"OtherModules\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<table class=\"overviewSummary\" summary=\"Other Modules table, listing modules, and an explanation\">\n"
+ "<caption><span>Other Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
"<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Modules</span><span class=\"tabEnd\">&nbsp;"
+ "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showGroups(1);\">"
+ "Module Group A</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\">"
+ "<span><a href=\"javascript:showGroups(2);\">Module Group B &amp; C</a></span><span class=\"tabEnd\">"
+ "&nbsp;</span></span><span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:showGroups(4);\">"
+ "Other Modules</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
"var groups = {\"i0\":1,\"i1\":2,\"i2\":2,\"i3\":4};\n"
+ "var tabs = {65535:[\"t0\",\"All Modules\"],1:[\"t1\",\"Module Group A\"],2:[\"t2\",\"Module Group B &amp; C\"],4:[\"t4\",\"Other Modules\"]};\n"
+ "var altColor = \"altColor\";\n"
+ "var rowColor = \"rowColor\";\n"
+ "var tableTab = \"tableTab\";\n"
+ "var activeTableTab = \"activeTableTab\";");
checkOutput("overview-summary.html", false,
"<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
"<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+ "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>",
"Java SE Modules");
}
void checkGroupOptionOrdering() {
checkOutput("overview-summary.html", true,
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Modules</span><span "
+ "class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\"><span>"
+ "<a href=\"javascript:showGroups(1);\">B Group</a></span><span class=\"tabEnd\">"
+ "&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:showGroups(2);\">"
+ "C Group</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t4\" class=\"tableTab\">"
+ "<span><a href=\"javascript:showGroups(4);\">A Group</a></span><span class=\"tabEnd\">&nbsp;</span>"
+ "</span><span id=\"t8\" class=\"tableTab\"><span><a href=\"javascript:showGroups(8);\">Other Modules"
+ "</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
"var tabs = {65535:[\"t0\",\"All Modules\"],1:[\"t1\",\"B Group\"],2:[\"t2\",\"C Group\"],"
+ "4:[\"t4\",\"A Group\"],8:[\"t8\",\"Other Modules\"]};");
checkOutput("overview-summary.html", false,
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Modules</span><span "
+ "class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\"><span>"
+ "<a href=\"javascript:showGroups(1);\">A Group</a></span><span class=\"tabEnd\">"
+ "&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:showGroups(2);\">"
+ "B Group</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t4\" class=\"tableTab\">"
+ "<span><a href=\"javascript:showGroups(4);\">C Group</a></span><span class=\"tabEnd\">&nbsp;</span>"
+ "</span><span id=\"t8\" class=\"tableTab\"><span><a href=\"javascript:showGroups(8);\">Other Modules"
+ "</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
"Java SE Modules");
}
void checkUnnamedModuleGroupOption() {
checkOutput("overview-summary.html", true,
"<div class=\"contentContainer\"><a name=\"PackageGroup0\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<table class=\"overviewSummary\" summary=\"Package Group 0 table, listing packages, and an explanation\">\n"
+ "<caption><span>Package Group 0</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>",
"<div class=\"contentContainer\"><a name=\"PackageGroup1\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<table class=\"overviewSummary\" summary=\"Package Group 1 table, listing packages, and an explanation\">\n"
+ "<caption><span>Package Group 1</span><span class=\"tabEnd\">&nbsp;</span></caption>");
"<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">\n"
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;"
+ "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showGroups(1);\">"
+ "Package Group 0</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" "
+ "class=\"tableTab\"><span><a href=\"javascript:showGroups(2);\">Package Group 1</a></span>"
+ "<span class=\"tabEnd\">&nbsp;</span></span></caption>",
"var groups = {\"i0\":1,\"i1\":2};\n"
+ "var tabs = {65535:[\"t0\",\"All Packages\"],1:[\"t1\",\"Package Group 0\"],2:[\"t2\",\"Package Group 1\"]};\n"
+ "var altColor = \"altColor\";\n"
+ "var rowColor = \"rowColor\";\n"
+ "var tableTab = \"tableTab\";\n"
+ "var activeTableTab = \"activeTableTab\";");
}
void checkGroupOptionPackageOrdering() {
checkOutput("overview-summary.html", true,
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span "
+ "class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\"><span>"
+ "<a href=\"javascript:showGroups(1);\">Z Group</a></span><span class=\"tabEnd\">"
+ "&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:showGroups(2);\">"
+ "A Group</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
"var tabs = {65535:[\"t0\",\"All Packages\"],1:[\"t1\",\"Z Group\"],2:[\"t2\",\"A Group\"]};");
}
void checkGroupOptionSingleModule() {
checkOutput("overview-summary.html", true,
"<div class=\"contentContainer\"><a name=\"ModuleGroupB\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<table class=\"overviewSummary\" summary=\"Module Group B table, listing modules, and an explanation\">\n"
"<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+ "<caption><span>Module Group B</span><span class=\"tabEnd\">&nbsp;</span></caption>");
checkOutput("overview-summary.html", false,
"<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
"<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+ "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
}

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363 8160196 8151743 8177417
* 8175218 8176452 8181215 8182263 8183511 8169819
* 8175218 8176452 8181215 8182263 8183511 8169819 8183037
* @summary Run tests on doclet stylesheet.
* @author jamieh
* @library ../lib
@ -112,7 +112,8 @@ public class TestStylesheet extends JavadocTester {
+ " border: none;\n"
+ " height:16px;\n"
+ "}",
".memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span {\n"
".memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span,\n"
+ ".overviewSummary caption span.activeTableTab span {\n"
+ " white-space:nowrap;\n"
+ " padding-top:5px;\n"
+ " padding-left:12px;\n"
@ -123,7 +124,8 @@ public class TestStylesheet extends JavadocTester {
+ " background-color:#F8981D;\n"
+ " height:16px;\n"
+ "}",
".memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span {\n"
".memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span,\n"
+ ".overviewSummary caption span.tableTab span {\n"
+ " white-space:nowrap;\n"
+ " padding-top:5px;\n"
+ " padding-left:12px;\n"
@ -152,7 +154,8 @@ public class TestStylesheet extends JavadocTester {
+ " padding:0px 0px 12px 10px;\n"
+ "}",
".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab,\n"
+ ".packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab {\n"
+ ".packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab,\n"
+ ".overviewSummary caption span.tableTab, .overviewSummary caption span.activeTableTab {\n"
+ " padding-top:0px;\n"
+ " padding-left:0px;\n"
+ " padding-right:0px;\n"

View File

@ -38,6 +38,7 @@ import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.tree.ErroneousTree;
import com.sun.source.tree.ExpressionStatementTree;
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.IfTree;
import com.sun.source.tree.LambdaExpressionTree;
import com.sun.source.tree.MethodInvocationTree;
import com.sun.source.tree.MethodTree;
@ -284,6 +285,48 @@ public class JavacParserTest extends TestCase {
1, t.getSourcePositions().getStartPosition(cut, clazz));
}
@Test
void testPositionMissingStatement() throws IOException {
String code = "class C { void t() { if (true) } }";
DiagnosticCollector<JavaFileObject> dc = new DiagnosticCollector<>();
JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, fm, dc, null,
null, Arrays.asList(new MyFileObject(code)));
CompilationUnitTree cut = ct.parse().iterator().next();
Trees trees = Trees.instance(ct);
SourcePositions positions = trees.getSourcePositions();
new TreeScanner<Void, Void>() {
@Override
public Void visitIf(IfTree it, Void v) {
StatementTree st = it.getThenStatement();
int startpos = (int) positions.getStartPosition(cut, st);
int endpos = (int) positions.getEndPosition(cut, st);
assertEquals("testPositionMissingStatement.execpos", startpos, endpos);
assertEquals("testPositionMissingStatement.execkind",
Kind.EXPRESSION_STATEMENT,
st.getKind());
Tree err = ((ExpressionStatementTree) st).getExpression();
startpos = (int) positions.getStartPosition(cut, err);
endpos = (int) positions.getEndPosition(cut, err);
assertEquals("testPositionMissingStatement.errpos", startpos, endpos);
assertEquals("testPositionMissingStatement.errkind",
Kind.ERRONEOUS,
err.getKind());
return super.visitIf(it, v);
}
}.scan(cut, null);
assertEquals("testPositionMissingStatement.diags", 1, dc.getDiagnostics().size());
Diagnostic<? extends JavaFileObject> d = dc.getDiagnostics().get(0);
int startpos = (int) d.getStartPosition();
int pos = (int) d.getPosition();
int endpos = (int) d.getEndPosition();
assertEquals("testPositionMissingStatement.diagspan", startpos, endpos);
assertEquals("testPositionMissingStatement.diagpref", startpos, pos);
}
@Test
void testPositionsSane1() throws IOException {
performPositionsSanityTest("package test; class Test { " +