diff --git a/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java b/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java index 93b0a75e702..31f2f615b01 100644 --- a/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java +++ b/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java @@ -31,6 +31,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class AbsentInformationException extends Exception { private static final long serialVersionUID = 4988939309582416373L; diff --git a/jdk/src/share/classes/com/sun/jdi/Accessible.java b/jdk/src/share/classes/com/sun/jdi/Accessible.java index 7eb8dbb154e..4ad4d3b03d8 100644 --- a/jdk/src/share/classes/com/sun/jdi/Accessible.java +++ b/jdk/src/share/classes/com/sun/jdi/Accessible.java @@ -36,6 +36,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Accessible { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ArrayReference.java b/jdk/src/share/classes/com/sun/jdi/ArrayReference.java index f450931f66c..87ee9577b9d 100644 --- a/jdk/src/share/classes/com/sun/jdi/ArrayReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ArrayReference.java @@ -39,6 +39,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ArrayReference extends ObjectReference { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ArrayType.java b/jdk/src/share/classes/com/sun/jdi/ArrayType.java index fb5b2da9a56..fc209fa11b7 100644 --- a/jdk/src/share/classes/com/sun/jdi/ArrayType.java +++ b/jdk/src/share/classes/com/sun/jdi/ArrayType.java @@ -38,6 +38,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ArrayType extends ReferenceType { /** diff --git a/jdk/src/share/classes/com/sun/jdi/BooleanType.java b/jdk/src/share/classes/com/sun/jdi/BooleanType.java index ae7bbb9532d..adbb49edbbb 100644 --- a/jdk/src/share/classes/com/sun/jdi/BooleanType.java +++ b/jdk/src/share/classes/com/sun/jdi/BooleanType.java @@ -35,5 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface BooleanType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/BooleanValue.java b/jdk/src/share/classes/com/sun/jdi/BooleanValue.java index 02aa89aa3ac..d360e80008e 100644 --- a/jdk/src/share/classes/com/sun/jdi/BooleanValue.java +++ b/jdk/src/share/classes/com/sun/jdi/BooleanValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface BooleanValue extends PrimitiveValue -{ +@jdk.Exported +public interface BooleanValue extends PrimitiveValue { + /** * Returns this BooleanValue as a boolean. * diff --git a/jdk/src/share/classes/com/sun/jdi/Bootstrap.java b/jdk/src/share/classes/com/sun/jdi/Bootstrap.java index e4c0f95679f..ca449dd0252 100644 --- a/jdk/src/share/classes/com/sun/jdi/Bootstrap.java +++ b/jdk/src/share/classes/com/sun/jdi/Bootstrap.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @since 1.3 */ +@jdk.Exported public class Bootstrap extends Object { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ByteType.java b/jdk/src/share/classes/com/sun/jdi/ByteType.java index be8efa866da..87da248a656 100644 --- a/jdk/src/share/classes/com/sun/jdi/ByteType.java +++ b/jdk/src/share/classes/com/sun/jdi/ByteType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface ByteType extends PrimitiveType -{ +@jdk.Exported +public interface ByteType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/ByteValue.java b/jdk/src/share/classes/com/sun/jdi/ByteValue.java index 4e4a8992abe..b7fc08bc786 100644 --- a/jdk/src/share/classes/com/sun/jdi/ByteValue.java +++ b/jdk/src/share/classes/com/sun/jdi/ByteValue.java @@ -33,8 +33,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface ByteValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface ByteValue extends PrimitiveValue, Comparable { + /** * Returns this ByteValue as a byte. * diff --git a/jdk/src/share/classes/com/sun/jdi/CharType.java b/jdk/src/share/classes/com/sun/jdi/CharType.java index 0174c0d3907..cdcf036efc5 100644 --- a/jdk/src/share/classes/com/sun/jdi/CharType.java +++ b/jdk/src/share/classes/com/sun/jdi/CharType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface CharType extends PrimitiveType -{ +@jdk.Exported +public interface CharType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/CharValue.java b/jdk/src/share/classes/com/sun/jdi/CharValue.java index 87a9d44bad5..6909fb96ea7 100644 --- a/jdk/src/share/classes/com/sun/jdi/CharValue.java +++ b/jdk/src/share/classes/com/sun/jdi/CharValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface CharValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface CharValue extends PrimitiveValue, Comparable { + /** * Returns this CharValue as a char. * diff --git a/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java b/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java index 11edb716c41..8e511d893be 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java @@ -39,6 +39,7 @@ import java.util.List; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface ClassLoaderReference extends ObjectReference { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java b/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java index 97732769844..debc3bd47fc 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java @@ -67,6 +67,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class ClassNotLoadedException extends Exception { private static final long serialVersionUID = -6242978768444298722L; diff --git a/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java b/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java index 538bc827256..a26f93d4987 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class ClassNotPreparedException extends RuntimeException { private static final long serialVersionUID = -6120698967144079642L; public ClassNotPreparedException() diff --git a/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java b/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java index f6fa3867fa2..d008379d3a7 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java @@ -35,6 +35,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface ClassObjectReference extends ObjectReference { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ClassType.java b/jdk/src/share/classes/com/sun/jdi/ClassType.java index 73e94f10de8..73720245d39 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassType.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassType.java @@ -41,6 +41,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ClassType extends ReferenceType { /** * Gets the superclass of this class. diff --git a/jdk/src/share/classes/com/sun/jdi/DoubleType.java b/jdk/src/share/classes/com/sun/jdi/DoubleType.java index a585f45bbbe..7898aa4c8b3 100644 --- a/jdk/src/share/classes/com/sun/jdi/DoubleType.java +++ b/jdk/src/share/classes/com/sun/jdi/DoubleType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface DoubleType extends PrimitiveType -{ +@jdk.Exported +public interface DoubleType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/DoubleValue.java b/jdk/src/share/classes/com/sun/jdi/DoubleValue.java index fccff0dbbde..529e23305e9 100644 --- a/jdk/src/share/classes/com/sun/jdi/DoubleValue.java +++ b/jdk/src/share/classes/com/sun/jdi/DoubleValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface DoubleValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface DoubleValue extends PrimitiveValue, Comparable { + /** * Returns this DoubleValue as a double. * diff --git a/jdk/src/share/classes/com/sun/jdi/Field.java b/jdk/src/share/classes/com/sun/jdi/Field.java index fea18a9598e..5e5dff2e9ed 100644 --- a/jdk/src/share/classes/com/sun/jdi/Field.java +++ b/jdk/src/share/classes/com/sun/jdi/Field.java @@ -38,6 +38,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Field extends TypeComponent, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/FloatType.java b/jdk/src/share/classes/com/sun/jdi/FloatType.java index c0de125200b..e0d3d4824b0 100644 --- a/jdk/src/share/classes/com/sun/jdi/FloatType.java +++ b/jdk/src/share/classes/com/sun/jdi/FloatType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface FloatType extends PrimitiveType -{ +@jdk.Exported +public interface FloatType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/FloatValue.java b/jdk/src/share/classes/com/sun/jdi/FloatValue.java index 07937d27663..273451b1406 100644 --- a/jdk/src/share/classes/com/sun/jdi/FloatValue.java +++ b/jdk/src/share/classes/com/sun/jdi/FloatValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface FloatValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface FloatValue extends PrimitiveValue, Comparable { + /** * Returns this FloatValue as a float. * diff --git a/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java b/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java index 01b7c713692..ccb5c99e52c 100644 --- a/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java +++ b/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java @@ -32,16 +32,15 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ -public class IncompatibleThreadStateException extends Exception -{ +@jdk.Exported +public class IncompatibleThreadStateException extends Exception { private static final long serialVersionUID = 6199174323414551389L; - public IncompatibleThreadStateException() - { + + public IncompatibleThreadStateException() { super(); } - public IncompatibleThreadStateException(String s) - { + public IncompatibleThreadStateException(String s) { super(s); } } diff --git a/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java b/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java index a7caff8f579..deaa41e15df 100644 --- a/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java +++ b/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class InconsistentDebugInfoException extends RuntimeException { private static final long serialVersionUID = 7964236415376861808L; public InconsistentDebugInfoException() { diff --git a/jdk/src/share/classes/com/sun/jdi/IntegerType.java b/jdk/src/share/classes/com/sun/jdi/IntegerType.java index 03601a5e9f6..8142ed49ec6 100644 --- a/jdk/src/share/classes/com/sun/jdi/IntegerType.java +++ b/jdk/src/share/classes/com/sun/jdi/IntegerType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface IntegerType extends PrimitiveType -{ +@jdk.Exported +public interface IntegerType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/IntegerValue.java b/jdk/src/share/classes/com/sun/jdi/IntegerValue.java index 89b7defaa48..4cdd3520cbb 100644 --- a/jdk/src/share/classes/com/sun/jdi/IntegerValue.java +++ b/jdk/src/share/classes/com/sun/jdi/IntegerValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface IntegerValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface IntegerValue extends PrimitiveValue, Comparable { + /** * Returns this IntegerValue as an int. * diff --git a/jdk/src/share/classes/com/sun/jdi/InterfaceType.java b/jdk/src/share/classes/com/sun/jdi/InterfaceType.java index 94a26e04a8a..e2c28ec24cb 100644 --- a/jdk/src/share/classes/com/sun/jdi/InterfaceType.java +++ b/jdk/src/share/classes/com/sun/jdi/InterfaceType.java @@ -43,6 +43,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface InterfaceType extends ReferenceType { /** * Gets the interfaces directly extended by this interface. diff --git a/jdk/src/share/classes/com/sun/jdi/InternalException.java b/jdk/src/share/classes/com/sun/jdi/InternalException.java index 668a4bcc98c..706bc65810d 100644 --- a/jdk/src/share/classes/com/sun/jdi/InternalException.java +++ b/jdk/src/share/classes/com/sun/jdi/InternalException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class InternalException extends RuntimeException { private static final long serialVersionUID = -9171606393104480607L; private int errorCode; diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java b/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java index 357f6c5e2a8..bae0b071e43 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported @Deprecated public class InvalidCodeIndexException extends RuntimeException { private static final long serialVersionUID = 7416010225133747805L; diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java b/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java index acf530cc73f..38a0980a933 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported @Deprecated public class InvalidLineNumberException extends RuntimeException { private static final long serialVersionUID = 4048709912372692875L; diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java b/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java index 8bcca8eb269..696d21d4431 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class InvalidStackFrameException extends RuntimeException { private static final long serialVersionUID = -1919378296505827922L; public InvalidStackFrameException() { diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java b/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java index 20d0f488568..9671dfd3b1f 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java @@ -32,16 +32,15 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public class InvalidTypeException extends Exception -{ +@jdk.Exported +public class InvalidTypeException extends Exception { private static final long serialVersionUID = 2256667231949650806L; - public InvalidTypeException() - { + + public InvalidTypeException() { super(); } - public InvalidTypeException(String s) - { + public InvalidTypeException(String s) { super(s); } } diff --git a/jdk/src/share/classes/com/sun/jdi/InvocationException.java b/jdk/src/share/classes/com/sun/jdi/InvocationException.java index 565a74dbf2f..89e8763b845 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvocationException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvocationException.java @@ -32,19 +32,17 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ -public class InvocationException extends Exception -{ +@jdk.Exported +public class InvocationException extends Exception { private static final long serialVersionUID = 6066780907971918568L; ObjectReference exception; - public InvocationException(ObjectReference exception) - { + public InvocationException(ObjectReference exception) { super("Exception occurred in target VM"); this.exception = exception; } - public ObjectReference exception() - { + public ObjectReference exception() { return exception; } } diff --git a/jdk/src/share/classes/com/sun/jdi/JDIPermission.java b/jdk/src/share/classes/com/sun/jdi/JDIPermission.java index cb69adf7436..ddcb8f7bf6b 100644 --- a/jdk/src/share/classes/com/sun/jdi/JDIPermission.java +++ b/jdk/src/share/classes/com/sun/jdi/JDIPermission.java @@ -78,6 +78,7 @@ package com.sun.jdi; * */ +@jdk.Exported public final class JDIPermission extends java.security.BasicPermission { private static final long serialVersionUID = -6988461416938786271L; /** diff --git a/jdk/src/share/classes/com/sun/jdi/LocalVariable.java b/jdk/src/share/classes/com/sun/jdi/LocalVariable.java index dc74f911129..60fe24aca32 100644 --- a/jdk/src/share/classes/com/sun/jdi/LocalVariable.java +++ b/jdk/src/share/classes/com/sun/jdi/LocalVariable.java @@ -42,6 +42,7 @@ package com.sun.jdi; * @since 1.3 */ +@jdk.Exported public interface LocalVariable extends Mirror, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/Locatable.java b/jdk/src/share/classes/com/sun/jdi/Locatable.java index a00badf64b0..4cb0ea751e9 100644 --- a/jdk/src/share/classes/com/sun/jdi/Locatable.java +++ b/jdk/src/share/classes/com/sun/jdi/Locatable.java @@ -33,6 +33,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Locatable { /** * Returns the {@link Location} of this mirror, if there diff --git a/jdk/src/share/classes/com/sun/jdi/Location.java b/jdk/src/share/classes/com/sun/jdi/Location.java index a2447285b3e..e3fd4c1687d 100644 --- a/jdk/src/share/classes/com/sun/jdi/Location.java +++ b/jdk/src/share/classes/com/sun/jdi/Location.java @@ -86,6 +86,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Location extends Mirror, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/LongType.java b/jdk/src/share/classes/com/sun/jdi/LongType.java index b27c5d30330..126317c4ecf 100644 --- a/jdk/src/share/classes/com/sun/jdi/LongType.java +++ b/jdk/src/share/classes/com/sun/jdi/LongType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface LongType extends PrimitiveType -{ +@jdk.Exported +public interface LongType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/LongValue.java b/jdk/src/share/classes/com/sun/jdi/LongValue.java index 1dfd41feeb8..1ccd37dfd6b 100644 --- a/jdk/src/share/classes/com/sun/jdi/LongValue.java +++ b/jdk/src/share/classes/com/sun/jdi/LongValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface LongValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface LongValue extends PrimitiveValue, Comparable { + /** * Returns this LongValue as a long. * diff --git a/jdk/src/share/classes/com/sun/jdi/Method.java b/jdk/src/share/classes/com/sun/jdi/Method.java index 2d41b471089..396381f3e7e 100644 --- a/jdk/src/share/classes/com/sun/jdi/Method.java +++ b/jdk/src/share/classes/com/sun/jdi/Method.java @@ -39,6 +39,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Method extends TypeComponent, Locatable, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/Mirror.java b/jdk/src/share/classes/com/sun/jdi/Mirror.java index d821c4faebf..9660ebdcfe9 100644 --- a/jdk/src/share/classes/com/sun/jdi/Mirror.java +++ b/jdk/src/share/classes/com/sun/jdi/Mirror.java @@ -56,6 +56,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java b/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java index fb6557c7461..a35cc403b81 100644 --- a/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java +++ b/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @since 1.6 */ +@jdk.Exported public interface MonitorInfo extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java b/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java index 311fd1f625c..2db8460d03f 100644 --- a/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java +++ b/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class NativeMethodException extends RuntimeException { private static final long serialVersionUID = 3924951669039469992L; diff --git a/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java b/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java index 720690dd1da..29da6d9b08b 100644 --- a/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java +++ b/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class ObjectCollectedException extends RuntimeException { private static final long serialVersionUID = -1928428056197269588L; public ObjectCollectedException() { diff --git a/jdk/src/share/classes/com/sun/jdi/ObjectReference.java b/jdk/src/share/classes/com/sun/jdi/ObjectReference.java index 66e8acf7c47..18710cbab93 100644 --- a/jdk/src/share/classes/com/sun/jdi/ObjectReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ObjectReference.java @@ -55,8 +55,9 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ -public interface ObjectReference extends Value -{ +@jdk.Exported +public interface ObjectReference extends Value { + /** * Gets the {@link ReferenceType} that mirrors the type * of this object. The type may be a subclass or implementor of the diff --git a/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java b/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java index 8c4aae74ef8..e2c9ae79352 100644 --- a/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java +++ b/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java @@ -33,6 +33,7 @@ import java.util.List; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface PathSearchingVirtualMachine extends VirtualMachine { /** * Get the class path for this virtual machine. diff --git a/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java b/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java index ba34a5049a4..3805d6a577d 100644 --- a/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java +++ b/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java @@ -37,5 +37,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface PrimitiveType extends Type { } diff --git a/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java b/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java index 0d9442a38a0..6af5a3311fd 100644 --- a/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java +++ b/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java @@ -35,8 +35,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface PrimitiveValue extends Value -{ +@jdk.Exported +public interface PrimitiveValue extends Value { + /** * Converts this value to a BooleanValue and returns the result * as a boolean. diff --git a/jdk/src/share/classes/com/sun/jdi/ReferenceType.java b/jdk/src/share/classes/com/sun/jdi/ReferenceType.java index 864e368ea76..96973bca203 100644 --- a/jdk/src/share/classes/com/sun/jdi/ReferenceType.java +++ b/jdk/src/share/classes/com/sun/jdi/ReferenceType.java @@ -77,6 +77,7 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ReferenceType extends Type, Comparable, Accessible { diff --git a/jdk/src/share/classes/com/sun/jdi/ShortType.java b/jdk/src/share/classes/com/sun/jdi/ShortType.java index c7b9e8b04dc..87542a1af23 100644 --- a/jdk/src/share/classes/com/sun/jdi/ShortType.java +++ b/jdk/src/share/classes/com/sun/jdi/ShortType.java @@ -35,5 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ShortType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/ShortValue.java b/jdk/src/share/classes/com/sun/jdi/ShortValue.java index 771ef562683..c7011c35a20 100644 --- a/jdk/src/share/classes/com/sun/jdi/ShortValue.java +++ b/jdk/src/share/classes/com/sun/jdi/ShortValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface ShortValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface ShortValue extends PrimitiveValue, Comparable { + /** * Returns this ShortValue as a short. * diff --git a/jdk/src/share/classes/com/sun/jdi/StackFrame.java b/jdk/src/share/classes/com/sun/jdi/StackFrame.java index 40c03021ad2..dc78485aaac 100644 --- a/jdk/src/share/classes/com/sun/jdi/StackFrame.java +++ b/jdk/src/share/classes/com/sun/jdi/StackFrame.java @@ -58,8 +58,9 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ -public interface StackFrame extends Mirror, Locatable -{ +@jdk.Exported +public interface StackFrame extends Mirror, Locatable { + /** * Returns the {@link Location} of the current instruction in the frame. * The method for which this frame was created can also be accessed diff --git a/jdk/src/share/classes/com/sun/jdi/StringReference.java b/jdk/src/share/classes/com/sun/jdi/StringReference.java index a149768f18a..e32b442a9de 100644 --- a/jdk/src/share/classes/com/sun/jdi/StringReference.java +++ b/jdk/src/share/classes/com/sun/jdi/StringReference.java @@ -35,8 +35,8 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface StringReference extends ObjectReference -{ +@jdk.Exported +public interface StringReference extends ObjectReference { /** * Returns the StringReference as a String. The returned string * is the equivalent of the mirrored string, but is an entity in the diff --git a/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java b/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java index 8bf631d7ec4..ca13fc363b5 100644 --- a/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java @@ -37,8 +37,9 @@ import java.util.List; * @author James McIlree * @since 1.3 */ -public interface ThreadGroupReference extends ObjectReference -{ +@jdk.Exported +public interface ThreadGroupReference extends ObjectReference { + /** * Returns the name of this thread group. * diff --git a/jdk/src/share/classes/com/sun/jdi/ThreadReference.java b/jdk/src/share/classes/com/sun/jdi/ThreadReference.java index 235ab291f87..a082ddf580e 100644 --- a/jdk/src/share/classes/com/sun/jdi/ThreadReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ThreadReference.java @@ -36,8 +36,8 @@ import java.util.List; * @author James McIlree * @since 1.3 */ -public interface ThreadReference extends ObjectReference -{ +@jdk.Exported +public interface ThreadReference extends ObjectReference { /** Thread status is unknown */ public final int THREAD_STATUS_UNKNOWN =-1; /** Thread has completed execution */ diff --git a/jdk/src/share/classes/com/sun/jdi/Type.java b/jdk/src/share/classes/com/sun/jdi/Type.java index 3f216e5bc44..fdcccd495fa 100644 --- a/jdk/src/share/classes/com/sun/jdi/Type.java +++ b/jdk/src/share/classes/com/sun/jdi/Type.java @@ -127,8 +127,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface Type extends Mirror -{ +@jdk.Exported +public interface Type extends Mirror { + /** * Returns the JNI-style signature for this type. *

diff --git a/jdk/src/share/classes/com/sun/jdi/TypeComponent.java b/jdk/src/share/classes/com/sun/jdi/TypeComponent.java index 5f2a192803d..5354a675ce7 100644 --- a/jdk/src/share/classes/com/sun/jdi/TypeComponent.java +++ b/jdk/src/share/classes/com/sun/jdi/TypeComponent.java @@ -44,6 +44,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface TypeComponent extends Mirror, Accessible { /** diff --git a/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java b/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java index 36e424bd689..b5f354aedfb 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Jim Holmlund * @since 1.5 */ +@jdk.Exported public class VMCannotBeModifiedException extends UnsupportedOperationException { private static final long serialVersionUID = -4063879815130164009L; public VMCannotBeModifiedException() { diff --git a/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java b/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java index bf78d851989..888308ca4dd 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java @@ -33,6 +33,7 @@ package com.sun.jdi; * @author Robert Field * @since 1.3 */ +@jdk.Exported public class VMDisconnectedException extends RuntimeException { private static final long serialVersionUID = 2892975269768351637L; diff --git a/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java b/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java index c4e19acabe8..90c0232fd4e 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java @@ -33,6 +33,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class VMMismatchException extends RuntimeException { private static final long serialVersionUID = 289169358790459564L; public VMMismatchException() { diff --git a/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java b/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java index 1848d22c854..afb8235fb92 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class VMOutOfMemoryException extends RuntimeException { private static final long serialVersionUID = 71504228548910686L; public VMOutOfMemoryException() { diff --git a/jdk/src/share/classes/com/sun/jdi/Value.java b/jdk/src/share/classes/com/sun/jdi/Value.java index 316f4b8b97b..582f439f701 100644 --- a/jdk/src/share/classes/com/sun/jdi/Value.java +++ b/jdk/src/share/classes/com/sun/jdi/Value.java @@ -168,8 +168,8 @@ package com.sun.jdi; * @since 1.3 */ -public interface Value extends Mirror -{ +@jdk.Exported +public interface Value extends Mirror { /** * Returns the run-time type of this value. * diff --git a/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java b/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java index 38faf903176..096465acbbf 100644 --- a/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java +++ b/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java @@ -70,6 +70,7 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface VirtualMachine extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java b/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java index 5af1776d5fb..a388086c9e0 100644 --- a/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java +++ b/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java @@ -271,6 +271,7 @@ import java.io.IOException; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface VirtualMachineManager { /** diff --git a/jdk/src/share/classes/com/sun/jdi/VoidType.java b/jdk/src/share/classes/com/sun/jdi/VoidType.java index 4a976e84920..85671b4cee0 100644 --- a/jdk/src/share/classes/com/sun/jdi/VoidType.java +++ b/jdk/src/share/classes/com/sun/jdi/VoidType.java @@ -35,5 +35,6 @@ package com.sun.jdi; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VoidType extends Type { } diff --git a/jdk/src/share/classes/com/sun/jdi/VoidValue.java b/jdk/src/share/classes/com/sun/jdi/VoidValue.java index 8a8a79e465c..74fee8dfd39 100644 --- a/jdk/src/share/classes/com/sun/jdi/VoidValue.java +++ b/jdk/src/share/classes/com/sun/jdi/VoidValue.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VoidValue extends Value { /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java b/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java index 8b846137d57..9343795f846 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java @@ -35,6 +35,7 @@ import java.io.IOException; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface AttachingConnector extends Connector { /** * Attaches to a running application and and returns a diff --git a/jdk/src/share/classes/com/sun/jdi/connect/Connector.java b/jdk/src/share/classes/com/sun/jdi/connect/Connector.java index e817c446eb4..f6bd8060656 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/Connector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/Connector.java @@ -45,6 +45,7 @@ import java.io.Serializable; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface Connector { /** * Returns a short identifier for the connector. Connector implementors @@ -91,6 +92,7 @@ public interface Connector { * {@link Connector.IntegerArgument}, * or {@link Connector.SelectedArgument}. */ + @jdk.Exported public interface Argument extends Serializable { /** * Returns a short, unique identifier for the argument. @@ -156,6 +158,7 @@ public interface Connector { * whose value is Boolean. Boolean values are represented * by the localized versions of the strings "true" and "false". */ + @jdk.Exported public interface BooleanArgument extends Argument { /** * Sets the value of the argument. @@ -196,6 +199,7 @@ public interface Connector { * whose value is an integer. Integer values are represented * by their corresponding strings. */ + @jdk.Exported public interface IntegerArgument extends Argument { /** * Sets the value of the argument. @@ -257,6 +261,7 @@ public interface Connector { * Specification for and value of a Connector argument, * whose value is a String. */ + @jdk.Exported public interface StringArgument extends Argument { /** * Performs basic sanity check of argument. @@ -269,6 +274,7 @@ public interface Connector { * Specification for and value of a Connector argument, * whose value is a String selected from a list of choices. */ + @jdk.Exported public interface SelectedArgument extends Argument { /** * Return the possible values for the argument diff --git a/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java b/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java index fd45b15eb3c..27c49744252 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java @@ -36,8 +36,9 @@ import java.util.Collections; * @author Gordon Hirsch * @since 1.3 */ -public class IllegalConnectorArgumentsException extends Exception -{ +@jdk.Exported +public class IllegalConnectorArgumentsException extends Exception { + private static final long serialVersionUID = -3042212603611350941L; List names; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java b/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java index 206c8aafa19..dc636ed7e79 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java @@ -35,6 +35,7 @@ import java.io.IOException; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface LaunchingConnector extends Connector { /** * Launches an application and connects to its VM. Properties diff --git a/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java b/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java index b588875c99b..b6e4f0a2bb7 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java @@ -35,6 +35,7 @@ import com.sun.jdi.VirtualMachine; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface ListeningConnector extends Connector { /** * Indicates whether this listening connector supports multiple diff --git a/jdk/src/share/classes/com/sun/jdi/connect/Transport.java b/jdk/src/share/classes/com/sun/jdi/connect/Transport.java index 266bd8089ab..b271a9692bc 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/Transport.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/Transport.java @@ -42,6 +42,7 @@ import com.sun.jdi.connect.spi.TransportService; // for javadoc * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface Transport { /** * Returns a short identifier for the transport. diff --git a/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java b/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java index fcfc48cf0d6..9ea50ee1e89 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java @@ -54,6 +54,7 @@ package com.sun.jdi.connect; * * @since 1.5 */ +@jdk.Exported public class TransportTimeoutException extends java.io.IOException { private static final long serialVersionUID = 4107035242623365074L; /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java b/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java index 111d48b260c..0163347c2e7 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java @@ -34,8 +34,9 @@ package com.sun.jdi.connect; * @author Gordon Hirsch * @since 1.3 */ -public class VMStartException extends Exception -{ +@jdk.Exported +public class VMStartException extends Exception { + private static final long serialVersionUID = 6408644824640801020L; Process process; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/package-info.java b/jdk/src/share/classes/com/sun/jdi/connect/package-info.java new file mode 100644 index 00000000000..c444b75137a --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/connect/package-info.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package defines connections between the virtual machine + * using the JDI and the target virtual machine. + * In concert with {@link com.sun.jdi.VirtualMachineManager} + * it is the mechanism for launching, attaching, etc to + * target virtual machines. + *

+ * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi.connect; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/package.html b/jdk/src/share/classes/com/sun/jdi/connect/package.html deleted file mode 100644 index 7484ce2ca6e..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/connect/package.html +++ /dev/null @@ -1,43 +0,0 @@ - - -com.sun.jdi.connect description - - - - -This package defines -connections between the virtual machine -using the JDI and the target virtual machine. -In concert with {@link com.sun.jdi.VirtualMachineManager} -it is the mechanism for launching, attaching, etc to -target virtual machines. -

-Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java index 6c172af97ee..bd0a8c4400c 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java @@ -45,6 +45,7 @@ package com.sun.jdi.connect.spi; * * @since 1.5 */ +@jdk.Exported public class ClosedConnectionException extends java.io.IOException { private static final long serialVersionUID = 3877032124297204774L; /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java index 6d87949abb4..d4b1721af64 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java @@ -56,6 +56,7 @@ import java.io.IOException; * @since 1.5 */ +@jdk.Exported public abstract class Connection { /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java index 6db4cfea8e9..297d3e25116 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java @@ -77,6 +77,7 @@ import com.sun.jdi.connect.TransportTimeoutException; * @since 1.5 */ +@jdk.Exported public abstract class TransportService { /** @@ -96,6 +97,7 @@ public abstract class TransportService { /** * The transport service capabilities. */ + @jdk.Exported public static abstract class Capabilities { /** @@ -229,6 +231,7 @@ public abstract class TransportService { * #stopListening stopListening} to stop the transport * service from listening on an address. */ + @jdk.Exported public static abstract class ListenKey { /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/package-info.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/package-info.java new file mode 100644 index 00000000000..956e28dcff8 --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package comprises the interfaces and classes used to + * develop new {@link com.sun.jdi.connect.spi.TransportService} + * implementations. + */ + +@jdk.Exported +package com.sun.jdi.connect.spi; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/package.html b/jdk/src/share/classes/com/sun/jdi/connect/spi/package.html deleted file mode 100644 index 29f98ede107..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/package.html +++ /dev/null @@ -1,35 +0,0 @@ - - - com.sun.jdi.connect.spi description - - - -This package comprises the interfaces and classes used to -develop new {@link com.sun.jdi.connect.spi.TransportService} -implementations. - - diff --git a/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java index 1770fca292d..6bee053ffd0 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java @@ -37,5 +37,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface AccessWatchpointEvent extends WatchpointEvent { } diff --git a/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java index 811e6f7f14a..0fbd9cf3d1e 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java @@ -47,6 +47,6 @@ import java.util.List; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface BreakpointEvent extends LocatableEvent { - } diff --git a/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java index 9b57feed2d2..2922ed81435 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java @@ -39,6 +39,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassPrepareEvent extends Event { /** * Returns the thread in which this event has occurred. diff --git a/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java index 8835b1e6e87..1da9da39030 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java @@ -39,6 +39,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassUnloadEvent extends Event { /** * Returns the name of the class that has been unloaded. diff --git a/jdk/src/share/classes/com/sun/jdi/event/Event.java b/jdk/src/share/classes/com/sun/jdi/event/Event.java index ba005734bb9..92c0217431d 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/Event.java +++ b/jdk/src/share/classes/com/sun/jdi/event/Event.java @@ -43,6 +43,7 @@ import com.sun.jdi.request.EventRequest; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface Event extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java b/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java index 220a1e417bd..a66fc850a54 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java +++ b/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java @@ -40,6 +40,7 @@ import java.util.Iterator; * @since 1.3 */ +@jdk.Exported public interface EventIterator extends Iterator { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java b/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java index 4c966a97942..5dde7462154 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java +++ b/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java @@ -57,6 +57,7 @@ import com.sun.jdi.*; * @since 1.3 */ +@jdk.Exported public interface EventQueue extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/EventSet.java b/jdk/src/share/classes/com/sun/jdi/event/EventSet.java index 26efafc1899..63efacf2d51 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/EventSet.java +++ b/jdk/src/share/classes/com/sun/jdi/event/EventSet.java @@ -127,6 +127,7 @@ import java.util.Set; * @since 1.3 */ +@jdk.Exported public interface EventSet extends Mirror, Set { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java index 89cb4667d17..1a03bb6cdf3 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ExceptionEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java b/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java index d7f66054e22..66a2070ae19 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java @@ -36,6 +36,7 @@ import java.util.List; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface LocatableEvent extends Event, Locatable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java index 963b4e6657a..2f48a4a69b9 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodEntryEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java index e492cc4d852..7a08790d080 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java @@ -40,6 +40,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodExitEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java index 32d637d2891..9531ad4ee16 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ModificationWatchpointEvent extends WatchpointEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java index 9f22f9aa57d..338ac38f25e 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java @@ -40,6 +40,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnterEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java index 0b4ba8171f9..1c9835b9634 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java @@ -39,6 +39,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnteredEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java index 7d3d717526b..d8630df1e7f 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java index f9b14ca3573..b458ad6d68f 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitedEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java b/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java index e6a5f7510a5..ebeadfffd7b 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java @@ -46,6 +46,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface StepEvent extends LocatableEvent { - } diff --git a/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java index 01f4b04b416..f998e6da724 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadDeathEvent extends Event { /** * Returns the thread which is terminating. diff --git a/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java index 5be5d0ff2e4..7730e9a5225 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java @@ -52,6 +52,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadStartEvent extends Event { /** * Returns the thread which has started. diff --git a/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java b/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java index 7225ae028e1..a6decf00c03 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java @@ -68,5 +68,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VMDeathEvent extends Event { } diff --git a/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java b/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java index 8301d78c0f3..55a928c1010 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java @@ -52,5 +52,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VMDisconnectEvent extends Event { } diff --git a/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java b/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java index cf500a28de7..3172bc74aeb 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VMStartEvent extends Event { /** * Returns the initial thread of the VM which has started. diff --git a/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java index d60908f897e..9cb5d5d4f6f 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java @@ -37,6 +37,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface WatchpointEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/package-info.java b/jdk/src/share/classes/com/sun/jdi/event/package-info.java new file mode 100644 index 00000000000..fa9afe3346a --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/event/package-info.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package defines JDI events and event processing. + * An {@link com.sun.jdi.event.Event} is always a member of an + * {@link com.sun.jdi.event.EventSet}, which + * is retrieved from the {@link com.sun.jdi.event.EventQueue}. + * Examples of Events include + * {@link com.sun.jdi.event.BreakpointEvent "breakpoints events"}, + * {@link com.sun.jdi.event.ThreadStartEvent "thread creation events"} and + * {@link com.sun.jdi.event.VMDeathEvent "virtual machine death event"}. + * With the exception + * of termination events, all events received must be requested with an + * {@link com.sun.jdi.request.EventRequest "EventRequest"}. The + * {@link com.sun.jdi.request} package defines event requests and event + * request management. + *

+ * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi.event; diff --git a/jdk/src/share/classes/com/sun/jdi/event/package.html b/jdk/src/share/classes/com/sun/jdi/event/package.html deleted file mode 100644 index 521a8b7c85f..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/event/package.html +++ /dev/null @@ -1,49 +0,0 @@ - - - com.sun.jdi.event description - - - -This package defines JDI events and event processing. -An {@link com.sun.jdi.event.Event} is always a member of an -{@link com.sun.jdi.event.EventSet}, which -is retrieved from the {@link com.sun.jdi.event.EventQueue}. -Examples of Events include -{@link com.sun.jdi.event.BreakpointEvent "breakpoints events"}, -{@link com.sun.jdi.event.ThreadStartEvent "thread creation events"} and -{@link com.sun.jdi.event.VMDeathEvent "virtual machine death event"}. -With the exception -of termination events, all events received must be requested with an -{@link com.sun.jdi.request.EventRequest "EventRequest"}. The -{@link com.sun.jdi.request} package defines event requests and event -request management. -

-Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jdi/package-info.java b/jdk/src/share/classes/com/sun/jdi/package-info.java new file mode 100644 index 00000000000..00f422fd702 --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/package-info.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This is the core package of the Java Debug + * Interface (JDI), it defines mirrors for values, types, and the target + * VirtualMachine itself - as well bootstrapping facilities. + * {@link com.sun.jdi.VirtualMachine} mirrors the target virtual machine and + * is the origin of all information provided by the JDI. A VirtualMachine + * is typically created by using the + * {@link com.sun.jdi.VirtualMachineManager} to create + * a connection to the target virtual machine (see the + * {@link com.sun.jdi.connect} package). In turn the + * {@link com.sun.jdi.VirtualMachineManager} is typically created by calling + * {@link com.sun.jdi.Bootstrap#virtualMachineManager()}. + *

+ * Most of the methods within this package can throw the unchecked exception + * {@link com.sun.jdi.VMDisconnectedException}. + *

+ * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi; diff --git a/jdk/src/share/classes/com/sun/jdi/package.html b/jdk/src/share/classes/com/sun/jdi/package.html deleted file mode 100644 index 5aee603d981..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/package.html +++ /dev/null @@ -1,50 +0,0 @@ - - - com.sun.jdi package description - - - -This is the core package of the Java Debug -Interface (JDI), it defines mirrors for values, types, and the target -VirtualMachine itself - as well bootstrapping facilities. -{@link com.sun.jdi.VirtualMachine} mirrors the target virtual machine and -is the origin of all information provided by the JDI. A VirtualMachine -is typically created by using the -{@link com.sun.jdi.VirtualMachineManager} to create -a connection to the target virtual machine (see the -{@link com.sun.jdi.connect} package). In turn the -{@link com.sun.jdi.VirtualMachineManager} is typically created by calling -{@link com.sun.jdi.Bootstrap#virtualMachineManager()}. -

-Most of the methods within this package can throw the unchecked exception -{@link com.sun.jdi.VMDisconnectedException}. -

-Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java index 727614774b5..15915252a98 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java @@ -56,5 +56,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface AccessWatchpointRequest extends WatchpointRequest { } diff --git a/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java index d31df572854..6d6ee7d2bfe 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java @@ -46,6 +46,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface BreakpointRequest extends EventRequest, Locatable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java index 19f1bfc1e6a..6089292ced4 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java @@ -47,6 +47,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassPrepareRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java index abad6d319c6..4868b8053ed 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java @@ -46,6 +46,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassUnloadRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java b/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java index 5de664eb367..b50203481c2 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java +++ b/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java @@ -31,16 +31,15 @@ package com.sun.jdi.request; * @author Robert Field * @since 1.3 */ -public class DuplicateRequestException extends RuntimeException -{ +@jdk.Exported +public class DuplicateRequestException extends RuntimeException { private static final long serialVersionUID = -3719784920313411060L; - public DuplicateRequestException() - { + + public DuplicateRequestException() { super(); } - public DuplicateRequestException(String s) - { + public DuplicateRequestException(String s) { super(s); } } diff --git a/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java b/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java index 9b9138e2c29..8b64f1f2457 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java @@ -78,6 +78,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface EventRequest extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java b/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java index e2627de9296..13f03fc5242 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java +++ b/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java @@ -44,6 +44,7 @@ import java.util.List; * @since 1.3 */ +@jdk.Exported public interface EventRequestManager extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java index e7e06bf26de..ddb5d97d81c 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ExceptionRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java b/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java index 8bd3292caa3..619f47bd968 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java +++ b/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java @@ -35,6 +35,7 @@ package com.sun.jdi.request; * @author Robert Field * @since 1.3 */ +@jdk.Exported public class InvalidRequestStateException extends RuntimeException { private static final long serialVersionUID = -3774632428543322148L; public InvalidRequestStateException() diff --git a/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java index 397e97cbdcb..1d98adec192 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodEntryRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java index c6a4649abaa..e0612903e0e 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodExitRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java index 778d5d8ef34..20b5b2320f4 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java @@ -55,5 +55,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ModificationWatchpointRequest extends WatchpointRequest { } diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java index b3edd957ed9..864522cef6c 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnterRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java index 0066f868caa..965df47b8ff 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnteredRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java index 37ce47f1831..35df22578e4 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java index 9fea543e278..ee4982a4767 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitedRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java b/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java index 765fdd02a81..2ea385f45d2 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface StepRequest extends EventRequest { /** Step into any newly pushed frames */ diff --git a/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java index fe9e68a9aca..ac17fa23fc0 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadDeathRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java index 298da9a3941..596c96b329a 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadStartRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java b/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java index c600651c562..86434403439 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java @@ -56,6 +56,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.4 */ +@jdk.Exported public interface VMDeathRequest extends EventRequest { } diff --git a/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java index cafe61dc40f..9c78f75499c 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface WatchpointRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/package-info.java b/jdk/src/share/classes/com/sun/jdi/request/package-info.java new file mode 100644 index 00000000000..add151ddce0 --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/request/package-info.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package is used to request that a JDI + * event be sent under specified conditions. + * With the exception of termination events, which are + * always sent, there is one kind of + * {@link com.sun.jdi.request.EventRequest} for each kind of + * {@link com.sun.jdi.event.Event Event} - for example, + * {@link com.sun.jdi.request.BreakpointRequest} is used to request a + * {@link com.sun.jdi.event.BreakpointEvent BreakpointEvent}. + * Event requests are created by the + * {@link com.sun.jdi.request.EventRequestManager}. + * Events and event processing are defined in the + * {@link com.sun.jdi.event} package. + *

+ * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi.request; diff --git a/jdk/src/share/classes/com/sun/jdi/request/package.html b/jdk/src/share/classes/com/sun/jdi/request/package.html deleted file mode 100644 index c99c1c8e359..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/request/package.html +++ /dev/null @@ -1,48 +0,0 @@ - - - com.sun.jdi.request description - - - -This package is used to request that a JDI -event be sent under specified conditions. -With the exception of termination events, which are -always sent, there is one kind of -{@link com.sun.jdi.request.EventRequest} for each kind of -{@link com.sun.jdi.event.Event Event} - for example, -{@link com.sun.jdi.request.BreakpointRequest} is used to request a -{@link com.sun.jdi.event.BreakpointEvent BreakpointEvent}. -Event requests are created by the -{@link com.sun.jdi.request.EventRequestManager}. -Events and event processing are defined in the -{@link com.sun.jdi.event} package. -

-Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java b/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java index 64fb94b3fb8..b27512020d8 100644 --- a/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java +++ b/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java @@ -85,6 +85,7 @@ import sun.management.GarbageCollectionNotifInfoCompositeData; * **/ +@jdk.Exported public class GarbageCollectionNotificationInfo implements CompositeDataView { private final String gcName; diff --git a/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java b/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java index ad9335f94d0..af574caa43f 100644 --- a/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java +++ b/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java @@ -37,6 +37,7 @@ import javax.management.openmbean.CompositeType; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public interface GarbageCollectorMXBean extends java.lang.management.GarbageCollectorMXBean { diff --git a/jdk/src/share/classes/com/sun/management/GcInfo.java b/jdk/src/share/classes/com/sun/management/GcInfo.java index 5fa897cb1ff..516174a5384 100644 --- a/jdk/src/share/classes/com/sun/management/GcInfo.java +++ b/jdk/src/share/classes/com/sun/management/GcInfo.java @@ -64,6 +64,7 @@ import sun.management.GcInfoBuilder; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public class GcInfo implements CompositeData, CompositeDataView { private final long index; private final long startTime; diff --git a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java index 2fe8835259f..e8a9137a6fa 100644 --- a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java +++ b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java @@ -48,6 +48,7 @@ import java.lang.management.PlatformManagedObject; * * @see ManagementFactory#getPlatformMXBeans(Class) */ +@jdk.Exported public interface HotSpotDiagnosticMXBean extends PlatformManagedObject { /** * Dumps the heap to the outputFile file in the same diff --git a/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java b/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java index d20cd3696f1..57075080ff1 100644 --- a/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java +++ b/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java @@ -39,6 +39,7 @@ package com.sun.management; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public interface OperatingSystemMXBean extends java.lang.management.OperatingSystemMXBean { diff --git a/jdk/src/share/classes/com/sun/management/ThreadMXBean.java b/jdk/src/share/classes/com/sun/management/ThreadMXBean.java index f5a9a5b9a0d..25a59c41017 100644 --- a/jdk/src/share/classes/com/sun/management/ThreadMXBean.java +++ b/jdk/src/share/classes/com/sun/management/ThreadMXBean.java @@ -38,6 +38,7 @@ import java.util.Map; * @since 6u25 */ +@jdk.Exported public interface ThreadMXBean extends java.lang.management.ThreadMXBean { /** * Returns the total CPU time for each thread whose ID is diff --git a/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java b/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java index 20f43bf0bbd..00cb3f4af86 100644 --- a/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java +++ b/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java @@ -32,6 +32,7 @@ package com.sun.management; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public interface UnixOperatingSystemMXBean extends com.sun.management.OperatingSystemMXBean { diff --git a/jdk/src/share/classes/com/sun/management/VMOption.java b/jdk/src/share/classes/com/sun/management/VMOption.java index ba8e1d06fb9..d79bc5b4d67 100644 --- a/jdk/src/share/classes/com/sun/management/VMOption.java +++ b/jdk/src/share/classes/com/sun/management/VMOption.java @@ -52,6 +52,7 @@ import javax.management.openmbean.CompositeData; * @author Mandy Chung * @since 1.6 */ +@jdk.Exported public class VMOption { private String name; private String value; @@ -64,6 +65,7 @@ public class VMOption { * * @since 1.6 */ + @jdk.Exported public enum Origin { /** * The VM option has not been set and its value diff --git a/jdk/src/share/classes/com/sun/management/package-info.java b/jdk/src/share/classes/com/sun/management/package-info.java new file mode 100644 index 00000000000..75808f5c96f --- /dev/null +++ b/jdk/src/share/classes/com/sun/management/package-info.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package contains Oracle Corporation's platform extension to + * the implementation of the + * + * java.lang.management API and also defines the management + * interface for some other components for the platform. + * + *

+ * All platform MBeans are registered in the platform MBeanServer + * which can be obtained via the + * + * java.lang.management.ManagementFactory.getPlatformMBeanServer + * + * @author Mandy Chung + * @since 1.5 + */ + +@jdk.Exported +package com.sun.management; diff --git a/jdk/src/share/classes/com/sun/management/package.html b/jdk/src/share/classes/com/sun/management/package.html deleted file mode 100644 index c26d4309da6..00000000000 --- a/jdk/src/share/classes/com/sun/management/package.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -This package contains Oracle Corporation's platform extension to -the implementation of the - -java.lang.management API and also defines the management -interface for some other components for the platform. - -

-All platform MBeans are registered in the platform MBeanServer -which can be obtained via the - -java.lang.management.ManagementFactory.getPlatformMBeanServer - -@author Mandy Chung -@since 1.5 - - - - - diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java b/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java index c9a0bc3c5ee..ba4aecb3e17 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java @@ -36,6 +36,7 @@ import java.util.*; * Note. This implies that any caching of credentials or other authentication * information must be done outside of this class. */ +@jdk.Exported public abstract class Authenticator { /** @@ -47,6 +48,7 @@ public abstract class Authenticator { * Indicates an authentication failure. The authentication * attempt has completed. */ + @jdk.Exported public static class Failure extends Result { private int responseCode; @@ -68,6 +70,7 @@ public abstract class Authenticator { * authenticated user principal can be acquired by calling * getPrincipal(). */ + @jdk.Exported public static class Success extends Result { private HttpPrincipal principal; @@ -89,6 +92,7 @@ public abstract class Authenticator { * set any necessary response headers in the given HttpExchange * before returning this Retry object. */ + @jdk.Exported public static class Retry extends Result { private int responseCode; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java b/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java index 60ccd3ab73d..09964d5dced 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java @@ -33,6 +33,7 @@ import java.util.Base64; * to provide an implementation of {@link #checkCredentials(String,String)} * which is called to verify each incoming request. */ +@jdk.Exported public abstract class BasicAuthenticator extends Authenticator { protected String realm; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Filter.java b/jdk/src/share/classes/com/sun/net/httpserver/Filter.java index 7431453f85e..01fd7b694da 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Filter.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Filter.java @@ -39,6 +39,7 @@ import java.util.*; * exchange handler. * @since 1.6 */ +@jdk.Exported public abstract class Filter { protected Filter () {} @@ -48,6 +49,7 @@ public abstract class Filter { * Each filter in the chain is given one of these * so it can invoke the next filter in the chain */ + @jdk.Exported public static class Chain { /* the last element in the chain must invoke the users * handler diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java index afe3c217d41..c33e250d32b 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java @@ -58,6 +58,7 @@ import java.util.*; * as a header line containing the key but no associated value. * @since 1.6 */ +@jdk.Exported public class Headers implements Map> { HashMap> map; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java index d42833c6689..b145813abb9 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java @@ -40,6 +40,7 @@ import java.util.*; * context can be pre- and post-processed by each Filter in the chain. * @since 1.6 */ +@jdk.Exported public abstract class HttpContext { protected HttpContext () { diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java index 1754fe30bb6..2ceacf764ae 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -65,6 +65,7 @@ import sun.net.www.MessageHeader; * @since 1.6 */ +@jdk.Exported public abstract class HttpExchange { protected HttpExchange () { diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java index 54c69cb464d..3611d67c429 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java @@ -32,6 +32,7 @@ import java.io.IOException; * HTTP exchange is handled by one of these handlers. * @since 1.6 */ +@jdk.Exported public interface HttpHandler { /** * Handle the given request and generate an appropriate response. diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java index 2a2f6e93249..e34eccb173f 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java @@ -33,6 +33,7 @@ import java.security.Principal; * Represents a user authenticated by HTTP Basic or Digest * authentication. */ +@jdk.Exported public class HttpPrincipal implements Principal { private String username, realm; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java index e24b133134d..21dfe413f30 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java @@ -87,6 +87,7 @@ import com.sun.net.httpserver.spi.HttpServerProvider; * @since 1.6 */ +@jdk.Exported public abstract class HttpServer { /** diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java index 2543a157a4d..f15c8a9a84e 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java @@ -67,6 +67,7 @@ import javax.net.ssl.*; * * @since 1.6 */ +@jdk.Exported public class HttpsConfigurator { private SSLContext context; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java index 807bb51c4d6..1893b1de1fc 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java @@ -39,6 +39,7 @@ import java.util.*; * @since 1.6 */ +@jdk.Exported public abstract class HttpsExchange extends HttpExchange { protected HttpsExchange () { diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java index d740c11b52f..70df374dad3 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java @@ -49,6 +49,7 @@ import javax.net.ssl.SSLParameters; * are used, and any settings made in this object are ignored. * @since 1.6 */ +@jdk.Exported public abstract class HttpsParameters { private String[] cipherSuites; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java index dbcdd9f60ba..b4a0a58fef4 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java @@ -45,6 +45,7 @@ import com.sun.net.httpserver.spi.*; * @since 1.6 */ +@jdk.Exported public abstract class HttpsServer extends HttpServer { /** diff --git a/jdk/src/share/classes/com/sun/net/httpserver/package-info.java b/jdk/src/share/classes/com/sun/net/httpserver/package-info.java index 859746cb362..ebe76e5fdfe 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/package-info.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/package-info.java @@ -123,4 +123,5 @@

@since 1.6 */ +@jdk.Exported package com.sun.net.httpserver; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java b/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java index 080420b6285..affd8ab2aa0 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java @@ -40,6 +40,7 @@ import com.sun.net.httpserver.*; * {@link HttpServer} and associated classes. Applications do not normally use * this class. See {@link #provider()} for how providers are found and loaded. */ +@jdk.Exported public abstract class HttpServerProvider { /** diff --git a/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java b/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java index 9f85747317d..f4d244a9995 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java @@ -24,7 +24,8 @@ */ /** - Provides a pluggable service provider interface, which allows the HTTP server - implementation to be replaced with other implementations. -*/ + * Provides a pluggable service provider interface, which allows the HTTP server + * implementation to be replaced with other implementations. + */ +@jdk.Exported package com.sun.net.httpserver.spi; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java b/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java index 6240c6c9189..d11cc16fb21 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java @@ -39,6 +39,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class AbstractNotificationHandler implements NotificationHandler { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/Association.java b/jdk/src/share/classes/com/sun/nio/sctp/Association.java index 965feae3418..01cc82deecc 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/Association.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/Association.java @@ -51,6 +51,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class Association { private final int associationID; private final int maxInStreams; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java index 5e8b29d4398..ff41b472d4b 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java @@ -29,6 +29,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public abstract class AssociationChangeNotification implements Notification { @@ -37,6 +38,7 @@ public abstract class AssociationChangeNotification * * @since 1.7 */ + @jdk.Exported public enum AssocChangeEvent { /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java b/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java index 7301b45fb0e..42dd17fde42 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java @@ -34,6 +34,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public enum HandlerResult { /** * Try to receieve another message or notification. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java b/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java index b5a4137054d..dec6382b5a1 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java @@ -31,6 +31,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class IllegalReceiveException extends IllegalStateException { private static final long serialVersionUID = 2296619040988576224L; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java b/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java index 4088df34687..dc965d626cd 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java @@ -31,6 +31,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class IllegalUnbindException extends IllegalStateException { private static final long serialVersionUID = -310540883995532224L; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java b/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java index abe49f24593..c331b25d681 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java @@ -30,6 +30,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class InvalidStreamException extends IllegalArgumentException { private static final long serialVersionUID = -9172703378046665558L; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java index 997c6253834..a63f909aa04 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java @@ -56,6 +56,7 @@ import java.net.SocketAddress; * * @since 1.7 */ +@jdk.Exported public abstract class MessageInfo { /** * Initializes a new instance of this class. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/Notification.java b/jdk/src/share/classes/com/sun/nio/sctp/Notification.java index 2436fae7ba7..8c20103735a 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/Notification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/Notification.java @@ -37,6 +37,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public interface Notification { /** * Returns the association that this notification is applicable to. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java b/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java index f5af2b227e2..f95d9ec5ab3 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java @@ -49,6 +49,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public interface NotificationHandler { /** * Invoked when a notification is received from the SCTP stack. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java index d8afdcd957a..e05c8bb0277 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java @@ -32,6 +32,7 @@ import java.net.SocketAddress; * * @since 1.7 */ +@jdk.Exported public abstract class PeerAddressChangeNotification implements Notification { @@ -46,6 +47,7 @@ public abstract class PeerAddressChangeNotification * * @since 1.7 */ + @jdk.Exported public enum AddressChangeEvent { /** * This address is now reachable. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java index 22cf07650f4..52709b07e9d 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java @@ -134,6 +134,7 @@ import java.nio.channels.SelectionKey; * * @since 1.7 */ +@jdk.Exported public abstract class SctpChannel extends AbstractSelectableChannel { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java index 42e56591e43..79c5efba5cc 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java @@ -134,6 +134,7 @@ import java.nio.channels.SelectionKey; * * @since 1.7 */ +@jdk.Exported public abstract class SctpMultiChannel extends AbstractSelectableChannel { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java index c96e516ca4d..a1e7a9a4439 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java @@ -68,6 +68,7 @@ import java.nio.channels.spi.AbstractSelectableChannel; * * @since 1.7 */ +@jdk.Exported public abstract class SctpServerChannel extends AbstractSelectableChannel { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java index 3cccefa4371..783bc56f752 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java @@ -35,4 +35,5 @@ import java.net.SocketOption; * * @see SctpStandardSocketOptions */ +@jdk.Exported public interface SctpSocketOption extends SocketOption { } diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java index 839c73be29b..1ac4c79f5cc 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java @@ -34,6 +34,7 @@ import sun.nio.ch.sctp.SctpStdSocketOption; * * @since 1.7 */ +@jdk.Exported public class SctpStandardSocketOptions { private SctpStandardSocketOptions() {} /** @@ -315,6 +316,7 @@ public class SctpStandardSocketOptions { * * @since 1.7 */ + @jdk.Exported public static class InitMaxStreams { private int maxInStreams; private int maxOutStreams; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java index 2c3bc855d11..8178b3ca63b 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java @@ -37,6 +37,7 @@ import java.net.SocketAddress; * * @since 1.7 */ +@jdk.Exported public abstract class SendFailedNotification implements Notification { /** * Initializes a new instance of this class. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java index 6405752e310..d3556b3a155 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java @@ -32,6 +32,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public abstract class ShutdownNotification implements Notification { /** * Initializes a new instance of this class. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/package-info.java b/jdk/src/share/classes/com/sun/nio/sctp/package-info.java index 7893a4d755f..fe63d18b65b 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/package-info.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/package-info.java @@ -72,4 +72,5 @@ * @since 1.7 */ +@jdk.Exported package com.sun.nio.sctp; diff --git a/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java index 6e067fe723d..e974f2cb833 100644 --- a/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java @@ -45,6 +45,7 @@ import javax.naming.ldap.LdapName; * * @since 1.6 */ +@jdk.Exported public final class LdapPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = 6820120005580754861L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java index 9afbfead1a7..e89e565afd0 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java @@ -45,6 +45,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTDomainPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = -4408637351440771220L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java b/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java index b574f8cde9f..02f9634ef39 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java @@ -31,6 +31,7 @@ package com.sun.security.auth; * */ +@jdk.Exported public class NTNumericCredential { private long impersonationToken; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSid.java b/jdk/src/share/classes/com/sun/security/auth/NTSid.java index 0720c5ec3fb..2c64deb65a6 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSid.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSid.java @@ -47,6 +47,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSid implements Principal, java.io.Serializable { private static final long serialVersionUID = 4412290580770249885L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java index 0182c345dfd..082b9c43379 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java @@ -43,6 +43,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSidDomainPrincipal extends NTSid { private static final long serialVersionUID = 5247810785821650912L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java index 66df636ba64..52205c974a0 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java @@ -40,6 +40,7 @@ package com.sun.security.auth; * @see javax.security.auth.Subject * @see com.sun.security.auth.NTSid */ +@jdk.Exported public class NTSidGroupPrincipal extends NTSid { private static final long serialVersionUID = -1373347438636198229L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java index 10055e5c29f..7d3f6663f8b 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java @@ -39,6 +39,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSidPrimaryGroupPrincipal extends NTSid { private static final long serialVersionUID = 8011978367305190527L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java index c7f8f9b4afe..b180f52338b 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java @@ -39,6 +39,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSidUserPrincipal extends NTSid { private static final long serialVersionUID = -5573239889517749525L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java index c5d42486607..405d5538dae 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTUserPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = -8737649811939033735L; diff --git a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java index 1df34428514..a6402eb68ee 100644 --- a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java +++ b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java @@ -215,6 +215,7 @@ import javax.security.auth.Subject; * @see java.security.ProtectionDomain * @see java.security.Security security properties */ +@jdk.Exported(false) @Deprecated public class PolicyFile extends javax.security.auth.Policy { diff --git a/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java b/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java index 2d8ccde63b3..122a31cd30a 100644 --- a/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java +++ b/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java @@ -50,6 +50,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public interface PrincipalComparator { /** * Check if the specified Subject is implied by diff --git a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java index 66943aaa71a..bb7e8b8f01c 100644 --- a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java @@ -45,6 +45,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported(false) @Deprecated public class SolarisNumericGroupPrincipal implements Principal, diff --git a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java index 5623239666e..eff1f3dcedf 100644 --- a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java @@ -44,6 +44,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported(false) @Deprecated public class SolarisNumericUserPrincipal implements Principal, diff --git a/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java index 406692c7687..bd3e8c8067f 100644 --- a/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java @@ -44,6 +44,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported(false) @Deprecated public class SolarisPrincipal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java index 5c4260b5ccc..7e63b443156 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class UnixNumericGroupPrincipal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java index bb15312b602..25811860e13 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class UnixNumericUserPrincipal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java index 67d9133ef03..3a8004f24bd 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class UnixPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = -2951667807323493631L; diff --git a/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java index 0b8a9a821ee..a156b473beb 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java @@ -42,6 +42,7 @@ import java.security.Principal; * * @since 1.6 */ +@jdk.Exported public final class UserPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = 892106070870210969L; diff --git a/jdk/src/share/classes/com/sun/security/auth/X500Principal.java b/jdk/src/share/classes/com/sun/security/auth/X500Principal.java index cb48043aea4..d4b7ce26347 100644 --- a/jdk/src/share/classes/com/sun/security/auth/X500Principal.java +++ b/jdk/src/share/classes/com/sun/security/auth/X500Principal.java @@ -49,6 +49,7 @@ import sun.security.x509.X500Name; * class. * @see javax.security.auth.x500.X500Principal */ +@jdk.Exported(false) @Deprecated public class X500Principal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java b/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java index 9f6bd0433c2..a68ad5db678 100644 --- a/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java +++ b/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java @@ -54,6 +54,7 @@ import javax.swing.JTextField; * @see javax.security.auth.callback * @deprecated This class will be removed in a future release. */ +@jdk.Exported(false) @Deprecated public class DialogCallbackHandler implements CallbackHandler { diff --git a/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java b/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java index 004c05da149..6bebfb4f398 100644 --- a/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java +++ b/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java @@ -53,6 +53,7 @@ import sun.security.util.Password; * @see javax.security.auth.callback */ +@jdk.Exported public class TextCallbackHandler implements CallbackHandler { /** diff --git a/jdk/src/share/classes/com/sun/security/auth/callback/package-info.java b/jdk/src/share/classes/com/sun/security/auth/callback/package-info.java new file mode 100644 index 00000000000..61d65688798 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/callback/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +@jdk.Exported +package com.sun.security.auth.callback; diff --git a/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java b/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java index 3e6dc7da579..53058177ac2 100644 --- a/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java +++ b/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java @@ -83,6 +83,7 @@ import java.net.URI; * @see javax.security.auth.login.LoginContext * @see java.security.Security security properties */ +@jdk.Exported public class ConfigFile extends Configuration { private final sun.security.provider.ConfigFile.Spi spi; diff --git a/jdk/src/share/classes/com/sun/security/auth/login/package-info.java b/jdk/src/share/classes/com/sun/security/auth/login/package-info.java new file mode 100644 index 00000000000..a0b207c5578 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/login/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +@jdk.Exported +package com.sun.security.auth.login; diff --git a/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java index b6b8660a2e4..35d35cc91d9 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java @@ -151,6 +151,7 @@ import com.sun.security.auth.UnixNumericGroupPrincipal; * * */ +@jdk.Exported public class JndiLoginModule implements LoginModule { private static final ResourceBundle rb = AccessController.doPrivileged( diff --git a/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java index 70f74d65a22..ada7630b463 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java @@ -110,6 +110,7 @@ import sun.security.util.Password; * * */ +@jdk.Exported public class KeyStoreLoginModule implements LoginModule { private static final ResourceBundle rb = AccessController.doPrivileged( diff --git a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java index cd60c6ac790..c5b26892073 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java @@ -379,6 +379,7 @@ import sun.misc.HexDumpEncoder; * @author Ram Marti */ +@jdk.Exported public class Krb5LoginModule implements LoginModule { // initial state diff --git a/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java index 10fa6b640d8..24c7571effe 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java @@ -304,6 +304,7 @@ import com.sun.security.auth.UserPrincipal; * * @since 1.6 */ +@jdk.Exported public class LdapLoginModule implements LoginModule { // Use the default classloader for this class to load the prompt strings. diff --git a/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java index 4ef208def94..18fb73db7cc 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java @@ -57,6 +57,7 @@ import com.sun.security.auth.NTNumericCredential; * * @see javax.security.auth.spi.LoginModule */ +@jdk.Exported public class NTLoginModule implements LoginModule { private NTSystem ntSystem; diff --git a/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java b/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java index 51f9a2c688c..502d92a7144 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java @@ -30,6 +30,7 @@ package com.sun.security.auth.module; * security information for the current user. * */ +@jdk.Exported public class NTSystem { private native void getCurrent(boolean debug); diff --git a/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java index 07042b7e3e7..e03eb7a03b1 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java @@ -52,6 +52,7 @@ import com.sun.security.auth.SolarisNumericGroupPrincipal; * UnixLoginModule. * */ +@jdk.Exported(false) @Deprecated public class SolarisLoginModule implements LoginModule { diff --git a/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java b/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java index 622671bd3fb..df4f5278877 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java @@ -30,6 +30,7 @@ package com.sun.security.auth.module; * UID/GID/groups information for the current user. * */ +@jdk.Exported public class SolarisSystem { private native void getSolarisInfo(); diff --git a/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java index 00b7d2559a2..3b592671998 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java @@ -47,6 +47,7 @@ import com.sun.security.auth.UnixNumericGroupPrincipal; * debug messages will be output to the output stream, System.out. * */ +@jdk.Exported public class UnixLoginModule implements LoginModule { // initial state diff --git a/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java b/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java index b902cc9e36a..804d8c10a1b 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java @@ -30,6 +30,7 @@ package com.sun.security.auth.module; * UID/GID/groups information for the current user. * */ +@jdk.Exported public class UnixSystem { private native void getUnixInfo(); diff --git a/jdk/src/share/classes/com/sun/security/auth/module/package-info.java b/jdk/src/share/classes/com/sun/security/auth/module/package-info.java new file mode 100644 index 00000000000..21569670ffe --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/module/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +@jdk.Exported +package com.sun.security.auth.module; diff --git a/jdk/src/share/classes/com/sun/security/auth/package-info.java b/jdk/src/share/classes/com/sun/security/auth/package-info.java new file mode 100644 index 00000000000..3fe7e206fa7 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +@jdk.Exported +package com.sun.security.auth; diff --git a/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java b/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java index afdb880e42e..fdabd190fb8 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java +++ b/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java @@ -28,7 +28,8 @@ package com.sun.security.jgss; /** * Kerberos 5 AuthorizationData entry. */ -final public class AuthorizationDataEntry { +@jdk.Exported +public final class AuthorizationDataEntry { private final int type; private final byte[] data; diff --git a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java index 3d8935a59e8..798379e0dde 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java +++ b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java @@ -32,6 +32,7 @@ import org.ietf.jgss.*; * functionalities not defined by {@code org.ietf.jgss.GSSContext}, * such as querying context-specific attributes. */ +@jdk.Exported public interface ExtendedGSSContext extends GSSContext { /** * Return the mechanism-specific attribute associated with {@code type}. diff --git a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java index 8f09482a7d0..bf44dff65cd 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java +++ b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java @@ -32,6 +32,7 @@ import org.ietf.jgss.*; * functionalities not defined by {@code org.ietf.jgss.GSSCredential}. * @since 1.8 */ +@jdk.Exported public interface ExtendedGSSCredential extends GSSCredential { /** * Impersonates a principal. In Kerberos, this can be implemented diff --git a/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java b/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java index d05582a8c17..50b83da5ebb 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java +++ b/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java @@ -33,6 +33,7 @@ import org.ietf.jgss.GSSCredential; * GSS-API Utilities for using in conjunction with Sun Microsystem's * implementation of Java GSS-API. */ +@jdk.Exported public class GSSUtil { /** diff --git a/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java b/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java index e07072d5b9c..1e247f9ca07 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java +++ b/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java @@ -35,6 +35,7 @@ import java.security.BasicPermission; * *

The target name is the {@link InquireType} allowed. */ +@jdk.Exported public final class InquireSecContextPermission extends BasicPermission { private static final long serialVersionUID = -7131173349668647297L; diff --git a/jdk/src/share/classes/com/sun/security/jgss/InquireType.java b/jdk/src/share/classes/com/sun/security/jgss/InquireType.java index e69ad1a6ced..c153ccb8c4f 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/InquireType.java +++ b/jdk/src/share/classes/com/sun/security/jgss/InquireType.java @@ -29,6 +29,7 @@ package com.sun.security.jgss; * Attribute types that can be specified as an argument of * {@link com.sun.security.jgss.ExtendedGSSContext#inquireSecContext} */ +@jdk.Exported public enum InquireType { /** * Attribute type for retrieving the session key of an diff --git a/jdk/src/share/classes/com/sun/security/jgss/package-info.java b/jdk/src/share/classes/com/sun/security/jgss/package-info.java new file mode 100644 index 00000000000..b1c82d77387 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/jgss/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +@jdk.Exported +package com.sun.security.jgss; diff --git a/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java b/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java index 5f241b4044b..cee1a519d38 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java @@ -40,6 +40,7 @@ package com.sun.tools.attach; * the error returned by the agent's Agent_OnAttach function. * This error code can be obtained by invoking the {@link #returnValue() returnValue} method. */ +@jdk.Exported public class AgentInitializationException extends Exception { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java b/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java index a724d8b4bf2..fa19a5f3e63 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java @@ -36,6 +36,7 @@ package com.sun.tools.attach; * com.sun.tools.attach.VirtualMachine#loadAgentPath loadAgentPath} methods * if the agent, or agent library, cannot be loaded. */ +@jdk.Exported public class AgentLoadException extends Exception { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java b/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java index ac4d1ee6be2..40f86243413 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java @@ -36,6 +36,7 @@ import com.sun.tools.attach.spi.AttachProvider; // for javadoc * AttachProvider.attachVirtualMachine} if the provider attempts to * attach to a Java virtual machine with which it not comptatible. */ +@jdk.Exported public class AttachNotSupportedException extends Exception { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java b/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java index ca094d658d8..4d05f1e49b6 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java @@ -79,6 +79,7 @@ package com.sun.tools.attach; * @see com.sun.tools.attach.spi.AttachProvider */ +@jdk.Exported public final class AttachPermission extends java.security.BasicPermission { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java index 29464d88da6..1bea7512147 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java +++ b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java @@ -102,6 +102,7 @@ import java.io.IOException; * @since 1.6 */ +@jdk.Exported public abstract class VirtualMachine { private AttachProvider provider; private String id; diff --git a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java index 9334ea19fc6..3e27fe8489f 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java +++ b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java @@ -55,6 +55,7 @@ import com.sun.tools.attach.spi.AttachProvider; * * @since 1.6 */ +@jdk.Exported public class VirtualMachineDescriptor { private AttachProvider provider; diff --git a/jdk/src/share/classes/com/sun/tools/attach/package-info.java b/jdk/src/share/classes/com/sun/tools/attach/package-info.java new file mode 100644 index 00000000000..e335725390a --- /dev/null +++ b/jdk/src/share/classes/com/sun/tools/attach/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Provides the API to attach to a JavaTM + * virtual machine. + *

+ * A tool, written in the Java Language, uses this API to attach to a target + * virtual machine (VM) and load its tool agent into the target VM. For + * example, a management console might have a management agent which it uses + * to obtain management information from instrumented objects in a Java + * virtual machine. If the management console is required to manage + * an application that is running in a virtual machine that does not include + * the management agent, then this API can be used to attach to the target + * VM and load the agent. + * + * @since 1.6 + */ + +@jdk.Exported +package com.sun.tools.attach; diff --git a/jdk/src/share/classes/com/sun/tools/attach/package.html b/jdk/src/share/classes/com/sun/tools/attach/package.html deleted file mode 100644 index 8673b110bb3..00000000000 --- a/jdk/src/share/classes/com/sun/tools/attach/package.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - -Provides the API to attach to a JavaTM -virtual machine. - -A tool, written in the Java Language, uses this API to attach to a target -virtual machine (VM) and load its tool agent into the target VM. For -example, a management console might have a management agent which it uses -to obtain management information from instrumented objects in a Java -virtual machine. If the management console is required to manage -an application that is running in a virtual machine that does not include -the management agent, then this API can be used to attach to the target -VM and load the agent. - -@since 1.6 - - - - - - diff --git a/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java b/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java index f85daab7706..67f74f707c4 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java +++ b/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java @@ -74,6 +74,7 @@ import java.util.ServiceLoader; * @since 1.6 */ +@jdk.Exported public abstract class AttachProvider { private static final Object lock = new Object(); diff --git a/jdk/src/share/classes/com/sun/tools/attach/spi/package-info.java b/jdk/src/share/classes/com/sun/tools/attach/spi/package-info.java new file mode 100644 index 00000000000..b2c68ebe5a0 --- /dev/null +++ b/jdk/src/share/classes/com/sun/tools/attach/spi/package-info.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/** + * Only developers who are defining new attach providers should need to make + * direct use of this package. + * + * @since 1.6 + */ + +@jdk.Exported +package com.sun.tools.attach.spi; diff --git a/jdk/src/share/classes/com/sun/tools/attach/spi/package.html b/jdk/src/share/classes/com/sun/tools/attach/spi/package.html deleted file mode 100644 index 28b7db6bc31..00000000000 --- a/jdk/src/share/classes/com/sun/tools/attach/spi/package.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - -Provider classes for the {@link com.sun.tools.attach} package. - -

Only developers who are defining new attach providers should need to make -direct use of this package.

- -@since 1.6 - - - diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java b/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java index 0c24061b99f..9c8895f304f 100644 --- a/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java +++ b/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java @@ -43,6 +43,7 @@ import javax.swing.event.SwingPropertyChangeSupport; * * @since 1.6 */ +@jdk.Exported public interface JConsoleContext { /** * The {@link ConnectionState ConnectionState} bound property name. @@ -53,6 +54,7 @@ public interface JConsoleContext { * Values for the {@linkplain #CONNECTION_STATE_PROPERTY * ConnectionState} bound property. */ + @jdk.Exported public enum ConnectionState { /** * The connection has been successfully established. diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java b/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java index ab8a969e349..daff88c33af 100644 --- a/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java +++ b/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java @@ -72,6 +72,7 @@ import javax.swing.SwingWorker; * * @since 1.6 */ +@jdk.Exported public abstract class JConsolePlugin { private volatile JConsoleContext context = null; private List listeners = null; diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/package-info.java b/jdk/src/share/classes/com/sun/tools/jconsole/package-info.java new file mode 100644 index 00000000000..99b52aa3728 --- /dev/null +++ b/jdk/src/share/classes/com/sun/tools/jconsole/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package contains the JConsole API. + * + * @since 1.6 + */ + +@jdk.Exported +package com.sun.tools.jconsole; diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/package.html b/jdk/src/share/classes/com/sun/tools/jconsole/package.html deleted file mode 100644 index c0859d24723..00000000000 --- a/jdk/src/share/classes/com/sun/tools/jconsole/package.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - -This package contains the JConsole API. - -@since 1.6 - - - diff --git a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java index f74678e1bae..486680712e0 100644 --- a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java +++ b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java @@ -27,12 +27,15 @@ package java.lang.invoke; import jdk.internal.org.objectweb.asm.*; import sun.misc.Unsafe; +import sun.security.action.GetPropertyAction; +import java.io.FilePermission; import java.lang.reflect.Constructor; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.ProtectionDomain; import java.util.concurrent.atomic.AtomicInteger; +import java.util.PropertyPermission; import static jdk.internal.org.objectweb.asm.Opcodes.*; @@ -66,12 +69,23 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; // Used to ensure that each spun class name is unique private static final AtomicInteger counter = new AtomicInteger(0); + // For dumping generated classes to disk, for debugging purposes + private static final ProxyClassesDumper dumper; + + static { + final String key = "jdk.internal.lambda.dumpProxyClasses"; + String path = AccessController.doPrivileged( + new GetPropertyAction(key), null, + new PropertyPermission(key , "read")); + dumper = (null == path) ? null : ProxyClassesDumper.getInstance(path); + } + // See context values in AbstractValidatingLambdaMetafactory private final String implMethodClassName; // Name of type containing implementation "CC" private final String implMethodName; // Name of implementation method "impl" private final String implMethodDesc; // Type descriptor for implementation methods "(I)Ljava/lang/String;" - private final Type[] implMethodArgumentTypes; // ASM types for implementaion method parameters - private final Type implMethodReturnType; // ASM type for implementaion method return type "Ljava/lang/String;" + private final Type[] implMethodArgumentTypes; // ASM types for implementation method parameters + private final Type implMethodReturnType; // ASM type for implementation method return type "Ljava/lang/String;" private final MethodType constructorType; // Generated class constructor type "(CC)void" private final String constructorDesc; // Type descriptor for constructor "(LCC;)V" private final ClassWriter cw; // ASM class writer @@ -259,29 +273,31 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; final byte[] classBytes = cw.toByteArray(); - /*** Uncomment to dump the generated file - System.out.printf("Loaded: %s (%d bytes) %n", lambdaClassName, - classBytes.length); - try (FileOutputStream fos = new FileOutputStream(lambdaClassName - .replace('/', '.') + ".class")) { - fos.write(classBytes); - } catch (IOException ex) { - PlatformLogger.getLogger(InnerClassLambdaMetafactory.class - .getName()).severe(ex.getMessage(), ex); - } - ***/ + // If requested, dump out to a file for debugging purposes + if (dumper != null) { + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Void run() { + dumper.dumpClass(lambdaClassName, classBytes); + return null; + } + }, null, + new FilePermission("<>", "read, write"), + // createDirectories may need it + new PropertyPermission("user.dir", "read")); + } ClassLoader loader = targetClass.getClassLoader(); ProtectionDomain pd = (loader == null) - ? null - : AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public ProtectionDomain run() { - return targetClass.getProtectionDomain(); - } - } - ); + ? null + : AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ProtectionDomain run() { + return targetClass.getProtectionDomain(); + } + } + ); return UNSAFE.defineClass(lambdaClassName, classBytes, 0, classBytes.length, diff --git a/jdk/src/share/classes/java/lang/invoke/ProxyClassesDumper.java b/jdk/src/share/classes/java/lang/invoke/ProxyClassesDumper.java new file mode 100644 index 00000000000..463f1ff286c --- /dev/null +++ b/jdk/src/share/classes/java/lang/invoke/ProxyClassesDumper.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package java.lang.invoke; + +import sun.util.logging.PlatformLogger; + +import java.io.FilePermission; +import java.nio.file.Files; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Objects; +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * Helper class used by InnerClassLambdaMetafactory to log generated classes + * + * @implNote + *

Because this class is called by LambdaMetafactory, make use + * of lambda lead to recursive calls cause stack overflow. + */ +final class ProxyClassesDumper { + private static final char[] HEX = { + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' + }; + private static final char[] BAD_CHARS = { + '\\', ':', '*', '?', '"', '<', '>', '|' + }; + private static final String[] REPLACEMENT = { + "%5C", "%3A", "%2A", "%3F", "%22", "%3C", "%3E", "%7C" + }; + + private final Path dumpDir; + + public static ProxyClassesDumper getInstance(String path) { + if (null == path) { + return null; + } + try { + path = path.trim(); + final Path dir = Paths.get(path.length() == 0 ? "." : path); + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Void run() { + validateDumpDir(dir); + return null; + } + }, null, new FilePermission("<>", "read, write")); + return new ProxyClassesDumper(dir); + } catch (InvalidPathException ex) { + PlatformLogger.getLogger(ProxyClassesDumper.class.getName()) + .warning("Path " + path + " is not valid - dumping disabled", ex); + } catch (IllegalArgumentException iae) { + PlatformLogger.getLogger(ProxyClassesDumper.class.getName()) + .warning(iae.getMessage() + " - dumping disabled"); + } + return null; + } + + private ProxyClassesDumper(Path path) { + dumpDir = Objects.requireNonNull(path); + } + + private static void validateDumpDir(Path path) { + if (!Files.exists(path)) { + throw new IllegalArgumentException("Directory " + path + " does not exist"); + } else if (!Files.isDirectory(path)) { + throw new IllegalArgumentException("Path " + path + " is not a directory"); + } else if (!Files.isWritable(path)) { + throw new IllegalArgumentException("Directory " + path + " is not writable"); + } + } + + public static String encodeForFilename(String className) { + final int len = className.length(); + StringBuilder sb = new StringBuilder(len); + + for (int i = 0; i < len; i++) { + char c = className.charAt(i); + // control characters + if (c <= 31) { + sb.append('%'); + sb.append(HEX[c >> 4 & 0x0F]); + sb.append(HEX[c & 0x0F]); + } else { + int j = 0; + for (; j < BAD_CHARS.length; j++) { + if (c == BAD_CHARS[j]) { + sb.append(REPLACEMENT[j]); + break; + } + } + if (j >= BAD_CHARS.length) { + sb.append(c); + } + } + } + + return sb.toString(); + } + + public void dumpClass(String className, final byte[] classBytes) { + Path file; + try { + file = dumpDir.resolve(encodeForFilename(className) + ".class"); + } catch (InvalidPathException ex) { + PlatformLogger.getLogger(ProxyClassesDumper.class.getName()) + .warning("Invalid path for class " + className); + return; + } + + try { + Path dir = file.getParent(); + Files.createDirectories(dir); + Files.write(file, classBytes); + } catch (Exception ignore) { + PlatformLogger.getLogger(ProxyClassesDumper.class.getName()) + .warning("Exception writing to path at " + file.toString()); + // simply don't care if this operation failed + } + } +} diff --git a/jdk/src/share/classes/java/security/DomainLoadStoreParameter.java b/jdk/src/share/classes/java/security/DomainLoadStoreParameter.java new file mode 100644 index 00000000000..bc9697597e5 --- /dev/null +++ b/jdk/src/share/classes/java/security/DomainLoadStoreParameter.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.security; + +import java.net.URI; +import java.util.*; +import static java.security.KeyStore.*; + +/** + * Configuration data that specifies the keystores in a keystore domain. + * A keystore domain is a collection of keystores that are presented as a + * single logical keystore. The configuration data is used during + * {@code KeyStore} + * {@link KeyStore#load(KeyStore.LoadStoreParameter) load} and + * {@link KeyStore#store(KeyStore.LoadStoreParameter) store} operations. + *

+ * The following syntax is supported for configuration data: + *

{@code
+ *     domain  [ ...] {
+ *         keystore  [ ...] ;
+ *         ...
+ *     };
+ *     ...
+ * }
+ * where {@code domainName} and {@code keystoreName} are identifiers + * and {@code property} is a key/value pairing. The key and value are + * separated by an 'equals' symbol and the value is enclosed in double + * quotes. A property value may be either a printable string or a binary + * string of colon-separated pairs of hexadecimal digits. Multi-valued + * properties are represented as a comma-separated list of values, + * enclosed in square brackets. + * See {@link Arrays#toString(java.lang.Object[])}. + *

+ * To ensure that keystore entries are uniquely identified, each + * entry's alias is prefixed by its {@code keystoreName} followed + * by the entry name separator and each {@code keystoreName} must be + * unique within its domain. Entry name prefixes are omitted when + * storing a keystore. + *

+ * Properties are context-sensitive: properties that apply to + * all the keystores in a domain are located in the domain clause, + * and properties that apply only to a specific keystore are located + * in that keystore's clause. + * Unless otherwise specified, a property in a keystore clause overrides + * a property of the same name in the domain clause. All property names + * are case-insensitive. The following properties are supported: + *

+ *
{@code keystoreType=""}
+ *
The keystore type.
+ *
{@code keystoreURI=""}
+ *
The keystore location.
+ *
{@code keystoreProviderName=""}
+ *
The name of the keystore's JCE provider.
+ *
{@code keystorePasswordEnv=""}
+ *
The environment variable that stores a keystore password. + * Alternatively, passwords may be supplied to the constructor + * method in a {@code Map}.
+ *
{@code entryNameSeparator=""}
+ *
The separator between a keystore name prefix and an entry name. + * When specified, it applies to all the entries in a domain. + * Its default value is a space.
+ *
+ *

+ * For example, configuration data for a simple keystore domain + * comprising three keystores is shown below: + *

+ *
+ * domain app1 {
+ *     keystore app1-truststore
+ *         keystoreURI="file:///app1/etc/truststore.jks";
+ *
+ *     keystore system-truststore
+ *         keystoreURI="${java.home}/lib/security/cacerts";
+ *
+ *     keystore app1-keystore
+ *         keystoreType="PKCS12"
+ *         keystoreURI="file:///app1/etc/keystore.p12";
+ * };
+ *
+ * 
+ * @since 1.8 + */ +public final class DomainLoadStoreParameter implements LoadStoreParameter { + + private final URI configuration; + private final Map protectionParams; + + /** + * Constructs a DomainLoadStoreParameter for a keystore domain with + * the parameters used to protect keystore data. + * + * @param configuration identifier for the domain configuration data. + * The name of the target domain should be specified in the + * {@code java.net.URI} fragment component when it is necessary + * to distinguish between several domain configurations at the + * same location. + * + * @param protectionParams the map from keystore name to the parameter + * used to protect keystore data. + * A {@code java.util.Collections.EMPTY_MAP} should be used + * when protection parameters are not required or when they have + * been specified by properties in the domain configuration data. + * It is cloned to prevent subsequent modification. + * + * @exception NullPointerException if {@code configuration} or + * {@code protectionParams} is {@code null} + */ + public DomainLoadStoreParameter(URI configuration, + Map protectionParams) { + if (configuration == null || protectionParams == null) { + throw new NullPointerException("invalid null input"); + } + this.configuration = configuration; + this.protectionParams = + Collections.unmodifiableMap(new HashMap<>(protectionParams)); + } + + /** + * Gets the identifier for the domain configuration data. + * + * @return the identifier for the configuration data + */ + public URI getConfiguration() { + return configuration; + } + + /** + * Gets the keystore protection parameters for keystores in this + * domain. + * + * @return an unmodifiable map of keystore names to protection + * parameters + */ + public Map getProtectionParams() { + return protectionParams; + } + + /** + * Gets the keystore protection parameters for this domain. + * Keystore domains do not support a protection parameter. + * + * @return always returns {@code null} + */ + @Override + public KeyStore.ProtectionParameter getProtectionParameter() { + return null; + } +} diff --git a/jdk/src/share/classes/java/security/KeyStore.java b/jdk/src/share/classes/java/security/KeyStore.java index 187683baa50..e769bb158e1 100644 --- a/jdk/src/share/classes/java/security/KeyStore.java +++ b/jdk/src/share/classes/java/security/KeyStore.java @@ -218,148 +218,6 @@ public class KeyStore { public ProtectionParameter getProtectionParameter(); } - /** - * Configuration data that specifies the keystores in a keystore domain. - * A keystore domain is a collection of keystores that are presented as a - * single logical keystore. The configuration data is used during - * {@code KeyStore} - * {@link #load(KeyStore.LoadStoreParameter) load} and - * {@link #store(KeyStore.LoadStoreParameter) store} operations. - *

- * The following syntax is supported for configuration data: - *

{@code
-     *     domain  [ ...] {
-     *         keystore  [ ...] ;
-     *         ...
-     *     };
-     *     ...
-     * }
- * where {@code domainName} and {@code keystoreName} are identifiers - * and {@code property} is a key/value pairing. The key and value are - * separated by an 'equals' symbol and the value is enclosed in double - * quotes. A property value may be either a printable string or a binary - * string of colon-separated pairs of hexadecimal digits. Multi-valued - * properties are represented as a comma-separated list of values, - * enclosed in square brackets. - * See {@link Arrays#toString(java.lang.Object[])}. - *

- * To ensure that keystore entries are uniquely identified, each - * entry's alias is prefixed by its {@code keystoreName} followed - * by the entry name separator and each {@code keystoreName} must be - * unique within its domain. Entry name prefixes are omitted when - * storing a keystore. - *

- * Properties are context-sensitive: properties that apply to - * all the keystores in a domain are located in the domain clause, - * and properties that apply only to a specific keystore are located - * in that keystore's clause. - * Unless otherwise specified, a property in a keystore clause overrides - * a property of the same name in the domain clause. All property names - * are case-insensitive. The following properties are supported: - *

- *
{@code keystoreType=""}
- *
The keystore type.
- *
{@code keystoreURI=""}
- *
The keystore location.
- *
{@code keystoreProviderName=""}
- *
The name of the keystore's JCE provider.
- *
{@code keystorePasswordEnv=""}
- *
The environment variable that stores a keystore password. - * Alternatively, passwords may be supplied to the constructor - * method in a {@code Map}.
- *
{@code entryNameSeparator=""}
- *
The separator between a keystore name prefix and an entry name. - * When specified, it applies to all the entries in a domain. - * Its default value is a space.
- *
- *

- * For example, configuration data for a simple keystore domain - * comprising three keystores is shown below: - *

-     *
-     * domain app1 {
-     *     keystore app1-truststore
-     *         keystoreURI="file:///app1/etc/truststore.jks"
-     *
-     *     keystore system-truststore
-     *         keystoreURI="${java.home}/lib/security/cacerts"
-     *
-     *     keystore app1-keystore
-     *         keystoreType="PKCS12"
-     *         keystoreURI="file:///app1/etc/keystore.p12"
-     * };
-     *
-     * 
- * @since 1.8 - */ - public static final class DomainLoadStoreParameter - implements LoadStoreParameter { - - private final URI configuration; - private final Map protectionParams; - - /** - * Constructs a DomainLoadStoreParameter for a keystore domain with - * the parameters used to protect keystore data. - * - * @param configuration identifier for the domain configuration data. - * The name of the target domain should be specified in the - * {@code java.net.URI} fragment component when it is necessary - * to distinguish between several domain configurations at the - * same location. - * - * @param protectionParams the map from keystore name to the parameter - * used to protect keystore data. - * A {@code java.util.Collections.EMPTY_MAP} should be used - * when protection parameters are not required or when they have - * been specified by properties in the domain configuration data. - * It is cloned to prevent subsequent modification. - * - * @exception NullPointerException if {@code configuration} or - * {@code protectionParams} is {@code null} - */ - public DomainLoadStoreParameter(URI configuration, - Map protectionParams) { - if (configuration == null || protectionParams == null) { - throw new NullPointerException("invalid null input"); - } - this.configuration = configuration; - this.protectionParams = - Collections.unmodifiableMap(new HashMap<>(protectionParams)); - } - - /** - * Gets the identifier for the domain configuration data. - * - * @return the identifier for the configuration data - */ - public URI getConfiguration() { - return configuration; - } - - /** - * Gets the keystore protection parameters for keystores in this - * domain. - * - * @return an unmodifiable map of keystore names to protection - * parameters - */ - public Map getProtectionParams() { - return protectionParams; - } - - /** - * Gets the keystore protection parameters for this domain. - * Keystore domains do not support a protection parameter. - * - * @return always returns {@code null} - */ - @Override - public KeyStore.ProtectionParameter getProtectionParameter() { - return null; - } - } - /** * A marker interface for keystore protection parameters. * diff --git a/jdk/src/share/classes/java/time/DayOfWeek.java b/jdk/src/share/classes/java/time/DayOfWeek.java index b48482241df..605c57710ec 100644 --- a/jdk/src/share/classes/java/time/DayOfWeek.java +++ b/jdk/src/share/classes/java/time/DayOfWeek.java @@ -187,7 +187,12 @@ public enum DayOfWeek implements TemporalAccessor, TemporalAdjuster { if (temporal instanceof DayOfWeek) { return (DayOfWeek) temporal; } - return of(temporal.get(DAY_OF_WEEK)); + try { + return of(temporal.get(DAY_OF_WEEK)); + } catch (DateTimeException ex) { + throw new DateTimeException("Unable to obtain DayOfWeek from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName(), ex); + } } //----------------------------------------------------------------------- diff --git a/jdk/src/share/classes/java/time/Instant.java b/jdk/src/share/classes/java/time/Instant.java index 0e22c7bf972..e7a264159d3 100644 --- a/jdk/src/share/classes/java/time/Instant.java +++ b/jdk/src/share/classes/java/time/Instant.java @@ -366,9 +366,14 @@ public final class Instant return (Instant) temporal; } Objects.requireNonNull(temporal, "temporal"); - long instantSecs = temporal.getLong(INSTANT_SECONDS); - int nanoOfSecond = temporal.get(NANO_OF_SECOND); - return Instant.ofEpochSecond(instantSecs, nanoOfSecond); + try { + long instantSecs = temporal.getLong(INSTANT_SECONDS); + int nanoOfSecond = temporal.get(NANO_OF_SECOND); + return Instant.ofEpochSecond(instantSecs, nanoOfSecond); + } catch (DateTimeException ex) { + throw new DateTimeException("Unable to obtain Instant from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName()); + } } //----------------------------------------------------------------------- diff --git a/jdk/src/share/classes/java/time/LocalDate.java b/jdk/src/share/classes/java/time/LocalDate.java index f388959aa63..4ac39968b64 100644 --- a/jdk/src/share/classes/java/time/LocalDate.java +++ b/jdk/src/share/classes/java/time/LocalDate.java @@ -356,7 +356,8 @@ public final class LocalDate Objects.requireNonNull(temporal, "temporal"); LocalDate date = temporal.query(TemporalQuery.localDate()); if (date == null) { - throw new DateTimeException("Unable to obtain LocalDate from TemporalAccessor: " + temporal.getClass()); + throw new DateTimeException("Unable to obtain LocalDate from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName()); } return date; } diff --git a/jdk/src/share/classes/java/time/LocalDateTime.java b/jdk/src/share/classes/java/time/LocalDateTime.java index aed44dd4bfe..30107f2358a 100644 --- a/jdk/src/share/classes/java/time/LocalDateTime.java +++ b/jdk/src/share/classes/java/time/LocalDateTime.java @@ -449,7 +449,8 @@ public final class LocalDateTime LocalTime time = LocalTime.from(temporal); return new LocalDateTime(date, time); } catch (DateTimeException ex) { - throw new DateTimeException("Unable to obtain LocalDateTime from TemporalAccessor: " + temporal.getClass(), ex); + throw new DateTimeException("Unable to obtain LocalDateTime from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName(), ex); } } diff --git a/jdk/src/share/classes/java/time/LocalTime.java b/jdk/src/share/classes/java/time/LocalTime.java index 77ab2c7f286..1ac9737a16f 100644 --- a/jdk/src/share/classes/java/time/LocalTime.java +++ b/jdk/src/share/classes/java/time/LocalTime.java @@ -397,7 +397,8 @@ public final class LocalTime Objects.requireNonNull(temporal, "temporal"); LocalTime time = temporal.query(TemporalQuery.localTime()); if (time == null) { - throw new DateTimeException("Unable to obtain LocalTime from TemporalAccessor: " + temporal.getClass()); + throw new DateTimeException("Unable to obtain LocalTime from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName()); } return time; } diff --git a/jdk/src/share/classes/java/time/Month.java b/jdk/src/share/classes/java/time/Month.java index 85d12d8f136..578212d3d6d 100644 --- a/jdk/src/share/classes/java/time/Month.java +++ b/jdk/src/share/classes/java/time/Month.java @@ -217,7 +217,8 @@ public enum Month implements TemporalAccessor, TemporalAdjuster { } return of(temporal.get(MONTH_OF_YEAR)); } catch (DateTimeException ex) { - throw new DateTimeException("Unable to obtain Month from TemporalAccessor: " + temporal.getClass(), ex); + throw new DateTimeException("Unable to obtain Month from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName(), ex); } } diff --git a/jdk/src/share/classes/java/time/MonthDay.java b/jdk/src/share/classes/java/time/MonthDay.java index 67f5d4fa87f..13986b6187b 100644 --- a/jdk/src/share/classes/java/time/MonthDay.java +++ b/jdk/src/share/classes/java/time/MonthDay.java @@ -266,7 +266,8 @@ public final class MonthDay } return of(temporal.get(MONTH_OF_YEAR), temporal.get(DAY_OF_MONTH)); } catch (DateTimeException ex) { - throw new DateTimeException("Unable to obtain MonthDay from TemporalAccessor: " + temporal.getClass(), ex); + throw new DateTimeException("Unable to obtain MonthDay from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName(), ex); } } diff --git a/jdk/src/share/classes/java/time/OffsetDateTime.java b/jdk/src/share/classes/java/time/OffsetDateTime.java index 410c7f3a747..df474cbc089 100644 --- a/jdk/src/share/classes/java/time/OffsetDateTime.java +++ b/jdk/src/share/classes/java/time/OffsetDateTime.java @@ -347,8 +347,8 @@ public final class OffsetDateTime if (temporal instanceof OffsetDateTime) { return (OffsetDateTime) temporal; } - ZoneOffset offset = ZoneOffset.from(temporal); try { + ZoneOffset offset = ZoneOffset.from(temporal); try { LocalDateTime ldt = LocalDateTime.from(temporal); return OffsetDateTime.of(ldt, offset); @@ -357,7 +357,8 @@ public final class OffsetDateTime return OffsetDateTime.ofInstant(instant, offset); } } catch (DateTimeException ex) { - throw new DateTimeException("Unable to obtain OffsetDateTime from TemporalAccessor: " + temporal.getClass(), ex); + throw new DateTimeException("Unable to obtain OffsetDateTime from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName(), ex); } } diff --git a/jdk/src/share/classes/java/time/OffsetTime.java b/jdk/src/share/classes/java/time/OffsetTime.java index a8dbf8a7a56..f3f646fa250 100644 --- a/jdk/src/share/classes/java/time/OffsetTime.java +++ b/jdk/src/share/classes/java/time/OffsetTime.java @@ -284,7 +284,8 @@ public final class OffsetTime ZoneOffset offset = ZoneOffset.from(temporal); return new OffsetTime(time, offset); } catch (DateTimeException ex) { - throw new DateTimeException("Unable to obtain OffsetTime from TemporalAccessor: " + temporal.getClass(), ex); + throw new DateTimeException("Unable to obtain OffsetTime from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName(), ex); } } diff --git a/jdk/src/share/classes/java/time/Year.java b/jdk/src/share/classes/java/time/Year.java index 377dfd5185a..1ca262ebf32 100644 --- a/jdk/src/share/classes/java/time/Year.java +++ b/jdk/src/share/classes/java/time/Year.java @@ -249,7 +249,8 @@ public final class Year } return of(temporal.get(YEAR)); } catch (DateTimeException ex) { - throw new DateTimeException("Unable to obtain Year from TemporalAccessor: " + temporal.getClass(), ex); + throw new DateTimeException("Unable to obtain Year from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName(), ex); } } diff --git a/jdk/src/share/classes/java/time/YearMonth.java b/jdk/src/share/classes/java/time/YearMonth.java index 223c90ab0f0..3c12784d82e 100644 --- a/jdk/src/share/classes/java/time/YearMonth.java +++ b/jdk/src/share/classes/java/time/YearMonth.java @@ -252,7 +252,8 @@ public final class YearMonth } return of(temporal.get(YEAR), temporal.get(MONTH_OF_YEAR)); } catch (DateTimeException ex) { - throw new DateTimeException("Unable to obtain YearMonth from TemporalAccessor: " + temporal.getClass(), ex); + throw new DateTimeException("Unable to obtain YearMonth from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName(), ex); } } diff --git a/jdk/src/share/classes/java/time/ZoneId.java b/jdk/src/share/classes/java/time/ZoneId.java index 86b0c74fd9d..6d42601c5b9 100644 --- a/jdk/src/share/classes/java/time/ZoneId.java +++ b/jdk/src/share/classes/java/time/ZoneId.java @@ -504,7 +504,8 @@ public abstract class ZoneId implements Serializable { public static ZoneId from(TemporalAccessor temporal) { ZoneId obj = temporal.query(TemporalQuery.zone()); if (obj == null) { - throw new DateTimeException("Unable to obtain ZoneId from TemporalAccessor: " + temporal.getClass()); + throw new DateTimeException("Unable to obtain ZoneId from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName()); } return obj; } diff --git a/jdk/src/share/classes/java/time/ZoneOffset.java b/jdk/src/share/classes/java/time/ZoneOffset.java index 3475e5f4db3..e1e4993ec26 100644 --- a/jdk/src/share/classes/java/time/ZoneOffset.java +++ b/jdk/src/share/classes/java/time/ZoneOffset.java @@ -336,7 +336,8 @@ public final class ZoneOffset Objects.requireNonNull(temporal, "temporal"); ZoneOffset offset = temporal.query(TemporalQuery.offset()); if (offset == null) { - throw new DateTimeException("Unable to obtain ZoneOffset from TemporalAccessor: " + temporal.getClass()); + throw new DateTimeException("Unable to obtain ZoneOffset from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName()); } return offset; } diff --git a/jdk/src/share/classes/java/time/ZonedDateTime.java b/jdk/src/share/classes/java/time/ZonedDateTime.java index 1114ab4edd3..679653f61b1 100644 --- a/jdk/src/share/classes/java/time/ZonedDateTime.java +++ b/jdk/src/share/classes/java/time/ZonedDateTime.java @@ -553,7 +553,8 @@ public final class ZonedDateTime return of(ldt, zone); } } catch (DateTimeException ex) { - throw new DateTimeException("Unable to create ZonedDateTime from TemporalAccessor: " + temporal.getClass(), ex); + throw new DateTimeException("Unable to obtain ZonedDateTime from TemporalAccessor: " + + temporal + " of type " + temporal.getClass().getName(), ex); } } diff --git a/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java b/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java index f4983b48861..442a228fd1f 100644 --- a/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java +++ b/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java @@ -78,9 +78,11 @@ import java.math.RoundingMode; import java.text.ParsePosition; import java.time.DateTimeException; import java.time.Instant; +import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZoneOffset; +import java.time.chrono.ChronoLocalDate; import java.time.chrono.Chronology; import java.time.chrono.IsoChronology; import java.time.format.DateTimeTextProvider.LocaleStore; @@ -499,51 +501,16 @@ public final class DateTimeFormatterBuilder { //----------------------------------------------------------------------- /** - * Appends the reduced value of a date-time field with fixed width to the formatter. + * Appends the reduced value of a date-time field to the formatter. *

- * This is typically used for formatting and parsing a two digit year. - * The {@code width} is the printed and parsed width. - * The {@code baseValue} is used during parsing to determine the valid range. - *

- * For formatting, the width is used to determine the number of characters to format. - * The rightmost characters are output to match the width, left padding with zero. - *

- * For strict parsing, the number of characters allowed by the width are parsed. - * For lenient parsing, the number of characters must be at least 1 and less than 10. - * If the number of digits parsed is equal to {@code width} and the value is positive, - * the value of the field is computed to be the first number greater than - * or equal to the {@code baseValue} with the same least significant characters, - * otherwise the value parsed is the field value. - * This allows a reduced value to be entered for values in range of the baseValue - * and width and absolute values can be entered for values outside the range. - *

- * For example, a base value of {@code 1980} and a width of {@code 2} will have - * valid values from {@code 1980} to {@code 2079}. - * During parsing, the text {@code "12"} will result in the value {@code 2012} as that - * is the value within the range where the last two characters are "12". - * Compare with lenient parsing the text {@code "1915"} that will result in the - * value {@code 1915}. - * - * @param field the field to append, not null - * @param width the field width of the printed and parsed field, from 1 to 10 - * @param baseValue the base value of the range of valid values - * @return this, for chaining, not null - * @throws IllegalArgumentException if the width or base value is invalid - * @see #appendValueReduced(java.time.temporal.TemporalField, int, int, int) - */ - public DateTimeFormatterBuilder appendValueReduced(TemporalField field, - int width, int baseValue) { - return appendValueReduced(field, width, width, baseValue); - } - - /** - * Appends the reduced value of a date-time field with a flexible width to the formatter. - *

- * This is typically used for formatting and parsing a two digit year - * but allowing for the year value to be up to maxWidth. + * Since fields such as year vary by chronology, it is recommended to use the + * {@link #appendValueReduced(TemporalField, int, int, ChronoLocalDate)} date} + * variant of this method in most cases. This variant is suitable for + * simple fields or working with only the ISO chronology. *

* For formatting, the {@code width} and {@code maxWidth} are used to * determine the number of characters to format. + * If they are equal then the format is fixed width. * If the value of the field is within the range of the {@code baseValue} using * {@code width} characters then the reduced value is formatted otherwise the value is * truncated to fit {@code maxWidth}. @@ -562,8 +529,7 @@ public final class DateTimeFormatterBuilder { * valid values from {@code 1980} to {@code 2079}. * During parsing, the text {@code "12"} will result in the value {@code 2012} as that * is the value within the range where the last two characters are "12". - * Compare with parsing the text {@code "1915"} that will result in the - * value {@code 1915}. + * By contrast, parsing the text {@code "1915"} will result in the value {@code 1915}. * * @param field the field to append, not null * @param width the field width of the printed and parsed field, from 1 to 10 @@ -575,7 +541,67 @@ public final class DateTimeFormatterBuilder { public DateTimeFormatterBuilder appendValueReduced(TemporalField field, int width, int maxWidth, int baseValue) { Objects.requireNonNull(field, "field"); - ReducedPrinterParser pp = new ReducedPrinterParser(field, width, maxWidth, baseValue); + ReducedPrinterParser pp = new ReducedPrinterParser(field, width, maxWidth, baseValue, null); + appendValue(pp); + return this; + } + + /** + * Appends the reduced value of a date-time field to the formatter. + *

+ * This is typically used for formatting and parsing a two digit year. + *

+ * The base date is used to calculate the full value during parsing. + * For example, if the base date is 1950-01-01 then parsed values for + * a two digit year parse will be in the range 1950-01-01 to 2049-12-31. + * Only the year would be extracted from the date, thus a base date of + * 1950-08-25 would also parse to the range 1950-01-01 to 2049-12-31. + * This behaviour is necessary to support fields such as week-based-year + * or other calendar systems where the parsed value does not align with + * standard ISO years. + *

+ * The exact behavior is as follows. Parse the full set of fields and + * determine the effective chronology. Then convert the base date to the + * effective chronology. Then extract the specified field from the + * chronology-specific base date and use it to determine the + * {@code baseValue} used below. + *

+ * For formatting, the {@code width} and {@code maxWidth} are used to + * determine the number of characters to format. + * If they are equal then the format is fixed width. + * If the value of the field is within the range of the {@code baseValue} using + * {@code width} characters then the reduced value is formatted otherwise the value is + * truncated to fit {@code maxWidth}. + * The rightmost characters are output to match the width, left padding with zero. + *

+ * For strict parsing, the number of characters allowed by {@code width} to {@code maxWidth} are parsed. + * For lenient parsing, the number of characters must be at least 1 and less than 10. + * If the number of digits parsed is equal to {@code width} and the value is positive, + * the value of the field is computed to be the first number greater than + * or equal to the {@code baseValue} with the same least significant characters, + * otherwise the value parsed is the field value. + * This allows a reduced value to be entered for values in range of the baseValue + * and width and absolute values can be entered for values outside the range. + *

+ * For example, a base value of {@code 1980} and a width of {@code 2} will have + * valid values from {@code 1980} to {@code 2079}. + * During parsing, the text {@code "12"} will result in the value {@code 2012} as that + * is the value within the range where the last two characters are "12". + * By contrast, parsing the text {@code "1915"} will result in the value {@code 1915}. + * + * @param field the field to append, not null + * @param width the field width of the printed and parsed field, from 1 to 10 + * @param maxWidth the maximum field width of the printed field, from 1 to 10 + * @param baseDate the base date used to calculate the base value for the range + * of valid values in the parsed chronology, not null + * @return this, for chaining, not null + * @throws IllegalArgumentException if the width or base value is invalid + */ + public DateTimeFormatterBuilder appendValueReduced( + TemporalField field, int width, int maxWidth, ChronoLocalDate baseDate) { + Objects.requireNonNull(field, "field"); + Objects.requireNonNull(baseDate, "baseDate"); + ReducedPrinterParser pp = new ReducedPrinterParser(field, width, maxWidth, 0, baseDate); appendValue(pp); return this; } @@ -1682,7 +1708,7 @@ public final class DateTimeFormatterBuilder { case 'u': case 'y': if (count == 2) { - appendValueReduced(field, 2, 2000); + appendValueReduced(field, 2, 2, ReducedPrinterParser.BASE_DATE); } else if (count < 4) { appendValue(field, count, 19, SignStyle.NORMAL); } else { @@ -2516,7 +2542,7 @@ public final class DateTimeFormatterBuilder { if (valueLong == null) { return false; } - long value = getValue(valueLong); + long value = getValue(context, valueLong); DecimalStyle decimalStyle = context.getDecimalStyle(); String str = (value == Long.MIN_VALUE ? "9223372036854775808" : Long.toString(Math.abs(value))); if (str.length() > maxWidth) { @@ -2560,10 +2586,11 @@ public final class DateTimeFormatterBuilder { /** * Gets the value to output. * - * @param value the base value of the field, not null + * @param context the context + * @param value the value of the field, not null * @return the value */ - long getValue(long value) { + long getValue(DateTimePrintContext context, long value) { return value; } @@ -2703,7 +2730,13 @@ public final class DateTimeFormatterBuilder { * Prints and parses a reduced numeric date-time field. */ static final class ReducedPrinterParser extends NumberPrinterParser { + /** + * The base date for reduced value parsing. + */ + static final LocalDate BASE_DATE = LocalDate.of(2000, 1, 1); + private final int baseValue; + private final ChronoLocalDate baseDate; /** * Constructor. @@ -2712,10 +2745,11 @@ public final class DateTimeFormatterBuilder { * @param minWidth the minimum field width, from 1 to 10 * @param maxWidth the maximum field width, from 1 to 10 * @param baseValue the base value + * @param baseDate the base date */ ReducedPrinterParser(TemporalField field, int minWidth, int maxWidth, - int baseValue) { - this(field, minWidth, maxWidth, baseValue, 0); + int baseValue, ChronoLocalDate baseDate) { + this(field, minWidth, maxWidth, baseValue, baseDate, 0); if (minWidth < 1 || minWidth > 10) { throw new IllegalArgumentException("The minWidth must be from 1 to 10 inclusive but was " + minWidth); } @@ -2726,11 +2760,13 @@ public final class DateTimeFormatterBuilder { throw new IllegalArgumentException("Maximum width must exceed or equal the minimum width but " + maxWidth + " < " + minWidth); } - if (field.range().isValidValue(baseValue) == false) { - throw new IllegalArgumentException("The base value must be within the range of the field"); - } - if ((((long) baseValue) + EXCEED_POINTS[maxWidth]) > Integer.MAX_VALUE) { - throw new DateTimeException("Unable to add printer-parser as the range exceeds the capacity of an int"); + if (baseDate == null) { + if (field.range().isValidValue(baseValue) == false) { + throw new IllegalArgumentException("The base value must be within the range of the field"); + } + if ((((long) baseValue) + EXCEED_POINTS[maxWidth]) > Integer.MAX_VALUE) { + throw new DateTimeException("Unable to add printer-parser as the range exceeds the capacity of an int"); + } } } @@ -2742,17 +2778,24 @@ public final class DateTimeFormatterBuilder { * @param minWidth the minimum field width, from 1 to 10 * @param maxWidth the maximum field width, from 1 to 10 * @param baseValue the base value + * @param baseDate the base date * @param subsequentWidth the subsequentWidth for this instance */ private ReducedPrinterParser(TemporalField field, int minWidth, int maxWidth, - int baseValue, int subsequentWidth) { + int baseValue, ChronoLocalDate baseDate, int subsequentWidth) { super(field, minWidth, maxWidth, SignStyle.NOT_NEGATIVE, subsequentWidth); this.baseValue = baseValue; + this.baseDate = baseDate; } @Override - long getValue(long value) { + long getValue(DateTimePrintContext context, long value) { long absValue = Math.abs(value); + int baseValue = this.baseValue; + if (baseDate != null) { + Chronology chrono = Chronology.from(context.getTemporal()); + baseValue = chrono.date(baseDate).get(field); + } if (value >= baseValue && value < baseValue + EXCEED_POINTS[minWidth]) { // Use the reduced value if it fits in minWidth return absValue % EXCEED_POINTS[minWidth]; @@ -2763,6 +2806,12 @@ public final class DateTimeFormatterBuilder { @Override int setValue(DateTimeParseContext context, long value, int errorPos, int successPos) { + int baseValue = this.baseValue; + if (baseDate != null) { + // TODO: effective chrono is inaccurate at this point + Chronology chrono = context.getEffectiveChronology(); + baseValue = chrono.date(baseDate).get(field); + } int parseLen = successPos - errorPos; if (parseLen == minWidth && value >= 0) { long range = EXCEED_POINTS[minWidth]; @@ -2773,7 +2822,7 @@ public final class DateTimeFormatterBuilder { } else { value = basePart - value; } - if (basePart != 0 && value < baseValue) { + if (value < baseValue) { value += range; } } @@ -2790,7 +2839,7 @@ public final class DateTimeFormatterBuilder { if (subsequentWidth == -1) { return this; } - return new ReducedPrinterParser(field, minWidth, maxWidth, baseValue, -1); + return new ReducedPrinterParser(field, minWidth, maxWidth, baseValue, baseDate, -1); } /** @@ -2801,13 +2850,13 @@ public final class DateTimeFormatterBuilder { */ @Override ReducedPrinterParser withSubsequentWidth(int subsequentWidth) { - return new ReducedPrinterParser(field, minWidth, maxWidth, baseValue, + return new ReducedPrinterParser(field, minWidth, maxWidth, baseValue, baseDate, this.subsequentWidth + subsequentWidth); } @Override public String toString() { - return "ReducedValue(" + field + "," + minWidth + "," + maxWidth + "," + baseValue + ")"; + return "ReducedValue(" + field + "," + minWidth + "," + maxWidth + "," + (baseDate != null ? baseDate : baseValue) + ")"; } } @@ -4351,7 +4400,7 @@ public final class DateTimeFormatterBuilder { case 'Y': field = weekDef.weekBasedYear(); if (count == 2) { - return new ReducedPrinterParser(field, 2, 2, 2000, 0); + return new ReducedPrinterParser(field, 2, 2, 0, ReducedPrinterParser.BASE_DATE, 0); } else { return new NumberPrinterParser(field, count, 19, (count < 4) ? SignStyle.NORMAL : SignStyle.EXCEEDS_PAD, -1); @@ -4380,7 +4429,7 @@ public final class DateTimeFormatterBuilder { if (count == 1) { sb.append("WeekBasedYear"); } else if (count == 2) { - sb.append("ReducedValue(WeekBasedYear,2,2000)"); + sb.append("ReducedValue(WeekBasedYear,2,2,2000-01-01)"); } else { sb.append("WeekBasedYear,").append(count).append(",") .append(19).append(",") diff --git a/jdk/src/share/classes/java/time/format/Parsed.java b/jdk/src/share/classes/java/time/format/Parsed.java index 7413467826d..908c7decaef 100644 --- a/jdk/src/share/classes/java/time/format/Parsed.java +++ b/jdk/src/share/classes/java/time/format/Parsed.java @@ -588,11 +588,23 @@ final class Parsed implements TemporalAccessor { //----------------------------------------------------------------------- @Override public String toString() { - String str = fieldValues.toString() + "," + chrono + "," + zone; - if (date != null || time != null) { - str += " resolved to " + date + "," + time; + StringBuilder buf = new StringBuilder(64); + buf.append(fieldValues).append(',').append(chrono); + if (zone != null) { + buf.append(',').append(zone); } - return str; + if (date != null || time != null) { + buf.append(" resolved to "); + if (date != null) { + buf.append(date); + if (time != null) { + buf.append('T').append(time); + } + } else { + buf.append(time); + } + } + return buf.toString(); } } diff --git a/jdk/src/share/classes/java/util/HashSet.java b/jdk/src/share/classes/java/util/HashSet.java index 6ab58d0edf8..f9b09ee4c83 100644 --- a/jdk/src/share/classes/java/util/HashSet.java +++ b/jdk/src/share/classes/java/util/HashSet.java @@ -25,6 +25,8 @@ package java.util; +import java.io.InvalidObjectException; + /** * This class implements the Set interface, backed by a hash table * (actually a HashMap instance). It makes no guarantees as to the @@ -294,16 +296,37 @@ public class HashSet // Read in any hidden serialization magic s.defaultReadObject(); - // Read in HashMap capacity and load factor and create backing HashMap + // Read capacity and verify non-negative. int capacity = s.readInt(); + if (capacity < 0) { + throw new InvalidObjectException("Illegal capacity: " + + capacity); + } + + // Read load factor and verify positive and non NaN. float loadFactor = s.readFloat(); + if (loadFactor <= 0 || Float.isNaN(loadFactor)) { + throw new InvalidObjectException("Illegal load factor: " + + loadFactor); + } + + // Read size and verify non-negative. + int size = s.readInt(); + if (size < 0) { + throw new InvalidObjectException("Illegal size: " + + size); + } + + // Set the capacity according to the size and load factor ensuring that + // the HashMap is at least 25% full but clamping to maximum capacity. + capacity = (int) Math.min(size * Math.min(1 / loadFactor, 4.0f), + HashMap.MAXIMUM_CAPACITY); + + // Create backing HashMap map = (((HashSet)this) instanceof LinkedHashSet ? new LinkedHashMap(capacity, loadFactor) : new HashMap(capacity, loadFactor)); - // Read in size - int size = s.readInt(); - // Read in all elements in the proper order. for (int i=0; i { * #ORDERED}, {@link #DISTINCT}, {@link #SORTED}, {@link #SIZED}, * {@link #NONNULL}, {@link #IMMUTABLE}, {@link #CONCURRENT}, * {@link #SUBSIZED}. Repeated calls to {@code characteristics()} on - * a given spliterator should always return the same result. + * a given spliterator, prior to or in-between calls to {@code trySplit}, + * should always return the same result. * *

If a Spliterator reports an inconsistent set of * characteristics (either those returned from a single invocation * or across multiple invocations), no guarantees can be made * about any computation using this Spliterator. * + * @apiNote The characteristics of a given spliterator before splitting + * may differ from the characteristics after splitting. For specific + * examples see the characteristic values {@link #SIZED}, {@link #SUBSIZED} + * and {@link #CONCURRENT}. + * * @return a representation of characteristics */ int characteristics(); diff --git a/jdk/src/share/classes/java/util/logging/Level.java b/jdk/src/share/classes/java/util/logging/Level.java index 936925624e4..ade33284a9f 100644 --- a/jdk/src/share/classes/java/util/logging/Level.java +++ b/jdk/src/share/classes/java/util/logging/Level.java @@ -204,6 +204,12 @@ public class Level implements java.io.Serializable { * @throws NullPointerException if the name is null */ protected Level(String name, int value, String resourceBundleName) { + this(name, value, resourceBundleName, true); + } + + // private constructor to specify whether this instance should be added + // to the KnownLevel list from which Level.parse method does its look up + private Level(String name, int value, String resourceBundleName, boolean visible) { if (name == null) { throw new NullPointerException(); } @@ -212,7 +218,9 @@ public class Level implements java.io.Serializable { this.resourceBundleName = resourceBundleName; this.localizedLevelName = resourceBundleName == null ? name : null; this.cachedLocale = null; - KnownLevel.add(this); + if (visible) { + KnownLevel.add(this); + } } /** @@ -465,7 +473,7 @@ public class Level implements java.io.Serializable { // Finally, look for a known level with the given localized name, // in the current default locale. // This is relatively expensive, but not excessively so. - level = KnownLevel.findByLocalizedName(name); + level = KnownLevel.findByLocalizedLevelName(name); if (level != null) { return level.levelObject; } @@ -521,13 +529,14 @@ public class Level implements java.io.Serializable { private static Map> nameToLevels = new HashMap<>(); private static Map> intToLevels = new HashMap<>(); final Level levelObject; // instance of Level class or Level subclass - final Level mirroredLevel; // instance of Level class + final Level mirroredLevel; // mirror of the custom Level KnownLevel(Level l) { this.levelObject = l; if (l.getClass() == Level.class) { this.mirroredLevel = l; } else { - this.mirroredLevel = new Level(l.name, l.value, l.resourceBundleName); + // this mirrored level object is hidden + this.mirroredLevel = new Level(l.name, l.value, l.resourceBundleName, false); } } @@ -585,20 +594,6 @@ public class Level implements java.io.Serializable { return null; } - // Returns a KnownLevel with the given localized name matching - // by calling the Level.getLocalizedName() method - static synchronized KnownLevel findByLocalizedName(String name) { - for (List levels : nameToLevels.values()) { - for (KnownLevel l : levels) { - String lname = l.levelObject.getLocalizedName(); - if (name.equals(lname)) { - return l; - } - } - } - return null; - } - static synchronized KnownLevel matches(Level l) { List list = nameToLevels.get(l.name); if (list != null) { diff --git a/jdk/src/share/classes/sun/security/provider/DomainKeyStore.java b/jdk/src/share/classes/sun/security/provider/DomainKeyStore.java index ae0dbfb067c..9c4072abc49 100644 --- a/jdk/src/share/classes/sun/security/provider/DomainKeyStore.java +++ b/jdk/src/share/classes/sun/security/provider/DomainKeyStore.java @@ -41,7 +41,7 @@ import sun.security.util.PolicyUtil; * This class provides the domain keystore type identified as "DKS". * DKS presents a collection of separate keystores as a single logical keystore. * The collection of keystores is specified in a domain configuration file which - * is passed to DKS in a {@link KeyStore.DomainLoadStoreParameter}. + * is passed to DKS in a {@link DomainLoadStoreParameter}. *

* The following properties are supported: *

@@ -622,17 +622,16 @@ abstract class DomainKeyStore extends KeyStoreSpi { } throw new UnsupportedOperationException( - "This keystore must be stored using a " + - "KeyStore.DomainLoadStoreParameter"); + "This keystore must be stored using a DomainLoadStoreParameter"); } @Override public void engineStore(KeyStore.LoadStoreParameter param) throws IOException, NoSuchAlgorithmException, CertificateException { - if (param instanceof KeyStore.DomainLoadStoreParameter) { - KeyStore.DomainLoadStoreParameter domainParameter = - (KeyStore.DomainLoadStoreParameter) param; + if (param instanceof DomainLoadStoreParameter) { + DomainLoadStoreParameter domainParameter = + (DomainLoadStoreParameter) param; List builders = getBuilders( domainParameter.getConfiguration(), domainParameter.getProtectionParams()); @@ -645,7 +644,7 @@ abstract class DomainKeyStore extends KeyStoreSpi { if (!(pp instanceof KeyStore.PasswordProtection)) { throw new KeyStoreException( new IllegalArgumentException("ProtectionParameter" + - " must be a KeyStore.PasswordPartection")); + " must be a KeyStore.PasswordProtection")); } char[] password = ((KeyStore.PasswordProtection) builder.protection) @@ -663,7 +662,7 @@ abstract class DomainKeyStore extends KeyStoreSpi { } else { throw new UnsupportedOperationException( "This keystore must be stored using a " + - "KeyStore.DomainLoadStoreParameter"); + "DomainLoadStoreParameter"); } } @@ -710,7 +709,7 @@ abstract class DomainKeyStore extends KeyStoreSpi { } catch (Exception e) { throw new UnsupportedOperationException( "This keystore must be loaded using a " + - "KeyStore.DomainLoadStoreParameter"); + "DomainLoadStoreParameter"); } } @@ -718,9 +717,9 @@ abstract class DomainKeyStore extends KeyStoreSpi { public void engineLoad(KeyStore.LoadStoreParameter param) throws IOException, NoSuchAlgorithmException, CertificateException { - if (param instanceof KeyStore.DomainLoadStoreParameter) { - KeyStore.DomainLoadStoreParameter domainParameter = - (KeyStore.DomainLoadStoreParameter) param; + if (param instanceof DomainLoadStoreParameter) { + DomainLoadStoreParameter domainParameter = + (DomainLoadStoreParameter) param; List builders = getBuilders( domainParameter.getConfiguration(), domainParameter.getProtectionParams()); @@ -748,7 +747,7 @@ abstract class DomainKeyStore extends KeyStoreSpi { } else { throw new UnsupportedOperationException( "This keystore must be loaded using a " + - "KeyStore.DomainLoadStoreParameter"); + "DomainLoadStoreParameter"); } } diff --git a/jdk/src/solaris/classes/com/sun/management/OSMBeanFactory.java b/jdk/src/solaris/classes/com/sun/management/OSMBeanFactory.java index d73d4bda2e0..cbd9aa207d3 100644 --- a/jdk/src/solaris/classes/com/sun/management/OSMBeanFactory.java +++ b/jdk/src/solaris/classes/com/sun/management/OSMBeanFactory.java @@ -35,6 +35,7 @@ import sun.management.VMManagement; * public API and its API may change in incompatable ways between dot dot * releases and even patch releases. You should not rely on this class. */ +@jdk.Exported(false) public class OSMBeanFactory { /* static factory class */ private OSMBeanFactory() {}; diff --git a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c index 3c75f781e25..9a4d32ebf96 100644 --- a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,6 +51,24 @@ #define HAS_GLIBC_GETHOSTBY_R 1 #endif +static jclass ni_iacls; +static jclass ni_ia4cls; +static jmethodID ni_ia4ctrID; + +static void initializeInetClasses(JNIEnv *env) +{ + static int initialized = 0; + if (!initialized) { + ni_iacls = (*env)->FindClass(env, "java/net/InetAddress"); + ni_iacls = (*env)->NewGlobalRef(env, ni_iacls); + ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address"); + ni_ia4cls = (*env)->NewGlobalRef(env, ni_ia4cls); + ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "", "()V"); + initialized = 1; + } +} + + #if defined(_ALLBSD_SOURCE) && !defined(HAS_GLIBC_GETHOSTBY_R) /* Use getaddrinfo(3), which is thread safe */ /************************************************************************ @@ -99,14 +117,6 @@ Java_java_net_Inet4AddressImpl_getLocalHostName(JNIEnv *env, jobject this) { return (*env)->NewStringUTF(env, hostname); } -static jclass ni_iacls; -static jclass ni_ia4cls; -static jmethodID ni_ia4ctrID; -static jfieldID ni_iaaddressID; -static jfieldID ni_iahostID; -static jfieldID ni_iafamilyID; -static int initialized = 0; - /* * Find an internet address for a given hostname. Note that this * code only works for addresses of type INET. The translation @@ -129,14 +139,7 @@ Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, int error=0; struct addrinfo hints, *res, *resNew = NULL; - if (!initialized) { - ni_iacls = (*env)->FindClass(env, "java/net/InetAddress"); - ni_iacls = (*env)->NewGlobalRef(env, ni_iacls); - ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address"); - ni_ia4cls = (*env)->NewGlobalRef(env, ni_ia4cls); - ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "", "()V"); - initialized = 1; - } + initializeInetClasses(env); if (IS_NULL(host)) { JNU_ThrowNullPointerException(env, "host is null"); @@ -160,6 +163,17 @@ Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, return NULL; } +#ifdef MACOSX + /* If we're looking up the local machine, bypass DNS lookups and get + * address from getifaddrs. + */ + ret = lookupIfLocalhost(env, hostname, JNI_FALSE); + if (ret != NULL || (*env)->ExceptionCheck(env)) { + JNU_ReleaseStringPlatformChars(env, host, hostname); + return ret; + } +#endif + error = getaddrinfo(hostname, NULL, &hints, &res); if (error) { @@ -365,10 +379,7 @@ Java_java_net_Inet4AddressImpl_getLocalHostName(JNIEnv *env, jobject this) { return (*env)->NewStringUTF(env, hostname); } -static jclass ni_iacls; -static jclass ni_ia4cls; -static jmethodID ni_ia4ctrID; -static int initialized = 0; +extern jobjectArray lookupIfLocalhost(JNIEnv *env, const char *hostname, jboolean includeV6); /* * Find an internet address for a given hostname. Note that this @@ -390,14 +401,7 @@ Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, int error = 0; struct addrinfo hints, *res, *resNew = NULL; - if (!initialized) { - ni_iacls = (*env)->FindClass(env, "java/net/InetAddress"); - ni_iacls = (*env)->NewGlobalRef(env, ni_iacls); - ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address"); - ni_ia4cls = (*env)->NewGlobalRef(env, ni_ia4cls); - ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "", "()V"); - initialized = 1; - } + initializeInetClasses(env); if (IS_NULL(host)) { JNU_ThrowNullPointerException(env, "host is null"); diff --git a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c index 4fc64867f8b..dc5a4b63284 100644 --- a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,9 @@ #include #include #include -#ifdef _ALLBSD_SOURCE +#ifdef MACOSX +#include +#include #include /* gethostname */ #endif @@ -121,7 +123,145 @@ static jclass ni_ia6cls; static jmethodID ni_ia4ctrID; static jmethodID ni_ia6ctrID; static jfieldID ni_ia6ipaddressID; -static int initialized = 0; + +static void initializeInetClasses(JNIEnv *env) +{ + static int initialized = 0; + if (!initialized) { + ni_iacls = (*env)->FindClass(env, "java/net/InetAddress"); + ni_iacls = (*env)->NewGlobalRef(env, ni_iacls); + ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address"); + ni_ia4cls = (*env)->NewGlobalRef(env, ni_ia4cls); + ni_ia6cls = (*env)->FindClass(env, "java/net/Inet6Address"); + ni_ia6cls = (*env)->NewGlobalRef(env, ni_ia6cls); + ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "", "()V"); + ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "", "()V"); + ni_ia6ipaddressID = (*env)->GetFieldID(env, ni_ia6cls, "ipaddress", "[B"); + initialized = 1; + } +} + +#ifdef MACOSX +/* also called from Inet4AddressImpl.c */ +__private_extern__ jobjectArray +lookupIfLocalhost(JNIEnv *env, const char *hostname, jboolean includeV6) +{ + jobjectArray result = NULL; + jboolean preferIPv6Address; + char myhostname[NI_MAXHOST+1]; + struct ifaddrs *ifa = NULL; + int familyOrder = 0; + int count = 0, i, j; + int addrs4 = 0, addrs6 = 0, numV4Loopbacks = 0, numV6Loopbacks = 0; + jboolean includeLoopback = JNI_FALSE; + jobject name; + + // Make sure static variables we need are set. + initializeInetClasses(env); + + /* get the address preference */ + preferIPv6Address = (*env)->GetStaticBooleanField(env, ia_class, ia_preferIPv6AddressID); + + /* If the requested name matches this host's hostname, return IP addresses + * from all attached interfaces. (#2844683 et al) This prevents undesired + * PPP dialup, but may return addresses that don't actually correspond to + * the name (if the name actually matches something in DNS etc. + */ + myhostname[0] = '\0'; + if (JVM_GetHostName(myhostname, NI_MAXHOST)) { + /* Something went wrong, maybe networking is not setup? */ + return NULL; + } + myhostname[NI_MAXHOST] = '\0'; + + if (strcmp(myhostname, hostname) != 0) { + // Non-self lookup + return NULL; + } + + if (getifaddrs(&ifa) != 0) { + NET_ThrowNew(env, errno, "Can't get local interface addresses"); + return NULL; + } + + name = (*env)->NewStringUTF(env, hostname); + + /* Iterate over the interfaces, and total up the number of IPv4 and IPv6 + * addresses we have. Also keep a count of loopback addresses. We need to + * exclude them in the normal case, but return them if we don't get an IP + * address. + */ + struct ifaddrs *iter = ifa; + while (iter) { + int family = iter->ifa_addr->sa_family; + if (iter->ifa_name[0] != '\0' && iter->ifa_addr) + { + jboolean isLoopback = iter->ifa_flags & IFF_LOOPBACK; + if (family == AF_INET) { + addrs4++; + if (isLoopback) numV4Loopbacks++; + } else if (family == AF_INET6 && includeV6) { + addrs6++; + if (isLoopback) numV6Loopbacks++; + } else { + /* We don't care e.g. AF_LINK */ + } + } + iter = iter->ifa_next; + } + + if (addrs4 == numV4Loopbacks && addrs6 == numV6Loopbacks) { + // We don't have a real IP address, just loopback. We need to include + // loopback in our results. + includeLoopback = JNI_TRUE; + } + + /* Create and fill the Java array. */ + int arraySize = addrs4 + addrs6 - + (includeLoopback ? 0 : (numV4Loopbacks + numV6Loopbacks)); + result = (*env)->NewObjectArray(env, arraySize, ni_iacls, NULL); + if (!result) goto done; + + if (preferIPv6Address) { + i = includeLoopback ? addrs6 : (addrs6 - numV6Loopbacks); + j = 0; + } else { + i = 0; + j = includeLoopback ? addrs4 : (addrs4 - numV4Loopbacks); + } + + // Now loop around the ifaddrs + iter = ifa; + while (iter != NULL) { + jboolean isLoopback = iter->ifa_flags & IFF_LOOPBACK; + int family = iter->ifa_addr->sa_family; + + if (iter->ifa_name[0] != '\0' && iter->ifa_addr + && (family == AF_INET || (family == AF_INET6 && includeV6)) + && (!isLoopback || includeLoopback)) + { + int port; + int index = (family == AF_INET) ? i++ : j++; + jobject o = NET_SockaddrToInetAddress(env, iter->ifa_addr, &port); + if (!o) { + freeifaddrs(ifa); + if (!(*env)->ExceptionCheck(env)) + JNU_ThrowOutOfMemoryError(env, "Object allocation failed"); + return NULL; + } + setInetAddress_hostName(env, o, name); + (*env)->SetObjectArrayElement(env, result, index, o); + (*env)->DeleteLocalRef(env, o); + } + iter = iter->ifa_next; + } + + done: + freeifaddrs(ifa); + + return result; +} +#endif /* * Find an internet address for a given hostname. Note that this @@ -147,18 +287,7 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, struct addrinfo hints, *res, *resNew = NULL; #endif /* AF_INET6 */ - if (!initialized) { - ni_iacls = (*env)->FindClass(env, "java/net/InetAddress"); - ni_iacls = (*env)->NewGlobalRef(env, ni_iacls); - ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address"); - ni_ia4cls = (*env)->NewGlobalRef(env, ni_ia4cls); - ni_ia6cls = (*env)->FindClass(env, "java/net/Inet6Address"); - ni_ia6cls = (*env)->NewGlobalRef(env, ni_ia6cls); - ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "", "()V"); - ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "", "()V"); - ni_ia6ipaddressID = (*env)->GetFieldID(env, ni_ia6cls, "ipaddress", "[B"); - initialized = 1; - } + initializeInetClasses(env); if (IS_NULL(host)) { JNU_ThrowNullPointerException(env, "host is null"); @@ -167,6 +296,21 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, hostname = JNU_GetStringPlatformChars(env, host, JNI_FALSE); CHECK_NULL_RETURN(hostname, NULL); +#ifdef MACOSX + /* + * If getaddrinfo has failed and we're looking up the local machine, we + * attempt to get the address from getifaddrs. This ensures we get an + * IPv6 address for the local machine. + */ + if (error) { + ret = lookupIfLocalhost(env, hostname, JNI_TRUE); + if (ret != NULL || (*env)->ExceptionCheck(env)) { + JNU_ReleaseStringPlatformChars(env, host, hostname); + return ret; + } + } +#endif + #ifdef AF_INET6 static jfieldID ia_preferIPv6AddressID; if (ia_preferIPv6AddressID == NULL) { diff --git a/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java b/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java new file mode 100644 index 00000000000..c34e6e4ae79 --- /dev/null +++ b/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8023524 + * @summary tests logging generated classes for lambda + * @library /java/nio/file + * @run testng LogGeneratedClassesTest + */ +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.PosixFileAttributeView; +import java.util.stream.Stream; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.SkipException; + +import static java.nio.file.attribute.PosixFilePermissions.*; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + +public class LogGeneratedClassesTest extends LUtils { + String longFQCN; + + @BeforeClass + public void setup() throws IOException { + final List scratch = new ArrayList<>(); + scratch.clear(); + scratch.add("package com.example;"); + scratch.add("public class TestLambda {"); + scratch.add(" interface I {"); + scratch.add(" int foo();"); + scratch.add(" }"); + scratch.add(" public static void main(String[] args) {"); + scratch.add(" I lam = () -> 10;"); + scratch.add(" Runnable r = () -> {"); + scratch.add(" System.out.println(\"Runnable\");"); + scratch.add(" };"); + scratch.add(" r.run();"); + scratch.add(" System.out.println(\"Finish\");"); + scratch.add(" }"); + scratch.add("}"); + + File test = new File("TestLambda.java"); + createFile(test, scratch); + compile("-d", ".", test.getName()); + + scratch.remove(0); + scratch.remove(0); + scratch.add(0, "public class LongPackageName {"); + StringBuilder sb = new StringBuilder("com.example."); + // longer than 255 which exceed max length of most filesystems + for (int i = 0; i < 30; i++) { + sb.append("nonsense."); + } + sb.append("enough"); + longFQCN = sb.toString() + ".LongPackageName"; + sb.append(";"); + sb.insert(0, "package "); + scratch.add(0, sb.toString()); + test = new File("LongPackageName.java"); + createFile(test, scratch); + compile("-d", ".", test.getName()); + + // create target + Files.createDirectory(Paths.get("dump")); + Files.createDirectories(Paths.get("dumpLong/com/example/nonsense")); + Files.createFile(Paths.get("dumpLong/com/example/nonsense/nonsense")); + Files.createFile(Paths.get("file")); + } + + @AfterClass + public void cleanup() throws IOException { + Files.delete(Paths.get("TestLambda.java")); + Files.delete(Paths.get("LongPackageName.java")); + Files.delete(Paths.get("file")); + TestUtil.removeAll(Paths.get("com")); + TestUtil.removeAll(Paths.get("dump")); + TestUtil.removeAll(Paths.get("dumpLong")); + } + + @Test + public void testNotLogging() { + TestResult tr = doExec(JAVA_CMD.getAbsolutePath(), + "-cp", ".", + "-Djava.security.manager", + "com.example.TestLambda"); + tr.assertZero("Should still return 0"); + } + + @Test + public void testLogging() throws IOException { + assertTrue(Files.exists(Paths.get("dump"))); + TestResult tr = doExec(JAVA_CMD.getAbsolutePath(), + "-cp", ".", + "-Djdk.internal.lambda.dumpProxyClasses=dump", + "-Djava.security.manager", + "com.example.TestLambda"); + // dump/com/example + 2 class files + assertEquals(Files.walk(Paths.get("dump")).count(), 5, "Two lambda captured"); + tr.assertZero("Should still return 0"); + } + + @Test + public void testDumpDirNotExist() throws IOException { + assertFalse(Files.exists(Paths.get("notExist"))); + TestResult tr = doExec(JAVA_CMD.getAbsolutePath(), + "-cp", ".", + "-Djdk.internal.lambda.dumpProxyClasses=notExist", + "-Djava.security.manager", + "com.example.TestLambda"); + assertEquals(tr.testOutput.stream() + .filter(s -> s.startsWith("WARNING")) + .peek(s -> assertTrue(s.contains("does not exist"))) + .count(), + 1, "only show error once"); + tr.assertZero("Should still return 0"); + } + + @Test + public void testDumpDirIsFile() throws IOException { + assertTrue(Files.isRegularFile(Paths.get("file"))); + TestResult tr = doExec(JAVA_CMD.getAbsolutePath(), + "-cp", ".", + "-Djdk.internal.lambda.dumpProxyClasses=file", + "-Djava.security.manager", + "com.example.TestLambda"); + assertEquals(tr.testOutput.stream() + .filter(s -> s.startsWith("WARNING")) + .peek(s -> assertTrue(s.contains("not a directory"))) + .count(), + 1, "only show error once"); + tr.assertZero("Should still return 0"); + } + + @Test + public void testDumpDirNotWritable() throws IOException { + if (! Files.getFileStore(Paths.get(".")) + .supportsFileAttributeView(PosixFileAttributeView.class)) { + // No easy way to setup readonly directory + throw new SkipException("Posix not supported"); + } + + Files.createDirectory(Paths.get("readOnly"), + asFileAttribute(fromString("r-xr-xr-x"))); + + TestResult tr = doExec(JAVA_CMD.getAbsolutePath(), + "-cp", ".", + "-Djdk.internal.lambda.dumpProxyClasses=readOnly", + "-Djava.security.manager", + "com.example.TestLambda"); + assertEquals(tr.testOutput.stream() + .filter(s -> s.startsWith("WARNING")) + .peek(s -> assertTrue(s.contains("not writable"))) + .count(), + 1, "only show error once"); + tr.assertZero("Should still return 0"); + + TestUtil.removeAll(Paths.get("readOnly")); + } + + @Test + public void testLoggingException() throws IOException { + assertTrue(Files.exists(Paths.get("dumpLong"))); + TestResult tr = doExec(JAVA_CMD.getAbsolutePath(), + "-cp", ".", + "-Djdk.internal.lambda.dumpProxyClasses=dumpLong", + "-Djava.security.manager", + longFQCN); + assertEquals(tr.testOutput.stream() + .filter(s -> s.startsWith("WARNING: Exception")) + .count(), + 2, "show error each capture"); + // dumpLong/com/example/nosense/nosense + assertEquals(Files.walk(Paths.get("dumpLong")).count(), 5, "Two lambda captured failed to log"); + tr.assertZero("Should still return 0"); + } +} diff --git a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java index cf2c3a1dad6..59d2ca15b98 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java +++ b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java @@ -190,8 +190,69 @@ public class TCKDateTimeFormatterBuilder { //----------------------------------------------------------------------- @Test(expectedExceptions=NullPointerException.class) - public void test_appendValueReduced_null() throws Exception { - builder.appendValueReduced(null, 2, 2000); + public void test_appendValueReduced_int_nullField() throws Exception { + builder.appendValueReduced(null, 2, 2, 2000); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_appendValueReduced_int_minWidthTooSmall() throws Exception { + builder.appendValueReduced(YEAR, 0, 2, 2000); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_appendValueReduced_int_minWidthTooBig() throws Exception { + builder.appendValueReduced(YEAR, 11, 2, 2000); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_appendValueReduced_int_maxWidthTooSmall() throws Exception { + builder.appendValueReduced(YEAR, 2, 0, 2000); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_appendValueReduced_int_maxWidthTooBig() throws Exception { + builder.appendValueReduced(YEAR, 2, 11, 2000); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_appendValueReduced_int_maxWidthLessThanMin() throws Exception { + builder.appendValueReduced(YEAR, 2, 1, 2000); + } + + //----------------------------------------------------------------------- + @Test(expectedExceptions=NullPointerException.class) + public void test_appendValueReduced_date_nullField() throws Exception { + builder.appendValueReduced(null, 2, 2, LocalDate.of(2000, 1, 1)); + } + + @Test(expectedExceptions=NullPointerException.class) + public void test_appendValueReduced_date_nullDate() throws Exception { + builder.appendValueReduced(YEAR, 2, 2, null); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_appendValueReduced_date_minWidthTooSmall() throws Exception { + builder.appendValueReduced(YEAR, 0, 2, LocalDate.of(2000, 1, 1)); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_appendValueReduced_date_minWidthTooBig() throws Exception { + builder.appendValueReduced(YEAR, 11, 2, LocalDate.of(2000, 1, 1)); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_appendValueReduced_date_maxWidthTooSmall() throws Exception { + builder.appendValueReduced(YEAR, 2, 0, LocalDate.of(2000, 1, 1)); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_appendValueReduced_date_maxWidthTooBig() throws Exception { + builder.appendValueReduced(YEAR, 2, 11, LocalDate.of(2000, 1, 1)); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_appendValueReduced_date_maxWidthLessThanMin() throws Exception { + builder.appendValueReduced(YEAR, 2, 1, LocalDate.of(2000, 1, 1)); } //----------------------------------------------------------------------- diff --git a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java index f30eb9906b3..d431fa4acb3 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java +++ b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java @@ -126,9 +126,10 @@ public class TCKDateTimeFormatters { @Test public void test_pattern_String() { DateTimeFormatter test = DateTimeFormatter.ofPattern("d MMM yyyy"); + Locale fmtLocale = Locale.getDefault(Locale.Category.FORMAT); assertEquals(test.format(LocalDate.of(2012, 6, 30)), "30 " + - Month.JUNE.getDisplayName(TextStyle.SHORT, Locale.getDefault()) + " 2012"); - assertEquals(test.getLocale(), Locale.getDefault()); + Month.JUNE.getDisplayName(TextStyle.SHORT, fmtLocale) + " 2012"); + assertEquals(test.getLocale(), fmtLocale, "Locale.Category.FORMAT"); } @Test(expectedExceptions=IllegalArgumentException.class) diff --git a/jdk/test/java/time/test/java/time/format/TestDateTimeFormatter.java b/jdk/test/java/time/test/java/time/format/TestDateTimeFormatter.java index 540a0e89a16..1bfa4799320 100644 --- a/jdk/test/java/time/test/java/time/format/TestDateTimeFormatter.java +++ b/jdk/test/java/time/test/java/time/format/TestDateTimeFormatter.java @@ -61,12 +61,32 @@ package test.java.time.format; import static java.time.temporal.ChronoField.DAY_OF_MONTH; import static org.testng.Assert.assertSame; +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; -import java.time.format.DecimalStyle; +import java.time.DateTimeException; +import java.time.DayOfWeek; +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.Month; +import java.time.MonthDay; +import java.time.OffsetDateTime; +import java.time.OffsetTime; +import java.time.Year; +import java.time.YearMonth; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.chrono.ThaiBuddhistChronology; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; +import java.time.format.DecimalStyle; import java.time.format.SignStyle; +import java.time.temporal.TemporalAccessor; import java.util.Locale; +import java.util.function.Function; import org.testng.annotations.Test; @@ -87,4 +107,93 @@ public class TestDateTimeFormatter { assertSame(test, base); } + @Test + public void test_parse_errorMessage() throws Exception { + assertGoodErrorDate(DayOfWeek::from, "DayOfWeek"); + assertGoodErrorDate(Month::from, "Month"); + assertGoodErrorDate(YearMonth::from, "YearMonth"); + assertGoodErrorDate(MonthDay::from, "MonthDay"); + assertGoodErrorDate(LocalDate::from, "LocalDate"); + assertGoodErrorDate(LocalTime::from, "LocalTime"); + assertGoodErrorDate(LocalDateTime::from, "LocalDateTime"); + assertGoodErrorDate(OffsetTime::from, "OffsetTime"); + assertGoodErrorDate(OffsetDateTime::from, "OffsetDateTime"); + assertGoodErrorDate(ZonedDateTime::from, "ZonedDateTime"); + assertGoodErrorDate(Instant::from, "Instant"); + assertGoodErrorDate(ZoneOffset::from, "ZoneOffset"); + assertGoodErrorDate(ZoneId::from, "ZoneId"); + assertGoodErrorDate(ThaiBuddhistChronology.INSTANCE::date, ""); + + assertGoodErrorTime(DayOfWeek::from, "DayOfWeek"); + assertGoodErrorTime(Month::from, "Month"); + assertGoodErrorTime(Year::from, "Year"); + assertGoodErrorTime(YearMonth::from, "YearMonth"); + assertGoodErrorTime(MonthDay::from, "MonthDay"); + assertGoodErrorTime(LocalDate::from, "LocalDate"); + assertGoodErrorTime(LocalTime::from, "LocalTime"); + assertGoodErrorTime(LocalDateTime::from, "LocalDateTime"); + assertGoodErrorTime(OffsetTime::from, "OffsetTime"); + assertGoodErrorTime(OffsetDateTime::from, "OffsetDateTime"); + assertGoodErrorTime(ZonedDateTime::from, "ZonedDateTime"); + assertGoodErrorTime(Instant::from, "Instant"); + assertGoodErrorTime(ZoneOffset::from, "ZoneOffset"); + assertGoodErrorTime(ZoneId::from, "ZoneId"); + assertGoodErrorTime(ThaiBuddhistChronology.INSTANCE::date, ""); + } + + private void assertGoodErrorDate(Function function, String expectedText) { + DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyy-mm-dd"); + TemporalAccessor temporal = f.parse("2010-06-30"); + try { + function.apply(temporal); + fail("Should have failed"); + } catch (DateTimeException ex) { + String msg = ex.getMessage(); + assertTrue(msg.contains(expectedText), msg); + assertTrue(msg.contains("Year"), msg); + assertTrue(msg.contains("MinuteOfHour"), msg); + assertTrue(msg.contains("DayOfMonth"), msg); + } + } + + private void assertGoodErrorTime(Function function, String expectedText) { + DateTimeFormatter f = DateTimeFormatter.ofPattern("HH:MM:ss"); + TemporalAccessor temporal = f.parse("11:30:56"); + try { + function.apply(temporal); + fail("Should have failed"); + } catch (DateTimeException ex) { + String msg = ex.getMessage(); + assertTrue(msg.contains(expectedText), msg); + assertTrue(msg.contains("HourOfDay"), msg); + assertTrue(msg.contains("MonthOfYear"), msg); + assertTrue(msg.contains("SecondOfMinute"), msg); + } + } + + @Test + public void test_parsed_toString_resolvedTime() { + DateTimeFormatter f = DateTimeFormatter.ofPattern("HH:mm:ss"); + TemporalAccessor temporal = f.parse("11:30:56"); + String msg = temporal.toString(); + assertTrue(msg.contains("11:30:56"), msg); + } + + @Test + public void test_parsed_toString_resolvedDate() { + DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + TemporalAccessor temporal = f.parse("2010-06-30"); + String msg = temporal.toString(); + assertTrue(msg.contains("2010-06-30"), msg); + } + + @Test + public void test_parsed_toString_resolvedDateTime() { + DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + TemporalAccessor temporal = f.parse("2010-06-30 11:30:56"); + String msg = temporal.toString(); + assertTrue(msg.contains("2010-06-30"), msg); + assertTrue(msg.contains("11:30:56"), msg); + } + } diff --git a/jdk/test/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java b/jdk/test/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java index bdaf22be8f7..16a7d6ed72e 100644 --- a/jdk/test/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java +++ b/jdk/test/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java @@ -267,12 +267,12 @@ public class TestDateTimeFormatterBuilder { //----------------------------------------------------------------------- @Test(expectedExceptions=NullPointerException.class) public void test_appendValueReduced_null() throws Exception { - builder.appendValueReduced(null, 2, 2000); + builder.appendValueReduced(null, 2, 2, 2000); } @Test public void test_appendValueReduced() throws Exception { - builder.appendValueReduced(YEAR, 2, 2000); + builder.appendValueReduced(YEAR, 2, 2, 2000); DateTimeFormatter f = builder.toFormatter(); assertEquals(f.toString(), "ReducedValue(Year,2,2,2000)"); TemporalAccessor parsed = f.parseUnresolved("12", new ParsePosition(0)); @@ -281,7 +281,7 @@ public class TestDateTimeFormatterBuilder { @Test public void test_appendValueReduced_subsequent_parse() throws Exception { - builder.appendValue(MONTH_OF_YEAR, 1, 2, SignStyle.NORMAL).appendValueReduced(YEAR, 2, 2000); + builder.appendValue(MONTH_OF_YEAR, 1, 2, SignStyle.NORMAL).appendValueReduced(YEAR, 2, 2, 2000); DateTimeFormatter f = builder.toFormatter(); assertEquals(f.toString(), "Value(MonthOfYear,1,2,NORMAL)ReducedValue(Year,2,2,2000)"); ParsePosition ppos = new ParsePosition(0); @@ -654,19 +654,19 @@ public class TestDateTimeFormatterBuilder { {"GGGGG", "Text(Era,NARROW)"}, {"u", "Value(Year)"}, - {"uu", "ReducedValue(Year,2,2,2000)"}, + {"uu", "ReducedValue(Year,2,2,2000-01-01)"}, {"uuu", "Value(Year,3,19,NORMAL)"}, {"uuuu", "Value(Year,4,19,EXCEEDS_PAD)"}, {"uuuuu", "Value(Year,5,19,EXCEEDS_PAD)"}, {"y", "Value(YearOfEra)"}, - {"yy", "ReducedValue(YearOfEra,2,2,2000)"}, + {"yy", "ReducedValue(YearOfEra,2,2,2000-01-01)"}, {"yyy", "Value(YearOfEra,3,19,NORMAL)"}, {"yyyy", "Value(YearOfEra,4,19,EXCEEDS_PAD)"}, {"yyyyy", "Value(YearOfEra,5,19,EXCEEDS_PAD)"}, {"Y", "Localized(WeekBasedYear)"}, - {"YY", "Localized(ReducedValue(WeekBasedYear,2,2000))"}, + {"YY", "Localized(ReducedValue(WeekBasedYear,2,2,2000-01-01))"}, {"YYY", "Localized(WeekBasedYear,3,19,NORMAL)"}, {"YYYY", "Localized(WeekBasedYear,4,19,EXCEEDS_PAD)"}, {"YYYYY", "Localized(WeekBasedYear,5,19,EXCEEDS_PAD)"}, diff --git a/jdk/test/java/time/test/java/time/format/TestReducedParser.java b/jdk/test/java/time/test/java/time/format/TestReducedParser.java index 237b5b9416d..ae4ff981403 100644 --- a/jdk/test/java/time/test/java/time/format/TestReducedParser.java +++ b/jdk/test/java/time/test/java/time/format/TestReducedParser.java @@ -64,11 +64,20 @@ import static java.time.temporal.ChronoField.DAY_OF_YEAR; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; import static java.time.temporal.ChronoField.YEAR; import static java.time.temporal.ChronoField.YEAR_OF_ERA; +import static java.time.temporal.ChronoUnit.YEARS; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertNotNull; import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.chrono.Chronology; +import java.time.chrono.ChronoLocalDate; +import java.time.chrono.HijrahChronology; +import java.time.chrono.IsoChronology; +import java.time.chrono.JapaneseChronology; +import java.time.chrono.MinguoChronology; +import java.time.chrono.ThaiBuddhistChronology; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.time.temporal.TemporalAccessor; @@ -86,13 +95,17 @@ public class TestReducedParser extends AbstractTestPrinterParser { private static final boolean LENIENT = false; private DateTimeFormatter getFormatter0(TemporalField field, int width, int baseValue) { - return builder.appendValueReduced(field, width, baseValue).toFormatter(locale).withDecimalStyle(decimalStyle); + return builder.appendValueReduced(field, width, width, baseValue).toFormatter(locale).withDecimalStyle(decimalStyle); } private DateTimeFormatter getFormatter0(TemporalField field, int minWidth, int maxWidth, int baseValue) { return builder.appendValueReduced(field, minWidth, maxWidth, baseValue).toFormatter(locale).withDecimalStyle(decimalStyle); } + private DateTimeFormatter getFormatterBaseDate(TemporalField field, int minWidth, int maxWidth, int baseValue) { + return builder.appendValueReduced(field, minWidth, maxWidth, LocalDate.of(baseValue, 1, 1)).toFormatter(locale).withDecimalStyle(decimalStyle); + } + //----------------------------------------------------------------------- @DataProvider(name="error") Object[][] data_error() { @@ -243,6 +256,10 @@ public class TestReducedParser extends AbstractTestPrinterParser { // Negative baseValue {YEAR, 2, 4, -2005, "123", 0, strict(3, 123), lenient(3, 123)}, + + // Basics + {YEAR, 2, 4, 2010, "10", 0, strict(2, 2010), lenient(2, 2010)}, + {YEAR, 2, 4, 2010, "09", 0, strict(2, 2109), lenient(2, 2109)}, }; } @@ -264,6 +281,21 @@ public class TestReducedParser extends AbstractTestPrinterParser { } } + @Test(dataProvider="ParseLenientSensitive") + public void test_parseStrict_baseDate(TemporalField field, int minWidth, int maxWidth, int baseValue, String input, int pos, + Pair strict, Pair lenient) { + ParsePosition ppos = new ParsePosition(pos); + setStrict(true); + TemporalAccessor parsed = getFormatterBaseDate(field, minWidth, maxWidth, baseValue).parseUnresolved(input, ppos); + if (ppos.getErrorIndex() != -1) { + assertEquals(ppos.getErrorIndex(), strict.parseLen, "error case parse position"); + assertEquals(parsed, strict.parseVal, "unexpected parse result"); + } else { + assertEquals(ppos.getIndex(), strict.parseLen, "parse position"); + assertParsed(parsed, YEAR, strict.parseVal != null ? (long) strict.parseVal : null); + } + } + //----------------------------------------------------------------------- // Parsing tests for lenient mode //----------------------------------------------------------------------- @@ -282,6 +314,21 @@ public class TestReducedParser extends AbstractTestPrinterParser { } } + @Test(dataProvider="ParseLenientSensitive") + public void test_parseLenient_baseDate(TemporalField field, int minWidth, int maxWidth, int baseValue, String input, int pos, + Pair strict, Pair lenient) { + ParsePosition ppos = new ParsePosition(pos); + setStrict(false); + TemporalAccessor parsed = getFormatterBaseDate(field, minWidth, maxWidth, baseValue).parseUnresolved(input, ppos); + if (ppos.getErrorIndex() != -1) { + assertEquals(ppos.getErrorIndex(), lenient.parseLen, "error case parse position"); + assertEquals(parsed, lenient.parseVal, "unexpected parse result"); + } else { + assertEquals(ppos.getIndex(), lenient.parseLen, "parse position"); + assertParsed(parsed, YEAR, lenient.parseVal != null ? (long) lenient.parseVal : null); + } + } + private void assertParsed(TemporalAccessor parsed, TemporalField field, Long value) { if (value == null) { assertEquals(parsed, null, "Parsed Value"); @@ -334,6 +381,68 @@ public class TestReducedParser extends AbstractTestPrinterParser { } } + //----------------------------------------------------------------------- + // Cases and values in reduced value parsing mode + //----------------------------------------------------------------------- + @DataProvider(name="ReducedWithChrono") + Object[][] provider_reducedWithChrono() { + LocalDate baseYear = LocalDate.of(2000, 1, 1); + return new Object[][] { + {IsoChronology.INSTANCE.date(baseYear)}, + {IsoChronology.INSTANCE.date(baseYear).plus(1, YEARS)}, + {IsoChronology.INSTANCE.date(baseYear).plus(99, YEARS)}, + {HijrahChronology.INSTANCE.date(baseYear)}, + {HijrahChronology.INSTANCE.date(baseYear).plus(1, YEARS)}, + {HijrahChronology.INSTANCE.date(baseYear).plus(99, YEARS)}, + {JapaneseChronology.INSTANCE.date(baseYear)}, + {JapaneseChronology.INSTANCE.date(baseYear).plus(1, YEARS)}, + {JapaneseChronology.INSTANCE.date(baseYear).plus(99, YEARS)}, + {MinguoChronology.INSTANCE.date(baseYear)}, + {MinguoChronology.INSTANCE.date(baseYear).plus(1, YEARS)}, + {MinguoChronology.INSTANCE.date(baseYear).plus(99, YEARS)}, + {ThaiBuddhistChronology.INSTANCE.date(baseYear)}, + {ThaiBuddhistChronology.INSTANCE.date(baseYear).plus(1, YEARS)}, + {ThaiBuddhistChronology.INSTANCE.date(baseYear).plus(99, YEARS)}, + }; + } + + @Test(dataProvider="ReducedWithChrono") + public void test_reducedWithChronoYear(ChronoLocalDate date) { + Chronology chrono = date.getChronology(); + DateTimeFormatter df + = new DateTimeFormatterBuilder().appendValueReduced(YEAR, 2, 2, LocalDate.of(2000, 1, 1)) + .toFormatter() + .withChronology(chrono); + int expected = date.get(YEAR); + String input = df.format(date); + + ParsePosition pos = new ParsePosition(0); + TemporalAccessor parsed = df.parseUnresolved(input, pos); + int actual = parsed.get(YEAR); + assertEquals(actual, expected, + String.format("Wrong date parsed, chrono: %s, input: %s", + chrono, input)); + + } + @Test(dataProvider="ReducedWithChrono") + public void test_reducedWithChronoYearOfEra(ChronoLocalDate date) { + Chronology chrono = date.getChronology(); + DateTimeFormatter df + = new DateTimeFormatterBuilder().appendValueReduced(YEAR_OF_ERA, 2, 2, LocalDate.of(2000, 1, 1)) + .toFormatter() + .withChronology(chrono); + int expected = date.get(YEAR_OF_ERA); + String input = df.format(date); + + ParsePosition pos = new ParsePosition(0); + TemporalAccessor parsed = df.parseUnresolved(input, pos); + int actual = parsed.get(YEAR_OF_ERA); + assertEquals(actual, expected, + String.format("Wrong date parsed, chrono: %s, input: %s", + chrono, input)); + + } + //----------------------------------------------------------------------- // Class to structure the test data //----------------------------------------------------------------------- diff --git a/jdk/test/java/time/test/java/time/format/TestReducedPrinter.java b/jdk/test/java/time/test/java/time/format/TestReducedPrinter.java index c23cff27373..c4b6cf4dc39 100644 --- a/jdk/test/java/time/test/java/time/format/TestReducedPrinter.java +++ b/jdk/test/java/time/test/java/time/format/TestReducedPrinter.java @@ -59,19 +59,15 @@ */ package test.java.time.format; -import java.text.ParsePosition; import static java.time.temporal.ChronoField.YEAR; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; import java.time.DateTimeException; import java.time.LocalDate; +import java.time.chrono.MinguoDate; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; -import static java.time.temporal.ChronoField.DAY_OF_MONTH; -import static java.time.temporal.ChronoField.MONTH_OF_YEAR; -import static java.time.temporal.ChronoField.YEAR_OF_ERA; -import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; import org.testng.annotations.DataProvider; @@ -85,13 +81,17 @@ import test.java.time.temporal.MockFieldValue; public class TestReducedPrinter extends AbstractTestPrinterParser { private DateTimeFormatter getFormatter0(TemporalField field, int width, int baseValue) { - return builder.appendValueReduced(field, width, baseValue).toFormatter(locale).withDecimalStyle(decimalStyle); + return builder.appendValueReduced(field, width, width, baseValue).toFormatter(locale).withDecimalStyle(decimalStyle); } private DateTimeFormatter getFormatter0(TemporalField field, int minWidth, int maxWidth, int baseValue) { return builder.appendValueReduced(field, minWidth, maxWidth, baseValue).toFormatter(locale).withDecimalStyle(decimalStyle); } + private DateTimeFormatter getFormatterBaseDate(TemporalField field, int minWidth, int maxWidth, int baseValue) { + return builder.appendValueReduced(field, minWidth, maxWidth, LocalDate.of(baseValue, 1, 1)).toFormatter(locale).withDecimalStyle(decimalStyle); + } + //----------------------------------------------------------------------- @Test(expectedExceptions=DateTimeException.class) public void test_print_emptyCalendrical() throws Exception { @@ -192,6 +192,58 @@ public class TestReducedPrinter extends AbstractTestPrinterParser { } } + @Test(dataProvider="Pivot") + public void test_pivot_baseDate(int minWidth, int maxWidth, int baseValue, int value, String result) throws Exception { + try { + getFormatterBaseDate(YEAR, minWidth, maxWidth, baseValue).formatTo(new MockFieldValue(YEAR, value), buf); + if (result == null) { + fail("Expected exception"); + } + assertEquals(buf.toString(), result); + } catch (DateTimeException ex) { + if (result == null || value < 0) { + assertEquals(ex.getMessage().contains(YEAR.toString()), true); + } else { + throw ex; + } + } + } + + //----------------------------------------------------------------------- + public void test_minguoChrono_fixedWidth() throws Exception { + // ISO 2021 is Minguo 110 + DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 2, 2021); + MinguoDate date = MinguoDate.of(109, 6, 30); + assertEquals(f.format(date), "09"); + date = MinguoDate.of(110, 6, 30); + assertEquals(f.format(date), "10"); + date = MinguoDate.of(199, 6, 30); + assertEquals(f.format(date), "99"); + date = MinguoDate.of(200, 6, 30); + assertEquals(f.format(date), "00"); + date = MinguoDate.of(209, 6, 30); + assertEquals(f.format(date), "09"); + date = MinguoDate.of(210, 6, 30); + assertEquals(f.format(date), "10"); + } + + public void test_minguoChrono_extendedWidth() throws Exception { + // ISO 2021 is Minguo 110 + DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 4, 2021); + MinguoDate date = MinguoDate.of(109, 6, 30); + assertEquals(f.format(date), "109"); + date = MinguoDate.of(110, 6, 30); + assertEquals(f.format(date), "10"); + date = MinguoDate.of(199, 6, 30); + assertEquals(f.format(date), "99"); + date = MinguoDate.of(200, 6, 30); + assertEquals(f.format(date), "00"); + date = MinguoDate.of(209, 6, 30); + assertEquals(f.format(date), "09"); + date = MinguoDate.of(210, 6, 30); + assertEquals(f.format(date), "210"); + } + //----------------------------------------------------------------------- public void test_toString() throws Exception { assertEquals(getFormatter0(YEAR, 2, 2, 2005).toString(), "ReducedValue(Year,2,2,2005)"); diff --git a/jdk/test/java/util/HashSet/Serialization.java b/jdk/test/java/util/HashSet/Serialization.java new file mode 100644 index 00000000000..7597ae1a564 --- /dev/null +++ b/jdk/test/java/util/HashSet/Serialization.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.HashSet; +import java.util.Random; +import java.util.concurrent.ThreadLocalRandom; + +/* + * @test + * @bug 8016252 + * @summary Verify that a serialized HashSet may successfully be deserialized. + */ +public class Serialization { + + private static final int NUM_SETS = 43; + private static final int MAX_CAPACITY = 257; + private static final float MAX_LOAD_FACTOR = 100.0F; + + private static final Random rnd = ThreadLocalRandom.current(); + + private static HashSet createHashSet() { + int capacity = rnd.nextInt(MAX_CAPACITY); + float loadFactor = Float.MIN_VALUE + rnd.nextFloat()*MAX_LOAD_FACTOR; + HashSet hashSet = new HashSet(capacity, loadFactor); + float multiplier = 2*rnd.nextFloat(); // range [0,2] + int size = (int)(capacity*loadFactor*multiplier); + for (int i = 0; i < size; i++) { + hashSet.add(rnd.nextInt()); + } + return hashSet; + } + + private static HashSet serDeser(HashSet hashSet) throws IOException, ClassNotFoundException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(hashSet); + oos.flush(); + + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(bais); + HashSet result = (HashSet)ois.readObject(); + + oos.close(); + ois.close(); + + return result; + } + + private static void printHashSet(HashSet hashSet) { + System.err.println("Size: "+hashSet.size()); + for (Object o : hashSet) { + System.err.println(o); + } + } + + public static void main(String[] args) { + int failures = 0; + + for (int i = 0; i < NUM_SETS; i++) { + HashSet hashSet = createHashSet(); + + HashSet result = null; + try { + result = serDeser(hashSet); + } catch (IOException ioe) { + System.err.println(ioe); + failures++; + } catch (ClassNotFoundException cnfe) { + System.err.println(cnfe); + failures++; + } + + if (!hashSet.equals(result)) { + System.err.println("Unequal HashSets!"); + printHashSet(hashSet); + System.err.println(); + failures++; + } + } + + if (failures != 0) { + throw new RuntimeException("HashSet/Serialzation failed with "+ + failures+" failures!"); + } + } +} diff --git a/jdk/test/java/util/logging/Level/CustomLevel.java b/jdk/test/java/util/logging/Level/CustomLevel.java new file mode 100644 index 00000000000..a3c452a1e09 --- /dev/null +++ b/jdk/test/java/util/logging/Level/CustomLevel.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.*; +import java.util.*; +import java.util.logging.*; + +/* + * @test + * @bug 8026027 + * @summary Test Level.parse to look up custom levels by name and its + * localized name + * + * @run main/othervm CustomLevel + */ + +public class CustomLevel extends Level { + public CustomLevel(String name, int value, String resourceBundleName) { + super(name, value, resourceBundleName); + } + + private static final List levels = new ArrayList<>(); + private static final String RB_NAME = "myresource"; + public static void main(String[] args) throws Exception { + setupCustomLevels(); + + // Level.parse will return the custom Level instance + ResourceBundle rb = ResourceBundle.getBundle(RB_NAME); + for (Level level : levels) { + String name = level.getName(); + if (!name.equals("WARNING") && !name.equals("INFO")) { + // custom level whose name doesn't conflict with any standard one + checkCustomLevel(Level.parse(name), level); + } + String localizedName = rb.getString(level.getName()); + Level l = Level.parse(localizedName); + if (l != level) { + throw new RuntimeException("Unexpected level " + l + " " + l.getClass()); + } + } + } + + private static void setupCustomLevels() throws IOException { + levels.add(new CustomLevel("EMERGENCY", 1090, RB_NAME)); + levels.add(new CustomLevel("ALERT", 1060, RB_NAME)); + levels.add(new CustomLevel("CRITICAL", 1030, RB_NAME)); + levels.add(new CustomLevel("WARNING", 1010, RB_NAME)); + levels.add(new CustomLevel("INFO", 1000, RB_NAME)); + } + static void checkCustomLevel(Level level, Level expected) { + // Level value must be the same + if (!level.equals(expected)) { + throw new RuntimeException(formatLevel(level) + " != " + formatLevel(expected)); + } + + if (!level.getName().equals(expected.getName())) { + throw new RuntimeException(formatLevel(level) + " != " + formatLevel(expected)); + } + + // Level.parse is expected to return the custom Level + if (level != expected) { + throw new RuntimeException(formatLevel(level) + " != " + formatLevel(expected)); + } + + ResourceBundle rb = ResourceBundle.getBundle(RB_NAME); + String name = rb.getString(level.getName()); + if (!level.getLocalizedName().equals(name)) { + // must have the same localized name + throw new RuntimeException(level.getLocalizedName() + " != " + name); + } + } + + static String formatLevel(Level l) { + return l + ":" + l.intValue() + ":" + l.getClass().getName(); + } +} diff --git a/jdk/test/java/util/logging/Level/myresource.properties b/jdk/test/java/util/logging/Level/myresource.properties new file mode 100644 index 00000000000..2c8c4120544 --- /dev/null +++ b/jdk/test/java/util/logging/Level/myresource.properties @@ -0,0 +1,5 @@ +EMERGENCY=localized.emergency +ALERT=localized.alert +CRITICAL=localized.critical +WARNING=localized.warning +INFO=localized.info diff --git a/jdk/test/sun/security/provider/KeyStore/DKSTest.java b/jdk/test/sun/security/provider/KeyStore/DKSTest.java index c2b6baf3a42..d1c4f18fc95 100644 --- a/jdk/test/sun/security/provider/KeyStore/DKSTest.java +++ b/jdk/test/sun/security/provider/KeyStore/DKSTest.java @@ -81,8 +81,7 @@ public class DKSTest { int expected; KeyStore keystore = KeyStore.getInstance("DKS"); // load entries - keystore.load( - new KeyStore.DomainLoadStoreParameter(config, PASSWORDS)); + keystore.load(new DomainLoadStoreParameter(config, PASSWORDS)); cacertsCount = expected = keystore.size(); System.out.println("\nLoading domain keystore: " + config + "\t[" + expected + " entries]"); @@ -95,8 +94,7 @@ public class DKSTest { expected = cacertsCount + 1; keystore = KeyStore.getInstance("DKS"); // load entries - keystore.load( - new KeyStore.DomainLoadStoreParameter(config, PASSWORDS)); + keystore.load(new DomainLoadStoreParameter(config, PASSWORDS)); System.out.println("\nLoading domain keystore: " + config + "\t[" + expected + " entries]"); checkEntries(keystore, expected); @@ -109,7 +107,7 @@ public class DKSTest { keystore = KeyStore.getInstance("DKS"); // load entries keystore.load( - new KeyStore.DomainLoadStoreParameter(config, + new DomainLoadStoreParameter(config, Collections.emptyMap())); System.out.println("\nLoading domain keystore: " + config + "\t[" + expected + " entries]"); @@ -129,8 +127,7 @@ public class DKSTest { expected = 0; keystore = KeyStore.getInstance("DKS"); // load entries - keystore.load( - new KeyStore.DomainLoadStoreParameter(config, PASSWORDS)); + keystore.load(new DomainLoadStoreParameter(config, PASSWORDS)); System.out.println("\nLoading domain keystore: " + config + "\t[" + expected + " entries]"); checkEntries(keystore, expected); @@ -142,8 +139,7 @@ public class DKSTest { expected = 2 + 1 + 1 + 1; keystore = KeyStore.getInstance("DKS"); // load entries - keystore.load( - new KeyStore.DomainLoadStoreParameter(config, PASSWORDS)); + keystore.load(new DomainLoadStoreParameter(config, PASSWORDS)); System.out.println("\nLoading domain keystore: " + config + "\t[" + expected + " entries]"); checkEntries(keystore, expected); @@ -158,12 +154,10 @@ public class DKSTest { config = new URI(CONFIG + "#keystores_tmp"); System.out.println("Storing domain keystore: " + config + "\t[" + expected + " entries]"); - keystore.store( - new KeyStore.DomainLoadStoreParameter(config, PASSWORDS)); + keystore.store(new DomainLoadStoreParameter(config, PASSWORDS)); keystore = KeyStore.getInstance("DKS"); // reload entries - keystore.load( - new KeyStore.DomainLoadStoreParameter(config, PASSWORDS)); + keystore.load(new DomainLoadStoreParameter(config, PASSWORDS)); System.out.println("Reloading domain keystore: " + config + "\t[" + expected + " entries]"); checkEntries(keystore, expected);