diff --git a/.hgtags b/.hgtags index 58e232d224b..bb824527e83 100644 --- a/.hgtags +++ b/.hgtags @@ -456,3 +456,5 @@ b87d7b5d5dedc1185e5929470f945b7378cdb3ad jdk-10+27 a6e591e12f122768f675428e1e5a838fd0e9c7ec jdk-10+29 8fee80b92e65149f7414250fd5e34b6f35d417b4 jdk-10+30 e6278add9ff28fab70fe1cc4c1d65f7363dc9445 jdk-10+31 +a2008587c13fa05fa2dbfcb09fe987576fbedfd1 jdk-10+32 +bbd692ad4fa300ecca7939ffbe3b1d5e52a28cc6 jdk-10+33 diff --git a/doc/building.html b/doc/building.html index 357b0f5fb4b..bd4c1d80ddd 100644 --- a/doc/building.html +++ b/doc/building.html @@ -871,9 +871,9 @@ test-support/
When building for distribution, zipped is a good solution. Binaries built with internal is suitable for use by developers, since they facilitate debugging, but should be stripped before distributed to end users.
The configure script is based on the autoconf framework, but in some details deviate from a normal autoconf configure script.
The configure script in the top level directory of OpenJDK is just a thin wrapper that calls common/autoconf/configure. This in turn provides functionality that is not easily expressed in the normal Autoconf framework, and then calls into the core of the configure script, which is the common/autoconf/generated-configure.sh file.
The configure script in the top level directory of OpenJDK is just a thin wrapper that calls make/autoconf/configure. This in turn provides functionality that is not easily expressed in the normal Autoconf framework, and then calls into the core of the configure script, which is the make/autoconf/generated-configure.sh file.
As the name implies, this file is generated by Autoconf. It is checked in after regeneration, to alleviate the common user to have to install Autoconf.
-The build system will detect if the Autoconf source files have changed, and will trigger a regeneration of common/autoconf/generated-configure.sh if needed. You can also manually request such an update by bash common/autoconf/autogen.sh.
The build system will detect if the Autoconf source files have changed, and will trigger a regeneration of make/autoconf/generated-configure.sh if needed. You can also manually request such an update by bash make/autoconf/autogen.sh.
If you make changes to the build system that requires a re-generation, note the following:
You must use exactly version 2.69 of autoconf for your patch to be accepted. This is to avoid spurious changes in the generated file. Note that Ubuntu 16.04 ships a patched version of autoconf which claims to be 2.69, but is not.
- * If, when the adapter is called, the supplied array argument does - * not have the correct number of elements, the adapter will throw - * an {@link IllegalArgumentException} instead of invoking the target. + * When the adapter is called, the length of the supplied {@code array} + * argument is queried as if by {@code array.length} or {@code arraylength} + * bytecode. If the adapter accepts a zero-length trailing array argument, + * the supplied {@code array} argument can either be a zero-length array or + * {@code null}; otherwise, the adapter will throw a {@code NullPointerException} + * if the array is {@code null} and throw an {@link IllegalArgumentException} + * if the array does not have the correct number of elements. *
* Here are some simple examples of array-spreading method handles: *
{@code
@@ -902,7 +906,7 @@ assert( (boolean) eq2.invokeExact(new Object[]{ "me", "me" }));
assert(!(boolean) eq2.invokeExact(new Object[]{ "me", "thee" }));
// try to spread from anything but a 2-array:
for (int n = 0; n <= 10; n++) {
- Object[] badArityArgs = (n == 2 ? null : new Object[n]);
+ Object[] badArityArgs = (n == 2 ? new Object[0] : new Object[n]);
try { assert((boolean) eq2.invokeExact(badArityArgs) && false); }
catch (IllegalArgumentException ex) { } // OK
}
diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
index ee76e84d5ed..f5ba966e5a8 100644
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
@@ -662,8 +662,10 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
}
static void checkSpreadArgument(Object av, int n) {
- if (av == null) {
- if (n == 0) return;
+ if (av == null && n == 0) {
+ return;
+ } else if (av == null) {
+ throw new NullPointerException("null array reference");
} else if (av instanceof Object[]) {
int len = ((Object[])av).length;
if (len == n) return;
diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
index 5823b9cfdd1..bad45f6e336 100644
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
@@ -2514,14 +2514,20 @@ return mh1;
}
/**
- * Produces a method handle constructing arrays of a desired type.
+ * Produces a method handle constructing arrays of a desired type,
+ * as if by the {@code anewarray} bytecode.
* The return type of the method handle will be the array type.
* The type of its sole argument will be {@code int}, which specifies the size of the array.
+ *
+ * If the returned method handle is invoked with a negative
+ * array size, a {@code NegativeArraySizeException} will be thrown.
+ *
* @param arrayClass an array type
* @return a method handle which can create arrays of the given type
* @throws NullPointerException if the argument is {@code null}
* @throws IllegalArgumentException if {@code arrayClass} is not an array type
* @see java.lang.reflect.Array#newInstance(Class, int)
+ * @jvms 6.5 {@code anewarray} Instruction
* @since 9
*/
public static
@@ -2535,13 +2541,19 @@ return mh1;
}
/**
- * Produces a method handle returning the length of an array.
+ * Produces a method handle returning the length of an array,
+ * as if by the {@code arraylength} bytecode.
* The type of the method handle will have {@code int} as return type,
* and its sole argument will be the array type.
+ *
+ *
If the returned method handle is invoked with a {@code null}
+ * array reference, a {@code NullPointerException} will be thrown.
+ *
* @param arrayClass an array type
* @return a method handle which can retrieve the length of an array of the given array type
* @throws NullPointerException if the argument is {@code null}
* @throws IllegalArgumentException if arrayClass is not an array type
+ * @jvms 6.5 {@code arraylength} Instruction
* @since 9
*/
public static
@@ -2550,14 +2562,24 @@ return mh1;
}
/**
- * Produces a method handle giving read access to elements of an array.
+ * Produces a method handle giving read access to elements of an array,
+ * as if by the {@code aaload} bytecode.
* The type of the method handle will have a return type of the array's
* element type. Its first argument will be the array type,
* and the second will be {@code int}.
+ *
+ *
When the returned method handle is invoked,
+ * the array reference and array index are checked.
+ * A {@code NullPointerException} will be thrown if the array reference
+ * is {@code null} and an {@code ArrayIndexOutOfBoundsException} will be
+ * thrown if the index is negative or if it is greater than or equal to
+ * the length of the array.
+ *
* @param arrayClass an array type
* @return a method handle which can load values from the given array type
* @throws NullPointerException if the argument is null
* @throws IllegalArgumentException if arrayClass is not an array type
+ * @jvms 6.5 {@code aaload} Instruction
*/
public static
MethodHandle arrayElementGetter(Class> arrayClass) throws IllegalArgumentException {
@@ -2565,14 +2587,24 @@ return mh1;
}
/**
- * Produces a method handle giving write access to elements of an array.
+ * Produces a method handle giving write access to elements of an array,
+ * as if by the {@code astore} bytecode.
* The type of the method handle will have a void return type.
* Its last argument will be the array's element type.
* The first and second arguments will be the array type and int.
+ *
+ *
When the returned method handle is invoked,
+ * the array reference and array index are checked.
+ * A {@code NullPointerException} will be thrown if the array reference
+ * is {@code null} and an {@code ArrayIndexOutOfBoundsException} will be
+ * thrown if the index is negative or if it is greater than or equal to
+ * the length of the array.
+ *
* @param arrayClass the class of an array
* @return a method handle which can store values into the array type
* @throws NullPointerException if the argument is null
* @throws IllegalArgumentException if arrayClass is not an array type
+ * @jvms 6.5 {@code aastore} Instruction
*/
public static
MethodHandle arrayElementSetter(Class> arrayClass) throws IllegalArgumentException {
@@ -2603,6 +2635,14 @@ return mh1;
* and atomic update access modes compare values using their bitwise
* representation (see {@link Float#floatToRawIntBits} and
* {@link Double#doubleToRawLongBits}, respectively).
+ *
+ *
When the returned {@code VarHandle} is invoked,
+ * the array reference and array index are checked.
+ * A {@code NullPointerException} will be thrown if the array reference
+ * is {@code null} and an {@code ArrayIndexOutOfBoundsException} will be
+ * thrown if the index is negative or if it is greater than or equal to
+ * the length of the array.
+ *
* @apiNote
* Bitwise comparison of {@code float} values or {@code double} values,
* as performed by the numeric and atomic update access modes, differ
diff --git a/src/java.base/share/classes/java/lang/invoke/VarForm.java b/src/java.base/share/classes/java/lang/invoke/VarForm.java
index ca6a6d98937..07414fe32c8 100644
--- a/src/java.base/share/classes/java/lang/invoke/VarForm.java
+++ b/src/java.base/share/classes/java/lang/invoke/VarForm.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2015, 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
@@ -71,7 +71,7 @@ final class VarForm {
// (Receiver, , Value, Value)boolean
l.add(value);
- methodType_table[VarHandle.AccessType.COMPARE_AND_SWAP.ordinal()] =
+ methodType_table[VarHandle.AccessType.COMPARE_AND_SET.ordinal()] =
MethodType.methodType(boolean.class, l).erase();
// (Receiver, , Value, Value)Value
diff --git a/src/java.base/share/classes/java/lang/invoke/VarHandle.java b/src/java.base/share/classes/java/lang/invoke/VarHandle.java
index 5194d6ee981..1b4e1a975ff 100644
--- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java
@@ -30,7 +30,6 @@ import jdk.internal.util.Preconditions;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.Stable;
-import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -46,7 +45,7 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError;
* non-static fields, array elements, or components of an off-heap data
* structure. Access to such variables is supported under various
* access modes, including plain read/write access, volatile
- * read/write access, and compare-and-swap.
+ * read/write access, and compare-and-set.
*
* VarHandles are immutable and have no visible state. VarHandles cannot be
* subclassed by the user.
@@ -1529,7 +1528,7 @@ public abstract class VarHandle {
enum AccessType {
GET(Object.class),
SET(void.class),
- COMPARE_AND_SWAP(boolean.class),
+ COMPARE_AND_SET(boolean.class),
COMPARE_AND_EXCHANGE(Object.class),
GET_AND_UPDATE(Object.class);
@@ -1555,7 +1554,7 @@ public abstract class VarHandle {
i = fillParameters(ps, receiver, intermediate);
ps[i] = value;
return MethodType.methodType(void.class, ps);
- case COMPARE_AND_SWAP:
+ case COMPARE_AND_SET:
ps = allocateParameters(2, receiver, intermediate);
i = fillParameters(ps, receiver, intermediate);
ps[i++] = value;
@@ -1652,7 +1651,7 @@ public abstract class VarHandle {
* method
* {@link VarHandle#compareAndSet VarHandle.compareAndSet}
*/
- COMPARE_AND_SET("compareAndSet", AccessType.COMPARE_AND_SWAP),
+ COMPARE_AND_SET("compareAndSet", AccessType.COMPARE_AND_SET),
/**
* The access mode whose access is specified by the corresponding
* method
@@ -1676,25 +1675,25 @@ public abstract class VarHandle {
* method
* {@link VarHandle#weakCompareAndSetPlain VarHandle.weakCompareAndSetPlain}
*/
- WEAK_COMPARE_AND_SET_PLAIN("weakCompareAndSetPlain", AccessType.COMPARE_AND_SWAP),
+ WEAK_COMPARE_AND_SET_PLAIN("weakCompareAndSetPlain", AccessType.COMPARE_AND_SET),
/**
* The access mode whose access is specified by the corresponding
* method
* {@link VarHandle#weakCompareAndSet VarHandle.weakCompareAndSet}
*/
- WEAK_COMPARE_AND_SET("weakCompareAndSet", AccessType.COMPARE_AND_SWAP),
+ WEAK_COMPARE_AND_SET("weakCompareAndSet", AccessType.COMPARE_AND_SET),
/**
* The access mode whose access is specified by the corresponding
* method
* {@link VarHandle#weakCompareAndSetAcquire VarHandle.weakCompareAndSetAcquire}
*/
- WEAK_COMPARE_AND_SET_ACQUIRE("weakCompareAndSetAcquire", AccessType.COMPARE_AND_SWAP),
+ WEAK_COMPARE_AND_SET_ACQUIRE("weakCompareAndSetAcquire", AccessType.COMPARE_AND_SET),
/**
* The access mode whose access is specified by the corresponding
* method
* {@link VarHandle#weakCompareAndSetRelease VarHandle.weakCompareAndSetRelease}
*/
- WEAK_COMPARE_AND_SET_RELEASE("weakCompareAndSetRelease", AccessType.COMPARE_AND_SWAP),
+ WEAK_COMPARE_AND_SET_RELEASE("weakCompareAndSetRelease", AccessType.COMPARE_AND_SET),
/**
* The access mode whose access is specified by the corresponding
* method
diff --git a/src/java.base/share/classes/java/lang/invoke/VarHandles.java b/src/java.base/share/classes/java/lang/invoke/VarHandles.java
index f2f540b48bd..055550863e3 100644
--- a/src/java.base/share/classes/java/lang/invoke/VarHandles.java
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandles.java
@@ -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
@@ -313,7 +313,7 @@ final class VarHandles {
//
// void set(Object value);
//
-// boolean compareAndSwap(Object actualValue, Object expectedValue);
+// boolean compareAndSet(Object actualValue, Object expectedValue);
//
// Object compareAndExchange(Object actualValue, Object expectedValue);
//
diff --git a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
index e09a59c02bd..e8cdbccfb94 100644
--- a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
+++ b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
@@ -1593,7 +1593,7 @@ public class ModuleDescriptor
/**
* Adds a dependence on a module with the given (and possibly empty)
* set of modifiers. The dependence includes the version of the
- * module that that was recorded at compile-time.
+ * module that was recorded at compile-time.
*
* @param ms
* The set of modifiers
diff --git a/src/java.base/share/classes/java/lang/module/Resolver.java b/src/java.base/share/classes/java/lang/module/Resolver.java
index 04faaa9340d..e622ab20d84 100644
--- a/src/java.base/share/classes/java/lang/module/Resolver.java
+++ b/src/java.base/share/classes/java/lang/module/Resolver.java
@@ -217,7 +217,7 @@ final class Resolver {
Resolver bind() {
// Scan the finders for all available service provider modules. As
- // java.base uses services then then module finders will be scanned
+ // java.base uses services then the module finders will be scanned
// anyway.
Map> availableProviders = new HashMap<>();
for (ModuleReference mref : findAll()) {
diff --git a/src/java.base/share/classes/java/math/BigInteger.java b/src/java.base/share/classes/java/math/BigInteger.java
index 36bf6f1b2b6..992b8dbb944 100644
--- a/src/java.base/share/classes/java/math/BigInteger.java
+++ b/src/java.base/share/classes/java/math/BigInteger.java
@@ -2741,7 +2741,7 @@ public class BigInteger extends Number implements Comparable {
return z;
}
- // These methods are intended to be be replaced by virtual machine
+ // These methods are intended to be replaced by virtual machine
// intrinsics.
@HotSpotIntrinsicCandidate
private static int[] implMontgomeryMultiply(int[] a, int[] b, int[] n, int len,
diff --git a/src/java.base/share/classes/java/util/List.java b/src/java.base/share/classes/java/util/List.java
index 8dec9acd6c5..8ba368bf6f6 100644
--- a/src/java.base/share/classes/java/util/List.java
+++ b/src/java.base/share/classes/java/util/List.java
@@ -442,7 +442,8 @@ public interface List extends Collection {
/**
* Sorts this list according to the order induced by the specified
- * {@link Comparator}.
+ * {@link Comparator}. The sort is stable: this method must not
+ * reorder equal elements.
*
* All elements in this list must be mutually comparable using the
* specified comparator (that is, {@code c.compare(e1, e2)} must not throw
diff --git a/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java b/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java
index fdce4bfc422..e3ed63ebef6 100644
--- a/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java
+++ b/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java
@@ -687,7 +687,7 @@ public class URLClassPath {
}
/*
- * Nested class class used to represent a Loader of resources from a JAR URL.
+ * Nested class used to represent a Loader of resources from a JAR URL.
*/
static class JarLoader extends Loader {
private JarFile jar;
diff --git a/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java b/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
index ab92b03c856..90ec8f40761 100644
--- a/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
@@ -58,7 +58,7 @@ public interface JavaLangAccess {
ConstantPool getConstantPool(Class> klass);
/**
- * Compare-And-Swap the AnnotationType instance corresponding to this class.
+ * Compare-And-Set the AnnotationType instance corresponding to this class.
* (This method only applies to annotation types.)
*/
boolean casAnnotationType(Class> klass, AnnotationType oldType, AnnotationType newType);
@@ -254,7 +254,7 @@ public interface JavaLangAccess {
ServicesCatalog getServicesCatalog(ModuleLayer layer);
/**
- * Returns an ordered stream of layers. The first element is is the
+ * Returns an ordered stream of layers. The first element is the
* given layer, the remaining elements are its parents, in DFS order.
*/
Stream layers(ModuleLayer layer);
diff --git a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java
index 2b376598c8b..d09c158cfd4 100644
--- a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java
+++ b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java
@@ -572,7 +572,7 @@ public final class Unsafe {
checkPointer(o, offset);
if (o != null) {
- // If on heap, it it must be a primitive array
+ // If on heap, it must be a primitive array
checkPrimitiveArray(o.getClass());
}
}
diff --git a/src/java.base/share/classes/jdk/internal/module/ModulePath.java b/src/java.base/share/classes/jdk/internal/module/ModulePath.java
index 330117a8f37..19e53790c2f 100644
--- a/src/java.base/share/classes/jdk/internal/module/ModulePath.java
+++ b/src/java.base/share/classes/jdk/internal/module/ModulePath.java
@@ -112,7 +112,7 @@ public class ModulePath implements ModuleFinder {
}
/**
- * Returns a ModuleFinder that that locates modules on the file system by
+ * Returns a ModuleFinder that locates modules on the file system by
* searching a sequence of directories and/or packaged modules. The modules
* may be patched by the given ModulePatcher.
*/
@@ -121,7 +121,7 @@ public class ModulePath implements ModuleFinder {
}
/**
- * Returns a ModuleFinder that that locates modules on the file system by
+ * Returns a ModuleFinder that locates modules on the file system by
* searching a sequence of directories and/or packaged modules.
*/
public static ModuleFinder of(Path... entries) {
@@ -129,7 +129,7 @@ public class ModulePath implements ModuleFinder {
}
/**
- * Returns a ModuleFinder that that locates modules on the file system by
+ * Returns a ModuleFinder that locates modules on the file system by
* searching a sequence of directories and/or packaged modules.
*
* @param version The release version to use for multi-release JAR files
diff --git a/src/java.base/share/classes/jdk/internal/module/Modules.java b/src/java.base/share/classes/jdk/internal/module/Modules.java
index dffe5e8c0ff..d90ac7a2c31 100644
--- a/src/java.base/share/classes/jdk/internal/module/Modules.java
+++ b/src/java.base/share/classes/jdk/internal/module/Modules.java
@@ -65,7 +65,7 @@ public class Modules {
* Creates a new Module. The module has the given ModuleDescriptor and
* is defined to the given class loader.
*
- * The resulting Module is in a larval state in that it does not not read
+ * The resulting Module is in a larval state in that it does not read
* any other module and does not have any exports.
*
* The URI is for information purposes only.
diff --git a/src/java.base/share/classes/jdk/internal/module/SystemModulesMap.java b/src/java.base/share/classes/jdk/internal/module/SystemModulesMap.java
index 1c7ff8886d5..3753737ce9a 100644
--- a/src/java.base/share/classes/jdk/internal/module/SystemModulesMap.java
+++ b/src/java.base/share/classes/jdk/internal/module/SystemModulesMap.java
@@ -59,7 +59,7 @@ class SystemModulesMap {
}
/**
- * Returns the array of of SystemModules class names. The elements
+ * Returns the array of SystemModules class names. The elements
* correspond to the elements in the array returned by moduleNames().
*/
static String[] classNames() {
diff --git a/src/java.base/share/classes/sun/net/idn/StringPrep.java b/src/java.base/share/classes/sun/net/idn/StringPrep.java
index 433a386a3a4..80ccd04b241 100644
--- a/src/java.base/share/classes/sun/net/idn/StringPrep.java
+++ b/src/java.base/share/classes/sun/net/idn/StringPrep.java
@@ -212,7 +212,7 @@ public final class StringPrep {
//indexes[INDEX_MAPPING_DATA_SIZE] store the size of mappingData in bytes
mappingData = new char[indexes[INDEX_MAPPING_DATA_SIZE]/2];
- // load the rest of the data data and initialize the data members
+ // load the rest of the data and initialize the data members
reader.read(sprepBytes,mappingData);
sprepTrieImpl = new StringPrepTrieImpl();
diff --git a/src/java.base/share/classes/sun/net/www/MimeEntry.java b/src/java.base/share/classes/sun/net/www/MimeEntry.java
index f96953a42d4..44b7c49b3fa 100644
--- a/src/java.base/share/classes/sun/net/www/MimeEntry.java
+++ b/src/java.base/share/classes/sun/net/www/MimeEntry.java
@@ -252,7 +252,7 @@ public class MimeEntry implements Cloneable {
}
case UNKNOWN:
- // REMIND: What do do here?
+ // REMIND: What to do here?
return null;
}
diff --git a/src/java.base/share/classes/sun/security/provider/certpath/PolicyNodeImpl.java b/src/java.base/share/classes/sun/security/provider/certpath/PolicyNodeImpl.java
index a42a1e8e273..8c1d8d922a9 100644
--- a/src/java.base/share/classes/sun/security/provider/certpath/PolicyNodeImpl.java
+++ b/src/java.base/share/classes/sun/security/provider/certpath/PolicyNodeImpl.java
@@ -306,7 +306,7 @@ final class PolicyNodeImpl implements PolicyNode {
}
/**
- * Add all nodes at depth depth to set and return the Set.
+ * Add all nodes at depth to set and return the Set.
* Internal recursion helper.
*/
private void getPolicyNodes(int depth, Set set) {
diff --git a/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java b/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java
index afb08b1a68e..b4cc22e789d 100644
--- a/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java
+++ b/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java
@@ -195,7 +195,7 @@ implements CertAttrSet {
}
/**
- * Verify that that the current time is within the validity period.
+ * Verify that the current time is within the validity period.
*
* @exception CertificateExpiredException if the certificate has expired.
* @exception CertificateNotYetValidException if the certificate is not
@@ -208,7 +208,7 @@ implements CertAttrSet {
}
/**
- * Verify that that the passed time is within the validity period.
+ * Verify that the passed time is within the validity period.
*
* @exception CertificateExpiredException if the certificate has expired
* with respect to the Date supplied.
diff --git a/src/java.base/solaris/native/libjvm_dtrace/jvm_dtrace.c b/src/java.base/solaris/native/libjvm_dtrace/jvm_dtrace.c
index 58fc9197c7e..f466a063a63 100644
--- a/src/java.base/solaris/native/libjvm_dtrace/jvm_dtrace.c
+++ b/src/java.base/solaris/native/libjvm_dtrace/jvm_dtrace.c
@@ -422,7 +422,7 @@ int enqueue_command(jvm_t* jvm, const char* cstr, int arg_count, const char** ar
print_debug("door_call failed\n");
} else {
/*
- * door_call succeeded but the call didn't return the the expected jint.
+ * door_call succeeded but the call didn't return the expected jint.
*/
if (door_args.data_size < sizeof(int)) {
print_debug("Enqueue error - reason unknown as result is truncated!");
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
index 7e8f070b442..c4b652dfb2f 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
@@ -84,6 +84,7 @@ public abstract class AbstractAnnotationValueVisitor6
* {@code v.visit(av, p)} is equivalent to {@code av.accept(v, p)}.
* @param av {@inheritDoc}
* @param p {@inheritDoc}
+ * @return {@inheritDoc}
*/
public final R visit(AnnotationValue av, P p) {
return av.accept(this, p);
@@ -96,6 +97,7 @@ public abstract class AbstractAnnotationValueVisitor6
* {@code v.visit(av)} is equivalent to {@code av.accept(v,
* null)}.
* @param av {@inheritDoc}
+ * @return {@inheritDoc}
*/
public final R visit(AnnotationValue av) {
return av.accept(this, null);
@@ -111,6 +113,7 @@ public abstract class AbstractAnnotationValueVisitor6
*
* @param av {@inheritDoc}
* @param p {@inheritDoc}
+ * @return {@inheritDoc}
*/
@Override
public R visitUnknown(AnnotationValue av, P p) {
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
index 6e644d2a631..8c416e43adc 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
@@ -116,7 +116,7 @@ public abstract class AbstractElementVisitor6 implements ElementVisitor implements ElementVisitor extends AbstractElementVisit
}
/**
- * Visits a {@code ModuleElement} in a manner defined by a
+ * {@inheritDoc}
+ *
+ * @implSpec Visits a {@code ModuleElement} in a manner defined by a
* subclass.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
- * @return the result of the visit as defined by a subclass
+ * @return {@inheritDoc}
*/
@Override
public abstract R visitModule(ModuleElement t, P p);
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java
index 2aa646b428e..3343fd48ee7 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java
@@ -114,6 +114,8 @@ public class ElementKindVisitor6
*
* The element argument has kind {@code PACKAGE}.
*
+ * @implSpec This implementation calls {@code defaultAction}.
+ *
* @param e {@inheritDoc}
* @param p {@inheritDoc}
* @return {@inheritDoc}
@@ -125,7 +127,9 @@ public class ElementKindVisitor6
}
/**
- * Visits a type element, dispatching to the visit method for the
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation dispatches to the visit method for the
* specific {@linkplain ElementKind kind} of type, {@code
* ANNOTATION_TYPE}, {@code CLASS}, {@code ENUM}, or {@code
* INTERFACE}.
@@ -156,8 +160,9 @@ public class ElementKindVisitor6
}
/**
- * Visits an {@code ANNOTATION_TYPE} type element by calling
- * {@code defaultAction}.
+ * Visits an {@code ANNOTATION_TYPE} type element.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -168,8 +173,9 @@ public class ElementKindVisitor6
}
/**
- * Visits a {@code CLASS} type element by calling {@code
- * defaultAction}.
+ * Visits a {@code CLASS} type element.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -180,8 +186,9 @@ public class ElementKindVisitor6
}
/**
- * Visits an {@code ENUM} type element by calling {@code
- * defaultAction}.
+ * Visits an {@code ENUM} type element.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -192,8 +199,9 @@ public class ElementKindVisitor6
}
/**
- * Visits an {@code INTERFACE} type element by calling {@code
- * defaultAction}.
+ * Visits an {@code INTERFACE} type element.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*.
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -204,7 +212,9 @@ public class ElementKindVisitor6
}
/**
- * Visits a variable element, dispatching to the visit method for
+ * Visits a variable element
+ *
+ * @implSpec This implementation dispatches to the visit method for
* the specific {@linkplain ElementKind kind} of variable, {@code
* ENUM_CONSTANT}, {@code EXCEPTION_PARAMETER}, {@code FIELD},
* {@code LOCAL_VARIABLE}, {@code PARAMETER}, or {@code RESOURCE_VARIABLE}.
@@ -241,9 +251,10 @@ public class ElementKindVisitor6
}
/**
- * Visits an {@code ENUM_CONSTANT} variable element by calling
- * {@code defaultAction}.
+ * Visits an {@code ENUM_CONSTANT} variable element.
*
+ * @implSpec This implementation calls {@code defaultAction}.
+ *.
* @param e the element to visit
* @param p a visitor-specified parameter
* @return the result of {@code defaultAction}
@@ -253,9 +264,10 @@ public class ElementKindVisitor6
}
/**
- * Visits an {@code EXCEPTION_PARAMETER} variable element by calling
- * {@code defaultAction}.
+ * Visits an {@code EXCEPTION_PARAMETER} variable element.
*
+ * @implSpec This implementation calls {@code defaultAction}.
+ *.
* @param e the element to visit
* @param p a visitor-specified parameter
* @return the result of {@code defaultAction}
@@ -265,9 +277,10 @@ public class ElementKindVisitor6
}
/**
- * Visits a {@code FIELD} variable element by calling
- * {@code defaultAction}.
+ * Visits a {@code FIELD} variable element.
*
+ * @implSpec This implementation calls {@code defaultAction}.
+ *.
* @param e the element to visit
* @param p a visitor-specified parameter
* @return the result of {@code defaultAction}
@@ -277,8 +290,9 @@ public class ElementKindVisitor6
}
/**
- * Visits a {@code LOCAL_VARIABLE} variable element by calling
- * {@code defaultAction}.
+ * Visits a {@code LOCAL_VARIABLE} variable element.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -289,8 +303,9 @@ public class ElementKindVisitor6
}
/**
- * Visits a {@code PARAMETER} variable element by calling
- * {@code defaultAction}.
+ * Visits a {@code PARAMETER} variable element.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -301,8 +316,9 @@ public class ElementKindVisitor6
}
/**
- * Visits a {@code RESOURCE_VARIABLE} variable element by calling
- * {@code visitUnknown}.
+ * Visits a {@code RESOURCE_VARIABLE} variable element.
+ *
+ * @implSpec This implementation calls {@code visitUnknown}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -315,7 +331,9 @@ public class ElementKindVisitor6
}
/**
- * Visits an executable element, dispatching to the visit method
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation dispatches to the visit method
* for the specific {@linkplain ElementKind kind} of executable,
* {@code CONSTRUCTOR}, {@code INSTANCE_INIT}, {@code METHOD}, or
* {@code STATIC_INIT}.
@@ -346,8 +364,9 @@ public class ElementKindVisitor6
}
/**
- * Visits a {@code CONSTRUCTOR} executable element by calling
- * {@code defaultAction}.
+ * Visits a {@code CONSTRUCTOR} executable element.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -358,8 +377,9 @@ public class ElementKindVisitor6
}
/**
- * Visits an {@code INSTANCE_INIT} executable element by calling
- * {@code defaultAction}.
+ * Visits an {@code INSTANCE_INIT} executable element.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -370,8 +390,9 @@ public class ElementKindVisitor6
}
/**
- * Visits a {@code METHOD} executable element by calling
- * {@code defaultAction}.
+ * Visits a {@code METHOD} executable element.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -382,8 +403,9 @@ public class ElementKindVisitor6
}
/**
- * Visits a {@code STATIC_INIT} executable element by calling
- * {@code defaultAction}.
+ * Visits a {@code STATIC_INIT} executable element.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
@@ -393,12 +415,13 @@ public class ElementKindVisitor6
return defaultAction(e, p);
}
-
/**
* {@inheritDoc}
*
* The element argument has kind {@code TYPE_PARAMETER}.
*
+ * @implSpec This implementation calls {@code defaultAction}.
+ *
* @param e {@inheritDoc}
* @param p {@inheritDoc}
* @return {@inheritDoc}
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java
index ce3590f2e26..52531a62d55 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java
@@ -99,8 +99,9 @@ public class ElementKindVisitor7 extends ElementKindVisitor6 {
}
/**
- * Visits a {@code RESOURCE_VARIABLE} variable element by calling
- * {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java
index d40971ed6e1..9237cc11361 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java
@@ -98,8 +98,9 @@ public class ElementKindVisitor9 extends ElementKindVisitor8 {
}
/**
- * Visits a {@code ModuleElement} by calling {@code
- * defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner6.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner6.java
index f4ef050c20d..d67c36718e4 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner6.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner6.java
@@ -164,7 +164,9 @@ public class ElementScanner6 extends AbstractElementVisitor6 {
}
/**
- * {@inheritDoc} This implementation scans the enclosed elements.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation scans the enclosed elements.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
@@ -175,7 +177,9 @@ public class ElementScanner6 extends AbstractElementVisitor6 {
}
/**
- * {@inheritDoc} This implementation scans the enclosed elements.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation scans the enclosed elements.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
@@ -188,7 +192,7 @@ public class ElementScanner6 extends AbstractElementVisitor6 {
/**
* {@inheritDoc}
*
- * This implementation scans the enclosed elements, unless the
+ * @implSpec This implementation scans the enclosed elements, unless the
* element is a {@code RESOURCE_VARIABLE} in which case {@code
* visitUnknown} is called.
*
@@ -204,7 +208,9 @@ public class ElementScanner6 extends AbstractElementVisitor6 {
}
/**
- * {@inheritDoc} This implementation scans the parameters.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation scans the parameters.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
@@ -215,7 +221,9 @@ public class ElementScanner6 extends AbstractElementVisitor6 {
}
/**
- * {@inheritDoc} This implementation scans the enclosed elements.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation scans the enclosed elements.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner7.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner7.java
index 287f97f091c..5f526c56b0f 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner7.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner7.java
@@ -112,7 +112,9 @@ public class ElementScanner7 extends ElementScanner6 {
}
/**
- * This implementation scans the enclosed elements.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation scans the enclosed elements.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java
index 8cab8fde6a9..dba0a96e383 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java
@@ -111,8 +111,9 @@ public class ElementScanner9 extends ElementScanner8 {
}
/**
- * Visits a {@code ModuleElement} by scanning the enclosed
- * elements.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation scans the enclosed elements.
*
* @param e the element to visit
* @param p a visitor-specified parameter
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java
index e6ec0d15b81..26a41e02599 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java
@@ -113,9 +113,10 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * The default action for visit methods. The implementation in
- * this class just returns {@link #DEFAULT_VALUE}; subclasses will
- * commonly override this method.
+ * The default action for visit methods.
+ *
+ * @implSpec The implementation in this class just returns {@link
+ * #DEFAULT_VALUE}; subclasses will commonly override this method.
*
* @param o the value of the annotation
* @param p a visitor-specified parameter
@@ -126,7 +127,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param b {@inheritDoc}
* @param p {@inheritDoc}
@@ -137,7 +140,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param b {@inheritDoc}
* @param p {@inheritDoc}
@@ -148,7 +153,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param c {@inheritDoc}
* @param p {@inheritDoc}
@@ -159,7 +166,10 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
+ *
*
* @param d {@inheritDoc}
* @param p {@inheritDoc}
@@ -170,7 +180,10 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
+ *
*
* @param f {@inheritDoc}
* @param p {@inheritDoc}
@@ -181,7 +194,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param i {@inheritDoc}
* @param p {@inheritDoc}
@@ -192,7 +207,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param i {@inheritDoc}
* @param p {@inheritDoc}
@@ -203,7 +220,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param s {@inheritDoc}
* @param p {@inheritDoc}
@@ -214,7 +233,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param s {@inheritDoc}
* @param p {@inheritDoc}
@@ -225,7 +246,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
@@ -236,7 +259,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param c {@inheritDoc}
* @param p {@inheritDoc}
@@ -247,7 +272,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param a {@inheritDoc}
* @param p {@inheritDoc}
@@ -258,7 +285,9 @@ public class SimpleAnnotationValueVisitor6
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param vals {@inheritDoc}
* @param p {@inheritDoc}
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor6.java
index e7e97d0dd8b..e3a6cd94c1b 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor6.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor6.java
@@ -112,9 +112,10 @@ public class SimpleElementVisitor6 extends AbstractElementVisitor6 {
DEFAULT_VALUE = defaultValue;
}
/**
- * The default action for visit methods. The implementation in
- * this class just returns {@link #DEFAULT_VALUE}; subclasses will
- * commonly override this method.
+ * The default action for visit methods.
+ *
+ * @implSpec The implementation in this class just returns {@link
+ * #DEFAULT_VALUE}; subclasses will commonly override this method.
*
* @param e the element to process
* @param p a visitor-specified parameter
@@ -125,22 +126,26 @@ public class SimpleElementVisitor6 extends AbstractElementVisitor6 {
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
- * @return the result of {@code defaultAction}
+ * @return {@inheritDoc}
*/
public R visitPackage(PackageElement e, P p) {
return defaultAction(e, p);
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
- * @return the result of {@code defaultAction}
+ * @return {@inheritDoc}
*/
public R visitType(TypeElement e, P p) {
return defaultAction(e, p);
@@ -149,13 +154,13 @@ public class SimpleElementVisitor6 extends AbstractElementVisitor6 {
/**
* {@inheritDoc}
*
- * This implementation calls {@code defaultAction}, unless the
+ * @implSpec This implementation calls {@code defaultAction}, unless the
* element is a {@code RESOURCE_VARIABLE} in which case {@code
* visitUnknown} is called.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
- * @return the result of {@code defaultAction} or {@code visitUnknown}
+ * @return {@inheritDoc}
*/
public R visitVariable(VariableElement e, P p) {
if (e.getKind() != ElementKind.RESOURCE_VARIABLE)
@@ -165,22 +170,26 @@ public class SimpleElementVisitor6 extends AbstractElementVisitor6 {
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
- * @return the result of {@code defaultAction}
+ * @return {@inheritDoc}
*/
public R visitExecutable(ExecutableElement e, P p) {
return defaultAction(e, p);
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
- * @return the result of {@code defaultAction}
+ * @return {@inheritDoc}
*/
public R visitTypeParameter(TypeParameterElement e, P p) {
return defaultAction(e, p);
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor7.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor7.java
index 009f7851c46..22fd546effa 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor7.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor7.java
@@ -95,11 +95,13 @@ public class SimpleElementVisitor7 extends SimpleElementVisitor6 {
}
/**
- * This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param e {@inheritDoc}
* @param p {@inheritDoc}
- * @return the result of {@code defaultAction}
+ * @return {@inheritDoc}
*/
@Override
public R visitVariable(VariableElement e, P p) {
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java
index dad6c4e21bf..5c62d078a4c 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -94,12 +94,14 @@ public class SimpleElementVisitor9 extends SimpleElementVisitor8 {
}
/**
- * Visits a {@code ModuleElement} by calling {@code
+ * {@inheritDoc}
+ *
+ * @implSpec Visits a {@code ModuleElement} by calling {@code
* defaultAction}.
*
* @param e the element to visit
* @param p a visitor-specified parameter
- * @return the result of {@code defaultAction}
+ * @return {@inheritDoc}
*/
@Override
public R visitModule(ModuleElement e, P p) {
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java
index 44d55c7bede..26e851a1eb4 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java
@@ -113,9 +113,10 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 {
}
/**
- * The default action for visit methods. The implementation in
- * this class just returns {@link #DEFAULT_VALUE}; subclasses will
- * commonly override this method.
+ * The default action for visit methods.
+ *
+ * @implSpec The implementation in this class just returns {@link
+ * #DEFAULT_VALUE}; subclasses will commonly override this method.
*
* @param e the type to process
* @param p a visitor-specified parameter
@@ -126,7 +127,9 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 {
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
@@ -139,6 +142,8 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 {
/**
* {@inheritDoc} This implementation calls {@code defaultAction}.
*
+ * @implSpec This implementation calls {@code defaultAction}.
+ *
* @param t {@inheritDoc}
* @param p {@inheritDoc}
* @return the result of {@code defaultAction}
@@ -148,7 +153,9 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 {
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
@@ -159,7 +166,9 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 {
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
@@ -170,7 +179,9 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 {
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
@@ -181,7 +192,9 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 {
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
@@ -192,7 +205,9 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 {
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
@@ -203,7 +218,9 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 {
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
@@ -214,7 +231,9 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 {
}
/**
- * {@inheritDoc} This implementation calls {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java
index b857194261f..c22ae837921 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java
@@ -95,8 +95,9 @@ public class SimpleTypeVisitor7 extends SimpleTypeVisitor6 {
}
/**
- * This implementation visits a {@code UnionType} by calling
- * {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java
index 098f5f0f353..06ff70cb791 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java
@@ -93,8 +93,9 @@ public class SimpleTypeVisitor8 extends SimpleTypeVisitor7 {
}
/**
- * This implementation visits an {@code IntersectionType} by calling
- * {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor6.java
index 347779b4e10..e9ebc1dbd88 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor6.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor6.java
@@ -105,7 +105,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a primitive type, dispatching to the visit method for
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation dispatches to the visit method for
* the specific {@linkplain TypeKind kind} of primitive type:
* {@code BOOLEAN}, {@code BYTE}, etc.
*
@@ -147,8 +149,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@code BOOLEAN} primitive type by calling
- * {@code defaultAction}.
+ * Visits a {@code BOOLEAN} primitive type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
@@ -159,8 +162,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@code BYTE} primitive type by calling
- * {@code defaultAction}.
+ * Visits a {@code BYTE} primitive type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
@@ -171,8 +175,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@code SHORT} primitive type by calling
- * {@code defaultAction}.
+ * Visits a {@code SHORT} primitive type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
@@ -183,8 +188,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits an {@code INT} primitive type by calling
- * {@code defaultAction}.
+ * Visits an {@code INT} primitive type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
@@ -195,8 +201,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@code LONG} primitive type by calling
- * {@code defaultAction}.
+ * Visits a {@code LONG} primitive type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
@@ -207,8 +214,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@code CHAR} primitive type by calling
- * {@code defaultAction}.
+ * Visits a {@code CHAR} primitive type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
@@ -219,8 +227,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@code FLOAT} primitive type by calling
- * {@code defaultAction}.
+ * Visits a {@code FLOAT} primitive type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
@@ -231,8 +240,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@code DOUBLE} primitive type by calling
- * {@code defaultAction}.
+ * Visits a {@code DOUBLE} primitive type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
@@ -243,7 +253,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@link NoType} instance, dispatching to the visit method for
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation dispatches to the visit method for
* the specific {@linkplain TypeKind kind} of pseudo-type:
* {@code VOID}, {@code PACKAGE}, or {@code NONE}.
*
@@ -270,8 +282,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@link TypeKind#VOID VOID} pseudo-type by calling
- * {@code defaultAction}.
+ * Visits a {@link TypeKind#VOID VOID} pseudo-type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
@@ -282,8 +295,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@link TypeKind#PACKAGE PACKAGE} pseudo-type by calling
- * {@code defaultAction}.
+ * Visits a {@link TypeKind#PACKAGE PACKAGE} pseudo-type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
@@ -294,8 +308,9 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 {
}
/**
- * Visits a {@link TypeKind#NONE NONE} pseudo-type by calling
- * {@code defaultAction}.
+ * Visits a {@link TypeKind#NONE NONE} pseudo-type.
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t the type to visit
* @param p a visitor-specified parameter
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor7.java b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor7.java
index 792ba9b37ba..257d87c3d20 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor7.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor7.java
@@ -96,8 +96,9 @@ public class TypeKindVisitor7 extends TypeKindVisitor6 {
}
/**
- * This implementation visits a {@code UnionType} by calling
- * {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor8.java b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor8.java
index 63aea9a30eb..624a57785eb 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor8.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor8.java
@@ -94,8 +94,9 @@ public class TypeKindVisitor8 extends TypeKindVisitor7 {
}
/**
- * This implementation visits an {@code IntersectionType} by calling
- * {@code defaultAction}.
+ * {@inheritDoc}
+ *
+ * @implSpec This implementation calls {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
diff --git a/src/java.desktop/share/classes/java/awt/im/InputContext.java b/src/java.desktop/share/classes/java/awt/im/InputContext.java
index 8da65b2b0f9..27ddd28655b 100644
--- a/src/java.desktop/share/classes/java/awt/im/InputContext.java
+++ b/src/java.desktop/share/classes/java/awt/im/InputContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -55,8 +55,8 @@ import sun.awt.im.InputMethodContext;
*
* The Java Platform supports input methods that have been developed in the Java
* programming language, using the interfaces in the {@link java.awt.im.spi} package,
- * and installed into a Java SE Runtime Environment as extensions. Implementations
- * may also support using the native input methods of the platforms they run on;
+ * which can be made available by adding them to the application's class path.
+ * Implementations may also support using the native input methods of the platforms they run on;
* however, not all platforms and locales provide input methods. Keyboard layouts
* are provided by the host platform.
*
diff --git a/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java b/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java
index 0cda57065f7..c3b9a9fdbe9 100644
--- a/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java
+++ b/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java
@@ -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
@@ -101,6 +101,26 @@ public class RMIConnectorServer extends JMXConnectorServer {
public static final String RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE =
"jmx.remote.rmi.server.socket.factory";
+ /**
+ * Name of the attribute that specifies a list of class names acceptable
+ * as parameters to the {@link RMIServer#newClient(java.lang.Object) RMIServer.newClient()}
+ * remote method call.
+ *
+ * This list of classes should correspond to the transitive closure of the
+ * credentials class (or classes) used by the installed {@linkplain JMXAuthenticator}
+ * associated with the {@linkplain RMIServer} implementation.
+ *
+ * If the attribute is not set, or is null, then any class is
+ * deemed acceptable.
+ *
+ * @deprecated Use {@link #CREDENTIALS_FILTER_PATTERN} with a
+ * {@linkplain java.io.ObjectInputFilter.Config#createFilter
+ * filter pattern} string instead.
+ */
+ @Deprecated(since="10", forRemoval=true)
+ public static final String CREDENTIAL_TYPES =
+ "jmx.remote.rmi.server.credential.types";
+
/**
* Name of the attribute that specifies an
* {@link ObjectInputFilter} pattern string to filter classes acceptable
diff --git a/src/java.management/share/classes/javax/management/MBeanOperationInfo.java b/src/java.management/share/classes/javax/management/MBeanOperationInfo.java
index caa66148263..5069737edef 100644
--- a/src/java.management/share/classes/javax/management/MBeanOperationInfo.java
+++ b/src/java.management/share/classes/javax/management/MBeanOperationInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -146,6 +146,9 @@ public class MBeanOperationInfo extends MBeanFeatureInfo implements Cloneable {
* @param descriptor The descriptor for the operation. This may be null
* which is equivalent to an empty descriptor.
*
+ * @throws IllegalArgumentException if {@code impact} is not one of
+ * {@linkplain #ACTION}, {@linkplain #ACTION_INFO}, {@linkplain #INFO} or {@linkplain #UNKNOWN}.
+ *
* @since 1.6
*/
public MBeanOperationInfo(String name,
@@ -157,6 +160,12 @@ public class MBeanOperationInfo extends MBeanFeatureInfo implements Cloneable {
super(name, description, descriptor);
+ if (impact < INFO || impact > UNKNOWN) {
+ throw new IllegalArgumentException("Argument impact can only be "
+ + "one of ACTION, ACTION_INFO, "
+ + "INFO, or UNKNOWN" + " given value is :" + impact);
+ }
+
if (signature == null || signature.length == 0)
signature = MBeanParameterInfo.NO_PARAMS;
else
@@ -259,8 +268,7 @@ public class MBeanOperationInfo extends MBeanFeatureInfo implements Cloneable {
case ACTION: impactString = "action"; break;
case ACTION_INFO: impactString = "action/info"; break;
case INFO: impactString = "info"; break;
- case UNKNOWN: impactString = "unknown"; break;
- default: impactString = "(" + getImpact() + ")";
+ default: impactString = "unknown";
}
return getClass().getName() + "[" +
"description=" + getDescription() + ", " +
diff --git a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java
index bd66a036a2b..8bee3e22818 100644
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -30,7 +30,7 @@ import javax.xml.bind.annotation.adapters.XmlAdapter;
/**
* {@link XmlAdapter} useful for mapping interfaces.
*
- * See The JAXB user's guide
+ * See The JAXB user's guide
* for more about this adapter class.
*
* @author Kohsuke Kawaguchi
diff --git a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java
index 554e95db842..21b774dcedb 100644
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -32,14 +32,13 @@ import javax.xml.bind.Marshaller;
* to handle cycles in the object graph.
*
*
- * As discussed in
+ * As discussed in
* the users' guide, normally a cycle in the object graph causes the marshaller to report an error,
* and when an error is found, the JAXB RI recovers by cutting the cycle arbitrarily.
* This is not always a desired behavior.
*
*
* Implementing this interface allows user application to change this behavior.
- * Also see this related discussion.
*
* @since JAXB 2.1 EA2
* @author Kohsuke Kawaguchi
diff --git a/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java b/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java
index 278756423e0..4c343050acd 100644
--- a/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java
@@ -182,6 +182,9 @@ class ContextFinder {
Map properties) throws JAXBException {
try {
+
+ ModuleUtil.delegateAddOpensToImplModule(contextPathClasses, spFactory);
+
/*
* javax.xml.bind.context.factory points to a class which has a
* static method called 'createContext' that
@@ -215,8 +218,6 @@ class ContextFinder {
throw handleClassCastException(context.getClass(), JAXBContext.class);
}
- ModuleUtil.delegateAddOpensToImplModule(contextPathClasses, spFactory);
-
return (JAXBContext) context;
} catch (InvocationTargetException x) {
// throw if it is exception not to be wrapped
@@ -274,6 +275,7 @@ class ContextFinder {
Map properties,
Class spFactory) throws JAXBException {
try {
+ ModuleUtil.delegateAddOpensToImplModule(classes, spFactory);
Method m = spFactory.getMethod("createContext", Class[].class, Map.class);
Object obj = instantiateProviderIfNecessary(spFactory);
@@ -282,7 +284,6 @@ class ContextFinder {
// the cast would fail, so generate an exception with a nice message
throw handleClassCastException(context.getClass(), JAXBContext.class);
}
- ModuleUtil.delegateAddOpensToImplModule(classes, spFactory);
return (JAXBContext) context;
} catch (NoSuchMethodException | IllegalAccessException e) {
@@ -328,9 +329,8 @@ class ContextFinder {
JAXBContextFactory.class, logger, EXCEPTION_HANDLER);
if (obj != null) {
- JAXBContext context = obj.createContext(contextPath, classLoader, properties);
ModuleUtil.delegateAddOpensToImplModule(contextPathClasses, obj.getClass());
- return context;
+ return obj.createContext(contextPath, classLoader, properties);
}
// to ensure backwards compatibility
@@ -385,9 +385,8 @@ class ContextFinder {
ServiceLoaderUtil.firstByServiceLoader(JAXBContextFactory.class, logger, EXCEPTION_HANDLER);
if (factory != null) {
- JAXBContext context = factory.createContext(classes, properties);
ModuleUtil.delegateAddOpensToImplModule(classes, factory.getClass());
- return context;
+ return factory.createContext(classes, properties);
}
// to ensure backwards compatibility
diff --git a/src/java.xml.bind/share/classes/javax/xml/bind/ModuleUtil.java b/src/java.xml.bind/share/classes/javax/xml/bind/ModuleUtil.java
index d78441ca835..86b8b614563 100644
--- a/src/java.xml.bind/share/classes/javax/xml/bind/ModuleUtil.java
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/ModuleUtil.java
@@ -130,9 +130,6 @@ class ModuleUtil {
*/
static void delegateAddOpensToImplModule(Class[] classes, Class> factorySPI) throws JAXBException {
final Module implModule = factorySPI.getModule();
- if (!implModule.isNamed()) {
- return;
- }
Module jaxbModule = JAXBContext.class.getModule();
diff --git a/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java b/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java
index a1668787f54..0d5e72eaf5e 100644
--- a/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java
@@ -251,7 +251,7 @@ import java.io.Reader;
*
* JAXBElement Property
* Value
- *
+ *
*
* name
* {@code xml element name}
diff --git a/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java b/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java
index b76b9411325..febb584c88b 100644
--- a/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 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
@@ -34,7 +34,7 @@
*
*
* Related Documentation
- *
+ *
* For overviews, tutorials, examples, guides, and tool documentation,
* please see:
*
diff --git a/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java b/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
index 8b9136bd059..631936886ee 100644
--- a/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
@@ -78,7 +78,7 @@ public abstract class AttachmentUnmarshaller {
*
* MIME Type
* Java Type
- *
+ *
*
* {@code DataHandler.getContentType()}
* {@code instanceof DataHandler.getContent()}
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java
index 9136b3eb128..b8b3df80db4 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2017, 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
@@ -26,7 +26,6 @@
package com.sun.xml.internal.messaging.saaj;
import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPException;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
index b7fab4715b8..5daaf29ce7d 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
@@ -890,7 +890,7 @@ public abstract class MessageImpl
needsSave();
}
- static private final Iterator nullIter = Collections.EMPTY_LIST.iterator();
+ static private final Iterator nullIter = Collections.EMPTY_LIST.iterator();
@Override
public Iterator getAttachments() {
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
index 84c6d69f9d5..512490d455c 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
@@ -43,6 +43,11 @@ public class SOAPDocumentFragment implements DocumentFragment {
this.documentFragment = soapDocument.getDomDocument().createDocumentFragment();
}
+ public SOAPDocumentFragment(SOAPDocumentImpl soapDocument, DocumentFragment documentFragment) {
+ this.soapDocument = soapDocument;
+ this.documentFragment = documentFragment;
+ }
+
public SOAPDocumentFragment() {}
@Override
@@ -192,7 +197,7 @@ public class SOAPDocumentFragment implements DocumentFragment {
}
@Override
public Document getOwnerDocument() {
- return documentFragment.getOwnerDocument();
+ return soapDocument;
}
@Override
public Object getFeature(String feature, String version) {
@@ -231,4 +236,8 @@ public class SOAPDocumentFragment implements DocumentFragment {
public Document getSoapDocument() {
return soapDocument;
}
+
+ public Node getDomNode() {
+ return documentFragment;
+ }
}
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
index d08f01c876c..9e4d6c936d1 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
@@ -220,8 +220,8 @@ public class SOAPDocumentImpl implements SOAPDocument, javax.xml.soap.Node, Docu
if (importedNode instanceof javax.xml.soap.Node) {
Node newSoapNode = createSoapNode(importedNode.getClass(), newNode);
newNode.setUserData(SAAJ_NODE, newSoapNode, null);
- if (deep && importedNode.hasChildNodes()) {
- NodeList childNodes = importedNode.getChildNodes();
+ if (deep && newSoapNode.hasChildNodes()) {
+ NodeList childNodes = newSoapNode.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
registerChildNodes(childNodes.item(i), deep);
}
@@ -233,8 +233,12 @@ public class SOAPDocumentImpl implements SOAPDocument, javax.xml.soap.Node, Docu
return findIfPresent(newNode);
}
- //If the parentNode is not registered to domToSoap, create soap wapper for parentNode and register it to domToSoap
- //If deep = true, also register all children of parentNode to domToSoap map.
+ /**
+ * If the parentNode is not registered to domToSoap, create soap wapper for parentNode and register it to domToSoap
+ * If deep = true, also register all children transitively of parentNode to domToSoap map.
+ * @param parentNode node to wrap
+ * @param deep wrap child nodes transitively
+ */
public void registerChildNodes(Node parentNode, boolean deep) {
if (parentNode.getUserData(SAAJ_NODE) == null) {
if (parentNode instanceof Element) {
@@ -251,6 +255,8 @@ public class SOAPDocumentImpl implements SOAPDocument, javax.xml.soap.Node, Docu
new SOAPTextImpl(this, (CharacterData) parentNode);
break;
}
+ } else if (parentNode instanceof DocumentFragment) {
+ new SOAPDocumentFragment(this, (DocumentFragment) parentNode);
}
}
if (deep) {
@@ -412,7 +418,11 @@ public class SOAPDocumentImpl implements SOAPDocument, javax.xml.soap.Node, Docu
@Override
public NamedNodeMap getAttributes() {
- return new NamedNodeMapImpl(document.getAttributes(), this);
+ NamedNodeMap attributes = document.getAttributes();
+ if (attributes == null) {
+ return null;
+ }
+ return new NamedNodeMapImpl(attributes, this);
}
@Override
@@ -624,6 +634,8 @@ public class SOAPDocumentImpl implements SOAPDocument, javax.xml.soap.Node, Docu
return ((SOAPCommentImpl)node).getDomElement();
} else if (node instanceof CDATAImpl) {
return ((CDATAImpl) node).getDomElement();
+ } else if (node instanceof SOAPDocumentFragment) {
+ return ((SOAPDocumentFragment)node).getDomNode();
}
return node;
}
@@ -636,6 +648,8 @@ public class SOAPDocumentImpl implements SOAPDocument, javax.xml.soap.Node, Docu
return new SOAPCommentImpl(this, (Comment) node);
} else if (CDATAImpl.class.isAssignableFrom(nodeType)) {
return new CDATAImpl(this, (CDATASection) node);
+ } else if (SOAPDocumentFragment.class.isAssignableFrom(nodeType)) {
+ return new SOAPDocumentFragment(this, (DocumentFragment) node);
}
try {
Constructor constructor = nodeType.getConstructor(SOAPDocumentImpl.class, Element.class);
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
index 1410930bf74..b78fc707e68 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
@@ -618,7 +618,7 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument {
@Override
public Document getOwnerDocument() {
- return document.getDomDocument().getOwnerDocument();
+ return document;
}
@Override
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
index 975d2cc4a1a..b491a5039f2 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
@@ -46,20 +46,19 @@ public class CDATAImpl extends TextImpl implements CDATASection {
@Override
protected CDATASection createN(SOAPDocumentImpl ownerDoc, String text) {
- CDATASection c = ownerDoc.getDomDocument().createCDATASection(text);
-// ownerDoc.register(this);
- return c;
+ return ownerDoc.getDomDocument().createCDATASection(text);
}
@Override
protected CDATASection createN(SOAPDocumentImpl ownerDoc, CharacterData data) {
- CDATASection c = (CDATASection) data;
- return c;
+ return (CDATASection) data;
}
@Override
public Text splitText(int offset) throws DOMException {
- return getDomElement().splitText(offset);
+ Text text = getDomElement().splitText(offset);
+ getSoapDocument().registerChildNodes(text, true);
+ return text;
}
@Override
@@ -74,7 +73,9 @@ public class CDATAImpl extends TextImpl implements CDATASection {
@Override
public Text replaceWholeText(String content) throws DOMException {
- return getDomElement().replaceWholeText(content);
+ Text text = getDomElement().replaceWholeText(content);
+ getSoapDocument().registerChildNodes(text, true);
+ return text;
}
@Override
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
index efbc0dffe1c..7fac6bfc391 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
@@ -1720,7 +1720,11 @@ public class ElementImpl implements SOAPElement, SOAPBodyElement {
@Override
public NamedNodeMap getAttributes() {
- return new NamedNodeMapImpl(element.getAttributes(), soapDocument);
+ NamedNodeMap attributes = element.getAttributes();
+ if (attributes == null) {
+ return null;
+ }
+ return new NamedNodeMapImpl(attributes, soapDocument);
}
public Element getDomElement() {
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NamedNodeMapImpl.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NamedNodeMapImpl.java
index fb7f28d28ef..8f1d9bf14ae 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NamedNodeMapImpl.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NamedNodeMapImpl.java
@@ -30,6 +30,8 @@ import org.w3c.dom.DOMException;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+import java.util.Objects;
+
/**
* {@link NamedNodeMap} wrapper, finding SOAP elements automatically when possible.
*
@@ -48,6 +50,8 @@ public class NamedNodeMapImpl implements NamedNodeMap {
* @param soapDocument soap document to find soap elements
*/
public NamedNodeMapImpl(NamedNodeMap namedNodeMap, SOAPDocumentImpl soapDocument) {
+ Objects.requireNonNull(namedNodeMap);
+ Objects.requireNonNull(soapDocument);
this.namedNodeMap = namedNodeMap;
this.soapDocument = soapDocument;
}
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java
index b05af537243..b90cb2ba5ce 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java
@@ -45,15 +45,12 @@ public class SOAPCommentImpl extends TextImpl implements Comment {
@Override
protected Comment createN(SOAPDocumentImpl ownerDoc, String text) {
- Comment c = ownerDoc.getDomDocument().createComment(text);
-// ownerDoc.register(this);
- return c;
+ return ownerDoc.getDomDocument().createComment(text);
}
@Override
protected Comment createN(SOAPDocumentImpl ownerDoc, CharacterData data) {
- Comment c = (Comment) data;
- return c;
+ return (Comment) data;
}
@Override
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java
index 63cb43a3bc0..dd6655af2b0 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java
@@ -42,20 +42,19 @@ public class SOAPTextImpl extends TextImpl implements Text {
@Override
protected Text createN(SOAPDocumentImpl ownerDoc, String text) {
- Text t = ownerDoc.getDomDocument().createTextNode(text);
-// ownerDoc.register(this);
- return t;
+ return ownerDoc.getDomDocument().createTextNode(text);
}
@Override
protected Text createN(SOAPDocumentImpl ownerDoc, CharacterData data) {
- Text t = (Text) data;
- return t;
+ return (Text) data;
}
@Override
public Text splitText(int offset) throws DOMException {
- return getDomElement().splitText(offset);
+ Text text = getDomElement().splitText(offset);
+ getSoapDocument().registerChildNodes(text, true);
+ return text;
}
@Override
@@ -70,7 +69,9 @@ public class SOAPTextImpl extends TextImpl implements Text {
@Override
public Text replaceWholeText(String content) throws DOMException {
- return getDomElement().replaceWholeText(content);
+ Text text = getDomElement().replaceWholeText(content);
+ getSoapDocument().registerChildNodes(text, true);
+ return text;
}
@Override
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java
index 0a49b10a75e..868a702f65d 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java
@@ -136,62 +136,62 @@ public abstract class TextImpl implements Text, Charact
@Override
public Node getParentNode() {
- return domNode.getParentNode();
+ return soapDocument.findIfPresent(domNode.getParentNode());
}
@Override
public NodeList getChildNodes() {
- return domNode.getChildNodes();
+ return new NodeListImpl(soapDocument, domNode.getChildNodes());
}
@Override
public Node getFirstChild() {
- return domNode.getFirstChild();
+ return soapDocument.findIfPresent(domNode.getFirstChild());
}
@Override
public Node getLastChild() {
- return domNode.getLastChild();
+ return soapDocument.findIfPresent(domNode.getLastChild());
}
@Override
public Node getPreviousSibling() {
- return domNode.getPreviousSibling();
+ return soapDocument.findIfPresent(domNode.getPreviousSibling());
}
@Override
public Node getNextSibling() {
- return domNode.getNextSibling();
+ return soapDocument.findIfPresent(domNode.getNextSibling());
}
@Override
public NamedNodeMap getAttributes() {
- return domNode.getAttributes();
+ return new NamedNodeMapImpl(domNode.getAttributes(), soapDocument);
}
@Override
public Document getOwnerDocument() {
- return domNode.getOwnerDocument();
+ return soapDocument;
}
@Override
public Node insertBefore(Node newChild, Node refChild) throws DOMException {
- return domNode.insertBefore(newChild, refChild);
+ return soapDocument.findIfPresent(domNode.insertBefore(newChild, refChild));
}
@Override
public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
- return domNode.replaceChild(newChild, oldChild);
+ return soapDocument.findIfPresent(domNode.replaceChild(newChild, oldChild));
}
@Override
public Node removeChild(Node oldChild) throws DOMException {
- return domNode.removeChild(oldChild);
+ return soapDocument.findIfPresent(domNode.removeChild(oldChild));
}
@Override
public Node appendChild(Node newChild) throws DOMException {
- return domNode.appendChild(newChild);
+ return soapDocument.findIfPresent(domNode.appendChild(newChild));
}
@Override
@@ -339,4 +339,7 @@ public abstract class TextImpl implements Text, Charact
domNode.replaceData(offset, count, arg);
}
+ public SOAPDocumentImpl getSoapDocument() {
+ return soapDocument;
+ }
}
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java
index bbca1f20d37..f675cf97b8f 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -30,6 +30,8 @@ import com.sun.xml.internal.ws.api.pipe.*;
import com.sun.xml.internal.ws.client.HandlerConfiguration;
import javax.xml.namespace.QName;
import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
/**
* @author Rama Pulavarthi
@@ -40,6 +42,7 @@ public class ServerMUTube extends MUTube {
private ServerTubeAssemblerContext tubeContext;
private final Set roles;
private final Set handlerKnownHeaders;
+ private final Lock lock = new ReentrantLock();
public ServerMUTube(ServerTubeAssemblerContext tubeContext, Tube next) {
super(tubeContext.getEndpoint().getBinding(), next);
@@ -69,7 +72,13 @@ public class ServerMUTube extends MUTube {
*/
@Override
public NextAction processRequest(Packet request) {
- Set misUnderstoodHeaders = getMisUnderstoodHeaders(request.getMessage().getHeaders(),roles, handlerKnownHeaders);
+ Set misUnderstoodHeaders=null;
+ lock.lock();
+ try{
+ misUnderstoodHeaders = getMisUnderstoodHeaders(request.getMessage().getHeaders(),roles, handlerKnownHeaders);
+ } finally {
+ lock.unlock();
+ }
if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
return doInvoke(super.next, request);
}
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
index 88eace686b6..77fd03e0e7a 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
@@ -23,7 +23,7 @@
# questions.
#
-build-id=2.3.0-SNAPSHOT
-build-version=JAX-WS RI 2.3.0-SNAPSHOT
-major-version=2.3.0
-svn-revision=3012ef421cf43774943c57736dac2207aeea9f07
+build-id=2.3.1-SNAPSHOT
+build-version=JAX-WS RI 2.3.1-SNAPSHOT
+major-version=2.3.1
+svn-revision=6a0b290fe358f9de4deeec2d1ec3f6e76afa8005
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java
index d1ef8648bfc..4cea83af835 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java
@@ -27,7 +27,6 @@ package com.sun.xml.internal.ws.util.xml;
import com.sun.istack.internal.Nullable;
import com.sun.xml.internal.ws.server.ServerRtException;
-import java.io.File;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java
index 8a63b73cee1..13c72f2c9e4 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java
@@ -85,11 +85,8 @@ public class XmlUtil {
"http://xml.org/sax/properties/lexical-handler";
private static final String DISALLOW_DOCTYPE_DECL = "http://apache.org/xml/features/disallow-doctype-decl";
-
private static final String EXTERNAL_GE = "http://xml.org/sax/features/external-general-entities";
-
private static final String EXTERNAL_PE = "http://xml.org/sax/features/external-parameter-entities";
-
private static final String LOAD_EXTERNAL_DTD = "http://apache.org/xml/features/nonvalidating/load-external-dtd";
private static final Logger LOGGER = Logger.getLogger(XmlUtil.class.getName());
@@ -341,15 +338,15 @@ public class XmlUtil {
factory.setFeature(featureToSet, securityOn);
factory.setNamespaceAware(true);
if (securityOn) {
- factory.setExpandEntityReferences(false);
- featureToSet = DISALLOW_DOCTYPE_DECL;
- factory.setFeature(featureToSet, true);
- featureToSet = EXTERNAL_GE;
- factory.setFeature(featureToSet, false);
- featureToSet = EXTERNAL_PE;
- factory.setFeature(featureToSet, false);
- featureToSet = LOAD_EXTERNAL_DTD;
- factory.setFeature(featureToSet, false);
+ factory.setExpandEntityReferences(false);
+ featureToSet = DISALLOW_DOCTYPE_DECL;
+ factory.setFeature(featureToSet, true);
+ featureToSet = EXTERNAL_GE;
+ factory.setFeature(featureToSet, false);
+ featureToSet = EXTERNAL_PE;
+ factory.setFeature(featureToSet, false);
+ featureToSet = LOAD_EXTERNAL_DTD;
+ factory.setFeature(featureToSet, false);
}
} catch (ParserConfigurationException e) {
LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support "+featureToSet+" feature!", new Object[] {factory.getClass().getName()} );
diff --git a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java
index fa1fb331031..d6dbeb8bc72 100644
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -309,7 +309,7 @@ public class WSDLGenerator {
private static class CommentFilter implements XmlSerializer {
final XmlSerializer serializer;
private static final String VERSION_COMMENT =
- " Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is " + RuntimeVersion.VERSION + ". ";
+ " Generated by JAX-WS RI (http://javaee.github.io/metro-jax-ws). RI's version is " + RuntimeVersion.VERSION + ". ";
CommentFilter(XmlSerializer serializer) {
this.serializer = serializer;
diff --git a/src/java.xml.ws/share/classes/javax/xml/soap/Detail.java b/src/java.xml.ws/share/classes/javax/xml/soap/Detail.java
index 8b823e1aeeb..968faea4ad5 100644
--- a/src/java.xml.ws/share/classes/javax/xml/soap/Detail.java
+++ b/src/java.xml.ws/share/classes/javax/xml/soap/Detail.java
@@ -54,7 +54,7 @@ import javax.xml.namespace.QName;
* Name name = se.createName("GetLastTradePrice", "WOMBAT",
* "http://www.wombat.org/trader");
* d.addDetailEntry(name);
- * Iterator it = d.getDetailEntries();
+ * Iterator it = d.getDetailEntries();
* }
*
* @since 1.6
diff --git a/src/java.xml.ws/share/classes/javax/xml/soap/SAAJMetaFactory.java b/src/java.xml.ws/share/classes/javax/xml/soap/SAAJMetaFactory.java
index 109bc02e3ba..a0c6cd07319 100644
--- a/src/java.xml.ws/share/classes/javax/xml/soap/SAAJMetaFactory.java
+++ b/src/java.xml.ws/share/classes/javax/xml/soap/SAAJMetaFactory.java
@@ -28,7 +28,7 @@ package javax.xml.soap;
/**
* The access point for the implementation classes of the factories defined in the
* SAAJ API. The {@code newInstance} methods defined on factories {@link SOAPFactory} and
-* {@link MessageFactory} in SAAJ 1.3 defer to instances of this class to do the actual object creation.
+* {@link MessageFactory} in SAAJ 1.4 defer to instances of this class to do the actual object creation.
* The implementations of {@code newInstance()} methods (in {@link SOAPFactory} and {@link MessageFactory})
* that existed in SAAJ 1.2 have been updated to also delegate to the SAAJMetaFactory when the SAAJ 1.2
* defined lookup fails to locate the Factory implementation class name.
diff --git a/src/java.xml.ws/share/classes/javax/xml/soap/SAAJResult.java b/src/java.xml.ws/share/classes/javax/xml/soap/SAAJResult.java
index 4ed5359ac21..18376330084 100644
--- a/src/java.xml.ws/share/classes/javax/xml/soap/SAAJResult.java
+++ b/src/java.xml.ws/share/classes/javax/xml/soap/SAAJResult.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2015, 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
@@ -73,7 +73,7 @@ public class SAAJResult extends DOMResult {
* internally. The {@code SOAPPart} returned by {@link DOMResult#getNode()}
* is not guaranteed to be well-formed.
*
- * @param protocol - the name of the SOAP protocol that the resulting SAAJ
+ * @param protocol the name of the SOAP protocol that the resulting SAAJ
* tree should support
*
* @throws SOAPException if a {@code SOAPMessage} supporting the
@@ -95,7 +95,7 @@ public class SAAJResult extends DOMResult {
* after the transformation can be guaranteed only by means outside SAAJ
* specification.
*
- * @param message - the message whose {@code SOAPPart} will be
+ * @param message the message whose {@code SOAPPart} will be
* populated as a result of some transformation or
* marshalling operation
*
@@ -114,7 +114,7 @@ public class SAAJResult extends DOMResult {
* incoming data can be guaranteed by means outside of the SAAJ
* specification.
*
- * @param rootNode - the root to which the results will be appended
+ * @param rootNode the root to which the results will be appended
*
* @since 1.6, SAAJ 1.3
*/
diff --git a/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFactory.java b/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFactory.java
index 14397cf8276..183be767b07 100644
--- a/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFactory.java
+++ b/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFactory.java
@@ -64,7 +64,7 @@ public abstract class SOAPFactory {
* part of the tree rooted in {@code domElement} violates SOAP rules, a
* {@code SOAPException} will be thrown.
*
- * @param domElement - the {@code Element} to be copied.
+ * @param domElement the {@code Element} to be copied.
*
* @return a new {@code SOAPElement} that is a copy of {@code domElement}.
*
diff --git a/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFault.java b/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFault.java
index 6ec2d3e774c..9bc5617cc8b 100644
--- a/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFault.java
+++ b/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFault.java
@@ -468,7 +468,7 @@ public interface SOAPFault extends SOAPBodyElement {
* this {@code SOAPFault} object. The Node element
* is optional in SOAP 1.2.
*
- * @param uri - the URI of the Node
+ * @param uri the URI of the Node
*
* @exception SOAPException if there was an error in setting the
* Node for this {@code SOAPFault} object.
@@ -500,7 +500,7 @@ public interface SOAPFault extends SOAPBodyElement {
* this {@code SOAPFault} object. The Role element
* is optional in SOAP 1.2.
*
- * @param uri - the URI of the Role
+ * @param uri the URI of the Role
*
* @exception SOAPException if there was an error in setting the
* Role for this {@code SOAPFault} object.
diff --git a/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeader.java b/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeader.java
index 494cb21b073..60a9ee01f35 100644
--- a/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeader.java
+++ b/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeader.java
@@ -188,11 +188,11 @@ public interface SOAPHeader extends SOAPElement {
/**
* Creates a new Upgrade {@code SOAPHeaderElement} object initialized
- * with the specified String Iterator of supported SOAP URIs and adds
- * it to this {@code SOAPHeader} object.
+ * with the specified List of supported SOAP URIs and adds it to this
+ * {@code SOAPHeader} object.
* This operation is supported on both SOAP 1.1 and SOAP 1.2 header.
*
- * @param supportedSOAPURIs an URI Strings {@code Iterator} of SOAP
+ * @param supportedSOAPURIs an {@code Iterator} object with the URIs of SOAP
* versions supported.
* @return the new {@code SOAPHeaderElement} object that was
* inserted into this {@code SOAPHeader} object
diff --git a/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeaderElement.java b/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeaderElement.java
index 747e60c9810..12262a869c7 100644
--- a/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeaderElement.java
+++ b/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeaderElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2015, 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
@@ -60,7 +60,7 @@ public interface SOAPHeaderElement extends SOAPElement {
* Sets the {@code Role} associated with this {@code SOAPHeaderElement}
* object to the specified {@code Role}.
*
- * @param uri - the URI of the {@code Role}
+ * @param uri the URI of the {@code Role}
*
* @throws SOAPException if there is an error in setting the role
*
diff --git a/src/java.xml.ws/share/classes/javax/xml/ws/wsdl_customizationschema_2_0.xsd b/src/java.xml.ws/share/classes/javax/xml/ws/wsdl_customizationschema_2_0.xsd
new file mode 100644
index 00000000000..9efd05d39b8
--- /dev/null
+++ b/src/java.xml.ws/share/classes/javax/xml/ws/wsdl_customizationschema_2_0.xsd
@@ -0,0 +1,458 @@
+
+
+
+
+
+
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 2006-2017 Oracle and/or its affiliates. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+ https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ or packager/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [year] [name of copyright owner]"
+
+ Contributor(s):
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+
+
+
+
+
+
+ Schema for JAX-WS 2.0 WSDL customization.
+
+
+
+
+
+
+ TODO
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WSDL customization binding declaration.
+
+ There are two ways to specify binding declarations.
+
+ 1. All binding declarations pertainingto a given WSDL document are grouped together in a standalone
+ document, called an external binding file.
+
+ 2. The second approach consists in embeddeding binding declarations directly inside a WSDL document. In
+ either case, the jaxws:bindings element is used as a container for JAX-WS binding declarations. It
+ contains a (possibly empty) list of binding declarations, in any order.
+
+ A binding declaration embedded in a WSDL document can only affect the WSDL element it extends. When a
+ jaxws:bindings element is used as a WSDL extension, it MUST NOT have a node attribute. Moreover, it MUST
+ NOT have an element whose qualified name is jaxws:bindings amongs its children.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location of the remote WSDL to associate binding declarations with. It MUST NOT be present if
+ the jaxws:bindings element is used as an extension inside a WSDL document or one of its ancestor
+ jaxws:bindings elements already contains this attribute.
+
+
+
+
+
+
+
+
+ The value of the string is an XPATH 1.0 compliant string that resolves to a node in a remote
+ WSDL to associate binding declarations with. The remote WSDL is specified by the
+ wsdlLocation attribute occuring in the current element or in a parent of this element.
+
+ The node attribute can be used to customize the inlined schema inside the WSDL, in this case the
+ node attribute must point to the xs:schema node inside the WSDL. Further jaxb:bindings should be
+ used as the child of jaxws:bindings.
+
+ Example:
+
+ NOTE: It MUST NOT be present if the jaxws:bindings appears inside a WSDL document.
+
+
+
+
+
+
+
+ Used to indicate the version of WSDL customization declarations. Only valid on root level
+ bindings element.
+ If this is absent, it will implicitly be assumed to be 2.0.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If absent, the default package name is computed from the targetNamespace of the WSDL in scope. The rules
+ of targetNamespace to Java package name is described in the JAXB specification.
+
+ Appears in the context of a WSDL document, either as an extension to the wsdl:definitions element or in
+ an external binding file at a place where there is a WSDL document in scope.
+
+ Scope:
+ wsd;definitions
+
+ Example:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ enableWrapperStyle can be used to disable wrapper style Java method generation. If absent the default
+ value of enableWrapperStyle is true. Setting it to true may not result into wrapper style method
+ generation unless the wrapper style rules are satisfied as defined in JAX-WS 2.1 specification 2.3.1.2.
+
+ Scope:
+ wsd;definitions, wsdl:portType, wsdl:portType/wsdl:operation.
+
+ Example:
+
+
+ false
+
+
+
+
+
+
+
+
+ enableAsyncMapping can be used to enable async method generation in the entpoint interface generated
+ from a WSDL. If absent the default value of enableAsyncMapping is false. See JAX-WS 2.1 spec
+ section 2.3.4.2.
+
+ Scope:
+ wsd;definitions, wsdl:portType, wsdl:portType/wsdl:operation.
+
+ Note: These generated async methods can be used only on the client side.
+
+ Example:
+
+
+ false
+
+
+
+
+
+
+
+
+ If present the use of the mime:content information is enabled as defined in the JAX-WS 2.1 spec
+ section 2.6.3.1
+
+ Scope:
+ wsdl:definitions, wsdl:binding, wsdl:binding/wsdl:operation
+
+ Example:
+
+
+
+ false
+
+
+
+
+
+
+
+
+ Customizes the name of generated classes for the SEI, service class or the fault class.
+
+ Scope:
+ wsd;portType - The name of generated SEI (Service Endpoint Interface)
+ wsdl:portType/wsdl:operation/wsdl:fault - The generated fault class name.
+ wsdl:service - Name of the generated Service class.
+
+ Example:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Customizes the name of Java method in the generated classes.
+
+ Scope:
+ wsd;portType/wsdl:operation - name of Java methods corresponding to wsdl:operation
+ wsdl:service/wsdl:port - Name of the port getter in the generated Service class
+
+ Example:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Customizes the name of the Java method parameters in the generated SEI.
+
+ Scope:
+ wsd;portType/wsdl:operation
+ wsdl:binding/wsdl:operation To rename wsdl:header (additional header parameters, this support is
+ optional as JAX-WS 2.1 spec makes additional header mapping optional.
+ Example:
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ A XPath expression identifying a wsdl:part child of a wsdl:message.
+
+
+
+
+
+
+ The qualified name of a child element information item of the global type definition or global
+ element declaration referred to by the wsdl:part identified by the previous attribute. It is
+ optional and you need it only to rename parameters corresponding to wrapper style operation.
+
+
+
+
+
+
+ The name of the Java formal parameter corresponding to the parameter identified by the previous
+ two attributes.
+
+
+
+
+
+
+
+
+
+ This binding declaration specifies that the annotated port will be used with the
+ javax.xml.ws.Provider interface.
+
+
+
+
+
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
index 3db572c02e8..cbcecf7b841 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
@@ -952,6 +952,9 @@ public class Check {
if (t.hasTag(BOT)) {
log.error(pos, Errors.CantInferLocalVarType(name, Fragments.LocalCantInferNull));
return types.createErrorType(t);
+ } else if (t.hasTag(VOID)) {
+ log.error(pos, Errors.CantInferLocalVarType(name, Fragments.LocalCantInferVoid));
+ return types.createErrorType(t);
}
return t;
}
@@ -3918,6 +3921,8 @@ public class Check {
todo = todo.tail;
if (current == whatPackage.modle)
return ; //OK
+ if ((current.flags() & Flags.AUTOMATIC_MODULE) != 0)
+ continue; //for automatic modules, don't look into their dependencies
for (RequiresDirective req : current.requires) {
if (req.isTransitive()) {
todo = todo.prepend(req.module);
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
index fa26ef40ab2..f041a5638ac 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
@@ -2269,17 +2269,22 @@ public class LambdaToMethod extends TreeTranslator {
/**
* Erasure destroys the implementation parameter subtype
- * relationship for intersection types
+ * relationship for intersection types.
+ * Have similar problems for union types too.
*/
- boolean interfaceParameterIsIntersectionType() {
+ boolean interfaceParameterIsIntersectionOrUnionType() {
List tl = tree.getDescriptorType(types).getParameterTypes();
for (; tl.nonEmpty(); tl = tl.tail) {
Type pt = tl.head;
- if (pt.getKind() == TypeKind.TYPEVAR) {
- TypeVar tv = (TypeVar) pt;
- if (tv.bound.getKind() == TypeKind.INTERSECTION) {
+ switch (pt.getKind()) {
+ case INTERSECTION:
+ case UNION:
return true;
- }
+ case TYPEVAR:
+ TypeVar tv = (TypeVar) pt;
+ if (tv.bound.getKind() == TypeKind.INTERSECTION) {
+ return true;
+ }
}
}
return false;
@@ -2290,7 +2295,7 @@ public class LambdaToMethod extends TreeTranslator {
* (i.e. var args need to be expanded or "super" is used)
*/
final boolean needsConversionToLambda() {
- return interfaceParameterIsIntersectionType() ||
+ return interfaceParameterIsIntersectionOrUnionType() ||
isSuper ||
needsVarArgsConversion() ||
isArrayOp() ||
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java
index c4224c99ae4..f95f6640506 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java
@@ -3226,7 +3226,7 @@ public class Lower extends TreeTranslator {
JCVariableDecl indexdef = make.VarDef(index, make.Literal(INT, 0));
indexdef.init.type = indexdef.type = syms.intType.constType(0);
- List loopinit = List.of(arraycachedef, lencachedef, indexdef);
+ List loopinit = List.of(lencachedef, indexdef);
JCBinary cond = makeBinary(LT, make.Ident(index), make.Ident(lencache));
JCExpressionStatement step = make.Exec(makeUnary(PREINC, make.Ident(index)));
@@ -3236,18 +3236,27 @@ public class Lower extends TreeTranslator {
make.Ident(index)).setType(elemtype);
JCVariableDecl loopvardef = (JCVariableDecl)make.VarDef(tree.var.mods,
tree.var.name,
- tree.var.vartype,
- loopvarinit).setType(tree.var.type);
+ tree.var.vartype, null).setType(tree.var.type);
loopvardef.sym = tree.var.sym;
- JCBlock body = make.
- Block(0, List.of(loopvardef, tree.body));
+ JCStatement loopVarAssign = make.Assignment(tree.var.sym, loopvarinit);
+ JCBlock body = make.
+ Block(0, List.of(loopVarAssign, tree.body));
+
+ arraycachedef = translate(arraycachedef);
result = translate(make.
ForLoop(loopinit,
cond,
List.of(step),
body));
patchTargets(body, tree, result);
+ JCStatement nullAssignToArr = make.Assignment(arraycache, make.Literal(BOT, null).setType(syms.botType));
+ JCStatement nullAssignToLoopVar = tree.var.type.isPrimitive() ?
+ null :
+ make.Assignment(tree.var.sym, make.Literal(BOT, null).setType(syms.botType));
+ result = nullAssignToLoopVar == null ?
+ make.Block(0, List.of(arraycachedef, loopvardef, (JCStatement)result, nullAssignToArr)):
+ make.Block(0, List.of(arraycachedef, loopvardef, (JCStatement)result, nullAssignToArr, nullAssignToLoopVar));
}
/** Patch up break and continue targets. */
private void patchTargets(JCTree body, final JCTree src, final JCTree dest) {
@@ -3322,16 +3331,25 @@ public class Lower extends TreeTranslator {
JCVariableDecl indexDef = (JCVariableDecl)make.VarDef(tree.var.mods,
tree.var.name,
tree.var.vartype,
- vardefinit).setType(tree.var.type);
+ null).setType(tree.var.type);
indexDef.sym = tree.var.sym;
- JCBlock body = make.Block(0, List.of(indexDef, tree.body));
+ JCStatement loopVarAssign = make.Assignment(tree.var.sym, vardefinit);
+ JCBlock body = make.Block(0, List.of(loopVarAssign, tree.body));
body.endpos = TreeInfo.endPos(tree.body);
+ init = translate(init);
result = translate(make.
- ForLoop(List.of(init),
+ ForLoop(List.nil(),
cond,
List.nil(),
body));
patchTargets(body, tree, result);
+ JCStatement nullAssignToIterator = make.Assignment(itvar, make.Literal(BOT, null).setType(syms.botType));
+ JCStatement nullAssignToLoopVar = tree.var.type.isPrimitive() ?
+ null :
+ make.Assignment(tree.var.sym, make.Literal(BOT, null).setType(syms.botType));
+ result = nullAssignToLoopVar == null ?
+ make.Block(0, List.of(init, indexDef, (JCStatement)result, nullAssignToIterator)):
+ make.Block(0, List.of(init, indexDef, (JCStatement)result, nullAssignToIterator, nullAssignToLoopVar));
}
public void visitVarDef(JCVariableDecl tree) {
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
index e392322c114..c2ffcde2bf7 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
@@ -1548,7 +1548,8 @@ public class Resolve {
boolean allowBoxing,
boolean useVarargs) {
if (sym.kind == ERR ||
- !sym.isInheritedIn(site.tsym, types)) {
+ (site.tsym != sym.owner && !sym.isInheritedIn(site.tsym, types)) ||
+ !notOverriddenIn(site, sym)) {
return bestSoFar;
} else if (useVarargs && (sym.flags() & VARARGS) == 0) {
return bestSoFar.kind.isResolutionError() ?
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java
index 6d5f86a8056..27f57a24834 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java
@@ -253,8 +253,7 @@ public class TransTypes extends TreeTranslator {
boolean hypothetical,
ListBuffer bridges) {
make.at(pos);
- Type origType = types.memberType(origin.type, meth);
- Type origErasure = erasure(origType);
+ Type implTypeErasure = erasure(impl.type);
// Create a bridge method symbol and a bridge definition without a body.
Type bridgeType = meth.erasure(types);
@@ -281,7 +280,7 @@ public class TransTypes extends TreeTranslator {
: make.Super(types.supertype(origin.type).tsym.erasure(types), origin);
// The type returned from the original method.
- Type calltype = erasure(impl.type.getReturnType());
+ Type calltype = implTypeErasure.getReturnType();
// Construct a call of this.impl(params), or super.impl(params),
// casting params and possibly results as needed.
@@ -289,9 +288,9 @@ public class TransTypes extends TreeTranslator {
make.Apply(
null,
make.Select(receiver, impl).setType(calltype),
- translateArgs(make.Idents(md.params), origErasure.getParameterTypes(), null))
+ translateArgs(make.Idents(md.params), implTypeErasure.getParameterTypes(), null))
.setType(calltype);
- JCStatement stat = (origErasure.getReturnType().hasTag(VOID))
+ JCStatement stat = (implTypeErasure.getReturnType().hasTag(VOID))
? make.Exec(call)
: make.Return(coerce(call, bridgeType.getReturnType()));
md.body = make.Block(0, List.of(stat));
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
index 354f3433c7f..12a4a693a17 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
@@ -1319,6 +1319,9 @@ public class JavacParser implements Parser {
break loop;
case DOT:
nextToken();
+ if (token.kind == TokenKind.IDENTIFIER && typeArgs != null) {
+ return illegal();
+ }
int oldmode = mode;
mode &= ~NOPARAMS;
typeArgs = typeArgumentsOpt(EXPR);
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
index f919dbc7f14..dd10de703b1 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
@@ -1216,6 +1216,9 @@ compiler.err.var.not.allowed.compound=\
compiler.misc.local.cant.infer.null=\
variable initializer is ''null''
+compiler.misc.local.cant.infer.void=\
+ variable initializer is ''void''
+
compiler.misc.local.missing.init=\
cannot use ''var'' on variable without initializer
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCName.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCName.java
index 9a7a4de3872..734cf496559 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCName.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCName.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2015, 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
@@ -36,6 +36,7 @@ public enum GCName {
G1New ("G1New"),
ConcurrentMarkSweep ("ConcurrentMarkSweep"),
G1Old ("G1Old"),
+ G1Full ("G1Full"),
GCNameEndSentinel ("GCNameEndSentinel");
private final String value;
diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java
index 737135a8e52..57cbc4b279c 100644
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java
@@ -76,7 +76,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField {
@Override
public int hashCode() {
- return offset ^ modifiers;
+ return holder.hashCode() ^ offset;
}
@Override
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
index e04fdbc59d5..60024ce2102 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
@@ -358,6 +358,6 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
}
}
buf.append(")");
- return foundTypeVariable ? writer.getName(buf.toString()) : null;
+ return foundTypeVariable ? configuration.links.getName(buf.toString()) : null;
}
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java
index f10eb2c1a1e..36773b67ef9 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java
@@ -222,6 +222,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
*
* @param mdle the module to be documented
* @param dlTree the content tree to which the description will be added
+ * @param si the search index item
*/
protected void addDescription(ModuleElement mdle, Content dlTree, SearchIndexItem si) {
String moduleName = utils.getFullyQualifiedName(mdle);
@@ -316,7 +317,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
name = name + utils.flatSignature(ee);
si.setLabel(name);
if (!((utils.signature(ee)).equals(utils.flatSignature(ee)))) {
- si.setUrl(getName(getAnchor(ee)));
+ si.setUrl(links.getName(getAnchor(ee)));
}
} else {
@@ -364,7 +365,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
List extends DocTree> tags;
Content span = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(element));
HtmlTree div = new HtmlTree(HtmlTag.DIV);
- div.addStyle(HtmlStyle.deprecationBlock);
+ div.setStyle(HtmlStyle.deprecationBlock);
if (utils.isDeprecated(element)) {
div.addContent(span);
tags = utils.getBlockTags(element, DocTree.Kind.DEPRECATED);
@@ -420,7 +421,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
* @return a content tree for the marker anchor
*/
public Content getMarkerAnchorForIndex(String anchorNameForIndex) {
- return getMarkerAnchor(getNameForIndex(anchorNameForIndex), null);
+ return links.createAnchor(getNameForIndex(anchorNameForIndex), null);
}
/**
@@ -430,7 +431,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
* @return a valid HTML name string.
*/
public String getNameForIndex(String unicode) {
- return "I:" + getName(unicode);
+ return "I:" + links.getName(unicode);
}
/**
@@ -452,6 +453,13 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
}
/**
+ * Creates a search index file.
+ *
+ * @param searchIndexFile the file to be generated
+ * @param searchIndexZip the zip file to be generated
+ * @param searchIndexJS the file for the JavaScript to be generated
+ * @param searchIndex the search index items
+ * @param varName the variable name to write in the JavaScript file
* @throws DocFileIOException if there is a problem creating the search index file
*/
protected void createSearchIndexFile(DocPath searchIndexFile, DocPath searchIndexZip,
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java
index 8a6e6f2cda2..be700d2f16b 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java
@@ -25,6 +25,9 @@
package jdk.javadoc.internal.doclets.formats.html;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
+
import java.util.*;
import java.util.stream.Collectors;
@@ -36,17 +39,17 @@ import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.type.TypeMirror;
import com.sun.source.doctree.DocTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
+import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
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.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
import jdk.javadoc.internal.doclets.toolkit.Resources;
import jdk.javadoc.internal.doclets.toolkit.taglets.DeprecatedTaglet;
-import jdk.javadoc.internal.doclets.toolkit.util.MethodTypes;
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
@@ -72,11 +75,9 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
protected final SubWriterHolderWriter writer;
protected final Contents contents;
protected final Resources resources;
+ protected final Links links;
protected final TypeElement typeElement;
- protected Map typeMap = new LinkedHashMap<>();
- protected Set methodTypes = EnumSet.noneOf(MethodTypes.class);
- private int methodTypesOr = 0;
public final boolean nodepr;
protected boolean printedSummaryHeader = false;
@@ -89,6 +90,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
this.utils = configuration.utils;
this.contents = configuration.contents;
this.resources = configuration.resources;
+ this.links = configuration.links;
}
public AbstractMemberWriter(SubWriterHolderWriter writer) {
@@ -109,14 +111,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
*
* @return a string for the table summary
*/
- public abstract String getTableSummary();
-
- /**
- * Get the caption for the member summary table.
- *
- * @return a string for the table caption
- */
- public abstract Content getCaption();
+ private String getTableSummaryX() { return null; }
/**
* Get the summary table header for the member.
@@ -126,6 +121,27 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
*/
public abstract TableHeader getSummaryTableHeader(Element member);
+ private Table summaryTable;
+
+ private Table getSummaryTable() {
+ if (summaryTable == null) {
+ summaryTable = createSummaryTable();
+ }
+ return summaryTable;
+ }
+
+ /**
+ * Create the summary table for this element.
+ * The table should be created and initialized if needed, and configured
+ * so that it is ready to add content with {@link Table#addRows(Content[])}
+ * and similar methods.
+ *
+ * @return the summary table
+ */
+ protected abstract Table createSummaryTable();
+
+
+
/**
* Add inherited summary label for the member.
*
@@ -229,7 +245,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
* Add the modifier for the member. The modifiers are ordered as specified
* by The Java Language Specification.
*
- * @param member the member for which teh modifier will be added.
+ * @param member the member for which the modifier will be added.
* @param htmltree the content tree to which the modifier information will be added.
*/
protected void addModifiers(Element member, Content htmltree) {
@@ -420,51 +436,41 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
List extends Element> members = mems;
boolean printedUseTableHeader = false;
if (members.size() > 0) {
- Content caption = writer.getTableCaption(heading);
- Content table = (configuration.isOutputHtml5())
- ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
- : HtmlTree.TABLE(HtmlStyle.useSummary, tableSummary, caption);
- Content tbody = new HtmlTree(HtmlTag.TBODY);
- boolean altColor = true;
+ Table useTable = new Table(configuration.htmlVersion, HtmlStyle.useSummary)
+ .setSummary(tableSummary)
+ .setCaption(heading)
+ .setRowScopeColumn(1)
+ .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast);
for (Element element : members) {
- TypeElement te = utils.getEnclosingTypeElement(element);
+ TypeElement te = (typeElement == null)
+ ? utils.getEnclosingTypeElement(element)
+ : typeElement;
if (!printedUseTableHeader) {
- table.addContent(getSummaryTableHeader(element).toContent());
+ useTable.setHeader(getSummaryTableHeader(element));
printedUseTableHeader = true;
}
- HtmlTree tr = new HtmlTree(HtmlTag.TR);
- tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
- altColor = !altColor;
- HtmlTree tdFirst = new HtmlTree(HtmlTag.TD);
- tdFirst.addStyle(HtmlStyle.colFirst);
- writer.addSummaryType(this, element, tdFirst);
- tr.addContent(tdFirst);
- HtmlTree thType = new HtmlTree(HtmlTag.TH);
- thType.addStyle(HtmlStyle.colSecond);
- thType.addAttr(HtmlAttr.SCOPE, "row");
+ Content summaryType = new ContentBuilder();
+ addSummaryType(element, summaryType);
+ Content typeContent = new ContentBuilder();
if (te != null
&& !utils.isConstructor(element)
&& !utils.isClass(element)
&& !utils.isInterface(element)
&& !utils.isAnnotationType(element)) {
HtmlTree name = new HtmlTree(HtmlTag.SPAN);
- name.addStyle(HtmlStyle.typeNameLabel);
+ name.setStyle(HtmlStyle.typeNameLabel);
name.addContent(name(te) + ".");
- thType.addContent(name);
+ typeContent.addContent(name);
}
addSummaryLink(utils.isClass(element) || utils.isInterface(element)
? LinkInfoImpl.Kind.CLASS_USE
: LinkInfoImpl.Kind.MEMBER,
- te, element, thType);
- tr.addContent(thType);
- HtmlTree tdDesc = new HtmlTree(HtmlTag.TD);
- tdDesc.addStyle(HtmlStyle.colLast);
- writer.addSummaryLinkComment(this, element, tdDesc);
- tr.addContent(tdDesc);
- tbody.addContent(tr);
+ te, element, typeContent);
+ Content desc = new ContentBuilder();
+ writer.addSummaryLinkComment(this, element, desc);
+ useTable.addRow(summaryType, typeContent, desc);
}
- table.addContent(tbody);
- contentTree.addContent(table);
+ contentTree.addContent(useTable.toContent());
}
}
@@ -515,81 +521,26 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
* @param tElement the class that is being documented
* @param member the member being documented
* @param firstSentenceTags the first sentence tags to be added to the summary
- * @param tableContents the list of contents to which the documentation will be added
- * @param counter the counter for determining id and style for the table row
*/
+ @Override
public void addMemberSummary(TypeElement tElement, Element member,
- List extends DocTree> firstSentenceTags, List tableContents, int counter,
- VisibleMemberMap.Kind vmmKind) {
- HtmlTree tdSummaryType = new HtmlTree(HtmlTag.TD);
- tdSummaryType.addStyle(HtmlStyle.colFirst);
- writer.addSummaryType(this, member, tdSummaryType);
- HtmlTree tr = HtmlTree.TR(tdSummaryType);
- HtmlTree thSummaryLink = new HtmlTree(HtmlTag.TH);
- setSummaryColumnStyleAndScope(thSummaryLink);
- addSummaryLink(tElement, member, thSummaryLink);
- tr.addContent(thSummaryLink);
- HtmlTree tdDesc = new HtmlTree(HtmlTag.TD);
- tdDesc.addStyle(HtmlStyle.colLast);
- writer.addSummaryLinkComment(this, member, firstSentenceTags, tdDesc);
- tr.addContent(tdDesc);
- if (utils.isMethod(member) && !utils.isAnnotationType(member)
- && vmmKind != VisibleMemberMap.Kind.PROPERTIES) {
- int methodType = utils.isStatic(member) ? MethodTypes.STATIC.tableTabs().value() :
- MethodTypes.INSTANCE.tableTabs().value();
- if (utils.isInterface(member.getEnclosingElement())) {
- methodType = utils.isAbstract(member)
- ? methodType | MethodTypes.ABSTRACT.tableTabs().value()
- : methodType | MethodTypes.DEFAULT.tableTabs().value();
- } else {
- methodType = utils.isAbstract(member)
- ? methodType | MethodTypes.ABSTRACT.tableTabs().value()
- : methodType | MethodTypes.CONCRETE.tableTabs().value();
- }
- if (utils.isDeprecated(member) || utils.isDeprecated(typeElement)) {
- methodType = methodType | MethodTypes.DEPRECATED.tableTabs().value();
- }
- methodTypesOr = methodTypesOr | methodType;
- String tableId = "i" + counter;
- typeMap.put(tableId, methodType);
- tr.addAttr(HtmlAttr.ID, tableId);
+ List extends DocTree> firstSentenceTags) {
+ if (tElement != typeElement) {
+ throw new IllegalStateException();
}
- if (counter%2 == 0)
- tr.addStyle(HtmlStyle.altColor);
- else
- tr.addStyle(HtmlStyle.rowColor);
- tableContents.add(tr);
- }
-
- /**
- * Generate the method types set and return true if the method summary table
- * needs to show tabs.
- *
- * @return true if the table should show tabs
- */
- public boolean showTabs() {
- int value;
- for (MethodTypes type : EnumSet.allOf(MethodTypes.class)) {
- value = type.tableTabs().value();
- if ((value & methodTypesOr) == value) {
- methodTypes.add(type);
- }
- }
- boolean showTabs = methodTypes.size() > 1;
- if (showTabs) {
- methodTypes.add(MethodTypes.ALL);
- }
- return showTabs;
- }
-
- /**
- * Set the style and scope attribute for the summary column.
- *
- * @param thTree the column for which the style and scope attribute will be set
- */
- public void setSummaryColumnStyleAndScope(HtmlTree thTree) {
- thTree.addStyle(HtmlStyle.colSecond);
- thTree.addAttr(HtmlAttr.SCOPE, "row");
+ Table table = getSummaryTable();
+ List rowContents = new ArrayList<>();
+ Content summaryType = new ContentBuilder();
+ addSummaryType(member, summaryType);
+ if (!summaryType.isEmpty())
+ rowContents.add(summaryType);
+ Content summaryLink = new ContentBuilder();
+ addSummaryLink(tElement, member, summaryLink);
+ rowContents.add(summaryLink);
+ Content desc = new ContentBuilder();
+ writer.addSummaryLinkComment(this, member, firstSentenceTags, desc);
+ rowContents.add(desc);
+ table.addRow(member, rowContents);
}
/**
@@ -601,6 +552,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
* @param isLast true if this is the last member in the list
* @param linksTree the content tree to which the summary will be added
*/
+ @Override
public void addInheritedMemberSummary(TypeElement tElement,
Element nestedClass, boolean isFirst, boolean isLast,
Content linksTree) {
@@ -614,6 +566,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
* @param tElement the class the inherited member belongs to
* @return a content tree for the inherited summary header
*/
+ @Override
public Content getInheritedSummaryHeader(TypeElement tElement) {
Content inheritedTree = writer.getMemberTreeHeader();
writer.addInheritedSummaryHeader(this, tElement, inheritedTree);
@@ -625,6 +578,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
*
* @return a content tree for the inherited summary links
*/
+ @Override
public Content getInheritedSummaryLinksTree() {
return new HtmlTree(HtmlTag.CODE);
}
@@ -633,11 +587,18 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
* Get the summary table tree for the given class.
*
* @param tElement the class for which the summary table is generated
- * @param tableContents list of contents to be displayed in the summary table
* @return a content tree for the summary table
*/
- public Content getSummaryTableTree(TypeElement tElement, List tableContents) {
- return writer.getSummaryTableTree(this, tElement, tableContents, showTabs());
+ @Override
+ public Content getSummaryTableTree(TypeElement tElement) {
+ if (tElement != typeElement) {
+ throw new IllegalStateException();
+ }
+ Table table = getSummaryTable();
+ if (table.needsScript()) {
+ writer.getMainBodyScript().append(table.getScript());
+ }
+ return table.toContent();
}
/**
@@ -646,6 +607,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
* @param memberTree the content tree of member to be documented
* @return a content tree that will be added to the class documentation
*/
+ @Override
public Content getMemberTree(Content memberTree) {
return writer.getMemberTree(memberTree);
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java
index af91a3a10e6..5e9aa4b2374 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java
@@ -203,7 +203,7 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
? HtmlTree.NAV()
: new HtmlTree(HtmlTag.DIV);
- htmlTree.addStyle(HtmlStyle.indexNav);
+ htmlTree.setStyle(HtmlStyle.indexNav);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
addAllClassesLink(ul);
addAllPackagesLink(ul);
@@ -226,7 +226,7 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
? HtmlTree.NAV()
: new HtmlTree(HtmlTag.DIV);
- htmlTree.addStyle(HtmlStyle.indexNav);
+ htmlTree.setStyle(HtmlStyle.indexNav);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
addAllClassesLink(ul);
addAllPackagesLink(ul);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java
index 60a2a546e15..f84e8cab357 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java
@@ -146,7 +146,7 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
? HtmlTree.NAV()
: new HtmlTree(HtmlTag.DIV);
- htmlTree.addStyle(HtmlStyle.indexNav);
+ htmlTree.setStyle(HtmlStyle.indexNav);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
addAllClassesLink(ul);
if (configuration.showModules && configuration.modules.size() > 1) {
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java
index ecf0bc7e207..a9122d9cf16 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java
@@ -88,7 +88,7 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
Content ul = new HtmlTree(HtmlTag.UL);
for (TypeElement local : collection) {
HtmlTree li = new HtmlTree(HtmlTag.LI);
- li.addStyle(HtmlStyle.circle);
+ li.setStyle(HtmlStyle.circle);
addPartialInfo(local, li);
addExtendsImplements(parent, local, li);
addLevelInfo(local, classtree.directSubClasses(local, isEnum),
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
index f2a5b4b6d82..269dc26f5a6 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
@@ -25,16 +25,21 @@
package jdk.javadoc.internal.doclets.formats.html;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+
+import java.util.Arrays;
+
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
-import jdk.javadoc.internal.doclets.formats.html.TableHeader;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
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.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeFieldWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -104,7 +109,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
public void addAnnotationDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) {
if (!writer.printedAnnotationFieldHeading) {
- memberDetailsTree.addContent(writer.getMarkerAnchor(
+ memberDetailsTree.addContent(links.createAnchor(
SectionName.ANNOTATION_TYPE_FIELD_DETAIL));
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
contents.fieldDetailsLabel);
@@ -118,8 +123,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
*/
public Content getAnnotationDocTreeHeader(Element member,
Content annotationDetailsTree) {
- annotationDetailsTree.addContent(
- writer.getMarkerAnchor(name(member)));
+ annotationDetailsTree.addContent(links.createAnchor(name(member)));
Content annotationDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
heading.addContent(name(member));
@@ -197,22 +201,6 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
memberTree.addContent(label);
}
- /**
- * {@inheritDoc}
- */
- public String getTableSummary() {
- return configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Field_Summary"),
- configuration.getText("doclet.fields"));
- }
-
- /**
- * {@inheritDoc}
- */
- public Content getCaption() {
- return configuration.getContent("doclet.Fields");
- }
-
/**
* {@inheritDoc}
*/
@@ -222,29 +210,52 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
contents.descriptionLabel);
}
+ @Override
+ protected Table createSummaryTable() {
+ String summary = resources.getText("doclet.Member_Table_Summary",
+ resources.getText("doclet.Field_Summary"),
+ resources.getText("doclet.fields"));
+ Content caption = contents.getContent("doclet.Fields");
+
+ TableHeader header = new TableHeader(contents.modifierAndTypeLabel, contents.fields,
+ contents.descriptionLabel);
+
+ return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
+ .setSummary(summary)
+ .setCaption(caption)
+ .setHeader(header)
+ .setRowScopeColumn(1)
+ .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast)
+ .setUseTBody(false); // temporary? compatibility mode for TBody
+ }
+
/**
* {@inheritDoc}
*/
+ @Override
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
- memberTree.addContent(writer.getMarkerAnchor(
+ memberTree.addContent(links.createAnchor(
SectionName.ANNOTATION_TYPE_FIELD_SUMMARY));
}
/**
* {@inheritDoc}
*/
+ @Override
public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) {
}
/**
* {@inheritDoc}
*/
+ @Override
public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) {
}
/**
* {@inheritDoc}
*/
+ @Override
protected void addSummaryLink(LinkInfoImpl.Kind context, TypeElement typeElement, Element member,
Content tdSummary) {
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
@@ -281,7 +292,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
*/
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
if (link) {
- return writer.getHyperLink(
+ return Links.createLink(
SectionName.ANNOTATION_TYPE_FIELD_SUMMARY,
contents.navField);
} else {
@@ -294,7 +305,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
*/
protected void addNavDetailLink(boolean link, Content liNav) {
if (link) {
- liNav.addContent(writer.getHyperLink(
+ liNav.addContent(Links.createLink(
SectionName.ANNOTATION_TYPE_FIELD_DETAIL,
contents.navField));
} else {
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java
index f3126ac0d54..77c1570f27d 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java
@@ -25,17 +25,17 @@
package jdk.javadoc.internal.doclets.formats.html;
-import java.util.Arrays;
-import java.util.List;
+
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.TableHeader;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
+import jdk.javadoc.internal.doclets.formats.html.markup.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeOptionalMemberWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -71,6 +71,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
/**
* {@inheritDoc}
*/
+ @Override
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(
@@ -83,6 +84,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
/**
* {@inheritDoc}
*/
+ @Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(memberSummaryTree, memberTree);
}
@@ -90,6 +92,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
/**
* {@inheritDoc}
*/
+ @Override
public void addDefaultValueInfo(Element member, Content annotationDocTree) {
if (utils.isAnnotationType(member)) {
ExecutableElement ee = (ExecutableElement)member;
@@ -107,6 +110,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
/**
* {@inheritDoc}
*/
+ @Override
public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
contents.annotateTypeOptionalMemberSummaryLabel);
@@ -116,7 +120,8 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
/**
* {@inheritDoc}
*/
- public String getTableSummary() {
+ @Override
+ protected String getTableSummary() {
return resources.getText("doclet.Member_Table_Summary",
resources.getText("doclet.Annotation_Type_Optional_Member_Summary"),
resources.getText("doclet.annotation_type_optional_members"));
@@ -125,8 +130,9 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
/**
* {@inheritDoc}
*/
- public Content getCaption() {
- return configuration.getContent("doclet.Annotation_Type_Optional_Members");
+ @Override
+ protected Content getCaption() {
+ return contents.getContent("doclet.Annotation_Type_Optional_Members");
}
/**
@@ -141,17 +147,19 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
/**
* {@inheritDoc}
*/
+ @Override
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
- memberTree.addContent(writer.getMarkerAnchor(
+ memberTree.addContent(links.createAnchor(
SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY));
}
/**
* {@inheritDoc}
*/
+ @Override
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
if (link) {
- return writer.getHyperLink(
+ return Links.createLink(
SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY,
contents.navAnnotationTypeOptionalMember);
} else {
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
index 98f75793817..4b4dc853b03 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
@@ -25,6 +25,8 @@
package jdk.javadoc.internal.doclets.formats.html;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+
import java.util.Arrays;
import java.util.List;
@@ -33,11 +35,12 @@ import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
-import jdk.javadoc.internal.doclets.formats.html.TableHeader;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
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.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -108,7 +111,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
public void addAnnotationDetailsTreeHeader(TypeElement te,
Content memberDetailsTree) {
if (!writer.printedAnnotationHeading) {
- memberDetailsTree.addContent(writer.getMarkerAnchor(
+ memberDetailsTree.addContent(links.createAnchor(
SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL));
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
contents.annotationTypeDetailsLabel);
@@ -120,11 +123,11 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
/**
* {@inheritDoc}
*/
- public Content getAnnotationDocTreeHeader(Element member,
- Content annotationDetailsTree) {
+ @Override
+ public Content getAnnotationDocTreeHeader(Element member, Content annotationDetailsTree) {
String simpleName = name(member);
- annotationDetailsTree.addContent(writer.getMarkerAnchor(simpleName +
- utils.signature((ExecutableElement) member)));
+ annotationDetailsTree.addContent(links.createAnchor(
+ simpleName + utils.signature((ExecutableElement) member)));
Content annotationDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
heading.addContent(simpleName);
@@ -203,34 +206,54 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
}
/**
- * {@inheritDoc}
+ * Get the summary for the member summary table.
+ *
+ * @return a string for the table summary
*/
- public String getTableSummary() {
- return configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Annotation_Type_Required_Member_Summary"),
- configuration.getText("doclet.annotation_type_required_members"));
- }
-
- /**
- * {@inheritDoc}
- */
- public Content getCaption() {
- return configuration.getContent("doclet.Annotation_Type_Required_Members");
+ // Overridden by AnnotationTypeOptionalMemberWriterImpl
+ protected String getTableSummary() {
+ return resources.getText("doclet.Member_Table_Summary",
+ resources.getText("doclet.Annotation_Type_Required_Member_Summary"),
+ resources.getText("doclet.annotation_type_required_members"));
+ }
+
+ /**
+ * Get the caption for the summary table.
+ * @return the caption
+ */
+ // Overridden by AnnotationTypeOptionalMemberWriterImpl
+ protected Content getCaption() {
+ return contents.getContent("doclet.Annotation_Type_Required_Members");
}
/**
* {@inheritDoc}
*/
+ @Override
public TableHeader getSummaryTableHeader(Element member) {
return new TableHeader(contents.modifierAndTypeLabel,
contents.annotationTypeRequiredMemberLabel, contents.descriptionLabel);
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Table createSummaryTable() {
+ return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
+ .setSummary(getTableSummary())
+ .setCaption(getCaption())
+ .setHeader(getSummaryTableHeader(typeElement))
+ .setRowScopeColumn(1)
+ .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast)
+ .setUseTBody(false); // temporary? compatibility mode for TBody
+ }
+
/**
* {@inheritDoc}
*/
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
- memberTree.addContent(writer.getMarkerAnchor(
+ memberTree.addContent(links.createAnchor(
SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY));
}
@@ -285,7 +308,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
*/
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
if (link) {
- return writer.getHyperLink(
+ return Links.createLink(
SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY,
contents.navAnnotationTypeRequiredMember);
} else {
@@ -298,7 +321,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
*/
protected void addNavDetailLink(boolean link, Content liNav) {
if (link) {
- liNav.addContent(writer.getHyperLink(
+ liNav.addContent(Links.createLink(
SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL,
contents.navAnnotationTypeMember));
} else {
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
index a0e3f7e31b1..a08a61f739b 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
@@ -37,6 +37,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
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.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -108,7 +109,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
*/
@Override
protected Content getNavLinkPackage() {
- Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY,
+ Content linkContent = Links.createLink(DocPaths.PACKAGE_SUMMARY,
contents.packageLabel);
Content li = HtmlTree.LI(linkContent);
return li;
@@ -132,7 +133,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
*/
@Override
protected Content getNavLinkClassUse() {
- Content linkContent = getHyperLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
+ Content linkContent = Links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
Content li = HtmlTree.LI(linkContent);
return li;
}
@@ -191,7 +192,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
}
bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
- div.addStyle(HtmlStyle.header);
+ div.setStyle(HtmlStyle.header);
if (configuration.showModules) {
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(annotationType);
Content typeModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel);
@@ -346,7 +347,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
*/
@Override
protected Content getNavLinkTree() {
- Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE,
+ Content treeLinkContent = Links.createLink(DocPaths.PACKAGE_TREE,
contents.treeLabel, "", "");
Content li = HtmlTree.LI(treeLinkContent);
return li;
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
index 7019745e675..93117200375 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
@@ -25,6 +25,8 @@
package jdk.javadoc.internal.doclets.formats.html;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
@@ -45,6 +47,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
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.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
@@ -245,7 +248,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
protected void generateClassUseFile() throws DocFileIOException {
HtmlTree body = getClassUseHeader();
HtmlTree div = new HtmlTree(HtmlTag.DIV);
- div.addStyle(HtmlStyle.classUseContainer);
+ div.setStyle(HtmlStyle.classUseContainer);
if (pkgSet.size() > 0) {
addClassUse(div);
} else {
@@ -276,7 +279,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
*/
protected void addClassUse(Content contentTree) {
HtmlTree ul = new HtmlTree(HtmlTag.UL);
- ul.addStyle(HtmlStyle.blockList);
+ ul.setStyle(HtmlStyle.blockList);
if (configuration.packages.size() > 1) {
addPackageList(ul);
addPackageAnnotationList(ul);
@@ -291,25 +294,19 @@ public class ClassUseWriter extends SubWriterHolderWriter {
* @param contentTree the content tree to which the packages elements will be added
*/
protected void addPackageList(Content contentTree) {
- Content caption = getTableCaption(configuration.getContent(
+ Content caption = getTableCaption(contents.getContent(
"doclet.ClassUse_Packages.that.use.0",
getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement))));
- Content table = (configuration.isOutputHtml5())
- ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
- : HtmlTree.TABLE(HtmlStyle.useSummary, packageUseTableSummary, caption);
- table.addContent(getPackageTableHeader().toContent());
- Content tbody = new HtmlTree(HtmlTag.TBODY);
- boolean altColor = true;
+ Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary)
+ .setSummary(packageUseTableSummary)
+ .setCaption(caption)
+ .setHeader(getPackageTableHeader())
+ .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
for (PackageElement pkg : pkgSet) {
- HtmlTree tr = new HtmlTree(HtmlTag.TR);
- tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
- altColor = !altColor;
- addPackageUse(pkg, tr);
- tbody.addContent(tr);
+ addPackageUse(pkg, table);
}
- table.addContent(tbody);
- Content li = HtmlTree.LI(HtmlStyle.blockList, table);
+ Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
contentTree.addContent(li);
}
@@ -324,30 +321,22 @@ public class ClassUseWriter extends SubWriterHolderWriter {
pkgToPackageAnnotations.isEmpty()) {
return;
}
- Content caption = getTableCaption(configuration.getContent(
+ Content caption = getTableCaption(contents.getContent(
"doclet.ClassUse_PackageAnnotation",
getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement))));
- Content table = (configuration.isOutputHtml5())
- ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
- : HtmlTree.TABLE(HtmlStyle.useSummary, packageUseTableSummary, caption);
- table.addContent(getPackageTableHeader().toContent());
- Content tbody = new HtmlTree(HtmlTag.TBODY);
- boolean altColor = true;
+
+ Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary)
+ .setSummary(packageUseTableSummary)
+ .setCaption(caption)
+ .setHeader(getPackageTableHeader())
+ .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
for (PackageElement pkg : pkgToPackageAnnotations) {
- HtmlTree tr = new HtmlTree(HtmlTag.TR);
- tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
- altColor = !altColor;
- Content thFirst = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, getPackageLink(pkg));
- tr.addContent(thFirst);
- HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
- tdLast.addStyle(HtmlStyle.colLast);
- addSummaryComment(pkg, tdLast);
- tr.addContent(tdLast);
- tbody.addContent(tr);
+ Content summary = new ContentBuilder();
+ addSummaryComment(pkg, summary);
+ table.addRow(getPackageLink(pkg), summary);
}
- table.addContent(tbody);
- Content li = HtmlTree.LI(HtmlStyle.blockList, table);
+ Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
contentTree.addContent(li);
}
@@ -358,9 +347,9 @@ public class ClassUseWriter extends SubWriterHolderWriter {
*/
protected void addClassList(Content contentTree) {
HtmlTree ul = new HtmlTree(HtmlTag.UL);
- ul.addStyle(HtmlStyle.blockList);
+ ul.setStyle(HtmlStyle.blockList);
for (PackageElement pkg : pkgSet) {
- Content markerAnchor = getMarkerAnchor(getPackageAnchorName(pkg));
+ Content markerAnchor = links.createAnchor(getPackageAnchorName(pkg));
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION))
? HtmlTree.SECTION(markerAnchor)
: HtmlTree.LI(HtmlStyle.blockList, markerAnchor);
@@ -385,16 +374,14 @@ public class ClassUseWriter extends SubWriterHolderWriter {
* Add the package use information.
*
* @param pkg the package that uses the given class
- * @param contentTree the content tree to which the package use information will be added
+ * @param table the table to which the package use information will be added
*/
- protected void addPackageUse(PackageElement pkg, Content contentTree) {
- Content thFirst = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst,
- getHyperLink(getPackageAnchorName(pkg), new StringContent(utils.getPackageName(pkg))));
- contentTree.addContent(thFirst);
- HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
- tdLast.addStyle(HtmlStyle.colLast);
- addSummaryComment(pkg, tdLast);
- contentTree.addContent(tdLast);
+ protected void addPackageUse(PackageElement pkg, Table table) {
+ Content pkgLink =
+ links.createLink(getPackageAnchorName(pkg), new StringContent(utils.getPackageName(pkg)));
+ Content summary = new ContentBuilder();
+ addSummaryComment(pkg, summary);
+ table.addRow(pkgLink, summary);
}
/**
@@ -528,7 +515,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
*/
protected Content getNavLinkPackage() {
Content linkContent =
- getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), contents.packageLabel);
+ Links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), contents.packageLabel);
Content li = HtmlTree.LI(linkContent);
return li;
}
@@ -563,8 +550,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
*/
protected Content getNavLinkTree() {
Content linkContent = utils.isEnclosingPackageIncluded(typeElement)
- ? getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), contents.treeLabel)
- : getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), contents.treeLabel);
+ ? Links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), contents.treeLabel)
+ : Links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), contents.treeLabel);
Content li = HtmlTree.LI(linkContent);
return li;
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
index 2c73178cff3..ce014d48fcc 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
@@ -40,6 +40,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
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.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.ClassWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -119,7 +120,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
*/
@Override
protected Content getNavLinkPackage() {
- Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY,
+ Content linkContent = Links.createLink(DocPaths.PACKAGE_SUMMARY,
contents.packageLabel);
Content li = HtmlTree.LI(linkContent);
return li;
@@ -143,7 +144,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
*/
@Override
protected Content getNavLinkClassUse() {
- Content linkContent = getHyperLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
+ Content linkContent = Links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
Content li = HtmlTree.LI(linkContent);
return li;
}
@@ -202,7 +203,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
}
bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
- div.addStyle(HtmlStyle.header);
+ div.setStyle(HtmlStyle.header);
if (configuration.showModules) {
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(typeElement);
Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel);
@@ -380,13 +381,13 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
private Content getClassInheritenceTree(TypeMirror type) {
TypeMirror sup;
HtmlTree classTreeUl = new HtmlTree(HtmlTag.UL);
- classTreeUl.addStyle(HtmlStyle.inheritance);
+ classTreeUl.setStyle(HtmlStyle.inheritance);
Content liTree = null;
do {
sup = utils.getFirstVisibleSuperClass(type);
if (sup != null) {
HtmlTree ul = new HtmlTree(HtmlTag.UL);
- ul.addStyle(HtmlStyle.inheritance);
+ ul.setStyle(HtmlStyle.inheritance);
ul.addContent(getTreeForClassHelper(type));
if (liTree != null)
ul.addContent(liTree);
@@ -659,7 +660,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
*/
@Override
protected Content getNavLinkTree() {
- Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE,
+ Content treeLinkContent = Links.createLink(DocPaths.PACKAGE_TREE,
contents.treeLabel, "", "");
Content li = HtmlTree.LI(treeLinkContent);
return li;
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
index 78e234ce9dd..c7b922ae751 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
@@ -25,6 +25,9 @@
package jdk.javadoc.internal.doclets.formats.html;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
+
import java.util.*;
import javax.lang.model.element.Modifier;
@@ -37,6 +40,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
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.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.ConstantsSummaryWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -75,7 +79,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
/**
* The HTML tree for main tag.
*/
- private HtmlTree mainTree = HtmlTree.MAIN();
+ private final HtmlTree mainTree = HtmlTree.MAIN();
/**
* The HTML tree for constant values summary.
@@ -99,6 +103,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
/**
* {@inheritDoc}
*/
+ @Override
public Content getHeader() {
String label = configuration.getText("doclet.Constants_Summary");
HtmlTree bodyTree = getBody(true, getWindowTitle(label));
@@ -116,6 +121,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
/**
* {@inheritDoc}
*/
+ @Override
public Content getContentsHeader() {
return new HtmlTree(HtmlTag.UL);
}
@@ -123,19 +129,19 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
/**
* {@inheritDoc}
*/
+ @Override
public void addLinkToPackageContent(PackageElement pkg,
Set