changeset 14105:63b345c88831 jdk8u222-b06

Merge
author andrew
date Wed, 05 Jun 2019 05:16:47 +0100
parents d0cccfd32b1e (current diff) 087541244a57 (diff)
children fdf8e86e8126
files src/solaris/classes/sun/print/UnixPrintServiceLookup.java src/solaris/classes/sun/print/services/javax.print.PrintServiceLookup src/solaris/classes/sun/print/services/javax.print.StreamPrintServiceFactory src/windows/classes/sun/print/Win32PrintServiceLookup.java src/windows/classes/sun/print/services/javax.print.PrintServiceLookup src/windows/classes/sun/print/services/javax.print.StreamPrintServiceFactory test/sun/java2d/pisces/OpenJDKFillBug.java
diffstat 62 files changed, 3635 insertions(+), 2198 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri May 24 16:15:32 2019 +0100
+++ b/.hgtags	Wed Jun 05 05:16:47 2019 +0100
@@ -992,3 +992,4 @@
 78d1f9f2fec2cf65c712837553e9b0fbd07bd9a1 jdk8u222-b02
 7ecf0b6b46aea31bcf2641fcd526d9b211db2420 jdk8u222-b03
 8119ddcb3eecd4d3bd4aa6bde441f88d1fd6f999 jdk8u222-b04
+887c8314411dd461ec4b1e14cd6368ed3d9a7a3b jdk8u222-b05
--- a/THIRD_PARTY_README	Fri May 24 16:15:32 2019 +0100
+++ b/THIRD_PARTY_README	Wed Jun 05 05:16:47 2019 +0100
@@ -1612,7 +1612,7 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, 
+%% This notice is provided with respect to GIFLIB 5.1.8 & libungif 4.1.3, 
 which may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
@@ -1682,7 +1682,7 @@
 --- begin of LICENSE ---
 
  Mesa 3-D graphics library
- Version:  4.1
+ Version:  5.0
 
  Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
 
@@ -2797,61 +2797,8 @@
 not be used in advertising or otherwise to promote the sale, use or
 other dealings in this Software without prior written authorization
 from the X Consortium.
-___________________________
-The files in motif/lib/Xm/util included this copyright:mkdirhier.man,
-xmkmf.man, chownxterm.c, makeg.man, mergelib.cpp, lndir.man, makestrs.man, 
-checktree.c, lndir.c, makestrs.c
-Copyright (c) 1993, 1994 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not
-be used in advertising or otherwise to promote the sale, use or other
-dealing in this Software without prior written authorization from the
-X Consortium.
-_____________________________
-Xmos_r.h:
-/*
-Copyright (c) 1996 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-*/
-
+
+--- end of LICENSE ---
 _____________________________
 Copyright notice for HPkeysym.h:
 /*
@@ -2951,7 +2898,7 @@
   Apache Jakarta BCEL 5.1 
   Apache Jakarta Regexp 1.4 
   Apache Santuario XML Security for Java 1.5.4
-  Apache Xalan-Java 2.7.1 
+  Apache Xalan-Java 2.7.2
   Apache Xerces Java 2.10.0 
   Apache XML Resolver 1.1 
 
--- a/make/CopyIntoClasses.gmk	Fri May 24 16:15:32 2019 +0100
+++ b/make/CopyIntoClasses.gmk	Wed Jun 05 05:16:47 2019 +0100
@@ -195,9 +195,9 @@
     $(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g'))
 OUT_SERVICES_FILES_COLON := $(addsuffix :, $(OUT_SERVICES_FILES))
 # Exception handling for print services with no META-INF directory
-SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/*)
+SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/share/classes/sun/print/services/*)
 OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
-    $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/%, %, \
+    $(patsubst $(JDK_TOPDIR)/src/share/classes/sun/print/services/%, %, \
     $(SRC_SERVICES_FILES_PRINT)))
 OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :, $(OUT_SERVICES_FILES_PRINT))
 RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON), $(SRC_SERVICES_FILES_PRINT))
--- a/src/share/classes/java/util/stream/DoublePipeline.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/classes/java/util/stream/DoublePipeline.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -260,6 +260,12 @@
             @Override
             Sink<Double> opWrapSink(int flags, Sink<Double> sink) {
                 return new Sink.ChainedDouble<Double>(sink) {
+                    // true if cancellationRequested() has been called
+                    boolean cancellationRequestedCalled;
+
+                    // cache the consumer to avoid creation on every accepted element
+                    DoubleConsumer downstreamAsDouble = downstream::accept;
+
                     @Override
                     public void begin(long size) {
                         downstream.begin(-1);
@@ -268,11 +274,27 @@
                     @Override
                     public void accept(double t) {
                         try (DoubleStream result = mapper.apply(t)) {
-                            // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
-                            if (result != null)
-                                result.sequential().forEach(i -> downstream.accept(i));
+                            if (result != null) {
+                                if (!cancellationRequestedCalled) {
+                                    result.sequential().forEach(downstreamAsDouble);
+                                }
+                                else {
+                                    Spliterator.OfDouble s = result.sequential().spliterator();
+                                    do { } while (!downstream.cancellationRequested() && s.tryAdvance(downstreamAsDouble));
+                                }
+                            }
                         }
                     }
+
+                    @Override
+                    public boolean cancellationRequested() {
+                        // If this method is called then an operation within the stream
+                        // pipeline is short-circuiting (see AbstractPipeline.copyInto).
+                        // Note that we cannot differentiate between an upstream or
+                        // downstream operation
+                        cancellationRequestedCalled = true;
+                        return downstream.cancellationRequested();
+                    }
                 };
             }
         };
--- a/src/share/classes/java/util/stream/IntPipeline.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/classes/java/util/stream/IntPipeline.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -296,6 +296,12 @@
             @Override
             Sink<Integer> opWrapSink(int flags, Sink<Integer> sink) {
                 return new Sink.ChainedInt<Integer>(sink) {
+                    // true if cancellationRequested() has been called
+                    boolean cancellationRequestedCalled;
+
+                    // cache the consumer to avoid creation on every accepted element
+                    IntConsumer downstreamAsInt = downstream::accept;
+
                     @Override
                     public void begin(long size) {
                         downstream.begin(-1);
@@ -304,11 +310,27 @@
                     @Override
                     public void accept(int t) {
                         try (IntStream result = mapper.apply(t)) {
-                            // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
-                            if (result != null)
-                                result.sequential().forEach(i -> downstream.accept(i));
+                            if (result != null) {
+                                if (!cancellationRequestedCalled) {
+                                    result.sequential().forEach(downstreamAsInt);
+                                }
+                                else {
+                                    Spliterator.OfInt s = result.sequential().spliterator();
+                                    do { } while (!downstream.cancellationRequested() && s.tryAdvance(downstreamAsInt));
+                                }
+                            }
                         }
                     }
+
+                    @Override
+                    public boolean cancellationRequested() {
+                        // If this method is called then an operation within the stream
+                        // pipeline is short-circuiting (see AbstractPipeline.copyInto).
+                        // Note that we cannot differentiate between an upstream or
+                        // downstream operation
+                        cancellationRequestedCalled = true;
+                        return downstream.cancellationRequested();
+                    }
                 };
             }
         };
--- a/src/share/classes/java/util/stream/LongPipeline.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/classes/java/util/stream/LongPipeline.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -277,6 +277,12 @@
             @Override
             Sink<Long> opWrapSink(int flags, Sink<Long> sink) {
                 return new Sink.ChainedLong<Long>(sink) {
+                    // true if cancellationRequested() has been called
+                    boolean cancellationRequestedCalled;
+
+                    // cache the consumer to avoid creation on every accepted element
+                    LongConsumer downstreamAsLong = downstream::accept;
+
                     @Override
                     public void begin(long size) {
                         downstream.begin(-1);
@@ -285,11 +291,27 @@
                     @Override
                     public void accept(long t) {
                         try (LongStream result = mapper.apply(t)) {
-                            // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
-                            if (result != null)
-                                result.sequential().forEach(i -> downstream.accept(i));
+                            if (result != null) {
+                                if (!cancellationRequestedCalled) {
+                                    result.sequential().forEach(downstreamAsLong);
+                                }
+                                else {
+                                    Spliterator.OfLong s = result.sequential().spliterator();
+                                    do { } while (!downstream.cancellationRequested() && s.tryAdvance(downstreamAsLong));
+                                }
+                            }
                         }
                     }
+
+                    @Override
+                    public boolean cancellationRequested() {
+                        // If this method is called then an operation within the stream
+                        // pipeline is short-circuiting (see AbstractPipeline.copyInto).
+                        // Note that we cannot differentiate between an upstream or
+                        // downstream operation
+                        cancellationRequestedCalled = true;
+                        return downstream.cancellationRequested();
+                    }
                 };
             }
         };
--- a/src/share/classes/java/util/stream/ReferencePipeline.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/classes/java/util/stream/ReferencePipeline.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -251,12 +251,14 @@
     @Override
     public final <R> Stream<R> flatMap(Function<? super P_OUT, ? extends Stream<? extends R>> mapper) {
         Objects.requireNonNull(mapper);
-        // We can do better than this, by polling cancellationRequested when stream is infinite
         return new StatelessOp<P_OUT, R>(this, StreamShape.REFERENCE,
                                      StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
             @Override
             Sink<P_OUT> opWrapSink(int flags, Sink<R> sink) {
                 return new Sink.ChainedReference<P_OUT, R>(sink) {
+                    // true if cancellationRequested() has been called
+                    boolean cancellationRequestedCalled;
+
                     @Override
                     public void begin(long size) {
                         downstream.begin(-1);
@@ -265,11 +267,27 @@
                     @Override
                     public void accept(P_OUT u) {
                         try (Stream<? extends R> result = mapper.apply(u)) {
-                            // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
-                            if (result != null)
-                                result.sequential().forEach(downstream);
+                            if (result != null) {
+                                if (!cancellationRequestedCalled) {
+                                    result.sequential().forEach(downstream);
+                                }
+                                else {
+                                    Spliterator<? extends R> s = result.sequential().spliterator();
+                                    do { } while (!downstream.cancellationRequested() && s.tryAdvance(downstream));
+                                }
+                            }
                         }
                     }
+
+                    @Override
+                    public boolean cancellationRequested() {
+                        // If this method is called then an operation within the stream
+                        // pipeline is short-circuiting (see AbstractPipeline.copyInto).
+                        // Note that we cannot differentiate between an upstream or
+                        // downstream operation
+                        cancellationRequestedCalled = true;
+                        return downstream.cancellationRequested();
+                    }
                 };
             }
         };
@@ -278,13 +296,17 @@
     @Override
     public final IntStream flatMapToInt(Function<? super P_OUT, ? extends IntStream> mapper) {
         Objects.requireNonNull(mapper);
-        // We can do better than this, by polling cancellationRequested when stream is infinite
         return new IntPipeline.StatelessOp<P_OUT>(this, StreamShape.REFERENCE,
                                               StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
             @Override
             Sink<P_OUT> opWrapSink(int flags, Sink<Integer> sink) {
                 return new Sink.ChainedReference<P_OUT, Integer>(sink) {
+                    // true if cancellationRequested() has been called
+                    boolean cancellationRequestedCalled;
+
+                    // cache the consumer to avoid creation on every accepted element
                     IntConsumer downstreamAsInt = downstream::accept;
+
                     @Override
                     public void begin(long size) {
                         downstream.begin(-1);
@@ -293,11 +315,23 @@
                     @Override
                     public void accept(P_OUT u) {
                         try (IntStream result = mapper.apply(u)) {
-                            // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
-                            if (result != null)
-                                result.sequential().forEach(downstreamAsInt);
+                            if (result != null) {
+                                if (!cancellationRequestedCalled) {
+                                    result.sequential().forEach(downstreamAsInt);
+                                }
+                                else {
+                                    Spliterator.OfInt s = result.sequential().spliterator();
+                                    do { } while (!downstream.cancellationRequested() && s.tryAdvance(downstreamAsInt));
+                                }
+                            }
                         }
                     }
+
+                    @Override
+                    public boolean cancellationRequested() {
+                        cancellationRequestedCalled = true;
+                        return downstream.cancellationRequested();
+                    }
                 };
             }
         };
@@ -306,13 +340,17 @@
     @Override
     public final DoubleStream flatMapToDouble(Function<? super P_OUT, ? extends DoubleStream> mapper) {
         Objects.requireNonNull(mapper);
-        // We can do better than this, by polling cancellationRequested when stream is infinite
         return new DoublePipeline.StatelessOp<P_OUT>(this, StreamShape.REFERENCE,
                                                      StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
             @Override
             Sink<P_OUT> opWrapSink(int flags, Sink<Double> sink) {
                 return new Sink.ChainedReference<P_OUT, Double>(sink) {
+                    // true if cancellationRequested() has been called
+                    boolean cancellationRequestedCalled;
+
+                    // cache the consumer to avoid creation on every accepted element
                     DoubleConsumer downstreamAsDouble = downstream::accept;
+
                     @Override
                     public void begin(long size) {
                         downstream.begin(-1);
@@ -321,11 +359,23 @@
                     @Override
                     public void accept(P_OUT u) {
                         try (DoubleStream result = mapper.apply(u)) {
-                            // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
-                            if (result != null)
-                                result.sequential().forEach(downstreamAsDouble);
+                            if (result != null) {
+                                if (!cancellationRequestedCalled) {
+                                    result.sequential().forEach(downstreamAsDouble);
+                                }
+                                else {
+                                    Spliterator.OfDouble s = result.sequential().spliterator();
+                                    do { } while (!downstream.cancellationRequested() && s.tryAdvance(downstreamAsDouble));
+                                }
+                            }
                         }
                     }
+
+                    @Override
+                    public boolean cancellationRequested() {
+                        cancellationRequestedCalled = true;
+                        return downstream.cancellationRequested();
+                    }
                 };
             }
         };
@@ -340,7 +390,12 @@
             @Override
             Sink<P_OUT> opWrapSink(int flags, Sink<Long> sink) {
                 return new Sink.ChainedReference<P_OUT, Long>(sink) {
+                    // true if cancellationRequested() has been called
+                    boolean cancellationRequestedCalled;
+
+                    // cache the consumer to avoid creation on every accepted element
                     LongConsumer downstreamAsLong = downstream::accept;
+
                     @Override
                     public void begin(long size) {
                         downstream.begin(-1);
@@ -349,11 +404,23 @@
                     @Override
                     public void accept(P_OUT u) {
                         try (LongStream result = mapper.apply(u)) {
-                            // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
-                            if (result != null)
-                                result.sequential().forEach(downstreamAsLong);
+                            if (result != null) {
+                                if (!cancellationRequestedCalled) {
+                                    result.sequential().forEach(downstreamAsLong);
+                                }
+                                else {
+                                    Spliterator.OfLong s = result.sequential().spliterator();
+                                    do { } while (!downstream.cancellationRequested() && s.tryAdvance(downstreamAsLong));
+                                }
+                            }
                         }
                     }
+
+                    @Override
+                    public boolean cancellationRequested() {
+                        cancellationRequestedCalled = true;
+                        return downstream.cancellationRequested();
+                    }
                 };
             }
         };
--- a/src/share/classes/java/util/stream/SortedOps.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/classes/java/util/stream/SortedOps.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -304,7 +304,8 @@
     private static abstract class AbstractRefSortingSink<T> extends Sink.ChainedReference<T, T> {
         protected final Comparator<? super T> comparator;
         // @@@ could be a lazy final value, if/when support is added
-        protected boolean cancellationWasRequested;
+        // true if cancellationRequested() has been called
+        protected boolean cancellationRequestedCalled;
 
         AbstractRefSortingSink(Sink<? super T> downstream, Comparator<? super T> comparator) {
             super(downstream);
@@ -319,7 +320,11 @@
          */
         @Override
         public final boolean cancellationRequested() {
-            cancellationWasRequested = true;
+            // If this method is called then an operation within the stream
+            // pipeline is short-circuiting (see AbstractPipeline.copyInto).
+            // Note that we cannot differentiate between an upstream or
+            // downstream operation
+            cancellationRequestedCalled = true;
             return false;
         }
     }
@@ -347,7 +352,7 @@
         public void end() {
             Arrays.sort(array, 0, offset, comparator);
             downstream.begin(offset);
-            if (!cancellationWasRequested) {
+            if (!cancellationRequestedCalled) {
                 for (int i = 0; i < offset; i++)
                     downstream.accept(array[i]);
             }
@@ -386,7 +391,7 @@
         public void end() {
             list.sort(comparator);
             downstream.begin(list.size());
-            if (!cancellationWasRequested) {
+            if (!cancellationRequestedCalled) {
                 list.forEach(downstream::accept);
             }
             else {
@@ -409,7 +414,8 @@
      * Abstract {@link Sink} for implementing sort on int streams.
      */
     private static abstract class AbstractIntSortingSink extends Sink.ChainedInt<Integer> {
-        protected boolean cancellationWasRequested;
+        // true if cancellationRequested() has been called
+        protected boolean cancellationRequestedCalled;
 
         AbstractIntSortingSink(Sink<? super Integer> downstream) {
             super(downstream);
@@ -417,7 +423,7 @@
 
         @Override
         public final boolean cancellationRequested() {
-            cancellationWasRequested = true;
+            cancellationRequestedCalled = true;
             return false;
         }
     }
@@ -444,7 +450,7 @@
         public void end() {
             Arrays.sort(array, 0, offset);
             downstream.begin(offset);
-            if (!cancellationWasRequested) {
+            if (!cancellationRequestedCalled) {
                 for (int i = 0; i < offset; i++)
                     downstream.accept(array[i]);
             }
@@ -484,7 +490,7 @@
             int[] ints = b.asPrimitiveArray();
             Arrays.sort(ints);
             downstream.begin(ints.length);
-            if (!cancellationWasRequested) {
+            if (!cancellationRequestedCalled) {
                 for (int anInt : ints)
                     downstream.accept(anInt);
             }
@@ -507,7 +513,8 @@
      * Abstract {@link Sink} for implementing sort on long streams.
      */
     private static abstract class AbstractLongSortingSink extends Sink.ChainedLong<Long> {
-        protected boolean cancellationWasRequested;
+        // true if cancellationRequested() has been called
+        protected boolean cancellationRequestedCalled;
 
         AbstractLongSortingSink(Sink<? super Long> downstream) {
             super(downstream);
@@ -515,7 +522,7 @@
 
         @Override
         public final boolean cancellationRequested() {
-            cancellationWasRequested = true;
+            cancellationRequestedCalled = true;
             return false;
         }
     }
@@ -542,7 +549,7 @@
         public void end() {
             Arrays.sort(array, 0, offset);
             downstream.begin(offset);
-            if (!cancellationWasRequested) {
+            if (!cancellationRequestedCalled) {
                 for (int i = 0; i < offset; i++)
                     downstream.accept(array[i]);
             }
@@ -582,7 +589,7 @@
             long[] longs = b.asPrimitiveArray();
             Arrays.sort(longs);
             downstream.begin(longs.length);
-            if (!cancellationWasRequested) {
+            if (!cancellationRequestedCalled) {
                 for (long aLong : longs)
                     downstream.accept(aLong);
             }
@@ -605,7 +612,8 @@
      * Abstract {@link Sink} for implementing sort on long streams.
      */
     private static abstract class AbstractDoubleSortingSink extends Sink.ChainedDouble<Double> {
-        protected boolean cancellationWasRequested;
+        // true if cancellationRequested() has been called
+        protected boolean cancellationRequestedCalled;
 
         AbstractDoubleSortingSink(Sink<? super Double> downstream) {
             super(downstream);
@@ -613,7 +621,7 @@
 
         @Override
         public final boolean cancellationRequested() {
-            cancellationWasRequested = true;
+            cancellationRequestedCalled = true;
             return false;
         }
     }
@@ -640,7 +648,7 @@
         public void end() {
             Arrays.sort(array, 0, offset);
             downstream.begin(offset);
-            if (!cancellationWasRequested) {
+            if (!cancellationRequestedCalled) {
                 for (int i = 0; i < offset; i++)
                     downstream.accept(array[i]);
             }
@@ -680,7 +688,7 @@
             double[] doubles = b.asPrimitiveArray();
             Arrays.sort(doubles);
             downstream.begin(doubles.length);
-            if (!cancellationWasRequested) {
+            if (!cancellationRequestedCalled) {
                 for (double aDouble : doubles)
                     downstream.accept(aDouble);
             }
--- a/src/share/classes/javax/imageio/ImageIO.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/classes/javax/imageio/ImageIO.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1291,7 +1291,8 @@
      *
      * @exception IllegalArgumentException if <code>input</code> is
      * <code>null</code>.
-     * @exception IOException if an error occurs during reading.
+     * @exception IOException if an error occurs during reading or when not
+     * able to create required ImageInputStream.
      */
     public static BufferedImage read(File input) throws IOException {
         if (input == null) {
@@ -1341,7 +1342,8 @@
      *
      * @exception IllegalArgumentException if <code>input</code> is
      * <code>null</code>.
-     * @exception IOException if an error occurs during reading.
+     * @exception IOException if an error occurs during reading or when not
+     * able to create required ImageInputStream.
      */
     public static BufferedImage read(InputStream input) throws IOException {
         if (input == null) {
@@ -1349,6 +1351,9 @@
         }
 
         ImageInputStream stream = createImageInputStream(input);
+        if (stream == null) {
+            throw new IIOException("Can't create an ImageInputStream!");
+        }
         BufferedImage bi = read(stream);
         if (bi == null) {
             stream.close();
@@ -1381,7 +1386,8 @@
      *
      * @exception IllegalArgumentException if <code>input</code> is
      * <code>null</code>.
-     * @exception IOException if an error occurs during reading.
+     * @exception IOException if an error occurs during reading or when not
+     * able to create required ImageInputStream.
      */
     public static BufferedImage read(URL input) throws IOException {
         if (input == null) {
@@ -1395,6 +1401,14 @@
             throw new IIOException("Can't get input stream from URL!", e);
         }
         ImageInputStream stream = createImageInputStream(istream);
+        if (stream == null) {
+            /* close the istream when stream is null so that if user has
+             * given filepath as URL he can delete it, otherwise stream will
+             * be open to that file and he will not be able to delete it.
+             */
+            istream.close();
+            throw new IIOException("Can't create an ImageInputStream!");
+        }
         BufferedImage bi;
         try {
             bi = read(stream);
@@ -1507,7 +1521,8 @@
      *
      * @exception IllegalArgumentException if any parameter is
      * <code>null</code>.
-     * @exception IOException if an error occurs during writing.
+     * @exception IOException if an error occurs during writing or when not
+     * able to create required ImageOutputStream.
      */
     public static boolean write(RenderedImage im,
                                 String formatName,
@@ -1515,7 +1530,6 @@
         if (output == null) {
             throw new IllegalArgumentException("output == null!");
         }
-        ImageOutputStream stream = null;
 
         ImageWriter writer = getWriter(im, formatName);
         if (writer == null) {
@@ -1525,13 +1539,11 @@
             return false;
         }
 
-        try {
-            output.delete();
-            stream = createImageOutputStream(output);
-        } catch (IOException e) {
-            throw new IIOException("Can't create output stream!", e);
+        output.delete();
+        ImageOutputStream stream = createImageOutputStream(output);
+        if (stream == null) {
+            throw new IIOException("Can't create an ImageOutputStream!");
         }
-
         try {
             return doWrite(im, writer, stream);
         } finally {
@@ -1559,7 +1571,8 @@
      *
      * @exception IllegalArgumentException if any parameter is
      * <code>null</code>.
-     * @exception IOException if an error occurs during writing.
+     * @exception IOException if an error occurs during writing or when not
+     * able to create required ImageOutputStream.
      */
     public static boolean write(RenderedImage im,
                                 String formatName,
@@ -1567,13 +1580,10 @@
         if (output == null) {
             throw new IllegalArgumentException("output == null!");
         }
-        ImageOutputStream stream = null;
-        try {
-            stream = createImageOutputStream(output);
-        } catch (IOException e) {
-            throw new IIOException("Can't create output stream!", e);
+        ImageOutputStream stream = createImageOutputStream(output);
+        if (stream == null) {
+            throw new IIOException("Can't create an ImageOutputStream!");
         }
-
         try {
             return doWrite(im, getWriter(im, formatName), stream);
         } finally {
--- a/src/share/classes/javax/net/ssl/SSLSessionContext.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/classes/javax/net/ssl/SSLSessionContext.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -87,10 +87,17 @@
      * A check for sessions exceeding the timeout is made immediately whenever
      * the timeout limit is changed for this <code>SSLSessionContext</code>.
      *
+     * @apiNote Note that the JDK Implementation uses default values for both
+     *          the session cache size and timeout.  See
+     *          {@code getSessionCacheSize} and {@code getSessionTimeout} for
+     *          more information.  Applications should consider their
+     *          performance requirements and override the defaults if necessary.
+     *
      * @param seconds the new session timeout limit in seconds; zero means
-     *          there is no limit.
+     *        there is no limit.
      *
-     * @exception IllegalArgumentException if the timeout specified is {@code < 0}.
+     * @throws IllegalArgumentException if the timeout specified is {@code < 0}.
+     *
      * @see #getSessionTimeout
      */
     public void setSessionTimeout(int seconds)
@@ -109,33 +116,50 @@
      * whenever the timeout limit is changed for this
      * <code>SSLSessionContext</code>.
      *
+     * @implNote The JDK implementation returns the session timeout as set by
+     *           the {@code setSessionTimeout} method, or if not set, a default
+     *           value of 86400 seconds (24 hours).
+     *
      * @return the session timeout limit in seconds; zero means there is no
-     * limit.
+     *         limit.
+     *
      * @see #setSessionTimeout
      */
     public int getSessionTimeout();
 
     /**
-     * Sets the size of the cache used for storing
-     * <code>SSLSession</code> objects grouped under this
-     * <code>SSLSessionContext</code>.
+     * Sets the size of the cache used for storing <code>SSLSession</code>
+     * objects grouped under this <code>SSLSessionContext</code>.
+     *
+     * @apiNote Note that the JDK Implementation uses default values for both
+     *          the session cache size and timeout.  See
+     *          {@code getSessionCacheSize} and {@code getSessionTimeout} for
+     *          more information.  Applications should consider their
+     *          performance requirements and override the defaults if necessary.
      *
      * @param size the new session cache size limit; zero means there is no
-     * limit.
-     * @exception IllegalArgumentException if the specified size is {@code < 0}.
+     *        limit.
+     *
+     * @throws IllegalArgumentException if the specified size is {@code < 0}.
+     *
      * @see #getSessionCacheSize
      */
     public void setSessionCacheSize(int size)
                  throws IllegalArgumentException;
 
     /**
-     * Returns the size of the cache used for storing
-     * <code>SSLSession</code> objects grouped under this
-     * <code>SSLSessionContext</code>.
+     * Returns the size of the cache used for storing <code>SSLSession</code>
+     * objects grouped under this <code>SSLSessionContext</code>.
+     *
+     * @implNote The JDK implementation returns the cache size as set by
+     *           the {@code setSessionCacheSize} method, or if not set, the
+     *           value of the {@systemProperty javax.net.ssl.sessionCacheSize}
+     *           system property.  If neither is set, it returns a default
+     *           value of 20480.
      *
      * @return size of the session cache; zero means there is no size limit.
+     *
      * @see #setSessionCacheSize
      */
     public int getSessionCacheSize();
-
 }
--- a/src/share/classes/sun/java2d/pisces/PiscesCache.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/classes/sun/java2d/pisces/PiscesCache.java	Wed Jun 05 05:16:47 2019 +0100
@@ -167,15 +167,6 @@
         rowAARLE[row][1] = end;
     }
 
-    void getBBox(int bbox[]) {
-        // Since we add +1 to bboxX1,bboxY1 so when PTG asks for bbox,
-        // we will give after -1
-        bbox[0] = bboxX0;
-        bbox[1] = bboxY0;
-        bbox[2] = bboxX1 - 1;
-        bbox[3] = bboxY1 - 1;
-    }
-
     @Override
     public String toString() {
         String ret = "bbox = ["+
--- a/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java	Wed Jun 05 05:16:47 2019 +0100
@@ -76,7 +76,10 @@
     }
 
     public void getBbox(int bbox[]) {
-        cache.getBBox(bbox);
+        bbox[0] = cache.bboxX0;
+        bbox[1] = cache.bboxY0;
+        bbox[2] = cache.bboxX1;
+        bbox[3] = cache.bboxY1;
         //System.out.println("bbox["+bbox[0]+", "+bbox[1]+" => "+bbox[2]+", "+bbox[3]+"]");
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/print/services/javax.print.PrintServiceLookup	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,2 @@
+# Provider for Java Print Service
+sun.print.PrintServiceLookupProvider
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/print/services/javax.print.StreamPrintServiceFactory	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,2 @@
+# Provider for Java 2D Stream print services.
+sun.print.PSStreamPrinterFactory
--- a/src/share/classes/sun/security/ssl/SSLSessionContextImpl.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/classes/sun/security/ssl/SSLSessionContextImpl.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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,10 +33,13 @@
 import javax.net.ssl.SSLSession;
 import javax.net.ssl.SSLSessionContext;
 
+import sun.security.action.GetIntegerAction;
 import sun.security.util.Cache;
 
 
 final class SSLSessionContextImpl implements SSLSessionContext {
+    private final static int DEFAULT_MAX_CACHE_SIZE = 20480;
+
     private Cache<SessionId, SSLSessionImpl> sessionCache;
                                         // session cache, session id as key
     private Cache<String, SSLSessionImpl> sessionHostPortCache;
@@ -197,21 +200,19 @@
     }
 
     private int getDefaultCacheLimit() {
-        int cacheLimit = 0;
         try {
-        String s = java.security.AccessController.doPrivileged(
-                new java.security.PrivilegedAction<String>() {
-                @Override
-                public String run() {
-                    return System.getProperty(
-                        "javax.net.ssl.sessionCacheSize");
-                }
-            });
-            cacheLimit = (s != null) ? Integer.valueOf(s).intValue() : 0;
+            int defaultCacheLimit =
+                java.security.AccessController.doPrivileged(
+                    new GetIntegerAction("javax.net.ssl.sessionCacheSize",
+                                         DEFAULT_MAX_CACHE_SIZE)).intValue();
+
+            if (defaultCacheLimit >= 0) {
+                return defaultCacheLimit;
+            }
         } catch (Exception e) {
         }
 
-        return (cacheLimit > 0) ? cacheLimit : 0;
+        return DEFAULT_MAX_CACHE_SIZE;
     }
 
     boolean isTimedout(SSLSession sess) {
--- a/src/share/native/sun/awt/giflib/dgif_lib.c	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/native/sun/awt/giflib/dgif_lib.c	Wed Jun 05 05:16:47 2019 +0100
@@ -36,13 +36,16 @@
 #include <limits.h>
 #include <stdint.h>
 #include <fcntl.h>
+/** Begin JDK modifications to support building on Windows **/
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+/** End JDK modifications to support building on Windows **/
 #include <stdio.h>
 #include <string.h>
 
 #ifdef _WIN32
 #include <io.h>
-#else
-#include <unistd.h>
 #endif /* _WIN32 */
 
 #include "gif_lib.h"
@@ -52,10 +55,14 @@
 #define UNSIGNED_LITTLE_ENDIAN(lo, hi) ((lo) | ((hi) << 8))
 
 /* avoid extra function call in case we use fread (TVT) */
-#define READ(_gif,_buf,_len)                                     \
-  (((GifFilePrivateType*)_gif->Private)->Read ?                   \
-    ((GifFilePrivateType*)_gif->Private)->Read(_gif,_buf,_len) : \
-    fread(_buf,1,_len,((GifFilePrivateType*)_gif->Private)->File))
+/** JDK modification "inline" is dropped to support c89 **/
+static /**inline**/ int InternalRead(GifFileType *gif, GifByteType *buf, int len) {
+    //fprintf(stderr, "### Read: %d\n", len);
+    return
+    (((GifFilePrivateType*)gif->Private)->Read ?
+     ((GifFilePrivateType*)gif->Private)->Read(gif,buf,len) :
+     fread(buf,1,len,((GifFilePrivateType*)gif->Private)->File));
+}
 
 static int DGifGetWord(GifFileType *GifFile, GifWord *Word);
 static int DGifSetupDecompress(GifFileType *GifFile);
@@ -142,7 +149,7 @@
 
     /* Let's see if this is a GIF file: */
     /* coverity[check_return] */
-    if (READ(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
+    if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
         if (Error != NULL)
             *Error = D_GIF_ERR_READ_FAILED;
         (void)fclose(f);
@@ -219,7 +226,7 @@
 
     /* Lets see if this is a GIF file: */
     /* coverity[check_return] */
-    if (READ(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
+    if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
         if (Error != NULL)
             *Error = D_GIF_ERR_READ_FAILED;
         free((char *)Private);
@@ -276,7 +283,7 @@
         DGifGetWord(GifFile, &GifFile->SHeight) == GIF_ERROR)
         return GIF_ERROR;
 
-    if (READ(GifFile, Buf, 3) != 3) {
+    if (InternalRead(GifFile, Buf, 3) != 3) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         GifFreeMapObject(GifFile->SColorMap);
         GifFile->SColorMap = NULL;
@@ -300,7 +307,7 @@
         GifFile->SColorMap->SortFlag = SortFlag;
         for (i = 0; i < GifFile->SColorMap->ColorCount; i++) {
             /* coverity[check_return] */
-            if (READ(GifFile, Buf, 3) != 3) {
+            if (InternalRead(GifFile, Buf, 3) != 3) {
                 GifFreeMapObject(GifFile->SColorMap);
                 GifFile->SColorMap = NULL;
                 GifFile->Error = D_GIF_ERR_READ_FAILED;
@@ -314,9 +321,25 @@
         GifFile->SColorMap = NULL;
     }
 
+    /*
+     * No check here for whether the background color is in range for the
+     * screen color map.  Possibly there should be.
+     */
+
     return GIF_OK;
 }
 
+const char *
+DGifGetGifVersion(GifFileType *GifFile)
+{
+    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
+
+    if (Private->gif89)
+        return GIF89_STAMP;
+    else
+        return GIF87_STAMP;
+}
+
 /******************************************************************************
  This routine should be called before any attempt to read an image.
 ******************************************************************************/
@@ -333,11 +356,12 @@
     }
 
     /* coverity[check_return] */
-    if (READ(GifFile, &Buf, 1) != 1) {
+    if (InternalRead(GifFile, &Buf, 1) != 1) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         return GIF_ERROR;
     }
 
+    //fprintf(stderr, "### DGifGetRecordType: %02x\n", Buf);
     switch (Buf) {
       case DESCRIPTOR_INTRODUCER:
           *Type = IMAGE_DESC_RECORD_TYPE;
@@ -357,17 +381,12 @@
     return GIF_OK;
 }
 
-/******************************************************************************
- This routine should be called before any attempt to read an image.
- Note it is assumed the Image desc. header has been read.
-******************************************************************************/
 int
-DGifGetImageDesc(GifFileType *GifFile)
+DGifGetImageHeader(GifFileType *GifFile)
 {
     unsigned int BitsPerPixel;
     GifByteType Buf[3];
     GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-    SavedImage *sp;
 
     if (!IS_READABLE(Private)) {
         /* This file was NOT open for reading: */
@@ -380,7 +399,7 @@
         DGifGetWord(GifFile, &GifFile->Image.Width) == GIF_ERROR ||
         DGifGetWord(GifFile, &GifFile->Image.Height) == GIF_ERROR)
         return GIF_ERROR;
-    if (READ(GifFile, Buf, 1) != 1) {
+    if (InternalRead(GifFile, Buf, 1) != 1) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         GifFreeMapObject(GifFile->Image.ColorMap);
         GifFile->Image.ColorMap = NULL;
@@ -407,7 +426,7 @@
         /* Get the image local color map: */
         for (i = 0; i < GifFile->Image.ColorMap->ColorCount; i++) {
             /* coverity[check_return] */
-            if (READ(GifFile, Buf, 3) != 3) {
+            if (InternalRead(GifFile, Buf, 3) != 3) {
                 GifFreeMapObject(GifFile->Image.ColorMap);
                 GifFile->Error = D_GIF_ERR_READ_FAILED;
                 GifFile->Image.ColorMap = NULL;
@@ -419,6 +438,33 @@
         }
     }
 
+    Private->PixelCount = (long)GifFile->Image.Width *
+       (long)GifFile->Image.Height;
+
+    /* Reset decompress algorithm parameters. */
+    return DGifSetupDecompress(GifFile);
+}
+
+/******************************************************************************
+ This routine should be called before any attempt to read an image.
+ Note it is assumed the Image desc. header has been read.
+******************************************************************************/
+int
+DGifGetImageDesc(GifFileType *GifFile)
+{
+    GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+    SavedImage *sp;
+
+    if (!IS_READABLE(Private)) {
+        /* This file was NOT open for reading: */
+        GifFile->Error = D_GIF_ERR_NOT_READABLE;
+        return GIF_ERROR;
+    }
+
+    if (DGifGetImageHeader(GifFile) == GIF_ERROR) {
+        return GIF_ERROR;
+    }
+
     if (GifFile->SavedImages) {
         SavedImage* new_saved_images =
             (SavedImage *)reallocarray(GifFile->SavedImages,
@@ -453,11 +499,7 @@
 
     GifFile->ImageCount++;
 
-    Private->PixelCount = (long)GifFile->Image.Width *
-       (long)GifFile->Image.Height;
-
-    /* Reset decompress algorithm parameters. */
-    return DGifSetupDecompress(GifFile);
+    return GIF_OK;
 }
 
 /******************************************************************************
@@ -550,6 +592,7 @@
     GifByteType Buf;
     GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
 
+    //fprintf(stderr, "### -> DGifGetExtension:\n");
     if (!IS_READABLE(Private)) {
         /* This file was NOT open for reading: */
         GifFile->Error = D_GIF_ERR_NOT_READABLE;
@@ -557,11 +600,12 @@
     }
 
     /* coverity[check_return] */
-    if (READ(GifFile, &Buf, 1) != 1) {
+    if (InternalRead(GifFile, &Buf, 1) != 1) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         return GIF_ERROR;
     }
     *ExtCode = Buf;
+    //fprintf(stderr, "### <- DGifGetExtension: %02x, about to call next\n", Buf);
 
     return DGifGetExtensionNext(GifFile, Extension);
 }
@@ -577,20 +621,24 @@
     GifByteType Buf;
     GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
 
-    if (READ(GifFile, &Buf, 1) != 1) {
+    //fprintf(stderr, "### -> DGifGetExtensionNext\n");
+    if (InternalRead(GifFile, &Buf, 1) != 1) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         return GIF_ERROR;
     }
+    //fprintf(stderr, "### DGifGetExtensionNext sees %d\n", Buf);
+
     if (Buf > 0) {
         *Extension = Private->Buf;    /* Use private unused buffer. */
         (*Extension)[0] = Buf;  /* Pascal strings notation (pos. 0 is len.). */
         /* coverity[tainted_data,check_return] */
-        if (READ(GifFile, &((*Extension)[1]), Buf) != Buf) {
+        if (InternalRead(GifFile, &((*Extension)[1]), Buf) != Buf) {
             GifFile->Error = D_GIF_ERR_READ_FAILED;
             return GIF_ERROR;
         }
     } else
         *Extension = NULL;
+    //fprintf(stderr, "### <- DGifGetExtensionNext: %p\n", Extension);
 
     return GIF_OK;
 }
@@ -707,7 +755,7 @@
     unsigned char c[2];
 
     /* coverity[check_return] */
-    if (READ(GifFile, c, 2) != 2) {
+    if (InternalRead(GifFile, c, 2) != 2) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         return GIF_ERROR;
     }
@@ -752,7 +800,7 @@
 
     /* coverity[tainted_data_argument] */
     /* coverity[check_return] */
-    if (READ(GifFile, &Buf, 1) != 1) {
+    if (InternalRead(GifFile, &Buf, 1) != 1) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         return GIF_ERROR;
     }
@@ -762,7 +810,7 @@
         *CodeBlock = Private->Buf;    /* Use private unused buffer. */
         (*CodeBlock)[0] = Buf;  /* Pascal strings notation (pos. 0 is len.). */
         /* coverity[tainted_data] */
-        if (READ(GifFile, &((*CodeBlock)[1]), Buf) != Buf) {
+        if (InternalRead(GifFile, &((*CodeBlock)[1]), Buf) != Buf) {
             GifFile->Error = D_GIF_ERR_READ_FAILED;
             return GIF_ERROR;
         }
@@ -787,7 +835,7 @@
     GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
 
     /* coverity[check_return] */
-    if (READ(GifFile, &CodeSize, 1) < 1) {    /* Read Code size from file. */
+    if (InternalRead(GifFile, &CodeSize, 1) < 1) {    /* Read Code size from file. */
         return GIF_ERROR;    /* Failed to read Code size. */
     }
     BitsPerPixel = CodeSize;
@@ -921,7 +969,7 @@
                 while (StackPtr != 0 && i < LineLen)
                     Line[i++] = Stack[--StackPtr];
             }
-            if (LastCode != NO_SUCH_CODE && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
+            if (LastCode != NO_SUCH_CODE && Private->RunningCode - 2 < LZ_MAX_CODE && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
                 Prefix[Private->RunningCode - 2] = LastCode;
 
                 if (CrntCode == Private->RunningCode - 2) {
@@ -1069,7 +1117,7 @@
     if (Buf[0] == 0) {
         /* Needs to read the next buffer - this one is empty: */
         /* coverity[check_return] */
-        if (READ(GifFile, Buf, 1) != 1) {
+        if (InternalRead(GifFile, Buf, 1) != 1) {
             GifFile->Error = D_GIF_ERR_READ_FAILED;
             return GIF_ERROR;
         }
@@ -1081,7 +1129,7 @@
             GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
             return GIF_ERROR;
         }
-        if (READ(GifFile, &Buf[1], Buf[0]) != Buf[0]) {
+        if (InternalRead(GifFile, &Buf[1], Buf[0]) != Buf[0]) {
             GifFile->Error = D_GIF_ERR_READ_FAILED;
             return GIF_ERROR;
         }
@@ -1124,7 +1172,7 @@
 
               sp = &GifFile->SavedImages[GifFile->ImageCount - 1];
               /* Allocate memory for the image */
-              if (sp->ImageDesc.Width < 0 && sp->ImageDesc.Height < 0 &&
+              if (sp->ImageDesc.Width <= 0 || sp->ImageDesc.Height <= 0 ||
                       sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) {
                   return GIF_ERROR;
               }
@@ -1184,9 +1232,11 @@
                       == GIF_ERROR)
                       return (GIF_ERROR);
               }
-              while (ExtData != NULL) {
+              for (;;) {
                   if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR)
                       return (GIF_ERROR);
+                  if (ExtData == NULL)
+                      break;
                   /* Continue the extension block */
                   if (ExtData != NULL)
                       if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount,
--- a/src/share/native/sun/awt/giflib/gif_hash.h	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/native/sun/awt/giflib/gif_hash.h	Wed Jun 05 05:16:47 2019 +0100
@@ -31,6 +31,11 @@
 #ifndef _GIF_HASH_H_
 #define _GIF_HASH_H_
 
+/** Begin JDK modifications to support building on Windows **/
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+/** End JDK modifications to support building on Windows **/
 #include <stdint.h>
 
 #define HT_SIZE         8192    /* 12bits = 4096 or twice as big! */
--- a/src/share/native/sun/awt/giflib/gif_lib.h	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/native/sun/awt/giflib/gif_lib.h	Wed Jun 05 05:16:47 2019 +0100
@@ -37,19 +37,21 @@
 
 #define GIFLIB_MAJOR 5
 #define GIFLIB_MINOR 1
-#define GIFLIB_RELEASE 4
+#define GIFLIB_RELEASE 8
 
 #define GIF_ERROR   0
 #define GIF_OK      1
 
 #include <stddef.h>
-
+/** Begin JDK modifications to support building using old compilers**/
+//#include <stdbool.h>
 #ifdef bool
 #undef bool
 #endif
 typedef int bool;
 #define false 0
 #define true 1
+/** End JDK modifications to support building using old compilers**/
 
 #define GIF_STAMP "GIFVER"          /* First chars in file - GIF stamp.  */
 #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
@@ -88,7 +90,7 @@
 #define COMMENT_EXT_FUNC_CODE     0xfe    /* comment */
 #define GRAPHICS_EXT_FUNC_CODE    0xf9    /* graphics control (GIF89) */
 #define PLAINTEXT_EXT_FUNC_CODE   0x01    /* plaintext */
-#define APPLICATION_EXT_FUNC_CODE 0xff    /* application block */
+#define APPLICATION_EXT_FUNC_CODE 0xff    /* application block (GIF89) */
 } ExtensionBlock;
 
 typedef struct SavedImage {
@@ -230,10 +232,10 @@
 /* These are legacy.  You probably do not want to call them directly */
 int DGifGetScreenDesc(GifFileType *GifFile);
 int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType);
+int DGifGetImageHeader(GifFileType *GifFile);
 int DGifGetImageDesc(GifFileType *GifFile);
 int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen);
 int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel);
-int DGifGetComment(GifFileType *GifFile, char *GifComment);
 int DGifGetExtension(GifFileType *GifFile, int *GifExtCode,
                      GifByteType **GifExtension);
 int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension);
@@ -241,6 +243,7 @@
                 GifByteType **GifCodeBlock);
 int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock);
 int DGifGetLZCodes(GifFileType *GifFile, int *GifCode);
+const char *DGifGetGifVersion(GifFileType *GifFile);
 
 
 /******************************************************************************
@@ -274,9 +277,6 @@
                                      GifPixelType ColorTransIn2[]);
 extern int GifBitSize(int n);
 
-extern void * reallocarray(void *optr, size_t nmemb, size_t size);
-
-
 /******************************************************************************
  Support for the in-core structures allocation (slurp mode).
 ******************************************************************************/
--- a/src/share/native/sun/awt/giflib/gif_lib_private.h	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/native/sun/awt/giflib/gif_lib_private.h	Wed Jun 05 05:16:47 2019 +0100
@@ -34,6 +34,10 @@
 #include "gif_lib.h"
 #include "gif_hash.h"
 
+#ifndef SIZE_MAX
+    #define SIZE_MAX     UINTPTR_MAX
+#endif
+
 #define EXTENSION_INTRODUCER      0x21
 #define DESCRIPTOR_INTRODUCER     0x2c
 #define TERMINATOR_INTRODUCER     0x3b
@@ -78,6 +82,11 @@
     bool gif89;
 } GifFilePrivateType;
 
+#ifndef HAVE_REALLOCARRAY
+extern void *openbsd_reallocarray(void *optr, size_t nmemb, size_t size);
+#define reallocarray openbsd_reallocarray
+#endif
+
 #endif /* _GIF_LIB_PRIVATE_H */
 
 /* end */
--- a/src/share/native/sun/awt/giflib/gifalloc.c	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/native/sun/awt/giflib/gifalloc.c	Wed Jun 05 05:16:47 2019 +0100
@@ -33,6 +33,7 @@
 #include <string.h>
 
 #include "gif_lib.h"
+#include "gif_lib_private.h"
 
 #define MAX(x, y)    (((x) > (y)) ? (x) : (y))
 
@@ -348,15 +349,17 @@
 {
     if (GifFile->SavedImages == NULL)
         GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage));
-    else
-        GifFile->SavedImages = (SavedImage *)reallocarray(GifFile->SavedImages,
+    else {
+        SavedImage* newSavedImages = (SavedImage *)reallocarray(GifFile->SavedImages,
                                (GifFile->ImageCount + 1), sizeof(SavedImage));
-
+        if( newSavedImages == NULL)
+            return ((SavedImage *)NULL);
+        GifFile->SavedImages = newSavedImages;
+    }
     if (GifFile->SavedImages == NULL)
         return ((SavedImage *)NULL);
     else {
         SavedImage *sp = &GifFile->SavedImages[GifFile->ImageCount++];
-        memset((char *)sp, '\0', sizeof(SavedImage));
 
         if (CopyFrom != NULL) {
             memcpy((char *)sp, CopyFrom, sizeof(SavedImage));
@@ -368,7 +371,7 @@
              */
 
             /* first, the local color map */
-            if (sp->ImageDesc.ColorMap != NULL) {
+            if (CopyFrom->ImageDesc.ColorMap != NULL) {
                 sp->ImageDesc.ColorMap = GifMakeMapObject(
                                          CopyFrom->ImageDesc.ColorMap->ColorCount,
                                          CopyFrom->ImageDesc.ColorMap->Colors);
@@ -392,7 +395,7 @@
                    CopyFrom->ImageDesc.Width);
 
             /* finally, the extension blocks */
-            if (sp->ExtensionBlocks != NULL) {
+            if (CopyFrom->ExtensionBlocks != NULL) {
                 sp->ExtensionBlocks = (ExtensionBlock *)reallocarray(NULL,
                                       CopyFrom->ExtensionBlockCount,
                                       sizeof(ExtensionBlock));
@@ -404,6 +407,9 @@
                        sizeof(ExtensionBlock) * CopyFrom->ExtensionBlockCount);
             }
         }
+        else {
+            memset((char *)sp, '\0', sizeof(SavedImage));
+        }
 
         return (sp);
     }
--- a/src/share/native/sun/awt/giflib/openbsd-reallocarray.c	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/native/sun/awt/giflib/openbsd-reallocarray.c	Wed Jun 05 05:16:47 2019 +0100
@@ -44,6 +44,10 @@
 #include <stdint.h>
 #include <stdlib.h>
 
+#ifndef SIZE_MAX
+    #define SIZE_MAX     UINTPTR_MAX
+#endif
+
 /*
  * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
  * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
@@ -51,7 +55,7 @@
 #define MUL_NO_OVERFLOW    ((size_t)1 << (sizeof(size_t) * 4))
 
 void *
-reallocarray(void *optr, size_t nmemb, size_t size)
+openbsd_reallocarray(void *optr, size_t nmemb, size_t size)
 {
     if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
         nmemb > 0 && SIZE_MAX / nmemb < size) {
--- a/src/share/native/sun/font/freetypeScaler.c	Fri May 24 16:15:32 2019 +0100
+++ b/src/share/native/sun/font/freetypeScaler.c	Wed Jun 05 05:16:47 2019 +0100
@@ -364,6 +364,19 @@
     context->doBold = (boldness != 1.0);
     context->doItalize = (italic != 0);
 
+    /* freetype is very keen to use embedded bitmaps, even if it knows
+     * there is a rotation or you asked for antialiasing.
+     * In the rendering path we will check useSBits and disable
+     * bitmaps unless it is set. And here we set it only if none
+     * of the conditions invalidate using it.
+     * Note that we allow embedded bitmaps for the LCD case.
+     */
+    if ((aa != TEXT_AA_ON) && (fm != TEXT_FM_ON) &&
+        !context->doBold && !context->doItalize &&
+        (context->transform.yx == 0) && (context->transform.xy == 0))
+    {
+        context->useSbits = 1;
+    }
     return ptr_to_jlong(context);
 }
 
@@ -685,9 +698,8 @@
         return ptr_to_jlong(getNullGlyphImage());
     }
 
-    /* if algorithmic styling is required then we do not request bitmap */
-    if (context->doBold || context->doItalize) {
-        renderFlags =  FT_LOAD_DEFAULT;
+    if (!context->useSbits) {
+        renderFlags |= FT_LOAD_NO_BITMAP;
     }
 
     /* NB: in case of non identity transform
--- a/src/solaris/classes/sun/awt/X11/InfoWindow.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/solaris/classes/sun/awt/X11/InfoWindow.java	Wed Jun 05 05:16:47 2019 +0100
@@ -414,12 +414,24 @@
 
         private void loadGtkImages() {
             if (!gtkImagesLoaded) {
-                errorImage = (Image)Toolkit.getDefaultToolkit().getDesktopProperty(
-                    "gtk.icon.gtk-dialog-error.6.rtl");
-                warnImage = (Image)Toolkit.getDefaultToolkit().getDesktopProperty(
-                    "gtk.icon.gtk-dialog-warning.6.rtl");
-                infoImage = (Image)Toolkit.getDefaultToolkit().getDesktopProperty(
-                    "gtk.icon.gtk-dialog-info.6.rtl");
+                //check whether the gtk version is >= 3.10 as the Icon names were
+                //changed from this release
+                UNIXToolkit tk = (UNIXToolkit) Toolkit.getDefaultToolkit();
+                if (tk.checkGtkVersion(3, 10, 0)) {
+                    errorImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.dialog-error.6.rtl");
+                    warnImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.dialog-warning.6.rtl");
+                    infoImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.dialog-information.6.rtl");
+                } else {
+                    errorImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.gtk-dialog-error.6.rtl");
+                    warnImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.gtk-dialog-warning.6.rtl");
+                    infoImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.gtk-dialog-info.6.rtl");
+                }
                 gtkImagesLoaded = true;
             }
         }
@@ -492,4 +504,3 @@
         }
     }
 }
-
--- a/src/solaris/classes/sun/awt/X11/XMSelection.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/solaris/classes/sun/awt/X11/XMSelection.java	Wed Jun 05 05:16:47 2019 +0100
@@ -97,7 +97,15 @@
         XToolkit.awtLock();
         try {
             long root = XlibWrapper.RootWindow(display,screen);
-            XlibWrapper.XSelectInput(display, root, XConstants.StructureNotifyMask);
+            XWindowAttributes wattr = new XWindowAttributes();
+            try {
+                XlibWrapper.XGetWindowAttributes(display, root, wattr.pData);
+                XlibWrapper.XSelectInput(display, root,
+                        XConstants.StructureNotifyMask |
+                        wattr.get_your_event_mask());
+            } finally {
+                wattr.dispose();
+            }
             XToolkit.addEventDispatcher(root,
                     new XEventDispatcher() {
                         public void dispatchEvent(XEvent ev) {
--- a/src/solaris/classes/sun/print/CUPSPrinter.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/solaris/classes/sun/print/CUPSPrinter.java	Wed Jun 05 05:16:47 2019 +0100
@@ -318,8 +318,8 @@
                          * reported, exec lpstat -d which has all the Apple
                          * special behaviour for this built in.
                          */
-                         if (UnixPrintServiceLookup.isMac()) {
-                             printerInfo[0] = UnixPrintServiceLookup.
+                         if (PrintServiceLookupProvider.isMac()) {
+                             printerInfo[0] = PrintServiceLookupProvider.
                                                    getDefaultPrinterNameSysV();
                              printerInfo[1] = null;
                              return (String[])printerInfo.clone();
--- a/src/solaris/classes/sun/print/IPPPrintService.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/solaris/classes/sun/print/IPPPrintService.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1042,7 +1042,7 @@
                setting like collation.  Therefore, we temporarily exclude
                Linux.
             */
-            if (!UnixPrintServiceLookup.isLinux()) {
+            if (!PrintServiceLookupProvider.isLinux()) {
                 catList.add(SheetCollate.class);
             }
         }
@@ -1586,7 +1586,7 @@
          * Mac is using printer-info IPP attribute for its human-readable printer
          * name and is also the identifier used in NSPrintInfo:setPrinter.
          */
-        if (UnixPrintServiceLookup.isMac()) {
+        if (PrintServiceLookupProvider.isMac()) {
             PrintServiceAttributeSet psaSet = this.getAttributes();
             if (psaSet != null) {
                 PrinterInfo pName = (PrinterInfo)psaSet.get(PrinterInfo.class);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/print/PrintServiceLookupProvider.java	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,968 @@
+/*
+ * 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
+ * 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 sun.print;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Vector;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import javax.print.DocFlavor;
+import javax.print.MultiDocPrintService;
+import javax.print.PrintService;
+import javax.print.PrintServiceLookup;
+import javax.print.attribute.Attribute;
+import javax.print.attribute.AttributeSet;
+import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.attribute.HashPrintServiceAttributeSet;
+import javax.print.attribute.PrintRequestAttribute;
+import javax.print.attribute.PrintRequestAttributeSet;
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.PrintServiceAttributeSet;
+import javax.print.attribute.standard.PrinterName;
+import javax.print.attribute.standard.PrinterURI;
+import java.io.File;
+import java.io.FileReader;
+import java.net.URL;
+import java.nio.file.Files;
+
+/*
+ * Remind: This class uses solaris commands. We also need a linux
+ * version
+ */
+public class PrintServiceLookupProvider extends PrintServiceLookup
+    implements BackgroundServiceLookup, Runnable {
+
+    /* Remind: the current implementation is static, as its assumed
+     * its preferable to minimize creation of PrintService instances.
+     * Later we should add logic to add/remove services on the fly which
+     * will take a hit of needing to regather the list of services.
+     */
+    private String defaultPrinter;
+    private PrintService defaultPrintService;
+    private PrintService[] printServices; /* includes the default printer */
+    private Vector lookupListeners = null;
+    private static String debugPrefix = "PrintServiceLookupProvider>> ";
+    private static boolean pollServices = true;
+    private static final int DEFAULT_MINREFRESH = 120;  // 2 minutes
+    private static int minRefreshTime = DEFAULT_MINREFRESH;
+
+
+    static String osname;
+
+    // List of commands used to deal with the printer queues on AIX
+    String[] lpNameComAix = {
+      "/usr/bin/lsallq",
+      "/usr/bin/lpstat -W -p|/usr/bin/expand|/usr/bin/cut -f1 -d' '",
+      "/usr/bin/lpstat -W -d|/usr/bin/expand|/usr/bin/cut -f1 -d' '",
+      "/usr/bin/lpstat -W -v"
+    };
+    private static final int aix_lsallq = 0;
+    private static final int aix_lpstat_p = 1;
+    private static final int aix_lpstat_d = 2;
+    private static final int aix_lpstat_v = 3;
+    private static int aix_defaultPrinterEnumeration = aix_lsallq;
+
+    static {
+        /* The system property "sun.java2d.print.polling"
+         * can be used to force the printing code to poll or not poll
+         * for PrintServices.
+         */
+        String pollStr = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("sun.java2d.print.polling"));
+
+        if (pollStr != null) {
+            if (pollStr.equalsIgnoreCase("true")) {
+                pollServices = true;
+            } else if (pollStr.equalsIgnoreCase("false")) {
+                pollServices = false;
+            }
+        }
+
+        /* The system property "sun.java2d.print.minRefreshTime"
+         * can be used to specify minimum refresh time (in seconds)
+         * for polling PrintServices.  The default is 120.
+         */
+        String refreshTimeStr = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction(
+                "sun.java2d.print.minRefreshTime"));
+
+        if (refreshTimeStr != null) {
+            try {
+                minRefreshTime = (new Integer(refreshTimeStr)).intValue();
+            } catch (NumberFormatException e) {
+            }
+            if (minRefreshTime < DEFAULT_MINREFRESH) {
+                minRefreshTime = DEFAULT_MINREFRESH;
+            }
+        }
+
+        osname = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name"));
+
+        /* The system property "sun.java2d.print.aix.lpstat"
+         * can be used to force the usage of 'lpstat -p' to enumerate all
+         * printer queues. By default we use 'lsallq', because 'lpstat -p' can
+         * take lots of time if thousands of printers are attached to a server.
+         */
+        if (isAIX()) {
+            String aixPrinterEnumerator = java.security.AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction("sun.java2d.print.aix.lpstat"));
+
+            if (aixPrinterEnumerator != null) {
+                if (aixPrinterEnumerator.equalsIgnoreCase("lpstat")) {
+                    aix_defaultPrinterEnumeration = aix_lpstat_p;
+                } else if (aixPrinterEnumerator.equalsIgnoreCase("lsallq")) {
+                    aix_defaultPrinterEnumeration = aix_lsallq;
+                }
+            }
+        }
+    }
+
+    static boolean isMac() {
+        return osname.startsWith("Mac");
+    }
+
+    static boolean isSysV() {
+        return osname.equals("SunOS");
+    }
+
+    static boolean isLinux() {
+        return (osname.equals("Linux"));
+    }
+
+    static boolean isBSD() {
+        return (osname.equals("Linux") ||
+                osname.contains("OS X"));
+    }
+
+    static boolean isAIX() {
+        return osname.equals("AIX");
+    }
+
+    static final int UNINITIALIZED = -1;
+    static final int BSD_LPD = 0;
+    static final int BSD_LPD_NG = 1;
+
+    static int cmdIndex = UNINITIALIZED;
+
+    String[] lpcFirstCom = {
+        "/usr/sbin/lpc status | grep : | sed -ne '1,1 s/://p'",
+        "/usr/sbin/lpc status | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}'"
+    };
+
+    String[] lpcAllCom = {
+        "/usr/sbin/lpc status all | grep : | sed -e 's/://'",
+        "/usr/sbin/lpc status all | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}' | sort"
+    };
+
+    String[] lpcNameCom = {
+        "| grep : | sed -ne 's/://p'",
+        "| grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}'"
+    };
+
+
+    static int getBSDCommandIndex() {
+        String command  = "/usr/sbin/lpc status all";
+        String[] names = execCmd(command);
+
+        if ((names == null) || (names.length == 0)) {
+            return BSD_LPD_NG;
+        }
+
+        for (int i=0; i<names.length; i++) {
+            if (names[i].indexOf('@') != -1) {
+                return BSD_LPD_NG;
+            }
+        }
+
+        return BSD_LPD;
+    }
+
+
+    public PrintServiceLookupProvider() {
+        // start the printer listener thread
+        if (pollServices) {
+            PrinterChangeListener thr = new PrinterChangeListener();
+            thr.setDaemon(true);
+            thr.start();
+            IPPPrintService.debug_println(debugPrefix+"polling turned on");
+        }
+    }
+
+    /* Want the PrintService which is default print service to have
+     * equality of reference with the equivalent in list of print services
+     * This isn't required by the API and there's a risk doing this will
+     * lead people to assume its guaranteed.
+     */
+    public synchronized PrintService[] getPrintServices() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkPrintJobAccess();
+        }
+
+        if (printServices == null || !pollServices) {
+            refreshServices();
+        }
+        if (printServices == null) {
+            return new PrintService[0];
+        } else {
+            return (PrintService[])printServices.clone();
+        }
+    }
+
+    private int addPrintServiceToList(ArrayList printerList, PrintService ps) {
+        int index = printerList.indexOf(ps);
+        // Check if PrintService with same name is already in the list.
+        if (CUPSPrinter.isCupsRunning() && index != -1) {
+            // Bug in Linux: Duplicate entry of a remote printer
+            // and treats it as local printer but it is returning wrong
+            // information when queried using IPP. Workaround is to remove it.
+            // Even CUPS ignores these entries as shown in lpstat or using
+            // their web configuration.
+            PrinterURI uri = (PrinterURI)ps.getAttribute(PrinterURI.class);
+            if (uri.getURI().getHost().equals("localhost")) {
+                IPPPrintService.debug_println(debugPrefix+"duplicate PrintService, ignoring the new local printer: "+ps);
+                return index;  // Do not add this.
+            }
+            PrintService oldPS = (PrintService)(printerList.get(index));
+            uri = (PrinterURI)oldPS.getAttribute(PrinterURI.class);
+            if (uri.getURI().getHost().equals("localhost")) {
+                IPPPrintService.debug_println(debugPrefix+"duplicate PrintService, removing existing local printer: "+oldPS);
+                printerList.remove(oldPS);
+            } else {
+                return index;
+            }
+        }
+        printerList.add(ps);
+        return (printerList.size() - 1);
+    }
+
+
+    // refreshes "printServices"
+    public synchronized void refreshServices() {
+        /* excludes the default printer */
+        String[] printers = null; // array of printer names
+        String[] printerURIs = null; //array of printer URIs
+
+        try {
+            getDefaultPrintService();
+        } catch (Throwable t) {
+            IPPPrintService.debug_println(debugPrefix+
+              "Exception getting default printer : " + t);
+        }
+        if (CUPSPrinter.isCupsRunning()) {
+            try {
+                printerURIs = CUPSPrinter.getAllPrinters();
+                IPPPrintService.debug_println("CUPS URIs = " + printerURIs);
+                if (printerURIs != null) {
+                    for (int p = 0; p < printerURIs.length; p++) {
+                       IPPPrintService.debug_println("URI="+printerURIs[p]);
+                    }
+                }
+            } catch (Throwable t) {
+            IPPPrintService.debug_println(debugPrefix+
+              "Exception getting all CUPS printers : " + t);
+            }
+            if ((printerURIs != null) && (printerURIs.length > 0)) {
+                printers = new String[printerURIs.length];
+                for (int i=0; i<printerURIs.length; i++) {
+                    int lastIndex = printerURIs[i].lastIndexOf("/");
+                    printers[i] = printerURIs[i].substring(lastIndex+1);
+                }
+            }
+        } else {
+            if (isMac() || isSysV()) {
+                printers = getAllPrinterNamesSysV();
+            } else if (isAIX()) {
+                printers = getAllPrinterNamesAIX();
+            } else { //BSD
+                printers = getAllPrinterNamesBSD();
+            }
+        }
+
+        if (printers == null) {
+            if (defaultPrintService != null) {
+                printServices = new PrintService[1];
+                printServices[0] = defaultPrintService;
+            } else {
+                printServices = null;
+            }
+            return;
+        }
+
+        ArrayList printerList = new ArrayList();
+        int defaultIndex = -1;
+        for (int p=0; p<printers.length; p++) {
+            if (printers[p] == null) {
+                continue;
+            }
+            if ((defaultPrintService != null)
+                && printers[p].equals(getPrinterDestName(defaultPrintService))) {
+                defaultIndex = addPrintServiceToList(printerList, defaultPrintService);
+            } else {
+                if (printServices == null) {
+                    IPPPrintService.debug_println(debugPrefix+
+                                                  "total# of printers = "+printers.length);
+
+                    if (CUPSPrinter.isCupsRunning()) {
+                        try {
+                            addPrintServiceToList(printerList,
+                                                  new IPPPrintService(printers[p],
+                                                                   printerURIs[p],
+                                                                   true));
+                        } catch (Exception e) {
+                            IPPPrintService.debug_println(debugPrefix+
+                                                          " getAllPrinters Exception "+
+                                                          e);
+
+                        }
+                    } else {
+                        printerList.add(new UnixPrintService(printers[p]));
+                    }
+                } else {
+                    int j;
+                    for (j=0; j<printServices.length; j++) {
+                        if (printServices[j] != null) {
+                            if (printers[p].equals(getPrinterDestName(printServices[j]))) {
+                                printerList.add(printServices[j]);
+                                printServices[j] = null;
+                                break;
+                            }
+                        }
+                    }
+
+                    if (j == printServices.length) {      // not found?
+                        if (CUPSPrinter.isCupsRunning()) {
+                            try {
+                                addPrintServiceToList(printerList,
+                                             new IPPPrintService(printers[p],
+                                                                 printerURIs[p],
+                                                                 true));
+                            } catch (Exception e) {
+                                IPPPrintService.debug_println(debugPrefix+
+                                                              " getAllPrinters Exception "+
+                                                              e);
+
+                            }
+                        } else {
+                            printerList.add(new UnixPrintService(printers[p]));
+                        }
+                    }
+                }
+            }
+        }
+
+        // Look for deleted services and invalidate these
+        if (printServices != null) {
+            for (int j=0; j < printServices.length; j++) {
+                if ((printServices[j] instanceof UnixPrintService) &&
+                    (!printServices[j].equals(defaultPrintService))) {
+                    ((UnixPrintService)printServices[j]).invalidateService();
+                }
+            }
+        }
+
+        //if defaultService is not found in printerList
+        if (defaultIndex == -1 && defaultPrintService != null) {
+            defaultIndex = addPrintServiceToList(printerList, defaultPrintService);
+        }
+
+        printServices = (PrintService[])printerList.toArray(
+                                      new PrintService[] {});
+
+        // swap default with the first in the list
+        if (defaultIndex > 0) {
+            PrintService saveService = printServices[0];
+            printServices[0] = printServices[defaultIndex];
+            printServices[defaultIndex] = saveService;
+        }
+    }
+
+    private boolean matchesAttributes(PrintService service,
+                                      PrintServiceAttributeSet attributes) {
+
+        Attribute [] attrs =  attributes.toArray();
+        Attribute serviceAttr;
+        for (int i=0; i<attrs.length; i++) {
+            serviceAttr
+                = service.getAttribute((Class<PrintServiceAttribute>)attrs[i].getCategory());
+            if (serviceAttr == null || !serviceAttr.equals(attrs[i])) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+      /* This checks for validity of the printer name before passing as
+       * parameter to a shell command.
+       */
+      private boolean checkPrinterName(String s) {
+        char c;
+
+        for (int i=0; i < s.length(); i++) {
+          c = s.charAt(i);
+          if (Character.isLetterOrDigit(c) ||
+              c == '-' || c == '_' || c == '.' || c == '/') {
+            continue;
+          } else {
+            return false;
+          }
+        }
+        return true;
+      }
+
+    /*
+     * Gets the printer name compatible with the list of printers returned by
+     * the system when we query default or all the available printers.
+     */
+    private String getPrinterDestName(PrintService ps) {
+        if (isMac()) {
+            return ((IPPPrintService)ps).getDest();
+        }
+        return ps.getName();
+    }
+
+    /* On a network with many (hundreds) of network printers, it
+     * can save several seconds if you know all you want is a particular
+     * printer, to ask for that printer rather than retrieving all printers.
+     */
+    private PrintService getServiceByName(PrinterName nameAttr) {
+        String name = nameAttr.getValue();
+        if (name == null || name.equals("") || !checkPrinterName(name)) {
+            return null;
+        }
+        /* check if all printers are already available */
+        if (printServices != null) {
+            for (PrintService printService : printServices) {
+                PrinterName printerName =
+                    (PrinterName)printService.getAttribute(PrinterName.class);
+                if (printerName.getValue().equals(name)) {
+                    return printService;
+                }
+            }
+        }
+        /* take CUPS into account first */
+        if (CUPSPrinter.isCupsRunning()) {
+            try {
+                return new IPPPrintService(name,
+                                           new URL("http://"+
+                                                   CUPSPrinter.getServer()+":"+
+                                                   CUPSPrinter.getPort()+"/"+
+                                                   name));
+            } catch (Exception e) {
+                IPPPrintService.debug_println(debugPrefix+
+                                              " getServiceByName Exception "+
+                                              e);
+            }
+        }
+        /* fallback if nothing not having a printer at this point */
+        PrintService printer = null;
+        if (isMac() || isSysV()) {
+            printer = getNamedPrinterNameSysV(name);
+        } else if (isAIX()) {
+            printer = getNamedPrinterNameAIX(name);
+        } else {
+            printer = getNamedPrinterNameBSD(name);
+        }
+        return printer;
+    }
+
+    private PrintService[]
+        getPrintServices(PrintServiceAttributeSet serviceSet) {
+
+        if (serviceSet == null || serviceSet.isEmpty()) {
+            return getPrintServices();
+        }
+
+        /* Typically expect that if a service attribute is specified that
+         * its a printer name and there ought to be only one match.
+         * Directly retrieve that service and confirm
+         * that it meets the other requirements.
+         * If printer name isn't mentioned then go a slow path checking
+         * all printers if they meet the reqiremements.
+         */
+        PrintService[] services;
+        PrinterName name = (PrinterName)serviceSet.get(PrinterName.class);
+        PrintService defService;
+        if (name != null && (defService = getDefaultPrintService()) != null) {
+            /* To avoid execing a unix command  see if the client is asking
+             * for the default printer by name, since we already have that
+             * initialised.
+             */
+
+            PrinterName defName =
+                (PrinterName)defService.getAttribute(PrinterName.class);
+
+            if (defName != null && name.equals(defName)) {
+                if (matchesAttributes(defService, serviceSet)) {
+                    services = new PrintService[1];
+                    services[0] = defService;
+                    return services;
+                } else {
+                    return new PrintService[0];
+                }
+            } else {
+                /* Its not the default service */
+                PrintService service = getServiceByName(name);
+                if (service != null &&
+                    matchesAttributes(service, serviceSet)) {
+                    services = new PrintService[1];
+                    services[0] = service;
+                    return services;
+                } else {
+                    return new PrintService[0];
+                }
+            }
+        } else {
+            /* specified service attributes don't include a name.*/
+            Vector matchedServices = new Vector();
+            services = getPrintServices();
+            for (int i = 0; i< services.length; i++) {
+                if (matchesAttributes(services[i], serviceSet)) {
+                    matchedServices.add(services[i]);
+                }
+            }
+            services = new PrintService[matchedServices.size()];
+            for (int i = 0; i< services.length; i++) {
+                services[i] = (PrintService)matchedServices.elementAt(i);
+            }
+            return services;
+        }
+    }
+
+    /*
+     * If service attributes are specified then there must be additional
+     * filtering.
+     */
+    public PrintService[] getPrintServices(DocFlavor flavor,
+                                           AttributeSet attributes) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+          security.checkPrintJobAccess();
+        }
+        PrintRequestAttributeSet requestSet = null;
+        PrintServiceAttributeSet serviceSet = null;
+
+        if (attributes != null && !attributes.isEmpty()) {
+
+            requestSet = new HashPrintRequestAttributeSet();
+            serviceSet = new HashPrintServiceAttributeSet();
+
+            Attribute[] attrs = attributes.toArray();
+            for (int i=0; i<attrs.length; i++) {
+                if (attrs[i] instanceof PrintRequestAttribute) {
+                    requestSet.add(attrs[i]);
+                } else if (attrs[i] instanceof PrintServiceAttribute) {
+                    serviceSet.add(attrs[i]);
+                }
+            }
+        }
+
+        PrintService[] services = getPrintServices(serviceSet);
+        if (services.length == 0) {
+            return services;
+        }
+
+        if (CUPSPrinter.isCupsRunning()) {
+            ArrayList matchingServices = new ArrayList();
+            for (int i=0; i<services.length; i++) {
+                try {
+                    if (services[i].
+                        getUnsupportedAttributes(flavor, requestSet) == null) {
+                        matchingServices.add(services[i]);
+                    }
+                } catch (IllegalArgumentException e) {
+                }
+            }
+            services = new PrintService[matchingServices.size()];
+            return (PrintService[])matchingServices.toArray(services);
+
+        } else {
+            // We only need to compare 1 PrintService because all
+            // UnixPrintServices are the same anyway.  We will not use
+            // default PrintService because it might be null.
+            PrintService service = services[0];
+            if ((flavor == null ||
+                 service.isDocFlavorSupported(flavor)) &&
+                 service.getUnsupportedAttributes(flavor, requestSet) == null)
+            {
+                return services;
+            } else {
+                return new PrintService[0];
+            }
+        }
+    }
+
+    /*
+     * return empty array as don't support multi docs
+     */
+    public MultiDocPrintService[]
+        getMultiDocPrintServices(DocFlavor[] flavors,
+                                 AttributeSet attributes) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+          security.checkPrintJobAccess();
+        }
+        return new MultiDocPrintService[0];
+    }
+
+
+    public synchronized PrintService getDefaultPrintService() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+          security.checkPrintJobAccess();
+        }
+
+        // clear defaultPrintService
+        defaultPrintService = null;
+        String psuri = null;
+
+        IPPPrintService.debug_println("isRunning ? "+
+                                      (CUPSPrinter.isCupsRunning()));
+        if (CUPSPrinter.isCupsRunning()) {
+            String[] printerInfo = CUPSPrinter.getDefaultPrinter();
+            if (printerInfo != null && printerInfo.length >= 2) {
+                defaultPrinter = printerInfo[0];
+                psuri = printerInfo[1];
+            }
+        } else {
+            if (isMac() || isSysV()) {
+                defaultPrinter = getDefaultPrinterNameSysV();
+            } else if (isAIX()) {
+                defaultPrinter = getDefaultPrinterNameAIX();
+            } else {
+                defaultPrinter = getDefaultPrinterNameBSD();
+            }
+        }
+        if (defaultPrinter == null) {
+            return null;
+        }
+        defaultPrintService = null;
+        if (printServices != null) {
+            for (int j=0; j<printServices.length; j++) {
+                if (defaultPrinter.equals(getPrinterDestName(printServices[j]))) {
+                    defaultPrintService = printServices[j];
+                    break;
+                }
+            }
+        }
+        if (defaultPrintService == null) {
+            if (CUPSPrinter.isCupsRunning()) {
+                try {
+                    PrintService defaultPS;
+                    if ((psuri != null) && !psuri.startsWith("file")) {
+                        defaultPS = new IPPPrintService(defaultPrinter,
+                                                        psuri, true);
+                    } else {
+                        defaultPS = new IPPPrintService(defaultPrinter,
+                                            new URL("http://"+
+                                                    CUPSPrinter.getServer()+":"+
+                                                    CUPSPrinter.getPort()+"/"+
+                                                    defaultPrinter));
+                    }
+                    defaultPrintService = defaultPS;
+                } catch (Exception e) {
+                }
+            } else {
+                defaultPrintService = new UnixPrintService(defaultPrinter);
+            }
+        }
+
+        return defaultPrintService;
+    }
+
+    public synchronized void
+        getServicesInbackground(BackgroundLookupListener listener) {
+        if (printServices != null) {
+            listener.notifyServices(printServices);
+        } else {
+            if (lookupListeners == null) {
+                lookupListeners = new Vector();
+                lookupListeners.add(listener);
+                Thread lookupThread = new Thread(this);
+                lookupThread.start();
+            } else {
+                lookupListeners.add(listener);
+            }
+        }
+    }
+
+    /* This method isn't used in most cases because we rely on code in
+     * javax.print.PrintServiceLookup. This is needed just for the cases
+     * where those interfaces are by-passed.
+     */
+    private PrintService[] copyOf(PrintService[] inArr) {
+        if (inArr == null || inArr.length == 0) {
+            return inArr;
+        } else {
+            PrintService []outArr = new PrintService[inArr.length];
+            System.arraycopy(inArr, 0, outArr, 0, inArr.length);
+            return outArr;
+        }
+    }
+
+    public void run() {
+        PrintService[] services = getPrintServices();
+        synchronized (this) {
+            BackgroundLookupListener listener;
+            for (int i=0; i<lookupListeners.size(); i++) {
+                listener =
+                    (BackgroundLookupListener)lookupListeners.elementAt(i);
+                listener.notifyServices(copyOf(services));
+            }
+            lookupListeners = null;
+        }
+    }
+
+    private String getDefaultPrinterNameBSD() {
+        if (cmdIndex == UNINITIALIZED) {
+            cmdIndex = getBSDCommandIndex();
+        }
+        String[] names = execCmd(lpcFirstCom[cmdIndex]);
+        if (names == null || names.length == 0) {
+            return null;
+        }
+
+        if ((cmdIndex==BSD_LPD_NG) &&
+            (names[0].startsWith("missingprinter"))) {
+            return null;
+        }
+        return names[0];
+    }
+
+    private PrintService getNamedPrinterNameBSD(String name) {
+      if (cmdIndex == UNINITIALIZED) {
+        cmdIndex = getBSDCommandIndex();
+      }
+      String command = "/usr/sbin/lpc status " + name + lpcNameCom[cmdIndex];
+      String[] result = execCmd(command);
+
+      if (result == null || !(result[0].equals(name))) {
+          return null;
+      }
+      return new UnixPrintService(name);
+    }
+
+    private String[] getAllPrinterNamesBSD() {
+        if (cmdIndex == UNINITIALIZED) {
+            cmdIndex = getBSDCommandIndex();
+        }
+        String[] names = execCmd(lpcAllCom[cmdIndex]);
+        if (names == null || names.length == 0) {
+          return null;
+        }
+        return names;
+    }
+
+    static String getDefaultPrinterNameSysV() {
+        String defaultPrinter = "lp";
+        String command = "/usr/bin/lpstat -d";
+
+        String [] names = execCmd(command);
+        if (names == null || names.length == 0) {
+            return defaultPrinter;
+        } else {
+            int index = names[0].indexOf(":");
+            if (index == -1  || (names[0].length() <= index+1)) {
+                return null;
+            } else {
+                String name = names[0].substring(index+1).trim();
+                if (name.length() == 0) {
+                    return null;
+                } else {
+                    return name;
+                }
+            }
+        }
+    }
+
+    private PrintService getNamedPrinterNameSysV(String name) {
+
+        String command = "/usr/bin/lpstat -v " + name;
+        String []result = execCmd(command);
+
+        if (result == null || result[0].indexOf("unknown printer") > 0) {
+            return null;
+        } else {
+            return new UnixPrintService(name);
+        }
+    }
+
+    private String[] getAllPrinterNamesSysV() {
+        String defaultPrinter = "lp";
+        String command = "/usr/bin/lpstat -v|/usr/bin/expand|/usr/bin/cut -f3 -d' ' |/usr/bin/cut -f1 -d':' | /usr/bin/sort";
+
+        String [] names = execCmd(command);
+        ArrayList printerNames = new ArrayList();
+        for (int i=0; i < names.length; i++) {
+            if (!names[i].equals("_default") &&
+                !names[i].equals(defaultPrinter) &&
+                !names[i].equals("")) {
+                printerNames.add(names[i]);
+            }
+        }
+        return (String[])printerNames.toArray(new String[printerNames.size()]);
+    }
+
+    private String getDefaultPrinterNameAIX() {
+        String[] names = execCmd(lpNameComAix[aix_lpstat_d]);
+        // Remove headers and bogus entries added by remote printers.
+        names = UnixPrintService.filterPrinterNamesAIX(names);
+        if (names == null || names.length != 1) {
+            // No default printer found
+            return null;
+        } else {
+            return names[0];
+        }
+    }
+
+    private PrintService getNamedPrinterNameAIX(String name) {
+        // On AIX there should be no blank after '-v'.
+        String[] result = execCmd(lpNameComAix[aix_lpstat_v] + name);
+        // Remove headers and bogus entries added by remote printers.
+        result = UnixPrintService.filterPrinterNamesAIX(result);
+        if (result == null || result.length != 1) {
+            return null;
+        } else {
+            return new UnixPrintService(name);
+        }
+    }
+
+    private String[] getAllPrinterNamesAIX() {
+        // Determine all printers of the system.
+        String [] names = execCmd(lpNameComAix[aix_defaultPrinterEnumeration]);
+
+        // Remove headers and bogus entries added by remote printers.
+        names = UnixPrintService.filterPrinterNamesAIX(names);
+
+        ArrayList<String> printerNames = new ArrayList<String>();
+        for ( int i=0; i < names.length; i++) {
+            printerNames.add(names[i]);
+        }
+        return (String[])printerNames.toArray(new String[printerNames.size()]);
+    }
+
+    static String[] execCmd(final String command) {
+        ArrayList results = null;
+        try {
+            final String[] cmd = new String[3];
+            if (isSysV() || isAIX()) {
+                cmd[0] = "/usr/bin/sh";
+                cmd[1] = "-c";
+                cmd[2] = "env LC_ALL=C " + command;
+            } else {
+                cmd[0] = "/bin/sh";
+                cmd[1] = "-c";
+                cmd[2] = "LC_ALL=C " + command;
+            }
+
+            results = (ArrayList)AccessController.doPrivileged(
+                new PrivilegedExceptionAction() {
+                    public Object run() throws IOException {
+
+                        Process proc;
+                        BufferedReader bufferedReader = null;
+                        File f = Files.createTempFile("prn","xc").toFile();
+                        cmd[2] = cmd[2]+">"+f.getAbsolutePath();
+
+                        proc = Runtime.getRuntime().exec(cmd);
+                        try {
+                            boolean done = false; // in case of interrupt.
+                            while (!done) {
+                                try {
+                                    proc.waitFor();
+                                    done = true;
+                                } catch (InterruptedException e) {
+                                }
+                            }
+
+                            if (proc.exitValue() == 0) {
+                                FileReader reader = new FileReader(f);
+                                bufferedReader = new BufferedReader(reader);
+                                String line;
+                                ArrayList results = new ArrayList();
+                                while ((line = bufferedReader.readLine())
+                                       != null) {
+                                    results.add(line);
+                                }
+                                return results;
+                            }
+                        } finally {
+                            f.delete();
+                            // promptly close all streams.
+                            if (bufferedReader != null) {
+                                bufferedReader.close();
+                            }
+                            proc.getInputStream().close();
+                            proc.getErrorStream().close();
+                            proc.getOutputStream().close();
+                        }
+                        return null;
+                    }
+                });
+        } catch (PrivilegedActionException e) {
+        }
+        if (results == null) {
+            return new String[0];
+        } else {
+            return (String[])results.toArray(new String[results.size()]);
+        }
+    }
+
+    private class PrinterChangeListener extends Thread {
+
+        public void run() {
+            int refreshSecs;
+            while (true) {
+                try {
+                    refreshServices();
+                } catch (Exception se) {
+                    IPPPrintService.debug_println(debugPrefix+"Exception in refresh thread.");
+                    break;
+                }
+
+                if ((printServices != null) &&
+                    (printServices.length > minRefreshTime)) {
+                    // compute new refresh time 1 printer = 1 sec
+                    refreshSecs = printServices.length;
+                } else {
+                    refreshSecs = minRefreshTime;
+                }
+                try {
+                    sleep(refreshSecs * 1000);
+                } catch (InterruptedException e) {
+                    break;
+                }
+            }
+        }
+    }
+}
--- a/src/solaris/classes/sun/print/UnixPrintJob.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/solaris/classes/sun/print/UnixPrintJob.java	Wed Jun 05 05:16:47 2019 +0100
@@ -122,7 +122,7 @@
     UnixPrintJob(PrintService service) {
         this.service = service;
         mDestination = service.getName();
-        if (UnixPrintServiceLookup.isMac()) {
+        if (PrintServiceLookupProvider.isMac()) {
             mDestination = ((IPPPrintService)service).getDest();
         }
         mDestType = UnixPrintJob.DESTPRINTER;
@@ -873,7 +873,7 @@
             pFlags |= NOSHEET;
             ncomps+=1;
         }
-        if (UnixPrintServiceLookup.osname.equals("SunOS")) {
+        if (PrintServiceLookupProvider.osname.equals("SunOS")) {
             ncomps+=1; // lp uses 1 more arg than lpr (make a copy)
             execCmd = new String[ncomps];
             execCmd[n++] = "/usr/bin/lp";
--- a/src/solaris/classes/sun/print/UnixPrintService.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/solaris/classes/sun/print/UnixPrintService.java	Wed Jun 05 05:16:47 2019 +0100
@@ -220,7 +220,7 @@
 
     private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsSysV() {
         String command = "/usr/bin/lpstat -a " + printer;
-        String results[]= UnixPrintServiceLookup.execCmd(command);
+        String results[]= PrintServiceLookupProvider.execCmd(command);
 
         if (results != null && results.length > 0) {
             if (results[0].startsWith(printer + " accepting requests")) {
@@ -244,20 +244,20 @@
     }
 
     private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsBSD() {
-        if (UnixPrintServiceLookup.cmdIndex ==
-            UnixPrintServiceLookup.UNINITIALIZED) {
+        if (PrintServiceLookupProvider.cmdIndex ==
+            PrintServiceLookupProvider.UNINITIALIZED) {
 
-            UnixPrintServiceLookup.cmdIndex =
-                UnixPrintServiceLookup.getBSDCommandIndex();
+            PrintServiceLookupProvider.cmdIndex =
+                PrintServiceLookupProvider.getBSDCommandIndex();
         }
 
         String command = "/usr/sbin/lpc status " + printer
-            + lpcStatusCom[UnixPrintServiceLookup.cmdIndex];
-        String results[]= UnixPrintServiceLookup.execCmd(command);
+            + lpcStatusCom[PrintServiceLookupProvider.cmdIndex];
+        String results[]= PrintServiceLookupProvider.execCmd(command);
 
         if (results != null && results.length > 0) {
-            if (UnixPrintServiceLookup.cmdIndex ==
-                UnixPrintServiceLookup.BSD_LPD_NG) {
+            if (PrintServiceLookupProvider.cmdIndex ==
+                PrintServiceLookupProvider.BSD_LPD_NG) {
                 if (results[0].startsWith("enabled enabled")) {
                     return PrinterIsAcceptingJobs.ACCEPTING_JOBS ;
                 }
@@ -276,7 +276,7 @@
 
     // Filter the list of possible AIX Printers and remove header lines
     // and extra lines which have been added for remote printers.
-    // 'protected' because this method is also used from UnixPrintServiceLookup.
+    // 'protected' because this method is also used from PrintServiceLookupProvider.
     protected static String[] filterPrinterNamesAIX(String[] posPrinters) {
         ArrayList printers = new ArrayList();
         String [] splitPart;
@@ -301,7 +301,7 @@
     private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
         // On AIX there should not be a blank after '-a'.
         String command = "/usr/bin/lpstat -a" + printer;
-        String results[]= UnixPrintServiceLookup.execCmd(command);
+        String results[]= PrintServiceLookupProvider.execCmd(command);
 
         // Remove headers and bogus entries added by remote printers.
         results = filterPrinterNamesAIX(results);
@@ -320,11 +320,11 @@
     }
 
     private PrinterIsAcceptingJobs getPrinterIsAcceptingJobs() {
-        if (UnixPrintServiceLookup.isSysV()) {
+        if (PrintServiceLookupProvider.isSysV()) {
             return getPrinterIsAcceptingJobsSysV();
-        } else if (UnixPrintServiceLookup.isBSD()) {
+        } else if (PrintServiceLookupProvider.isBSD()) {
             return getPrinterIsAcceptingJobsBSD();
-        } else if (UnixPrintServiceLookup.isAIX()) {
+        } else if (PrintServiceLookupProvider.isAIX()) {
             return getPrinterIsAcceptingJobsAIX();
         } else {
             return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
@@ -351,29 +351,29 @@
 
     private QueuedJobCount getQueuedJobCountSysV() {
         String command = "/usr/bin/lpstat -R " + printer;
-        String results[]= UnixPrintServiceLookup.execCmd(command);
+        String results[]= PrintServiceLookupProvider.execCmd(command);
         int qlen = (results == null) ? 0 : results.length;
 
         return new QueuedJobCount(qlen);
     }
 
     private QueuedJobCount getQueuedJobCountBSD() {
-        if (UnixPrintServiceLookup.cmdIndex ==
-            UnixPrintServiceLookup.UNINITIALIZED) {
+        if (PrintServiceLookupProvider.cmdIndex ==
+            PrintServiceLookupProvider.UNINITIALIZED) {
 
-            UnixPrintServiceLookup.cmdIndex =
-                UnixPrintServiceLookup.getBSDCommandIndex();
+            PrintServiceLookupProvider.cmdIndex =
+                PrintServiceLookupProvider.getBSDCommandIndex();
         }
 
         int qlen = 0;
         String command = "/usr/sbin/lpc status " + printer
-            + lpcQueueCom[UnixPrintServiceLookup.cmdIndex];
-        String results[] = UnixPrintServiceLookup.execCmd(command);
+            + lpcQueueCom[PrintServiceLookupProvider.cmdIndex];
+        String results[] = PrintServiceLookupProvider.execCmd(command);
 
         if (results != null && results.length > 0) {
             String queued;
-            if (UnixPrintServiceLookup.cmdIndex ==
-                UnixPrintServiceLookup.BSD_LPD_NG) {
+            if (PrintServiceLookupProvider.cmdIndex ==
+                PrintServiceLookupProvider.BSD_LPD_NG) {
                 queued = results[0];
             } else {
                 queued = results[3].trim();
@@ -396,7 +396,7 @@
     private QueuedJobCount getQueuedJobCountAIX() {
         // On AIX there should not be a blank after '-a'.
         String command = "/usr/bin/lpstat -a" + printer;
-        String results[]=  UnixPrintServiceLookup.execCmd(command);
+        String results[]=  PrintServiceLookupProvider.execCmd(command);
 
         // Remove headers and bogus entries added by remote printers.
         results = filterPrinterNamesAIX(results);
@@ -413,11 +413,11 @@
     }
 
     private QueuedJobCount getQueuedJobCount() {
-        if (UnixPrintServiceLookup.isSysV()) {
+        if (PrintServiceLookupProvider.isSysV()) {
             return getQueuedJobCountSysV();
-        } else if (UnixPrintServiceLookup.isBSD()) {
+        } else if (PrintServiceLookupProvider.isBSD()) {
             return getQueuedJobCountBSD();
-        } else if (UnixPrintServiceLookup.isAIX()) {
+        } else if (PrintServiceLookupProvider.isAIX()) {
             return getQueuedJobCountAIX();
         } else {
             return new QueuedJobCount(0);
@@ -468,9 +468,9 @@
     }
 
     private PrintServiceAttributeSet getDynamicAttributes() {
-        if (UnixPrintServiceLookup.isSysV()) {
+        if (PrintServiceLookupProvider.isSysV()) {
             return getSysVServiceAttributes();
-        } else if (UnixPrintServiceLookup.isAIX()) {
+        } else if (PrintServiceLookupProvider.isAIX()) {
             return getAIXServiceAttributes();
         } else {
             return getBSDServiceAttributes();
--- a/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Fri May 24 16:15:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,968 +0,0 @@
-/*
- * 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
- * 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 sun.print;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Vector;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import javax.print.DocFlavor;
-import javax.print.MultiDocPrintService;
-import javax.print.PrintService;
-import javax.print.PrintServiceLookup;
-import javax.print.attribute.Attribute;
-import javax.print.attribute.AttributeSet;
-import javax.print.attribute.HashPrintRequestAttributeSet;
-import javax.print.attribute.HashPrintServiceAttributeSet;
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintRequestAttributeSet;
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.PrintServiceAttributeSet;
-import javax.print.attribute.standard.PrinterName;
-import javax.print.attribute.standard.PrinterURI;
-import java.io.File;
-import java.io.FileReader;
-import java.net.URL;
-import java.nio.file.Files;
-
-/*
- * Remind: This class uses solaris commands. We also need a linux
- * version
- */
-public class UnixPrintServiceLookup extends PrintServiceLookup
-    implements BackgroundServiceLookup, Runnable {
-
-    /* Remind: the current implementation is static, as its assumed
-     * its preferable to minimize creation of PrintService instances.
-     * Later we should add logic to add/remove services on the fly which
-     * will take a hit of needing to regather the list of services.
-     */
-    private String defaultPrinter;
-    private PrintService defaultPrintService;
-    private PrintService[] printServices; /* includes the default printer */
-    private Vector lookupListeners = null;
-    private static String debugPrefix = "UnixPrintServiceLookup>> ";
-    private static boolean pollServices = true;
-    private static final int DEFAULT_MINREFRESH = 120;  // 2 minutes
-    private static int minRefreshTime = DEFAULT_MINREFRESH;
-
-
-    static String osname;
-
-    // List of commands used to deal with the printer queues on AIX
-    String[] lpNameComAix = {
-      "/usr/bin/lsallq",
-      "/usr/bin/lpstat -W -p|/usr/bin/expand|/usr/bin/cut -f1 -d' '",
-      "/usr/bin/lpstat -W -d|/usr/bin/expand|/usr/bin/cut -f1 -d' '",
-      "/usr/bin/lpstat -W -v"
-    };
-    private static final int aix_lsallq = 0;
-    private static final int aix_lpstat_p = 1;
-    private static final int aix_lpstat_d = 2;
-    private static final int aix_lpstat_v = 3;
-    private static int aix_defaultPrinterEnumeration = aix_lsallq;
-
-    static {
-        /* The system property "sun.java2d.print.polling"
-         * can be used to force the printing code to poll or not poll
-         * for PrintServices.
-         */
-        String pollStr = java.security.AccessController.doPrivileged(
-            new sun.security.action.GetPropertyAction("sun.java2d.print.polling"));
-
-        if (pollStr != null) {
-            if (pollStr.equalsIgnoreCase("true")) {
-                pollServices = true;
-            } else if (pollStr.equalsIgnoreCase("false")) {
-                pollServices = false;
-            }
-        }
-
-        /* The system property "sun.java2d.print.minRefreshTime"
-         * can be used to specify minimum refresh time (in seconds)
-         * for polling PrintServices.  The default is 120.
-         */
-        String refreshTimeStr = java.security.AccessController.doPrivileged(
-            new sun.security.action.GetPropertyAction(
-                "sun.java2d.print.minRefreshTime"));
-
-        if (refreshTimeStr != null) {
-            try {
-                minRefreshTime = (new Integer(refreshTimeStr)).intValue();
-            } catch (NumberFormatException e) {
-            }
-            if (minRefreshTime < DEFAULT_MINREFRESH) {
-                minRefreshTime = DEFAULT_MINREFRESH;
-            }
-        }
-
-        osname = java.security.AccessController.doPrivileged(
-            new sun.security.action.GetPropertyAction("os.name"));
-
-        /* The system property "sun.java2d.print.aix.lpstat"
-         * can be used to force the usage of 'lpstat -p' to enumerate all
-         * printer queues. By default we use 'lsallq', because 'lpstat -p' can
-         * take lots of time if thousands of printers are attached to a server.
-         */
-        if (isAIX()) {
-            String aixPrinterEnumerator = java.security.AccessController.doPrivileged(
-                new sun.security.action.GetPropertyAction("sun.java2d.print.aix.lpstat"));
-
-            if (aixPrinterEnumerator != null) {
-                if (aixPrinterEnumerator.equalsIgnoreCase("lpstat")) {
-                    aix_defaultPrinterEnumeration = aix_lpstat_p;
-                } else if (aixPrinterEnumerator.equalsIgnoreCase("lsallq")) {
-                    aix_defaultPrinterEnumeration = aix_lsallq;
-                }
-            }
-        }
-    }
-
-    static boolean isMac() {
-        return osname.startsWith("Mac");
-    }
-
-    static boolean isSysV() {
-        return osname.equals("SunOS");
-    }
-
-    static boolean isLinux() {
-        return (osname.equals("Linux"));
-    }
-
-    static boolean isBSD() {
-        return (osname.equals("Linux") ||
-                osname.contains("OS X"));
-    }
-
-    static boolean isAIX() {
-        return osname.equals("AIX");
-    }
-
-    static final int UNINITIALIZED = -1;
-    static final int BSD_LPD = 0;
-    static final int BSD_LPD_NG = 1;
-
-    static int cmdIndex = UNINITIALIZED;
-
-    String[] lpcFirstCom = {
-        "/usr/sbin/lpc status | grep : | sed -ne '1,1 s/://p'",
-        "/usr/sbin/lpc status | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}'"
-    };
-
-    String[] lpcAllCom = {
-        "/usr/sbin/lpc status all | grep : | sed -e 's/://'",
-        "/usr/sbin/lpc status all | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}' | sort"
-    };
-
-    String[] lpcNameCom = {
-        "| grep : | sed -ne 's/://p'",
-        "| grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}'"
-    };
-
-
-    static int getBSDCommandIndex() {
-        String command  = "/usr/sbin/lpc status all";
-        String[] names = execCmd(command);
-
-        if ((names == null) || (names.length == 0)) {
-            return BSD_LPD_NG;
-        }
-
-        for (int i=0; i<names.length; i++) {
-            if (names[i].indexOf('@') != -1) {
-                return BSD_LPD_NG;
-            }
-        }
-
-        return BSD_LPD;
-    }
-
-
-    public UnixPrintServiceLookup() {
-        // start the printer listener thread
-        if (pollServices) {
-            PrinterChangeListener thr = new PrinterChangeListener();
-            thr.setDaemon(true);
-            thr.start();
-            IPPPrintService.debug_println(debugPrefix+"polling turned on");
-        }
-    }
-
-    /* Want the PrintService which is default print service to have
-     * equality of reference with the equivalent in list of print services
-     * This isn't required by the API and there's a risk doing this will
-     * lead people to assume its guaranteed.
-     */
-    public synchronized PrintService[] getPrintServices() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkPrintJobAccess();
-        }
-
-        if (printServices == null || !pollServices) {
-            refreshServices();
-        }
-        if (printServices == null) {
-            return new PrintService[0];
-        } else {
-            return (PrintService[])printServices.clone();
-        }
-    }
-
-    private int addPrintServiceToList(ArrayList printerList, PrintService ps) {
-        int index = printerList.indexOf(ps);
-        // Check if PrintService with same name is already in the list.
-        if (CUPSPrinter.isCupsRunning() && index != -1) {
-            // Bug in Linux: Duplicate entry of a remote printer
-            // and treats it as local printer but it is returning wrong
-            // information when queried using IPP. Workaround is to remove it.
-            // Even CUPS ignores these entries as shown in lpstat or using
-            // their web configuration.
-            PrinterURI uri = (PrinterURI)ps.getAttribute(PrinterURI.class);
-            if (uri.getURI().getHost().equals("localhost")) {
-                IPPPrintService.debug_println(debugPrefix+"duplicate PrintService, ignoring the new local printer: "+ps);
-                return index;  // Do not add this.
-            }
-            PrintService oldPS = (PrintService)(printerList.get(index));
-            uri = (PrinterURI)oldPS.getAttribute(PrinterURI.class);
-            if (uri.getURI().getHost().equals("localhost")) {
-                IPPPrintService.debug_println(debugPrefix+"duplicate PrintService, removing existing local printer: "+oldPS);
-                printerList.remove(oldPS);
-            } else {
-                return index;
-            }
-        }
-        printerList.add(ps);
-        return (printerList.size() - 1);
-    }
-
-
-    // refreshes "printServices"
-    public synchronized void refreshServices() {
-        /* excludes the default printer */
-        String[] printers = null; // array of printer names
-        String[] printerURIs = null; //array of printer URIs
-
-        try {
-            getDefaultPrintService();
-        } catch (Throwable t) {
-            IPPPrintService.debug_println(debugPrefix+
-              "Exception getting default printer : " + t);
-        }
-        if (CUPSPrinter.isCupsRunning()) {
-            try {
-                printerURIs = CUPSPrinter.getAllPrinters();
-                IPPPrintService.debug_println("CUPS URIs = " + printerURIs);
-                if (printerURIs != null) {
-                    for (int p = 0; p < printerURIs.length; p++) {
-                       IPPPrintService.debug_println("URI="+printerURIs[p]);
-                    }
-                }
-            } catch (Throwable t) {
-            IPPPrintService.debug_println(debugPrefix+
-              "Exception getting all CUPS printers : " + t);
-            }
-            if ((printerURIs != null) && (printerURIs.length > 0)) {
-                printers = new String[printerURIs.length];
-                for (int i=0; i<printerURIs.length; i++) {
-                    int lastIndex = printerURIs[i].lastIndexOf("/");
-                    printers[i] = printerURIs[i].substring(lastIndex+1);
-                }
-            }
-        } else {
-            if (isMac() || isSysV()) {
-                printers = getAllPrinterNamesSysV();
-            } else if (isAIX()) {
-                printers = getAllPrinterNamesAIX();
-            } else { //BSD
-                printers = getAllPrinterNamesBSD();
-            }
-        }
-
-        if (printers == null) {
-            if (defaultPrintService != null) {
-                printServices = new PrintService[1];
-                printServices[0] = defaultPrintService;
-            } else {
-                printServices = null;
-            }
-            return;
-        }
-
-        ArrayList printerList = new ArrayList();
-        int defaultIndex = -1;
-        for (int p=0; p<printers.length; p++) {
-            if (printers[p] == null) {
-                continue;
-            }
-            if ((defaultPrintService != null)
-                && printers[p].equals(getPrinterDestName(defaultPrintService))) {
-                defaultIndex = addPrintServiceToList(printerList, defaultPrintService);
-            } else {
-                if (printServices == null) {
-                    IPPPrintService.debug_println(debugPrefix+
-                                                  "total# of printers = "+printers.length);
-
-                    if (CUPSPrinter.isCupsRunning()) {
-                        try {
-                            addPrintServiceToList(printerList,
-                                                  new IPPPrintService(printers[p],
-                                                                   printerURIs[p],
-                                                                   true));
-                        } catch (Exception e) {
-                            IPPPrintService.debug_println(debugPrefix+
-                                                          " getAllPrinters Exception "+
-                                                          e);
-
-                        }
-                    } else {
-                        printerList.add(new UnixPrintService(printers[p]));
-                    }
-                } else {
-                    int j;
-                    for (j=0; j<printServices.length; j++) {
-                        if (printServices[j] != null) {
-                            if (printers[p].equals(getPrinterDestName(printServices[j]))) {
-                                printerList.add(printServices[j]);
-                                printServices[j] = null;
-                                break;
-                            }
-                        }
-                    }
-
-                    if (j == printServices.length) {      // not found?
-                        if (CUPSPrinter.isCupsRunning()) {
-                            try {
-                                addPrintServiceToList(printerList,
-                                             new IPPPrintService(printers[p],
-                                                                 printerURIs[p],
-                                                                 true));
-                            } catch (Exception e) {
-                                IPPPrintService.debug_println(debugPrefix+
-                                                              " getAllPrinters Exception "+
-                                                              e);
-
-                            }
-                        } else {
-                            printerList.add(new UnixPrintService(printers[p]));
-                        }
-                    }
-                }
-            }
-        }
-
-        // Look for deleted services and invalidate these
-        if (printServices != null) {
-            for (int j=0; j < printServices.length; j++) {
-                if ((printServices[j] instanceof UnixPrintService) &&
-                    (!printServices[j].equals(defaultPrintService))) {
-                    ((UnixPrintService)printServices[j]).invalidateService();
-                }
-            }
-        }
-
-        //if defaultService is not found in printerList
-        if (defaultIndex == -1 && defaultPrintService != null) {
-            defaultIndex = addPrintServiceToList(printerList, defaultPrintService);
-        }
-
-        printServices = (PrintService[])printerList.toArray(
-                                      new PrintService[] {});
-
-        // swap default with the first in the list
-        if (defaultIndex > 0) {
-            PrintService saveService = printServices[0];
-            printServices[0] = printServices[defaultIndex];
-            printServices[defaultIndex] = saveService;
-        }
-    }
-
-    private boolean matchesAttributes(PrintService service,
-                                      PrintServiceAttributeSet attributes) {
-
-        Attribute [] attrs =  attributes.toArray();
-        Attribute serviceAttr;
-        for (int i=0; i<attrs.length; i++) {
-            serviceAttr
-                = service.getAttribute((Class<PrintServiceAttribute>)attrs[i].getCategory());
-            if (serviceAttr == null || !serviceAttr.equals(attrs[i])) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-      /* This checks for validity of the printer name before passing as
-       * parameter to a shell command.
-       */
-      private boolean checkPrinterName(String s) {
-        char c;
-
-        for (int i=0; i < s.length(); i++) {
-          c = s.charAt(i);
-          if (Character.isLetterOrDigit(c) ||
-              c == '-' || c == '_' || c == '.' || c == '/') {
-            continue;
-          } else {
-            return false;
-          }
-        }
-        return true;
-      }
-
-    /*
-     * Gets the printer name compatible with the list of printers returned by
-     * the system when we query default or all the available printers.
-     */
-    private String getPrinterDestName(PrintService ps) {
-        if (isMac()) {
-            return ((IPPPrintService)ps).getDest();
-        }
-        return ps.getName();
-    }
-
-    /* On a network with many (hundreds) of network printers, it
-     * can save several seconds if you know all you want is a particular
-     * printer, to ask for that printer rather than retrieving all printers.
-     */
-    private PrintService getServiceByName(PrinterName nameAttr) {
-        String name = nameAttr.getValue();
-        if (name == null || name.equals("") || !checkPrinterName(name)) {
-            return null;
-        }
-        /* check if all printers are already available */
-        if (printServices != null) {
-            for (PrintService printService : printServices) {
-                PrinterName printerName =
-                    (PrinterName)printService.getAttribute(PrinterName.class);
-                if (printerName.getValue().equals(name)) {
-                    return printService;
-                }
-            }
-        }
-        /* take CUPS into account first */
-        if (CUPSPrinter.isCupsRunning()) {
-            try {
-                return new IPPPrintService(name,
-                                           new URL("http://"+
-                                                   CUPSPrinter.getServer()+":"+
-                                                   CUPSPrinter.getPort()+"/"+
-                                                   name));
-            } catch (Exception e) {
-                IPPPrintService.debug_println(debugPrefix+
-                                              " getServiceByName Exception "+
-                                              e);
-            }
-        }
-        /* fallback if nothing not having a printer at this point */
-        PrintService printer = null;
-        if (isMac() || isSysV()) {
-            printer = getNamedPrinterNameSysV(name);
-        } else if (isAIX()) {
-            printer = getNamedPrinterNameAIX(name);
-        } else {
-            printer = getNamedPrinterNameBSD(name);
-        }
-        return printer;
-    }
-
-    private PrintService[]
-        getPrintServices(PrintServiceAttributeSet serviceSet) {
-
-        if (serviceSet == null || serviceSet.isEmpty()) {
-            return getPrintServices();
-        }
-
-        /* Typically expect that if a service attribute is specified that
-         * its a printer name and there ought to be only one match.
-         * Directly retrieve that service and confirm
-         * that it meets the other requirements.
-         * If printer name isn't mentioned then go a slow path checking
-         * all printers if they meet the reqiremements.
-         */
-        PrintService[] services;
-        PrinterName name = (PrinterName)serviceSet.get(PrinterName.class);
-        PrintService defService;
-        if (name != null && (defService = getDefaultPrintService()) != null) {
-            /* To avoid execing a unix command  see if the client is asking
-             * for the default printer by name, since we already have that
-             * initialised.
-             */
-
-            PrinterName defName =
-                (PrinterName)defService.getAttribute(PrinterName.class);
-
-            if (defName != null && name.equals(defName)) {
-                if (matchesAttributes(defService, serviceSet)) {
-                    services = new PrintService[1];
-                    services[0] = defService;
-                    return services;
-                } else {
-                    return new PrintService[0];
-                }
-            } else {
-                /* Its not the default service */
-                PrintService service = getServiceByName(name);
-                if (service != null &&
-                    matchesAttributes(service, serviceSet)) {
-                    services = new PrintService[1];
-                    services[0] = service;
-                    return services;
-                } else {
-                    return new PrintService[0];
-                }
-            }
-        } else {
-            /* specified service attributes don't include a name.*/
-            Vector matchedServices = new Vector();
-            services = getPrintServices();
-            for (int i = 0; i< services.length; i++) {
-                if (matchesAttributes(services[i], serviceSet)) {
-                    matchedServices.add(services[i]);
-                }
-            }
-            services = new PrintService[matchedServices.size()];
-            for (int i = 0; i< services.length; i++) {
-                services[i] = (PrintService)matchedServices.elementAt(i);
-            }
-            return services;
-        }
-    }
-
-    /*
-     * If service attributes are specified then there must be additional
-     * filtering.
-     */
-    public PrintService[] getPrintServices(DocFlavor flavor,
-                                           AttributeSet attributes) {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-          security.checkPrintJobAccess();
-        }
-        PrintRequestAttributeSet requestSet = null;
-        PrintServiceAttributeSet serviceSet = null;
-
-        if (attributes != null && !attributes.isEmpty()) {
-
-            requestSet = new HashPrintRequestAttributeSet();
-            serviceSet = new HashPrintServiceAttributeSet();
-
-            Attribute[] attrs = attributes.toArray();
-            for (int i=0; i<attrs.length; i++) {
-                if (attrs[i] instanceof PrintRequestAttribute) {
-                    requestSet.add(attrs[i]);
-                } else if (attrs[i] instanceof PrintServiceAttribute) {
-                    serviceSet.add(attrs[i]);
-                }
-            }
-        }
-
-        PrintService[] services = getPrintServices(serviceSet);
-        if (services.length == 0) {
-            return services;
-        }
-
-        if (CUPSPrinter.isCupsRunning()) {
-            ArrayList matchingServices = new ArrayList();
-            for (int i=0; i<services.length; i++) {
-                try {
-                    if (services[i].
-                        getUnsupportedAttributes(flavor, requestSet) == null) {
-                        matchingServices.add(services[i]);
-                    }
-                } catch (IllegalArgumentException e) {
-                }
-            }
-            services = new PrintService[matchingServices.size()];
-            return (PrintService[])matchingServices.toArray(services);
-
-        } else {
-            // We only need to compare 1 PrintService because all
-            // UnixPrintServices are the same anyway.  We will not use
-            // default PrintService because it might be null.
-            PrintService service = services[0];
-            if ((flavor == null ||
-                 service.isDocFlavorSupported(flavor)) &&
-                 service.getUnsupportedAttributes(flavor, requestSet) == null)
-            {
-                return services;
-            } else {
-                return new PrintService[0];
-            }
-        }
-    }
-
-    /*
-     * return empty array as don't support multi docs
-     */
-    public MultiDocPrintService[]
-        getMultiDocPrintServices(DocFlavor[] flavors,
-                                 AttributeSet attributes) {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-          security.checkPrintJobAccess();
-        }
-        return new MultiDocPrintService[0];
-    }
-
-
-    public synchronized PrintService getDefaultPrintService() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-          security.checkPrintJobAccess();
-        }
-
-        // clear defaultPrintService
-        defaultPrintService = null;
-        String psuri = null;
-
-        IPPPrintService.debug_println("isRunning ? "+
-                                      (CUPSPrinter.isCupsRunning()));
-        if (CUPSPrinter.isCupsRunning()) {
-            String[] printerInfo = CUPSPrinter.getDefaultPrinter();
-            if (printerInfo != null && printerInfo.length >= 2) {
-                defaultPrinter = printerInfo[0];
-                psuri = printerInfo[1];
-            }
-        } else {
-            if (isMac() || isSysV()) {
-                defaultPrinter = getDefaultPrinterNameSysV();
-            } else if (isAIX()) {
-                defaultPrinter = getDefaultPrinterNameAIX();
-            } else {
-                defaultPrinter = getDefaultPrinterNameBSD();
-            }
-        }
-        if (defaultPrinter == null) {
-            return null;
-        }
-        defaultPrintService = null;
-        if (printServices != null) {
-            for (int j=0; j<printServices.length; j++) {
-                if (defaultPrinter.equals(getPrinterDestName(printServices[j]))) {
-                    defaultPrintService = printServices[j];
-                    break;
-                }
-            }
-        }
-        if (defaultPrintService == null) {
-            if (CUPSPrinter.isCupsRunning()) {
-                try {
-                    PrintService defaultPS;
-                    if ((psuri != null) && !psuri.startsWith("file")) {
-                        defaultPS = new IPPPrintService(defaultPrinter,
-                                                        psuri, true);
-                    } else {
-                        defaultPS = new IPPPrintService(defaultPrinter,
-                                            new URL("http://"+
-                                                    CUPSPrinter.getServer()+":"+
-                                                    CUPSPrinter.getPort()+"/"+
-                                                    defaultPrinter));
-                    }
-                    defaultPrintService = defaultPS;
-                } catch (Exception e) {
-                }
-            } else {
-                defaultPrintService = new UnixPrintService(defaultPrinter);
-            }
-        }
-
-        return defaultPrintService;
-    }
-
-    public synchronized void
-        getServicesInbackground(BackgroundLookupListener listener) {
-        if (printServices != null) {
-            listener.notifyServices(printServices);
-        } else {
-            if (lookupListeners == null) {
-                lookupListeners = new Vector();
-                lookupListeners.add(listener);
-                Thread lookupThread = new Thread(this);
-                lookupThread.start();
-            } else {
-                lookupListeners.add(listener);
-            }
-        }
-    }
-
-    /* This method isn't used in most cases because we rely on code in
-     * javax.print.PrintServiceLookup. This is needed just for the cases
-     * where those interfaces are by-passed.
-     */
-    private PrintService[] copyOf(PrintService[] inArr) {
-        if (inArr == null || inArr.length == 0) {
-            return inArr;
-        } else {
-            PrintService []outArr = new PrintService[inArr.length];
-            System.arraycopy(inArr, 0, outArr, 0, inArr.length);
-            return outArr;
-        }
-    }
-
-    public void run() {
-        PrintService[] services = getPrintServices();
-        synchronized (this) {
-            BackgroundLookupListener listener;
-            for (int i=0; i<lookupListeners.size(); i++) {
-                listener =
-                    (BackgroundLookupListener)lookupListeners.elementAt(i);
-                listener.notifyServices(copyOf(services));
-            }
-            lookupListeners = null;
-        }
-    }
-
-    private String getDefaultPrinterNameBSD() {
-        if (cmdIndex == UNINITIALIZED) {
-            cmdIndex = getBSDCommandIndex();
-        }
-        String[] names = execCmd(lpcFirstCom[cmdIndex]);
-        if (names == null || names.length == 0) {
-            return null;
-        }
-
-        if ((cmdIndex==BSD_LPD_NG) &&
-            (names[0].startsWith("missingprinter"))) {
-            return null;
-        }
-        return names[0];
-    }
-
-    private PrintService getNamedPrinterNameBSD(String name) {
-      if (cmdIndex == UNINITIALIZED) {
-        cmdIndex = getBSDCommandIndex();
-      }
-      String command = "/usr/sbin/lpc status " + name + lpcNameCom[cmdIndex];
-      String[] result = execCmd(command);
-
-      if (result == null || !(result[0].equals(name))) {
-          return null;
-      }
-      return new UnixPrintService(name);
-    }
-
-    private String[] getAllPrinterNamesBSD() {
-        if (cmdIndex == UNINITIALIZED) {
-            cmdIndex = getBSDCommandIndex();
-        }
-        String[] names = execCmd(lpcAllCom[cmdIndex]);
-        if (names == null || names.length == 0) {
-          return null;
-        }
-        return names;
-    }
-
-    static String getDefaultPrinterNameSysV() {
-        String defaultPrinter = "lp";
-        String command = "/usr/bin/lpstat -d";
-
-        String [] names = execCmd(command);
-        if (names == null || names.length == 0) {
-            return defaultPrinter;
-        } else {
-            int index = names[0].indexOf(":");
-            if (index == -1  || (names[0].length() <= index+1)) {
-                return null;
-            } else {
-                String name = names[0].substring(index+1).trim();
-                if (name.length() == 0) {
-                    return null;
-                } else {
-                    return name;
-                }
-            }
-        }
-    }
-
-    private PrintService getNamedPrinterNameSysV(String name) {
-
-        String command = "/usr/bin/lpstat -v " + name;
-        String []result = execCmd(command);
-
-        if (result == null || result[0].indexOf("unknown printer") > 0) {
-            return null;
-        } else {
-            return new UnixPrintService(name);
-        }
-    }
-
-    private String[] getAllPrinterNamesSysV() {
-        String defaultPrinter = "lp";
-        String command = "/usr/bin/lpstat -v|/usr/bin/expand|/usr/bin/cut -f3 -d' ' |/usr/bin/cut -f1 -d':' | /usr/bin/sort";
-
-        String [] names = execCmd(command);
-        ArrayList printerNames = new ArrayList();
-        for (int i=0; i < names.length; i++) {
-            if (!names[i].equals("_default") &&
-                !names[i].equals(defaultPrinter) &&
-                !names[i].equals("")) {
-                printerNames.add(names[i]);
-            }
-        }
-        return (String[])printerNames.toArray(new String[printerNames.size()]);
-    }
-
-    private String getDefaultPrinterNameAIX() {
-        String[] names = execCmd(lpNameComAix[aix_lpstat_d]);
-        // Remove headers and bogus entries added by remote printers.
-        names = UnixPrintService.filterPrinterNamesAIX(names);
-        if (names == null || names.length != 1) {
-            // No default printer found
-            return null;
-        } else {
-            return names[0];
-        }
-    }
-
-    private PrintService getNamedPrinterNameAIX(String name) {
-        // On AIX there should be no blank after '-v'.
-        String[] result = execCmd(lpNameComAix[aix_lpstat_v] + name);
-        // Remove headers and bogus entries added by remote printers.
-        result = UnixPrintService.filterPrinterNamesAIX(result);
-        if (result == null || result.length != 1) {
-            return null;
-        } else {
-            return new UnixPrintService(name);
-        }
-    }
-
-    private String[] getAllPrinterNamesAIX() {
-        // Determine all printers of the system.
-        String [] names = execCmd(lpNameComAix[aix_defaultPrinterEnumeration]);
-
-        // Remove headers and bogus entries added by remote printers.
-        names = UnixPrintService.filterPrinterNamesAIX(names);
-
-        ArrayList<String> printerNames = new ArrayList<String>();
-        for ( int i=0; i < names.length; i++) {
-            printerNames.add(names[i]);
-        }
-        return (String[])printerNames.toArray(new String[printerNames.size()]);
-    }
-
-    static String[] execCmd(final String command) {
-        ArrayList results = null;
-        try {
-            final String[] cmd = new String[3];
-            if (isSysV() || isAIX()) {
-                cmd[0] = "/usr/bin/sh";
-                cmd[1] = "-c";
-                cmd[2] = "env LC_ALL=C " + command;
-            } else {
-                cmd[0] = "/bin/sh";
-                cmd[1] = "-c";
-                cmd[2] = "LC_ALL=C " + command;
-            }
-
-            results = (ArrayList)AccessController.doPrivileged(
-                new PrivilegedExceptionAction() {
-                    public Object run() throws IOException {
-
-                        Process proc;
-                        BufferedReader bufferedReader = null;
-                        File f = Files.createTempFile("prn","xc").toFile();
-                        cmd[2] = cmd[2]+">"+f.getAbsolutePath();
-
-                        proc = Runtime.getRuntime().exec(cmd);
-                        try {
-                            boolean done = false; // in case of interrupt.
-                            while (!done) {
-                                try {
-                                    proc.waitFor();
-                                    done = true;
-                                } catch (InterruptedException e) {
-                                }
-                            }
-
-                            if (proc.exitValue() == 0) {
-                                FileReader reader = new FileReader(f);
-                                bufferedReader = new BufferedReader(reader);
-                                String line;
-                                ArrayList results = new ArrayList();
-                                while ((line = bufferedReader.readLine())
-                                       != null) {
-                                    results.add(line);
-                                }
-                                return results;
-                            }
-                        } finally {
-                            f.delete();
-                            // promptly close all streams.
-                            if (bufferedReader != null) {
-                                bufferedReader.close();
-                            }
-                            proc.getInputStream().close();
-                            proc.getErrorStream().close();
-                            proc.getOutputStream().close();
-                        }
-                        return null;
-                    }
-                });
-        } catch (PrivilegedActionException e) {
-        }
-        if (results == null) {
-            return new String[0];
-        } else {
-            return (String[])results.toArray(new String[results.size()]);
-        }
-    }
-
-    private class PrinterChangeListener extends Thread {
-
-        public void run() {
-            int refreshSecs;
-            while (true) {
-                try {
-                    refreshServices();
-                } catch (Exception se) {
-                    IPPPrintService.debug_println(debugPrefix+"Exception in refresh thread.");
-                    break;
-                }
-
-                if ((printServices != null) &&
-                    (printServices.length > minRefreshTime)) {
-                    // compute new refresh time 1 printer = 1 sec
-                    refreshSecs = printServices.length;
-                } else {
-                    refreshSecs = minRefreshTime;
-                }
-                try {
-                    sleep(refreshSecs * 1000);
-                } catch (InterruptedException e) {
-                    break;
-                }
-            }
-        }
-    }
-}
--- a/src/solaris/classes/sun/print/services/javax.print.PrintServiceLookup	Fri May 24 16:15:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-# Provider for Java Print Service
-sun.print.UnixPrintServiceLookup
--- a/src/solaris/classes/sun/print/services/javax.print.StreamPrintServiceFactory	Fri May 24 16:15:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-# Provider for Java 2D Stream print services.
-sun.print.PSStreamPrinterFactory
--- a/src/solaris/native/sun/awt/awt_InputMethod.c	Fri May 24 16:15:32 2019 +0100
+++ b/src/solaris/native/sun/awt/awt_InputMethod.c	Wed Jun 05 05:16:47 2019 +0100
@@ -1319,9 +1319,14 @@
     /* mark that XIM server was destroyed */
     X11im = NULL;
     JNIEnv* env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
+
+    AWT_LOCK();
     /* free the old pX11IMData and set it to null. this also avoids crashing
      * the jvm if the XIM server reappears */
-    X11InputMethodData *pX11IMData = getX11InputMethodData(env, currentX11InputMethodInstance);
+    while (x11InputMethodGRefListHead != NULL) {
+        getX11InputMethodData(env, x11InputMethodGRefListHead->inputMethodGRef);
+    }
+    AWT_UNLOCK();
 }
 
 /*
--- a/src/windows/classes/sun/awt/windows/WPrinterJob.java	Fri May 24 16:15:32 2019 +0100
+++ b/src/windows/classes/sun/awt/windows/WPrinterJob.java	Wed Jun 05 05:16:47 2019 +0100
@@ -93,7 +93,7 @@
 import sun.print.SunPageSelection;
 import sun.print.Win32MediaTray;
 import sun.print.Win32PrintService;
-import sun.print.Win32PrintServiceLookup;
+import sun.print.PrintServiceLookupProvider;
 import sun.print.ServiceDialog;
 import sun.print.DialogOwner;
 
@@ -454,7 +454,7 @@
                 // native printer is different !
                 // we update the current PrintService
                 try {
-                    setPrintService(Win32PrintServiceLookup.
+                    setPrintService(PrintServiceLookupProvider.
                                     getWin32PrintLUS().
                                     getPrintServiceByName(printerName));
                 } catch (PrinterException e) {
@@ -628,7 +628,7 @@
             String printerName = getNativePrintService();
 
             if (printerName != null) {
-                myService = Win32PrintServiceLookup.getWin32PrintLUS().
+                myService = PrintServiceLookupProvider.getWin32PrintLUS().
                     getPrintServiceByName(printerName);
                 // no need to call setNativePrintService as this name is
                 // currently set in native
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/windows/classes/sun/print/PrintServiceLookupProvider.java	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 2000, 2012, 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 sun.print;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import javax.print.DocFlavor;
+import javax.print.MultiDocPrintService;
+import javax.print.PrintService;
+import javax.print.PrintServiceLookup;
+import javax.print.attribute.Attribute;
+import javax.print.attribute.AttributeSet;
+import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.attribute.HashPrintServiceAttributeSet;
+import javax.print.attribute.PrintRequestAttribute;
+import javax.print.attribute.PrintRequestAttributeSet;
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.PrintServiceAttributeSet;
+import javax.print.attribute.standard.PrinterName;
+
+public class PrintServiceLookupProvider extends PrintServiceLookup {
+
+    private String defaultPrinter;
+    private PrintService defaultPrintService;
+    private String[] printers; /* excludes the default printer */
+    private PrintService[] printServices; /* includes the default printer */
+
+    static {
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
+    }
+
+    /* The singleton win32 print lookup service.
+     * Code that is aware of this field and wants to use it must first
+     * see if its null, and if so instantiate it by calling a method such as
+     * javax.print.PrintServiceLookup.defaultPrintService() so that the
+     * same instance is stored there.
+     */
+    private static PrintServiceLookupProvider win32PrintLUS;
+
+    /* Think carefully before calling this. Preferably don't call it. */
+    public static PrintServiceLookupProvider getWin32PrintLUS() {
+        if (win32PrintLUS == null) {
+            /* This call is internally synchronized.
+             * When it returns an instance of this class will have
+             * been instantiated - else there's a JDK internal error.
+             */
+            PrintServiceLookup.lookupDefaultPrintService();
+        }
+        return win32PrintLUS;
+    }
+
+    public PrintServiceLookupProvider() {
+
+        if (win32PrintLUS == null) {
+            win32PrintLUS = this;
+
+            String osName = AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction("os.name"));
+            // There's no capability for Win98 to refresh printers.
+            // See "OpenPrinter" for more info.
+            if (osName != null && osName.startsWith("Windows 98")) {
+                return;
+            }
+            // start the printer listener thread
+            PrinterChangeListener thr = new PrinterChangeListener();
+            thr.setDaemon(true);
+            thr.start();
+        } /* else condition ought to never happen! */
+    }
+
+    /* Want the PrintService which is default print service to have
+     * equality of reference with the equivalent in list of print services
+     * This isn't required by the API and there's a risk doing this will
+     * lead people to assume its guaranteed.
+     */
+    public synchronized PrintService[] getPrintServices() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkPrintJobAccess();
+        }
+        if (printServices == null) {
+            refreshServices();
+        }
+        return printServices;
+    }
+
+    private synchronized void refreshServices() {
+        printers = getAllPrinterNames();
+        if (printers == null) {
+            // In Windows it is safe to assume no default if printers == null so we
+            // don't get the default.
+            printServices = new PrintService[0];
+            return;
+        }
+
+        PrintService[] newServices = new PrintService[printers.length];
+        PrintService defService = getDefaultPrintService();
+        for (int p = 0; p < printers.length; p++) {
+            if (defService != null &&
+                printers[p].equals(defService.getName())) {
+                newServices[p] = defService;
+            } else {
+                if (printServices == null) {
+                    newServices[p] = new Win32PrintService(printers[p]);
+                } else {
+                    int j;
+                    for (j = 0; j < printServices.length; j++) {
+                        if ((printServices[j]!= null) &&
+                            (printers[p].equals(printServices[j].getName()))) {
+                            newServices[p] = printServices[j];
+                            printServices[j] = null;
+                            break;
+                        }
+                    }
+                    if (j == printServices.length) {
+                        newServices[p] = new Win32PrintService(printers[p]);
+                    }
+                }
+            }
+        }
+
+        // Look for deleted services and invalidate these
+        if (printServices != null) {
+            for (int j=0; j < printServices.length; j++) {
+                if ((printServices[j] instanceof Win32PrintService) &&
+                    (!printServices[j].equals(defaultPrintService))) {
+                    ((Win32PrintService)printServices[j]).invalidateService();
+                }
+            }
+        }
+        printServices = newServices;
+    }
+
+
+    public synchronized PrintService getPrintServiceByName(String name) {
+
+        if (name == null || name.equals("")) {
+            return null;
+        } else {
+            /* getPrintServices() is now very fast. */
+            PrintService[] printServices = getPrintServices();
+            for (int i=0; i<printServices.length; i++) {
+                if (printServices[i].getName().equals(name)) {
+                    return printServices[i];
+                }
+            }
+            return null;
+        }
+    }
+
+    boolean matchingService(PrintService service,
+                            PrintServiceAttributeSet serviceSet) {
+        if (serviceSet != null) {
+            Attribute [] attrs =  serviceSet.toArray();
+            Attribute serviceAttr;
+            for (int i=0; i<attrs.length; i++) {
+                serviceAttr
+                    = service.getAttribute((Class<PrintServiceAttribute>)attrs[i].getCategory());
+                if (serviceAttr == null || !serviceAttr.equals(attrs[i])) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    public PrintService[] getPrintServices(DocFlavor flavor,
+                                           AttributeSet attributes) {
+
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+          security.checkPrintJobAccess();
+        }
+        PrintRequestAttributeSet requestSet = null;
+        PrintServiceAttributeSet serviceSet = null;
+
+        if (attributes != null && !attributes.isEmpty()) {
+
+            requestSet = new HashPrintRequestAttributeSet();
+            serviceSet = new HashPrintServiceAttributeSet();
+
+            Attribute[] attrs = attributes.toArray();
+            for (int i=0; i<attrs.length; i++) {
+                if (attrs[i] instanceof PrintRequestAttribute) {
+                    requestSet.add(attrs[i]);
+                } else if (attrs[i] instanceof PrintServiceAttribute) {
+                    serviceSet.add(attrs[i]);
+                }
+            }
+        }
+
+        /*
+         * Special case: If client is asking for a particular printer
+         * (by name) then we can save time by getting just that service
+         * to check against the rest of the specified attributes.
+         */
+        PrintService[] services = null;
+        if (serviceSet != null && serviceSet.get(PrinterName.class) != null) {
+            PrinterName name = (PrinterName)serviceSet.get(PrinterName.class);
+            PrintService service = getPrintServiceByName(name.getValue());
+            if (service == null || !matchingService(service, serviceSet)) {
+                services = new PrintService[0];
+            } else {
+                services = new PrintService[1];
+                services[0] = service;
+            }
+        } else {
+            services = getPrintServices();
+        }
+
+        if (services.length == 0) {
+            return services;
+        } else {
+            ArrayList matchingServices = new ArrayList();
+            for (int i=0; i<services.length; i++) {
+                try {
+                    if (services[i].
+                        getUnsupportedAttributes(flavor, requestSet) == null) {
+                        matchingServices.add(services[i]);
+                    }
+                } catch (IllegalArgumentException e) {
+                }
+            }
+            services = new PrintService[matchingServices.size()];
+            return (PrintService[])matchingServices.toArray(services);
+        }
+    }
+
+    /*
+     * return empty array as don't support multi docs
+     */
+    public MultiDocPrintService[]
+        getMultiDocPrintServices(DocFlavor[] flavors,
+                                 AttributeSet attributes) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+          security.checkPrintJobAccess();
+        }
+        return new MultiDocPrintService[0];
+    }
+
+
+    public synchronized PrintService getDefaultPrintService() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+          security.checkPrintJobAccess();
+        }
+
+
+        // Windows does not have notification for a change in default
+        // so we always get the latest.
+        defaultPrinter = getDefaultPrinterName();
+        if (defaultPrinter == null) {
+            return null;
+        }
+
+        if ((defaultPrintService != null) &&
+            defaultPrintService.getName().equals(defaultPrinter)) {
+
+            return defaultPrintService;
+        }
+
+         // Not the same as default so proceed to get new PrintService.
+
+        // clear defaultPrintService
+        defaultPrintService = null;
+
+        if (printServices != null) {
+            for (int j=0; j<printServices.length; j++) {
+                if (defaultPrinter.equals(printServices[j].getName())) {
+                    defaultPrintService = printServices[j];
+                    break;
+                }
+            }
+        }
+
+        if (defaultPrintService == null) {
+            defaultPrintService = new Win32PrintService(defaultPrinter);
+        }
+        return defaultPrintService;
+    }
+
+    class PrinterChangeListener extends Thread {
+        long chgObj;
+        PrinterChangeListener() {
+            chgObj = notifyFirstPrinterChange(null);
+        }
+
+        public void run() {
+            if (chgObj != -1) {
+                while (true) {
+                    // wait for configuration to change
+                    if (notifyPrinterChange(chgObj) != 0) {
+                        try {
+                            refreshServices();
+                        } catch (SecurityException se) {
+                            break;
+                        }
+                    } else {
+                        notifyClosePrinterChange(chgObj);
+                        break;
+                    }
+                }
+            }
+        }
+    }
+
+    private native String getDefaultPrinterName();
+    private native String[] getAllPrinterNames();
+    private native long notifyFirstPrinterChange(String printer);
+    private native void notifyClosePrinterChange(long chgObj);
+    private native int notifyPrinterChange(long chgObj);
+}
--- a/src/windows/classes/sun/print/Win32PrintServiceLookup.java	Fri May 24 16:15:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,348 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, 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 sun.print;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import javax.print.DocFlavor;
-import javax.print.MultiDocPrintService;
-import javax.print.PrintService;
-import javax.print.PrintServiceLookup;
-import javax.print.attribute.Attribute;
-import javax.print.attribute.AttributeSet;
-import javax.print.attribute.HashPrintRequestAttributeSet;
-import javax.print.attribute.HashPrintServiceAttributeSet;
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintRequestAttributeSet;
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.PrintServiceAttributeSet;
-import javax.print.attribute.standard.PrinterName;
-
-public class Win32PrintServiceLookup extends PrintServiceLookup {
-
-    private String defaultPrinter;
-    private PrintService defaultPrintService;
-    private String[] printers; /* excludes the default printer */
-    private PrintService[] printServices; /* includes the default printer */
-
-    static {
-        java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Void>() {
-                public Void run() {
-                    System.loadLibrary("awt");
-                    return null;
-                }
-            });
-    }
-
-    /* The singleton win32 print lookup service.
-     * Code that is aware of this field and wants to use it must first
-     * see if its null, and if so instantiate it by calling a method such as
-     * javax.print.PrintServiceLookup.defaultPrintService() so that the
-     * same instance is stored there.
-     */
-    private static Win32PrintServiceLookup win32PrintLUS;
-
-    /* Think carefully before calling this. Preferably don't call it. */
-    public static Win32PrintServiceLookup getWin32PrintLUS() {
-        if (win32PrintLUS == null) {
-            /* This call is internally synchronized.
-             * When it returns an instance of this class will have
-             * been instantiated - else there's a JDK internal error.
-             */
-            PrintServiceLookup.lookupDefaultPrintService();
-        }
-        return win32PrintLUS;
-    }
-
-    public Win32PrintServiceLookup() {
-
-        if (win32PrintLUS == null) {
-            win32PrintLUS = this;
-
-            String osName = AccessController.doPrivileged(
-                new sun.security.action.GetPropertyAction("os.name"));
-            // There's no capability for Win98 to refresh printers.
-            // See "OpenPrinter" for more info.
-            if (osName != null && osName.startsWith("Windows 98")) {
-                return;
-            }
-            // start the printer listener thread
-            PrinterChangeListener thr = new PrinterChangeListener();
-            thr.setDaemon(true);
-            thr.start();
-        } /* else condition ought to never happen! */
-    }
-
-    /* Want the PrintService which is default print service to have
-     * equality of reference with the equivalent in list of print services
-     * This isn't required by the API and there's a risk doing this will
-     * lead people to assume its guaranteed.
-     */
-    public synchronized PrintService[] getPrintServices() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkPrintJobAccess();
-        }
-        if (printServices == null) {
-            refreshServices();
-        }
-        return printServices;
-    }
-
-    private synchronized void refreshServices() {
-        printers = getAllPrinterNames();
-        if (printers == null) {
-            // In Windows it is safe to assume no default if printers == null so we
-            // don't get the default.
-            printServices = new PrintService[0];
-            return;
-        }
-
-        PrintService[] newServices = new PrintService[printers.length];
-        PrintService defService = getDefaultPrintService();
-        for (int p = 0; p < printers.length; p++) {
-            if (defService != null &&
-                printers[p].equals(defService.getName())) {
-                newServices[p] = defService;
-            } else {
-                if (printServices == null) {
-                    newServices[p] = new Win32PrintService(printers[p]);
-                } else {
-                    int j;
-                    for (j = 0; j < printServices.length; j++) {
-                        if ((printServices[j]!= null) &&
-                            (printers[p].equals(printServices[j].getName()))) {
-                            newServices[p] = printServices[j];
-                            printServices[j] = null;
-                            break;
-                        }
-                    }
-                    if (j == printServices.length) {
-                        newServices[p] = new Win32PrintService(printers[p]);
-                    }
-                }
-            }
-        }
-
-        // Look for deleted services and invalidate these
-        if (printServices != null) {
-            for (int j=0; j < printServices.length; j++) {
-                if ((printServices[j] instanceof Win32PrintService) &&
-                    (!printServices[j].equals(defaultPrintService))) {
-                    ((Win32PrintService)printServices[j]).invalidateService();
-                }
-            }
-        }
-        printServices = newServices;
-    }
-
-
-    public synchronized PrintService getPrintServiceByName(String name) {
-
-        if (name == null || name.equals("")) {
-            return null;
-        } else {
-            /* getPrintServices() is now very fast. */
-            PrintService[] printServices = getPrintServices();
-            for (int i=0; i<printServices.length; i++) {
-                if (printServices[i].getName().equals(name)) {
-                    return printServices[i];
-                }
-            }
-            return null;
-        }
-    }
-
-    boolean matchingService(PrintService service,
-                            PrintServiceAttributeSet serviceSet) {
-        if (serviceSet != null) {
-            Attribute [] attrs =  serviceSet.toArray();
-            Attribute serviceAttr;
-            for (int i=0; i<attrs.length; i++) {
-                serviceAttr
-                    = service.getAttribute((Class<PrintServiceAttribute>)attrs[i].getCategory());
-                if (serviceAttr == null || !serviceAttr.equals(attrs[i])) {
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    public PrintService[] getPrintServices(DocFlavor flavor,
-                                           AttributeSet attributes) {
-
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-          security.checkPrintJobAccess();
-        }
-        PrintRequestAttributeSet requestSet = null;
-        PrintServiceAttributeSet serviceSet = null;
-
-        if (attributes != null && !attributes.isEmpty()) {
-
-            requestSet = new HashPrintRequestAttributeSet();
-            serviceSet = new HashPrintServiceAttributeSet();
-
-            Attribute[] attrs = attributes.toArray();
-            for (int i=0; i<attrs.length; i++) {
-                if (attrs[i] instanceof PrintRequestAttribute) {
-                    requestSet.add(attrs[i]);
-                } else if (attrs[i] instanceof PrintServiceAttribute) {
-                    serviceSet.add(attrs[i]);
-                }
-            }
-        }
-
-        /*
-         * Special case: If client is asking for a particular printer
-         * (by name) then we can save time by getting just that service
-         * to check against the rest of the specified attributes.
-         */
-        PrintService[] services = null;
-        if (serviceSet != null && serviceSet.get(PrinterName.class) != null) {
-            PrinterName name = (PrinterName)serviceSet.get(PrinterName.class);
-            PrintService service = getPrintServiceByName(name.getValue());
-            if (service == null || !matchingService(service, serviceSet)) {
-                services = new PrintService[0];
-            } else {
-                services = new PrintService[1];
-                services[0] = service;
-            }
-        } else {
-            services = getPrintServices();
-        }
-
-        if (services.length == 0) {
-            return services;
-        } else {
-            ArrayList matchingServices = new ArrayList();
-            for (int i=0; i<services.length; i++) {
-                try {
-                    if (services[i].
-                        getUnsupportedAttributes(flavor, requestSet) == null) {
-                        matchingServices.add(services[i]);
-                    }
-                } catch (IllegalArgumentException e) {
-                }
-            }
-            services = new PrintService[matchingServices.size()];
-            return (PrintService[])matchingServices.toArray(services);
-        }
-    }
-
-    /*
-     * return empty array as don't support multi docs
-     */
-    public MultiDocPrintService[]
-        getMultiDocPrintServices(DocFlavor[] flavors,
-                                 AttributeSet attributes) {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-          security.checkPrintJobAccess();
-        }
-        return new MultiDocPrintService[0];
-    }
-
-
-    public synchronized PrintService getDefaultPrintService() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-          security.checkPrintJobAccess();
-        }
-
-
-        // Windows does not have notification for a change in default
-        // so we always get the latest.
-        defaultPrinter = getDefaultPrinterName();
-        if (defaultPrinter == null) {
-            return null;
-        }
-
-        if ((defaultPrintService != null) &&
-            defaultPrintService.getName().equals(defaultPrinter)) {
-
-            return defaultPrintService;
-        }
-
-         // Not the same as default so proceed to get new PrintService.
-
-        // clear defaultPrintService
-        defaultPrintService = null;
-
-        if (printServices != null) {
-            for (int j=0; j<printServices.length; j++) {
-                if (defaultPrinter.equals(printServices[j].getName())) {
-                    defaultPrintService = printServices[j];
-                    break;
-                }
-            }
-        }
-
-        if (defaultPrintService == null) {
-            defaultPrintService = new Win32PrintService(defaultPrinter);
-        }
-        return defaultPrintService;
-    }
-
-    class PrinterChangeListener extends Thread {
-        long chgObj;
-        PrinterChangeListener() {
-            chgObj = notifyFirstPrinterChange(null);
-        }
-
-        public void run() {
-            if (chgObj != -1) {
-                while (true) {
-                    // wait for configuration to change
-                    if (notifyPrinterChange(chgObj) != 0) {
-                        try {
-                            refreshServices();
-                        } catch (SecurityException se) {
-                            break;
-                        }
-                    } else {
-                        notifyClosePrinterChange(chgObj);
-                        break;
-                    }
-                }
-            }
-        }
-    }
-
-    private native String getDefaultPrinterName();
-    private native String[] getAllPrinterNames();
-    private native long notifyFirstPrinterChange(String printer);
-    private native void notifyClosePrinterChange(long chgObj);
-    private native int notifyPrinterChange(long chgObj);
-}
--- a/src/windows/classes/sun/print/services/javax.print.PrintServiceLookup	Fri May 24 16:15:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-# Provider for Java Print Service
-sun.print.Win32PrintServiceLookup
--- a/src/windows/classes/sun/print/services/javax.print.StreamPrintServiceFactory	Fri May 24 16:15:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-# Providers for Java 2D/JPS Stream print services.
-sun.print.PSStreamPrinterFactory
--- a/src/windows/native/sun/windows/WPrinterJob.cpp	Fri May 24 16:15:32 2019 +0100
+++ b/src/windows/native/sun/windows/WPrinterJob.cpp	Wed Jun 05 05:16:47 2019 +0100
@@ -68,7 +68,7 @@
 extern "C" {
 
 JNIEXPORT jstring JNICALL
-Java_sun_print_Win32PrintServiceLookup_getDefaultPrinterName(JNIEnv *env,
+Java_sun_print_PrintServiceLookupProvider_getDefaultPrinterName(JNIEnv *env,
                                                              jobject peer)
 {
     TRY;
@@ -119,7 +119,7 @@
 
 
 JNIEXPORT jobjectArray JNICALL
-Java_sun_print_Win32PrintServiceLookup_getAllPrinterNames(JNIEnv *env,
+Java_sun_print_PrintServiceLookupProvider_getAllPrinterNames(JNIEnv *env,
                                                           jobject peer)
 {
     TRY;
@@ -176,7 +176,7 @@
 
 
 JNIEXPORT jlong JNICALL
-Java_sun_print_Win32PrintServiceLookup_notifyFirstPrinterChange(JNIEnv *env,
+Java_sun_print_PrintServiceLookupProvider_notifyFirstPrinterChange(JNIEnv *env,
                                                                 jobject peer,
                                                                 jstring printer) {
     HANDLE hPrinter;
@@ -210,7 +210,7 @@
 
 
 JNIEXPORT void JNICALL
-Java_sun_print_Win32PrintServiceLookup_notifyClosePrinterChange(JNIEnv *env,
+Java_sun_print_PrintServiceLookupProvider_notifyClosePrinterChange(JNIEnv *env,
                                                                 jobject peer,
                                                                 jlong chgObject) {
     FindClosePrinterChangeNotification((HANDLE)chgObject);
@@ -218,7 +218,7 @@
 
 
 JNIEXPORT jint JNICALL
-Java_sun_print_Win32PrintServiceLookup_notifyPrinterChange(JNIEnv *env,
+Java_sun_print_PrintServiceLookupProvider_notifyPrinterChange(JNIEnv *env,
                                                            jobject peer,
                                                            jlong chgObject) {
     DWORD dwChange;
--- a/test/ProblemList.txt	Fri May 24 16:15:32 2019 +0100
+++ b/test/ProblemList.txt	Wed Jun 05 05:16:47 2019 +0100
@@ -308,6 +308,8 @@
 # 8206912
 sun/security/krb5/auto/ReplayCacheTestProc.java                 solaris-sparcv9
 
+security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java  8224768 generic-all
+
 ############################################################################
 
 # jdk_sound
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/BasicStroke/DashScaleMinWidth.java	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.geom.Line2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+
+import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
+
+/**
+ * @test
+ * @bug 4917097 8019816
+ * @summary 1.4.1 REGRESSION: BasicStroke Dashes don't show when scale * line width = 1.0
+ * @run main/othervm -Dsun.java2d.uiScale=1 DashScaleMinWidth
+ */
+public final class DashScaleMinWidth  {
+
+    public static void main(final String[] args) {
+        BufferedImage img = new BufferedImage(200, 40, TYPE_INT_ARGB);
+        draw(img);
+        validate(img);
+
+        if (GraphicsEnvironment.isHeadless()) {
+            return;
+        }
+
+        GraphicsConfiguration gc =
+                GraphicsEnvironment.getLocalGraphicsEnvironment()
+                        .getDefaultScreenDevice().getDefaultConfiguration();
+
+        VolatileImage vi = gc.createCompatibleVolatileImage(200, 40);
+        BufferedImage snapshot;
+        int attempt = 0;
+        while (true) {
+            if (++attempt > 10) {
+                throw new RuntimeException("Too many attempts: " + attempt);
+            }
+            vi.validate(gc);
+            draw(vi);
+            snapshot = vi.getSnapshot();
+            if (!vi.contentsLost()) {
+                break;
+            }
+        }
+        validate(snapshot);
+    }
+
+    private static void draw(final Image img) {
+        float[] dashes = {200.0f, 200.0f};
+        BasicStroke bs = new BasicStroke(20.0f,
+                                         BasicStroke.CAP_BUTT,
+                                         BasicStroke.JOIN_MITER,
+                                         1.0f,
+                                         dashes,
+                                         0.0f);
+        Graphics2D g = (Graphics2D) img.getGraphics();
+        g.setColor(Color.WHITE);
+        g.fillRect(0, 0, 200, 40);
+        Line2D line = new Line2D.Double(400, 400, 3600, 400);
+        g.setColor(Color.BLACK);
+        g.scale(0.05, 0.05);
+        g.setStroke(bs);
+        g.draw(line);
+        g.dispose();
+    }
+
+    private static void validate(final BufferedImage img) {
+        int white = Color.white.getRGB();
+        int point = img.getRGB(35, 20);   // point in the gap
+        if (point != white) {
+            throw new RuntimeException("Line should be dashed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/BasicStroke/DashZeroWidth.java	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.geom.Line2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+
+import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
+
+/**
+ * @test
+ * @bug 4779211 8019816
+ * @summary REGRESSION: 1.4 Dashed lines disappear if BasicStroke width=0.0
+ * @run main/othervm -Dsun.java2d.uiScale=1 DashZeroWidth
+ */
+public final class DashZeroWidth {
+
+    public static void main(final String[] args) {
+        BufferedImage img = new BufferedImage(200, 40, TYPE_INT_ARGB);
+        draw(img);
+        validate(img);
+
+        if (GraphicsEnvironment.isHeadless()) {
+            return;
+        }
+
+        GraphicsConfiguration gc =
+                GraphicsEnvironment.getLocalGraphicsEnvironment()
+                        .getDefaultScreenDevice().getDefaultConfiguration();
+
+        VolatileImage vi = gc.createCompatibleVolatileImage(200, 40);
+        BufferedImage snapshot;
+        int attempt = 0;
+        while (true) {
+            if (++attempt > 10) {
+                throw new RuntimeException("Too many attempts: " + attempt);
+            }
+            vi.validate(gc);
+            draw(vi);
+            snapshot = vi.getSnapshot();
+            if (!vi.contentsLost()) {
+                break;
+            }
+        }
+        validate(snapshot);
+    }
+
+    private static void draw(final Image img) {
+        float[] dashes = {10.0f, 10.0f};
+        BasicStroke bs = new BasicStroke(0.0f, BasicStroke.CAP_BUTT,
+                                         BasicStroke.JOIN_BEVEL, 10.0f, dashes,
+                                         0.0f);
+        Graphics2D g = (Graphics2D) img.getGraphics();
+        g.setColor(Color.WHITE);
+        g.fillRect(0, 0, 200, 40);
+        Line2D line = new Line2D.Double(20, 20, 180, 20);
+        g.setColor(Color.BLACK);
+        g.setStroke(bs);
+        g.draw(line);
+        g.dispose();
+    }
+
+    private static void validate(final BufferedImage img) {
+        int black = Color.black.getRGB();
+        int white = Color.white.getRGB();
+        int pointB = img.getRGB(25, 20);   // point on the dash
+        int pointW = img.getRGB(35, 20);   // point in the gap
+        if (pointB != black || pointW != white) {
+            throw new RuntimeException("Line should be visible and dashed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FontClass/GlyphRotationTest.java	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018, 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 8204929
+ * @summary test rotation of font with embedded bitmaps
+ * @run main GlyphRotationTest
+ */
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import javax.imageio.ImageIO;
+
+public class GlyphRotationTest {
+
+    public static final String fontName = "MS UI Gothic";
+    public static Font font;
+    public static final int SZ = 50;
+
+    public static void main(String[] args) {
+        font = new Font(fontName, Font.PLAIN, 15);
+        if (!font.getFamily(java.util.Locale.ENGLISH).equals(fontName)) {
+            return;
+        }
+        BufferedImage bi = new BufferedImage(SZ,SZ,BufferedImage.TYPE_INT_RGB);
+        Graphics2D g2d = bi.createGraphics();
+        g2d.setColor(Color.white);
+        g2d.fillRect(0, 0, SZ, SZ);
+        g2d.setColor(Color.black);
+        g2d.setFont(font);
+        g2d.drawString("1", SZ/2, SZ/2);
+        int pixCnt1 = countPixels(bi);
+        AffineTransform at = AffineTransform.getRotateInstance(Math.PI/2);
+        font = font.deriveFont(Font.PLAIN, at);
+        g2d.setFont(font);
+        g2d.drawString("1", SZ/2, SZ/2);
+        int pixCnt2 = countPixels(bi);
+        if (args.length > 0) {
+            try {
+               ImageIO.write(bi, "png", new java.io.File("im.png"));
+            }  catch (Exception e) {}
+        }
+        if (pixCnt1 == pixCnt2) {
+            String msg = "cnt 1 = " + pixCnt1 + " cnt 2 = " + pixCnt2;
+            throw new RuntimeException(msg);
+        }
+    }
+
+    static int countPixels(BufferedImage bi) {
+        int cnt = 0;
+        int w = bi.getWidth(null);
+        int h = bi.getHeight(null);
+        for (int i=0; i<w; i++) {
+            for (int j=0; j<w; j++) {
+                int rgb = bi.getRGB(i, j) & 0xFFFFFF;
+                if (rgb == 0) {
+                    cnt++;
+                }
+            }
+        }
+        return cnt;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/im/InputContext/ReconnectTest.java	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,253 @@
+/*
+ * Copyright (c) 2018, 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
+ * @key headful
+ * @bug 8213183
+ * @summary verifies InputMethod reconnection
+ * @run main/manual ReconnectTest
+ */
+import java.awt.*;
+import java.awt.event.*;
+
+public class ReconnectTest {
+
+    private static void init() throws Exception {
+        String[] instructions
+            = {
+                "This test supports Linux and Japanese/Korean/Chinese",
+                "input method(IM). Under other environment, press Pass.",
+                "Test steps:",
+                "1.Turn on IM and input some Asian characters to TestWindow.",
+                "2.kill IM frontend by OS, and restart it.",
+                "  e.g. for ibus, $ ibus-daemon -r --xim &",
+                "3.Change focus to this Instructions window and back to TestWindow.",
+                "4.Confirm IM can be activated."
+              };
+
+        Sysout.createDialog();
+        Sysout.printInstructions(instructions);
+    }
+
+    static Frame mainFrame;
+
+    public static void initTestWindow() {
+        mainFrame = new Frame();
+        mainFrame.setTitle("TestWindow");
+        mainFrame.setLayout(new BorderLayout());
+        Panel p0 = new Panel();
+        p0.setLayout(new FlowLayout());
+        mainFrame.add(p0, BorderLayout.CENTER);
+        TextArea text = new TextArea();
+        p0.add(text);
+
+        mainFrame.pack();
+        mainFrame.setLocation(700, 10);
+        mainFrame.setVisible(true);
+    }
+
+    public static void dispose() {
+        Sysout.dispose();
+        mainFrame.dispose();
+    }
+
+    /**
+     * ***************************************************
+     * Standard Test Machinery Section DO NOT modify anything in this section --
+     * it's a standard chunk of code which has all of the synchronisation
+     * necessary for the test harness. By keeping it the same in all tests, it
+     * is easier to read and understand someone else's test, as well as insuring
+     * that all tests behave correctly with the test harness. There is a section
+     * following this for test-defined classes
+     * ****************************************************
+     */
+    private static boolean theTestPassed = false;
+    private static boolean testGeneratedInterrupt = false;
+    private static String failureMessage = "";
+    private static Thread mainThread = null;
+    final private static int sleepTime = 300000;
+
+    public static void main(String args[]) throws Exception {
+        mainThread = Thread.currentThread();
+        try {
+            init();
+            initTestWindow();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        try {
+            mainThread.sleep(sleepTime);
+        } catch (InterruptedException e) {
+            dispose();
+            if (testGeneratedInterrupt && !theTestPassed) {
+                throw new Exception(failureMessage);
+            }
+        }
+        if (!testGeneratedInterrupt) {
+            dispose();
+            throw new RuntimeException("Timed out after " + sleepTime / 1000
+                    + " seconds");
+        }
+    }
+
+    public static synchronized void pass() {
+        theTestPassed = true;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }
+
+    public static synchronized void fail(String whyFailed) {
+        theTestPassed = false;
+        testGeneratedInterrupt = true;
+        failureMessage = whyFailed;
+        mainThread.interrupt();
+    }
+}
+
+// *********** End Standard Test Machinery Section **********
+/**
+ * **************************************************
+ * Standard Test Machinery DO NOT modify anything below -- it's a standard chunk
+ * of code whose purpose is to make user interaction uniform, and thereby make
+ * it simpler to read and understand someone else's test.
+ * **************************************************
+ */
+/**
+ * This is part of the standard test machinery. It creates a dialog (with the
+ * instructions), and is the interface for sending text messages to the user. To
+ * print the instructions, send an array of strings to Sysout.createDialog
+ * WithInstructions method. Put one line of instructions per array entry. To
+ * display a message for the tester to see, simply call Sysout.println with the
+ * string to be displayed. This mimics System.out.println but works within the
+ * test harness as well as standalone.
+ */
+class Sysout {
+
+    private static TestDialog dialog;
+    private static Frame frame;
+
+    public static void createDialog() {
+        frame = new Frame();
+        dialog = new TestDialog(frame, "Instructions");
+        String[] defInstr = {"Instructions will appear here. ", ""};
+        dialog.printInstructions(defInstr);
+        dialog.setVisible(true);
+        println("Any messages for the tester will display here.");
+    }
+
+    public static void printInstructions(String[] instructions) {
+        dialog.printInstructions(instructions);
+    }
+
+    public static void println(String messageIn) {
+        dialog.displayMessage(messageIn);
+    }
+
+    public static void dispose() {
+        dialog.dispose();
+        frame.dispose();
+    }
+}
+
+/**
+ * This is part of the standard test machinery. It provides a place for the test
+ * instructions to be displayed, and a place for interactive messages to the
+ * user to be displayed. To have the test instructions displayed, see Sysout. To
+ * have a message to the user be displayed, see Sysout. Do not call anything in
+ * this dialog directly.
+ */
+class TestDialog extends Dialog implements ActionListener {
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+    Panel buttonP;
+    Button failB;
+    Button passB;
+
+    // DO NOT call this directly, go through Sysout
+    public TestDialog(Frame frame, String name) {
+        super(frame, name);
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea("", 15, maxStringLength, scrollBoth);
+        add("North", instructionsText);
+
+        messageText = new TextArea("", 5, maxStringLength, scrollBoth);
+        add("Center", messageText);
+
+        buttonP = new Panel();
+        failB = new Button("Fail");
+        failB.setActionCommand("fail");
+        failB.addActionListener(this);
+        passB = new Button("Pass");
+        buttonP.add(passB);
+        buttonP.add(failB);
+        passB.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent ae) {
+                ReconnectTest.pass();
+            }
+        });
+
+        add("South", buttonP);
+        pack();
+        setVisible(true);
+    }
+
+    // DO NOT call this directly, go through Sysout
+    public void printInstructions(String[] instructions) {
+        instructionsText.setText("");
+        String printStr, remainingStr;
+        for (int i = 0; i < instructions.length; i++) {
+            remainingStr = instructions[i];
+            while (remainingStr.length() > 0) {
+                if (remainingStr.length() >= maxStringLength) {
+                    int posOfSpace = remainingStr.
+                            lastIndexOf(' ', maxStringLength - 1);
+
+                    if (posOfSpace <= 0) {
+                        posOfSpace = maxStringLength - 1;
+                    }
+
+                    printStr = remainingStr.substring(0, posOfSpace + 1);
+                    remainingStr = remainingStr.substring(posOfSpace + 1);
+                } else {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+                instructionsText.append(printStr + "\n");
+            }
+        }
+    }
+
+    public void displayMessage(String messageIn) {
+        messageText.append(messageIn + "\n");
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        if (e.getActionCommand() == "fail") {
+            ReconnectTest.fail("User Clicked Fail");
+        }
+    }
+}
--- a/test/java/net/Socket/asyncClose/Race.java	Fri May 24 16:15:32 2019 +0100
+++ b/test/java/net/Socket/asyncClose/Race.java	Wed Jun 05 05:16:47 2019 +0100
@@ -30,6 +30,7 @@
 import java.io.InputStream;
 import java.net.ServerSocket;
 import java.net.Socket;
+import java.net.ConnectException;
 import java.net.SocketException;
 import java.util.concurrent.Phaser;
 
@@ -43,33 +44,37 @@
             final int port = ss.getLocalPort();
             final Phaser phaser = new Phaser(THREADS + 1);
             for (int i=0; i<100; i++) {
-                final Socket s = new Socket("localhost", port);
-                s.setSoLinger(false, 0);
-                try (Socket sa = ss.accept()) {
-                    sa.setSoLinger(false, 0);
-                    final InputStream is = s.getInputStream();
-                    Thread[] threads = new Thread[THREADS];
-                    for (int j=0; j<THREADS; j++) {
-                        threads[j] = new Thread() {
-                        public void run() {
-                            try {
-                                phaser.arriveAndAwaitAdvance();
-                                while (is.read() != -1)
-                                    Thread.sleep(50);
-                            } catch (Exception x) {
-                                if (!(x instanceof SocketException
-                                      && x.getMessage().equalsIgnoreCase("socket closed")))
-                                    x.printStackTrace();
-                                // ok, expect Socket closed
-                            }
-                        }};
+                try {
+                    final Socket s = new Socket("localhost", port);
+                    s.setSoLinger(false, 0);
+                    try (Socket sa = ss.accept()) {
+                        sa.setSoLinger(false, 0);
+                        final InputStream is = s.getInputStream();
+                        Thread[] threads = new Thread[THREADS];
+                        for (int j=0; j<THREADS; j++) {
+                            threads[j] = new Thread() {
+                            public void run() {
+                                try {
+                                    phaser.arriveAndAwaitAdvance();
+                                    while (is.read() != -1)
+                                        Thread.sleep(50);
+                                } catch (Exception x) {
+                                    if (!(x instanceof SocketException
+                                          && x.getMessage().equalsIgnoreCase("socket closed")))
+                                        x.printStackTrace();
+                                    // ok, expect Socket closed
+                                }
+                            }};
+                        }
+                        for (int j=0; j<100; j++)
+                            threads[j].start();
+                        phaser.arriveAndAwaitAdvance();
+                        s.close();
+                        for (int j=0; j<100; j++)
+                            threads[j].join();
                     }
-                    for (int j=0; j<100; j++)
-                        threads[j].start();
-                    phaser.arriveAndAwaitAdvance();
-                    s.close();
-                    for (int j=0; j<100; j++)
-                        threads[j].join();
+                } catch (ConnectException e) {
+                    System.err.println("Exception " + e + " Port: " + port);
                 }
             }
         }
--- a/test/java/net/ipv6tests/Tests.java	Fri May 24 16:15:32 2019 +0100
+++ b/test/java/net/ipv6tests/Tests.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -136,11 +136,17 @@
 
     /* check the time got is within 50% of the time expected */
     public static void checkTime (long got, long expected) {
-        dprintln ("checkTime: got " + got + " expected " + expected);
-        long upper = expected + (expected / 2);
-        long lower = expected - (expected / 2);
+        checkTime(got, expected, expected);
+    }
+
+    /* check the time got is between start and end, given 50% tolerance */
+    public static void checkTime(long got, long start, long end) {
+        dprintln("checkTime: got = " + got + " start = " + start + " end = " + end);
+        long upper = end + (end / 2);
+        long lower = start - (start / 2);
         if (got > upper || got < lower) {
-            throw new RuntimeException ("checkTime failed: got " + got + " expected " + expected);
+            throw new RuntimeException("checkTime failed: got " + got
+                    + ", expected between " + start + " and " + end);
         }
     }
 
--- a/test/java/net/ipv6tests/UdpTest.java	Fri May 24 16:15:32 2019 +0100
+++ b/test/java/net/ipv6tests/UdpTest.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -158,7 +158,7 @@
         });
         t1 = System.currentTimeMillis();
         s1.receive (new DatagramPacket (new byte [128], 128));
-        checkTime (System.currentTimeMillis() - t1, 4000);
+        checkTime (System.currentTimeMillis() - t1, 2000, 10000);
         s1.close ();
         s2.close ();
         System.out.println ("Test2: OK");
--- a/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FlatMapOpTest.java	Fri May 24 16:15:32 2019 +0100
+++ b/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FlatMapOpTest.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /*
  * @test
  * @summary flat-map operations
- * @bug 8044047 8076458
+ * @bug 8044047 8076458 8075939
  */
 
 package org.openjdk.tests.java.util.stream;
@@ -36,6 +36,7 @@
 import java.util.Collections;
 import java.util.function.Function;
 import java.util.stream.*;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import static java.util.stream.LambdaTestHelpers.*;
 import static java.util.stream.ThowableHelper.checkNPE;
@@ -43,6 +44,7 @@
 @Test
 public class FlatMapOpTest extends OpTestCase {
 
+    @Test
     public void testNullMapper() {
         checkNPE(() -> Stream.of(1).flatMap(null));
         checkNPE(() -> IntStream.of(1).flatMap(null));
@@ -53,6 +55,7 @@
     static final Function<Integer, Stream<Integer>> integerRangeMapper
             = e -> IntStream.range(0, e).boxed();
 
+    @Test
     public void testFlatMap() {
         String[] stringsArray = {"hello", "there", "", "yada"};
         Stream<String> strings = Arrays.asList(stringsArray).stream();
@@ -85,11 +88,24 @@
         exerciseOps(data, s -> s.flatMap((Integer e) -> IntStream.range(0, e).boxed().limit(10)));
     }
 
+    @Test
+    public void testOpsShortCircuit() {
+        AtomicInteger count = new AtomicInteger();
+        Stream.of(0).flatMap(i -> IntStream.range(0, 100).boxed()).
+                peek(i -> count.incrementAndGet()).
+                limit(10).toArray();
+        assertEquals(count.get(), 10);
+    }
+
     //
 
     @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class)
     public void testIntOps(String name, TestData.OfInt data) {
-        Collection<Integer> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToInt(j -> j)));
+        Collection<Integer> result = exerciseOps(data, s -> s.flatMap(IntStream::of));
+        assertEquals(data.size(), result.size());
+        assertContents(data, result);
+
+        result = exerciseOps(data, s -> s.boxed().flatMapToInt(IntStream::of));
         assertEquals(data.size(), result.size());
         assertContents(data, result);
 
@@ -101,13 +117,35 @@
     public void testIntOpsX(String name, TestData.OfInt data) {
         exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e)));
         exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e).limit(10)));
+
+        exerciseOps(data, s -> s.boxed().flatMapToInt(e -> IntStream.range(0, e)));
+        exerciseOps(data, s -> s.boxed().flatMapToInt(e -> IntStream.range(0, e).limit(10)));
+    }
+
+    @Test
+    public void testIntOpsShortCircuit() {
+        AtomicInteger count = new AtomicInteger();
+        IntStream.of(0).flatMap(i -> IntStream.range(0, 100)).
+                peek(i -> count.incrementAndGet()).
+                limit(10).toArray();
+        assertEquals(count.get(), 10);
+
+        count.set(0);
+        Stream.of(0).flatMapToInt(i -> IntStream.range(0, 100)).
+                peek(i -> count.incrementAndGet()).
+                limit(10).toArray();
+        assertEquals(count.get(), 10);
     }
 
     //
 
     @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
     public void testLongOps(String name, TestData.OfLong data) {
-        Collection<Long> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToLong(j -> j)));
+        Collection<Long> result = exerciseOps(data, s -> s.flatMap(LongStream::of));
+        assertEquals(data.size(), result.size());
+        assertContents(data, result);
+
+        result = exerciseOps(data, s -> s.boxed().flatMapToLong(LongStream::of));
         assertEquals(data.size(), result.size());
         assertContents(data, result);
 
@@ -121,11 +159,30 @@
         exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e).limit(10)));
     }
 
+    @Test
+    public void testLongOpsShortCircuit() {
+        AtomicInteger count = new AtomicInteger();
+        LongStream.of(0).flatMap(i -> LongStream.range(0, 100)).
+                peek(i -> count.incrementAndGet()).
+                limit(10).toArray();
+        assertEquals(count.get(), 10);
+
+        count.set(0);
+        Stream.of(0).flatMapToLong(i -> LongStream.range(0, 100)).
+                peek(i -> count.incrementAndGet()).
+                limit(10).toArray();
+        assertEquals(count.get(), 10);
+    }
+
     //
 
     @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
     public void testDoubleOps(String name, TestData.OfDouble data) {
-        Collection<Double> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToDouble(j -> j)));
+        Collection<Double> result = exerciseOps(data, s -> s.flatMap(DoubleStream::of));
+        assertEquals(data.size(), result.size());
+        assertContents(data, result);
+
+        result = exerciseOps(data, s -> s.boxed().flatMapToDouble(DoubleStream::of));
         assertEquals(data.size(), result.size());
         assertContents(data, result);
 
@@ -138,4 +195,19 @@
         exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).asDoubleStream()));
         exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).limit(10).asDoubleStream()));
     }
+
+    @Test
+    public void testDoubleOpsShortCircuit() {
+        AtomicInteger count = new AtomicInteger();
+        DoubleStream.of(0).flatMap(i -> IntStream.range(0, 100).asDoubleStream()).
+                peek(i -> count.incrementAndGet()).
+                limit(10).toArray();
+        assertEquals(count.get(), 10);
+
+        count.set(0);
+        Stream.of(0).flatMapToDouble(i -> IntStream.range(0, 100).asDoubleStream()).
+                peek(i -> count.incrementAndGet()).
+                limit(10).toArray();
+        assertEquals(count.get(), 10);
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/imageio/stream/NullStreamCheckTest.java	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2016, 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     8044289
+ * @summary Test verifies that when some of the read() and write() methods
+ *          are not able to get stream from createImageInputStream() and
+ *          createImageOutputStream() are we doing null check for stream
+ *          and throwing IOException as per specification.
+ * @run     main NullStreamCheckTest
+ */
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.imageio.ImageIO;
+import javax.imageio.spi.IIORegistry;
+import javax.imageio.spi.ImageInputStreamSpi;
+import javax.imageio.spi.ImageOutputStreamSpi;
+
+public class NullStreamCheckTest {
+
+    // get ImageIORegistry default instance.
+    private static final IIORegistry localRegistry = IIORegistry.
+            getDefaultInstance();
+    // stream variables needed for input and output.
+    static LocalOutputStream outputStream = new LocalOutputStream();
+    static LocalInputStream inputStream = new LocalInputStream();
+
+    static final int width = 50, height = 50;
+
+    // input and output BufferedImage needed while read and write.
+    static BufferedImage inputImage = new BufferedImage(width, height,
+            BufferedImage.TYPE_INT_ARGB);
+
+    // creates test file needed for read and write in local directory.
+    private static File createTestFile(String name) throws IOException {
+        String sep = System.getProperty("file.separator");
+        String dir = System.getProperty("test.src", ".");
+        String filePath = dir+sep;
+        File directory = new File(filePath);
+        File tmpTestFile = File.createTempFile(name, ".png", directory);
+        directory.delete();
+        return tmpTestFile;
+    }
+
+    /* if we catch expected IOException message return
+     * false otherwise return true.
+     */
+    private static boolean verifyOutputExceptionMessage(IOException ex) {
+        String message = ex.getMessage();
+        return (!message.equals("Can't create an ImageOutputStream!"));
+    }
+
+    /* if we catch expected IOException message return
+     * false otherwise return true.
+     */
+    private static boolean verifyInputExceptionMessage(IOException ex) {
+        String message = ex.getMessage();
+        return (!message.equals("Can't create an ImageInputStream!"));
+    }
+
+    private static void verifyFileWrite() throws IOException {
+        File outputTestFile = createTestFile("outputTestFile");
+        try {
+            ImageIO.write(inputImage, "png", outputTestFile);
+        } catch (IOException ex) {
+            if (verifyOutputExceptionMessage(ex))
+                throw ex;
+        } finally {
+            outputTestFile.delete();
+        }
+    }
+
+    private static void verifyStreamWrite() throws IOException {
+        try {
+            ImageIO.write(inputImage, "png", outputStream);
+        } catch (IOException ex) {
+            if (verifyOutputExceptionMessage(ex))
+                throw ex;
+        } finally {
+            try {
+                outputStream.close();
+            } catch (IOException ex) {
+                throw ex;
+            }
+        }
+    }
+
+    private static void verifyFileRead() throws IOException {
+        File inputTestFile = createTestFile("inputTestFile");
+        try {
+            ImageIO.read(inputTestFile);
+        } catch (IOException ex) {
+            if (verifyInputExceptionMessage(ex))
+                throw ex;
+        } finally {
+            inputTestFile.delete();
+        }
+    }
+
+    private static void verifyStreamRead() throws IOException {
+        try {
+            ImageIO.read(inputStream);
+        } catch (IOException ex) {
+            if (verifyInputExceptionMessage(ex))
+                throw ex;
+        } finally {
+            try {
+                inputStream.close();
+            } catch (IOException ex) {
+                throw ex;
+            }
+        }
+    }
+
+    private static void verifyUrlRead() throws IOException {
+        URL url;
+        File inputTestUrlFile = createTestFile("inputTestFile");
+        try {
+            try {
+                url = inputTestUrlFile.toURI().toURL();
+            } catch (MalformedURLException ex) {
+                throw ex;
+            }
+
+            try {
+                ImageIO.read(url);
+            } catch (IOException ex) {
+                if (verifyInputExceptionMessage(ex))
+                    throw ex;
+            }
+        } finally {
+            inputTestUrlFile.delete();
+        }
+    }
+
+    public static void main(String[] args) throws IOException,
+                                                  MalformedURLException {
+
+        /* deregister ImageOutputStreamSpi so that we creatImageOutputStream
+         * returns null while writing.
+         */
+        localRegistry.deregisterAll(ImageOutputStreamSpi.class);
+        /* verify possible ImageIO.write() scenario's for null stream output
+         * from createImageOutputStream() API in ImageIO class.
+         */
+        verifyFileWrite();
+        verifyStreamWrite();
+
+        /* deregister ImageInputStreamSpi so that we creatImageInputStream
+         * returns null while reading.
+         */
+        localRegistry.deregisterAll(ImageInputStreamSpi.class);
+        /* verify possible ImageIO.read() scenario's for null stream output
+         * from createImageInputStream API in ImageIO class.
+         */
+        verifyFileRead();
+        verifyStreamRead();
+        verifyUrlRead();
+    }
+
+    static class LocalOutputStream extends OutputStream {
+
+        @Override
+        public void write(int i) throws IOException {
+        }
+    }
+
+    static class LocalInputStream extends InputStream {
+
+        @Override
+        public int read() throws IOException {
+            return 0;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/sort/SortTest.java	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2018, 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.StringWriter;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.List;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
+import org.testng.annotations.Test;
+
+/*
+ * @test
+ * @bug 8193830
+ * @run testng/othervm -DrunSecMngr=true SortTest
+ * @run testng/othervm SortTest
+ * @summary verify xsl:sort lang attribute
+ */
+public class SortTest {
+
+    static final String LAND_EN = "en";
+    static final String LAND_PL = "pl";
+    static final String LAND_RU = "ru";
+
+    String filepath;
+    String slash = "";
+
+    @BeforeClass
+    public void setUpClass() throws Exception {
+        String file1 = getClass().getResource("/sort-alphabet-english.xml").getFile();
+        if (System.getProperty("os.name").contains("Windows")) {
+            filepath = file1.substring(1, file1.lastIndexOf("/") + 1);
+            slash = "/";
+        } else {
+            filepath = file1.substring(0, file1.lastIndexOf("/") + 1);
+        }
+    }
+
+    /*
+     * DataProvider fields:
+     * lang, xml, xsl, gold file
+     */
+    @DataProvider(name = "parameters")
+    public Object[][] getParameters() {
+
+        return new Object[][]{
+            {LAND_EN, "sort-alphabet-english.xml", "sort-alphabet-english.xsl", "sort-alphabet-english.out"},
+            {LAND_PL, "sort-alphabet-polish.xml", "sort-alphabet-polish.xsl", "sort-alphabet-polish.out"},
+            {LAND_RU, "sort-alphabet-russian.xml", "sort-alphabet-russian.xsl", "sort-alphabet-russian.out"},};
+    }
+
+    @Test(dataProvider = "parameters")
+    public final void testTransform(String lang, String xml, String xsl, String gold)
+            throws Exception {
+
+        StringWriter sw = new StringWriter();
+        // Create transformer factory
+        TransformerFactory factory = TransformerFactory.newInstance();
+
+        // Use the factory to create a template containing the xsl file
+        Templates template = factory.newTemplates(new StreamSource(getClass().getResourceAsStream(xsl)));
+        // Use the template to create a transformer
+        Transformer xformer = template.newTransformer();
+        xformer.setParameter("lang", lang);
+        // Prepare the input and output files
+        Source source = new StreamSource(getClass().getResourceAsStream(xml));
+
+        /*
+             * The following may be used to produce gold files.
+             * Using however the original gold files, and compare without considering
+             * the format
+         */
+        //String output = getClass().getResource(gold).getPath();
+        //Result result = new StreamResult(new FileOutputStream(output));
+        // use the following to verify the output against the pre-generated one
+        Result result = new StreamResult(sw);
+
+        // Apply the xsl file to the source file and write the result to the
+        // output file
+        xformer.transform(source, result);
+
+        String out = sw.toString();
+
+        List<String> lines = Files.readAllLines(Paths.get(filepath + gold));
+        String[] resultLines = out.split("\n");
+        int i = 0;
+
+        // the purpose is to test sort, so ignore the format of the output
+
+        for (String line : lines) {
+            Assert.assertEquals(resultLines[i++].trim(), line.trim());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/sort/sort-alphabet-english.out	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?><root>
+<p>lang: en</p>
+<ul>
+<li>A</li>
+<li>C</li>
+<li>D</li>
+<li>E</li>
+<li>F</li>
+<li>G</li>
+<li>H</li>
+<li>I</li>
+<li>J</li>
+<li>K</li>
+<li>L</li>
+<li>M</li>
+<li>N</li>
+<li>O</li>
+<li>P</li>
+<li>Q</li>
+<li>R</li>
+<li>S</li>
+<li>T</li>
+<li>U</li>
+<li>V</li>
+<li>W</li>
+<li>X</li>
+<li>Y</li>
+<li>Z</li>
+</ul>
+</root>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/sort/sort-alphabet-english.xml	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <!--
+   * Licensed to the Apache Software Foundation (ASF) under one
+   * or more contributor license agreements. See the NOTICE file
+   * distributed with this work for additional information
+   * regarding copyright ownership. The ASF licenses this file
+   * to you under the Apache License, Version 2.0 (the  "License");
+   * you may not use this file except in compliance with the License.
+   * You may obtain a copy of the License at
+   *
+   *     http://www.apache.org/licenses/LICENSE-2.0
+   *
+   * Unless required by applicable law or agreed to in writing, software
+   * distributed under the License is distributed on an "AS IS" BASIS,
+   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   * See the License for the specific language governing permissions and
+   * limitations under the License.
+  -->
+<alphabet language="en">
+  <character>A</character>
+  <character>E</character>
+  <character>C</character>
+  <character>D</character>
+  <character>F</character>
+  <character>G</character>
+  <character>H</character>
+  <character>I</character>
+  <character>J</character>
+  <character>K</character>
+  <character>L</character>
+  <character>M</character>
+  <character>N</character>
+  <character>Y</character>
+  <character>O</character>
+  <character>P</character>
+  <character>Q</character>
+  <character>U</character>
+  <character>R</character>
+  <character>S</character>
+  <character>V</character>
+  <character>W</character>
+  <character>T</character>
+  <character>X</character>
+  <character>Z</character>
+</alphabet>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/sort/sort-alphabet-english.xsl	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <!--
+   * Licensed to the Apache Software Foundation (ASF) under one
+   * or more contributor license agreements. See the NOTICE file
+   * distributed with this work for additional information
+   * regarding copyright ownership. The ASF licenses this file
+   * to you under the Apache License, Version 2.0 (the  "License");
+   * you may not use this file except in compliance with the License.
+   * You may obtain a copy of the License at
+   *
+   *     http://www.apache.org/licenses/LICENSE-2.0
+   *
+   * Unless required by applicable law or agreed to in writing, software
+   * distributed under the License is distributed on an "AS IS" BASIS,
+   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   * See the License for the specific language governing permissions and
+   * limitations under the License.
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+  <xsl:output method="xml" version="1.0" omit-xml-declaration="no" encoding="UTF-8" indent="yes" xml:space="preserve" />
+  <!-- <xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 
+    4.01//EN" version="4.0" encoding="UTF-8" indent="yes" xml:lang="$lang" omit-xml-declaration="no"/> -->
+  <xsl:param name="lang" />
+  <xsl:template match="alphabet">
+    <root>
+      <p>lang: <xsl:value-of select="$lang" /></p>
+      <ul>
+        <xsl:apply-templates select="character">
+          <xsl:sort select="." lang="{$lang}" order="ascending" />
+        </xsl:apply-templates>
+      </ul>
+    </root>
+  </xsl:template>
+  <xsl:template match="character">
+    <li>
+      <xsl:value-of select="text()" />
+    </li>
+  </xsl:template>
+</xsl:stylesheet>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.out	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?><root>
+<p>lang: pl</p>
+<ul>
+<li>A</li>
+<li>Ą</li>
+<li>B</li>
+<li>C</li>
+<li>Ć</li>
+<li>D</li>
+<li>E</li>
+<li>Ę</li>
+<li>F</li>
+<li>G</li>
+<li>H</li>
+<li>I</li>
+<li>J</li>
+<li>K</li>
+<li>L</li>
+<li>Ł</li>
+<li>M</li>
+<li>N</li>
+<li>Ń</li>
+<li>O</li>
+<li>Ó</li>
+<li>P</li>
+<li>R</li>
+<li>S</li>
+<li>Ś</li>
+<li>T</li>
+<li>U</li>
+<li>W</li>
+<li>Y</li>
+<li>Z</li>
+<li>Ź</li>
+<li>Ż</li>
+</ul>
+</root>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.xml	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <!--
+   * Licensed to the Apache Software Foundation (ASF) under one
+   * or more contributor license agreements. See the NOTICE file
+   * distributed with this work for additional information
+   * regarding copyright ownership. The ASF licenses this file
+   * to you under the Apache License, Version 2.0 (the  "License");
+   * you may not use this file except in compliance with the License.
+   * You may obtain a copy of the License at
+   *
+   *     http://www.apache.org/licenses/LICENSE-2.0
+   *
+   * Unless required by applicable law or agreed to in writing, software
+   * distributed under the License is distributed on an "AS IS" BASIS,
+   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   * See the License for the specific language governing permissions and
+   * limitations under the License.
+  -->
+<alphabet language="pl">
+  <character>A</character>
+  <character>Ż</character>
+  <character>B</character>
+  <character>C</character>
+  <character>Ć</character>
+  <character>D</character>
+  <character>Ł</character>
+  <character>E</character>
+  <character>Ę</character>
+  <character>F</character>
+  <character>G</character>
+  <character>H</character>
+  <character>I</character>
+  <character>J</character>
+  <character>K</character>
+  <character>L</character>
+  <character>Z</character>
+  <character>Ź</character>
+  <character>M</character>
+  <character>N</character>
+  <character>Ń</character>
+  <character>O</character>
+  <character>Ó</character>
+  <character>P</character>
+  <character>R</character>
+  <character>S</character>
+  <character>Ś</character>
+  <character>T</character>
+  <character>U</character>
+  <character>W</character>
+  <character>Ą</character>
+  <character>Y</character>
+</alphabet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.xsl	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <!--
+   * Licensed to the Apache Software Foundation (ASF) under one
+   * or more contributor license agreements. See the NOTICE file
+   * distributed with this work for additional information
+   * regarding copyright ownership. The ASF licenses this file
+   * to you under the Apache License, Version 2.0 (the  "License");
+   * you may not use this file except in compliance with the License.
+   * You may obtain a copy of the License at
+   *
+   *     http://www.apache.org/licenses/LICENSE-2.0
+   *
+   * Unless required by applicable law or agreed to in writing, software
+   * distributed under the License is distributed on an "AS IS" BASIS,
+   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   * See the License for the specific language governing permissions and
+   * limitations under the License.
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+  <xsl:output method="xml" version="1.0" omit-xml-declaration="no" encoding="UTF-8" indent="yes" xml:space="preserve" />
+  <!-- <xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 
+    4.01//EN" version="4.0" encoding="UTF-8" indent="yes" xml:lang="$lang" omit-xml-declaration="no"/> -->
+  <xsl:param name="lang" />
+  <xsl:template match="alphabet">
+    <root>
+      <p>lang: <xsl:value-of select="$lang" /></p>
+      <ul>
+        <xsl:apply-templates select="character">
+          <xsl:sort select="." lang="{$lang}" order="ascending" />
+        </xsl:apply-templates>
+      </ul>
+    </root>
+  </xsl:template>
+  <xsl:template match="character">
+    <li>
+      <xsl:value-of select="text()" />
+    </li>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.out	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?><root>
+<p>lang: ru</p>
+<ul>
+<li>А</li>
+<li>Б</li>
+<li>В</li>
+<li>Г</li>
+<li>Д</li>
+<li>Е</li>
+<li>Ё</li>
+<li>Ж</li>
+<li>З</li>
+<li>И</li>
+<li>Й</li>
+<li>К</li>
+<li>Л</li>
+<li>М</li>
+<li>Н</li>
+<li>О</li>
+<li>П</li>
+<li>Р</li>
+<li>С</li>
+<li>Т</li>
+<li>У</li>
+<li>Ф</li>
+<li>Х</li>
+<li>Ц</li>
+<li>Ч</li>
+<li>Ш</li>
+<li>Щ</li>
+<li>Ъ</li>
+<li>Ы</li>
+<li>Ь</li>
+<li>Э</li>
+<li>Ю</li>
+<li>Я</li>
+</ul>
+</root>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.xml	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <!--
+   * Licensed to the Apache Software Foundation (ASF) under one
+   * or more contributor license agreements. See the NOTICE file
+   * distributed with this work for additional information
+   * regarding copyright ownership. The ASF licenses this file
+   * to you under the Apache License, Version 2.0 (the  "License");
+   * you may not use this file except in compliance with the License.
+   * You may obtain a copy of the License at
+   *
+   *     http://www.apache.org/licenses/LICENSE-2.0
+   *
+   * Unless required by applicable law or agreed to in writing, software
+   * distributed under the License is distributed on an "AS IS" BASIS,
+   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   * See the License for the specific language governing permissions and
+   * limitations under the License.
+  -->
+<alphabet language="ru">
+  <character>А</character>
+  <character>Б</character>
+  <character>В</character>
+  <character>Г</character>
+  <character>Д</character>
+  <character>Е</character>
+  <character>Ё</character>
+  <character>Ж</character>
+  <character>З</character>
+  <character>Й</character>
+  <character>П</character>
+  <character>Я</character>
+  <character>К</character>
+  <character>Л</character>
+  <character>С</character>
+  <character>М</character>
+  <character>Н</character>
+  <character>О</character>
+  <character>Р</character>
+  <character>И</character>
+  <character>Т</character>
+  <character>Ф</character>
+  <character>Х</character>
+  <character>Ц</character>
+  <character>У</character>
+  <character>Ш</character>
+  <character>Щ</character>
+  <character>Ъ</character>
+  <character>Ы</character>
+  <character>Ч</character>
+  <character>Ь</character>
+  <character>Э</character>
+  <character>Ю</character>
+</alphabet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.xsl	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <!--
+   * Licensed to the Apache Software Foundation (ASF) under one
+   * or more contributor license agreements. See the NOTICE file
+   * distributed with this work for additional information
+   * regarding copyright ownership. The ASF licenses this file
+   * to you under the Apache License, Version 2.0 (the  "License");
+   * you may not use this file except in compliance with the License.
+   * You may obtain a copy of the License at
+   *
+   *     http://www.apache.org/licenses/LICENSE-2.0
+   *
+   * Unless required by applicable law or agreed to in writing, software
+   * distributed under the License is distributed on an "AS IS" BASIS,
+   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   * See the License for the specific language governing permissions and
+   * limitations under the License.
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+  <xsl:output method="xml" version="1.0" omit-xml-declaration="no" encoding="UTF-8" indent="yes" xml:space="preserve" />
+  <!-- <xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 
+    4.01//EN" version="4.0" encoding="UTF-8" indent="yes" xml:lang="$lang" omit-xml-declaration="no"/> -->
+  <xsl:param name="lang" />
+  <xsl:template match="alphabet">
+    <root>
+      <p>lang: <xsl:value-of select="$lang" /></p>
+      <ul>
+        <xsl:apply-templates select="character">
+          <xsl:sort select="." lang="{$lang}" order="ascending" />
+        </xsl:apply-templates>
+      </ul>
+    </root>
+  </xsl:template>
+  <xsl:template match="character">
+    <li>
+      <xsl:value-of select="text()" />
+    </li>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
--- a/test/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java	Fri May 24 16:15:32 2019 +0100
+++ b/test/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java	Wed Jun 05 05:16:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, 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
@@ -110,113 +110,113 @@
             + "pLwltum95OmYdBbxN4SBB7SC\n"
             + "-----END CERTIFICATE-----";
 
-    // Owner: CN=COMODO RSA Extended Validation Secure Server CA,
-    // O=COMODO CA Limited, L=Salford, ST=Greater Manchester, C=GB
-    // Issuer: CN=COMODO RSA Certification Authority, O=COMODO CA Limited,
-    // L=Salford, ST=Greater Manchester, C=GB
-    // Serial number: 6a74380d4ebfed435b5a3f7e16abdd8
-    // Valid from: Sat Feb 11 16:00:00 PST 2012 until: Thu Feb 11 15:59:59 PST 2027
-    private static final String VALID = "-----BEGIN CERTIFICATE-----\n"
-            + "MIIH8jCCBtqgAwIBAgIQcgqiz6QAlFISJPkBqYSxZzANBgkqhkiG9w0BAQsFADCB\n"
-            + "kjELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\n"
-            + "A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxODA2BgNV\n"
-            + "BAMTL0NPTU9ETyBSU0EgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVy\n"
-            + "IENBMB4XDTE3MDYzMDAwMDAwMFoXDTE5MDkyOTIzNTk1OVowggFdMREwDwYDVQQF\n"
-            + "EwgwNDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0\n"
-            + "ZSBPcmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExGzAZ\n"
-            + "BgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEWMBQG\n"
-            + "A1UECRMNVHJhZmZvcmQgUm9hZDEWMBQGA1UECRMNRXhjaGFuZ2UgUXVheTElMCMG\n"
-            + "A1UECRMcM3JkIEZsb29yLCAyNiBPZmZpY2UgVmlsbGFnZTEaMBgGA1UEChMRQ09N\n"
-            + "T0RPIENBIExpbWl0ZWQxGjAYBgNVBAsTEUNPTU9ETyBFViBTR0MgU1NMMTgwNgYD\n"
-            + "VQQDEy9jb21vZG9yc2FjZXJ0aWZpY2F0aW9uYXV0aG9yaXR5LWV2LmNvbW9kb2Nh\n"
-            + "LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAND/eZQBTjpBDsut\n"
-            + "eKwl+zpTitF8tJzwHAhcQHC2AaLF/GJl1rnjx4OfelMhKhN1Od9KU6onHGOd2w4m\n"
-            + "D4EiYK9TpXwuwTyzfkCmnkqxZjYK3KAJN013o4L+8y1zsGVUulpN/GfMaxTb4Xdm\n"
-            + "eSekTP91Phw3xezijBq3sa++1rO5RBaT1IHeHhHviC9WNrG8CIg/j5MyC9i43LZH\n"
-            + "iRXLER1LzT/MCIRsiG5AEbiYXV5BNd5SiiHtBJ1q0ZJH+AxL2ERaT41VCppboZwT\n"
-            + "hmJGGoky9FWjp6z8U6Enx0fAMJIZNEzW6LAJFKPEynEU004jFFCEumPUqqCC4ogx\n"
-            + "ulphY80CAwEAAaOCA3QwggNwMB8GA1UdIwQYMBaAFDna/8ooFIqodBMIueQOqdL6\n"
-            + "fp1pMB0GA1UdDgQWBBQ+S4ZhIrwOoeGs9BBT4uXq89Ux/jAOBgNVHQ8BAf8EBAMC\n"
-            + "BaAwDAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIw\n"
-            + "TwYDVR0gBEgwRjA7BgwrBgEEAbIxAQIBBQEwKzApBggrBgEFBQcCARYdaHR0cHM6\n"
-            + "Ly9zZWN1cmUuY29tb2RvLmNvbS9DUFMwBwYFZ4EMAQEwVgYDVR0fBE8wTTBLoEmg\n"
-            + "R4ZFaHR0cDovL2NybC5jb21vZG9jYS5jb20vQ09NT0RPUlNBRXh0ZW5kZWRWYWxp\n"
-            + "ZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3JsMIGHBggrBgEFBQcBAQR7MHkwUQYIKwYB\n"
-            + "BQUHMAKGRWh0dHA6Ly9jcnQuY29tb2RvY2EuY29tL0NPTU9ET1JTQUV4dGVuZGVk\n"
-            + "VmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNydDAkBggrBgEFBQcwAYYYaHR0cDov\n"
-            + "L29jc3AuY29tb2RvY2EuY29tMDoGA1UdEQQzMDGCL2NvbW9kb3JzYWNlcnRpZmlj\n"
-            + "YXRpb25hdXRob3JpdHktZXYuY29tb2RvY2EuY29tMIIBgAYKKwYBBAHWeQIEAgSC\n"
-            + "AXAEggFsAWoAdgCkuQmQtBhYFIe7E6LMZ3AKPDWYBPkb37jjd80OyA3cEAAAAVz5\n"
-            + "cV7GAAAEAwBHMEUCIQCpgc0Eqw3g4pr+oX88h5xgL1VEAiDpqAhbRtilgYwBbgIg\n"
-            + "UaIm+n8AHi55nB//Sb4Nz18GYVcfELfpIzRh1vW9HbYAdwBWFAaaL9fC7NP14b1E\n"
-            + "sj7HRna5vJkRXMDvlJhV1onQ3QAAAVz5cVybAAAEAwBIMEYCIQDdsgC4KZ++OP44\n"
-            + "X7LbUcNaxe0kFzbctF2L3bnmhp9nXQIhAM0/g+PrZBIBpYlOtzidePi8bBHrLWn2\n"
-            + "uBiP3pYIntl4AHcA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFc\n"
-            + "+XFeoQAABAMASDBGAiEAoySTb/QKw7JwtZtPHnECEMzgENQSFy58Kl+Mvcd3SmcC\n"
-            + "IQD8cU66Ih3ejvt0OTX+lfxQPKyggQfm4Uk/lwn5LEJXbDANBgkqhkiG9w0BAQsF\n"
-            + "AAOCAQEAKEaSYWn3Hi8rfJS4cMTJoMkVp2vpPH2dGXySBEy67TEGRw9+f75w3q95\n"
-            + "r1m3P+xsR6dBoidTq/6wqUYI51lB4Fq9ylh1Stp5Gj54CuyT+S31l7lD7sl0KMsn\n"
-            + "HDUDQHId7hKeORYpiIZOcrKOglKdi1uiGwDgoiLKh98lUrZA6durrhH+sl69wqp2\n"
-            + "0XAu+3hurXzCoZFJfyngTO1kt9qcFUAxc5LofIa9QvC6VR7dI4aAh7dUpIRlnjG3\n"
-            + "jJ1mUMTqWO6TFTtddb+uQjDqNgkYYYNuSax1WMEIZWbIi13EjXK1GPQUXJe6gQin\n"
-            + "NUq9JH9NPK6m8A1YKT+wgzfTDeaV2Q==\n"
-            + "-----END CERTIFICATE-----";
+    // Owner: CN=comodorsacertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, O=Sectigo Limited,
+    // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford,
+    // ST=Greater Manchester, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization,
+    // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690
+    // Issuer: CN=COMODO RSA Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford,
+    // ST=Greater Manchester, C=GB
+    // Serial number: d3df2597cbed1ab6e02ee82021771614
+    // Valid from: Wed Nov 28 16:00:00 PST 2018 until: Fri Feb 26 15:59:59 PST 2021
+    private static final String VALID = "-----BEGIN CERTIFICATE-----\n" +
+            "MIIH7jCCBtagAwIBAgIRANPfJZfL7Rq24C7oICF3FhQwDQYJKoZIhvcNAQELBQAw\n" +
+            "gZIxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO\n" +
+            "BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTgwNgYD\n" +
+            "VQQDEy9DT01PRE8gUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZl\n" +
+            "ciBDQTAeFw0xODExMjkwMDAwMDBaFw0yMTAyMjYyMzU5NTlaMIIBWzERMA8GA1UE\n" +
+            "BRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFByaXZh\n" +
+            "dGUgT3JnYW5pemF0aW9uMQswCQYDVQQGEwJHQjEPMA0GA1UEERMGTTUgM0VRMRsw\n" +
+            "GQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxFjAU\n" +
+            "BgNVBAkTDVRyYWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4Y2hhbmdlIFF1YXkxJTAj\n" +
+            "BgNVBAkTHDNyZCBGbG9vciwgMjYgT2ZmaWNlIFZpbGxhZ2UxGDAWBgNVBAoTD1Nl\n" +
+            "Y3RpZ28gTGltaXRlZDEaMBgGA1UECxMRQ09NT0RPIEVWIFNHQyBTU0wxODA2BgNV\n" +
+            "BAMTL2NvbW9kb3JzYWNlcnRpZmljYXRpb25hdXRob3JpdHktZXYuY29tb2RvY2Eu\n" +
+            "Y29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0P95lAFOOkEOy614\n" +
+            "rCX7OlOK0Xy0nPAcCFxAcLYBosX8YmXWuePHg596UyEqE3U530pTqiccY53bDiYP\n" +
+            "gSJgr1OlfC7BPLN+QKaeSrFmNgrcoAk3TXejgv7zLXOwZVS6Wk38Z8xrFNvhd2Z5\n" +
+            "J6RM/3U+HDfF7OKMGrexr77Ws7lEFpPUgd4eEe+IL1Y2sbwIiD+PkzIL2LjctkeJ\n" +
+            "FcsRHUvNP8wIhGyIbkARuJhdXkE13lKKIe0EnWrRkkf4DEvYRFpPjVUKmluhnBOG\n" +
+            "YkYaiTL0VaOnrPxToSfHR8Awkhk0TNbosAkUo8TKcRTTTiMUUIS6Y9SqoILiiDG6\n" +
+            "WmFjzQIDAQABo4IDcTCCA20wHwYDVR0jBBgwFoAUOdr/yigUiqh0Ewi55A6p0vp+\n" +
+            "nWkwHQYDVR0OBBYEFD5LhmEivA6h4az0EFPi5erz1TH+MA4GA1UdDwEB/wQEAwIF\n" +
+            "oDAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBP\n" +
+            "BgNVHSAESDBGMDsGDCsGAQQBsjEBAgEFATArMCkGCCsGAQUFBwIBFh1odHRwczov\n" +
+            "L3NlY3VyZS5jb21vZG8uY29tL0NQUzAHBgVngQwBATBWBgNVHR8ETzBNMEugSaBH\n" +
+            "hkVodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9SU0FFeHRlbmRlZFZhbGlk\n" +
+            "YXRpb25TZWN1cmVTZXJ2ZXJDQS5jcmwwgYcGCCsGAQUFBwEBBHsweTBRBggrBgEF\n" +
+            "BQcwAoZFaHR0cDovL2NydC5jb21vZG9jYS5jb20vQ09NT0RPUlNBRXh0ZW5kZWRW\n" +
+            "YWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCQGCCsGAQUFBzABhhhodHRwOi8v\n" +
+            "b2NzcC5jb21vZG9jYS5jb20wOgYDVR0RBDMwMYIvY29tb2RvcnNhY2VydGlmaWNh\n" +
+            "dGlvbmF1dGhvcml0eS1ldi5jb21vZG9jYS5jb20wggF9BgorBgEEAdZ5AgQCBIIB\n" +
+            "bQSCAWkBZwB1AO5Lvbd1zmC64UJpH6vhnmajD35fsHLYgwDEe4l6qP3LAAABZ2Bx\n" +
+            "+EAAAAQDAEYwRAIgXot8xi2N4oV6A8n2aXJ/TI6oI5t30ZgiyR3jF8nY8tYCIGBB\n" +
+            "e7sTFniA3vzfxhMbYsyAEy50PNFCaqLjNoyOaGNqAHYAb1N2rDHwMRnYmQCkURX/\n" +
+            "dxUcEdkCwQApBo2yCJo32RMAAAFnYHH4LQAABAMARzBFAiBq8utPzn0fL5zPPQNB\n" +
+            "gueIXEFDXPw8s5D+pzD6+ySwegIhAJUCgsW++nO2JwYNwJTxPsHOWs7WpXqXCsVC\n" +
+            "/FlJ1HHbAHYAu9nfvB+KcbWTlCOXqpJ7RzhXlQqrUugakJZkNo4e0YUAAAFnYHH4\n" +
+            "OAAABAMARzBFAiA7rSUo9XVQDb3CBLo85qFMzYzsylF223s0u4WXQTUGqQIhAKJq\n" +
+            "j602nEd4imaE9Wr7OWdIbbhLcNm5dhVZerk4MD6GMA0GCSqGSIb3DQEBCwUAA4IB\n" +
+            "AQBPeidaCGBGyFDK60+Eh8GyKQSMowcRA74B6C+JlQYTBtl024xAV7d3fnbULtzY\n" +
+            "rs5EGxlEPIR/ZLAETTdEi1mAalXAi2l1QDrmTeOGW+FZXlcXQuNeg56D9gkApftR\n" +
+            "yFFRLNScchNDsMwR3UOlJnD05DJk1J+SeNvOlefwfDHIlZBiQIrSxdWS8GIIkKLp\n" +
+            "4PIy+N4lgNEudi2LuRheEjmrkN9+NcKlU+v7lzlwCfWCDna2hacGRPRo5fAao5O0\n" +
+            "mlUzAYm76dn5dGGBVVqA0cfWnUeVfSTrlVb/QN+uYno4vIrpR5VBYPuJYU47vgzL\n" +
+            "YrTYerPngjPbZB0bfLOja0vb\n" +
+            "-----END CERTIFICATE-----";
 
-    // Owner: CN=comodorsacertificationauthority-ev.comodoca.com,
-    // OU=COMODO EV SGC SSL, O=COMODO CA Limited, STREET="3rd Floor, 26 Office Village",
-    // STREET=Exchange Quay, STREET=Trafford Road, L=Salford, ST=Greater Manchester,
-    // OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization,
+    // Owner: CN=comodorsacertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, O=COMODO CA Limited,
+    // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford,
+    // ST=Greater Manchester, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization,
     // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690
-    // Issuer: CN=COMODO RSA Extended Validation Secure Server CA,
-    // O=COMODO CA Limited, L=Salford, ST=Greater Manchester, C=GB
-    // Serial number: ff6ecae8c73f9b5ca811a1d2b14768be
-    // Valid from: Tue Aug 16 17:00:00 PDT 2016 until: Fri Nov 16 15:59:59 PST 2018
-    private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n"
-            + "MIIIGzCCBwOgAwIBAgIRAP9uyujHP5tcqBGh0rFHaL4wDQYJKoZIhvcNAQELBQAw\n"
-            + "gZIxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO\n"
-            + "BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTgwNgYD\n"
-            + "VQQDEy9DT01PRE8gUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZl\n"
-            + "ciBDQTAeFw0xNjA4MTcwMDAwMDBaFw0xODExMTYyMzU5NTlaMIIBXTERMA8GA1UE\n"
-            + "BRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFByaXZh\n"
-            + "dGUgT3JnYW5pemF0aW9uMQswCQYDVQQGEwJHQjEPMA0GA1UEERMGTTUgM0VRMRsw\n"
-            + "GQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxFjAU\n"
-            + "BgNVBAkTDVRyYWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4Y2hhbmdlIFF1YXkxJTAj\n"
-            + "BgNVBAkTHDNyZCBGbG9vciwgMjYgT2ZmaWNlIFZpbGxhZ2UxGjAYBgNVBAoTEUNP\n"
-            + "TU9ETyBDQSBMaW1pdGVkMRowGAYDVQQLExFDT01PRE8gRVYgU0dDIFNTTDE4MDYG\n"
-            + "A1UEAxMvY29tb2RvcnNhY2VydGlmaWNhdGlvbmF1dGhvcml0eS1ldi5jb21vZG9j\n"
-            + "YS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQ/3mUAU46QQ7L\n"
-            + "rXisJfs6U4rRfLSc8BwIXEBwtgGixfxiZda548eDn3pTISoTdTnfSlOqJxxjndsO\n"
-            + "Jg+BImCvU6V8LsE8s35App5KsWY2CtygCTdNd6OC/vMtc7BlVLpaTfxnzGsU2+F3\n"
-            + "ZnknpEz/dT4cN8Xs4owat7GvvtazuUQWk9SB3h4R74gvVjaxvAiIP4+TMgvYuNy2\n"
-            + "R4kVyxEdS80/zAiEbIhuQBG4mF1eQTXeUooh7QSdatGSR/gMS9hEWk+NVQqaW6Gc\n"
-            + "E4ZiRhqJMvRVo6es/FOhJ8dHwDCSGTRM1uiwCRSjxMpxFNNOIxRQhLpj1KqgguKI\n"
-            + "MbpaYWPNAgMBAAGjggOcMIIDmDAfBgNVHSMEGDAWgBQ52v/KKBSKqHQTCLnkDqnS\n"
-            + "+n6daTAdBgNVHQ4EFgQUPkuGYSK8DqHhrPQQU+Ll6vPVMf4wDgYDVR0PAQH/BAQD\n"
-            + "AgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMC\n"
-            + "MEYGA1UdIAQ/MD0wOwYMKwYBBAGyMQECAQUBMCswKQYIKwYBBQUHAgEWHWh0dHBz\n"
-            + "Oi8vc2VjdXJlLmNvbW9kby5jb20vQ1BTMFYGA1UdHwRPME0wS6BJoEeGRWh0dHA6\n"
-            + "Ly9jcmwuY29tb2RvY2EuY29tL0NPTU9ET1JTQUV4dGVuZGVkVmFsaWRhdGlvblNl\n"
-            + "Y3VyZVNlcnZlckNBLmNybDCBhwYIKwYBBQUHAQEEezB5MFEGCCsGAQUFBzAChkVo\n"
-            + "dHRwOi8vY3J0LmNvbW9kb2NhLmNvbS9DT01PRE9SU0FFeHRlbmRlZFZhbGlkYXRp\n"
-            + "b25TZWN1cmVTZXJ2ZXJDQS5jcnQwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmNv\n"
-            + "bW9kb2NhLmNvbTBvBgNVHREEaDBmgi9jb21vZG9yc2FjZXJ0aWZpY2F0aW9uYXV0\n"
-            + "aG9yaXR5LWV2LmNvbW9kb2NhLmNvbYIzd3d3LmNvbW9kb3JzYWNlcnRpZmljYXRp\n"
-            + "b25hdXRob3JpdHktZXYuY29tb2RvY2EuY29tMIIBfAYKKwYBBAHWeQIEAgSCAWwE\n"
-            + "ggFoAWYAdQBo9pj4H2SCvjqM7rkoHUz8cVFdZ5PURNEKZ6y7T0/7xAAAAVaYyfL5\n"
-            + "AAAEAwBGMEQCIBW1F2heN1IccknFpDVED66I/tb4BpkqWLwqzn5dwWQXAiAzSPv7\n"
-            + "1zuXUelPvK6l1gOLB/6VlD7gwVGg7M3B1+Vt7wB1AFYUBpov18Ls0/XhvUSyPsdG\n"
-            + "drm8mRFcwO+UmFXWidDdAAABVpjJ8k0AAAQDAEYwRAIgfTjxLr4edpWLyOGi32TW\n"
-            + "48I3c0YWQMM5qsMe7zDzdrACIBng0I2+XksdOXoz5CKMAZGYict+TnZ/p7sRPAYo\n"
-            + "dl05AHYA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFWmMnyzgAA\n"
-            + "BAMARzBFAiBiTeFCsfBnC4gKolnPUpL5S0eEkb0esucY40qhPqUnDgIhAOZrZz3G\n"
-            + "fLtEq73nEdAfvocUQC7IdMTEJRceb25Pk5J/MA0GCSqGSIb3DQEBCwUAA4IBAQBB\n"
-            + "YldVJKeAwqpPejxa0h3n3G8WefmAJXJtBcMKMDZ8thofgOyVDnVTkNVtY5UwwV8D\n"
-            + "a0bt0UhCzr88v7BrZ8PNci3qiTQgGz9q27s4x64og47sGREoil/0h3xdZ8cWVsAa\n"
-            + "i/aIHD0frCktX/PUZClpAuTQwJgKHurl1Apn1+RVZ3gozebOOopXmopscgp3FQV0\n"
-            + "RqBVietPoq6koeaJKf2ux102yW/Ef4RxXLJOLZ7ynV4tbIGyz4q+RhXbDknNrUcZ\n"
-            + "ugRTCaWUQ3cxtFQjA6MvY4G4eTycyiQTf/qFH5D7mrqY9ZLUuwH3AgLx49UZvQMk\n"
-            + "03iaUVSV6CNAsQVv4S5p\n"
-            + "-----END CERTIFICATE-----";
+    // Issuer: CN=COMODO RSA Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford,
+    // ST=Greater Manchester, C=GB
+    // Serial number: 720aa2cfa40094521224f901a984b167
+    // Valid from: Thu Jun 29 17:00:00 PDT 2017 until: Sun Sep 29 16:59:59 PDT 2019
+    private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" +
+            "MIIH8jCCBtqgAwIBAgIQcgqiz6QAlFISJPkBqYSxZzANBgkqhkiG9w0BAQsFADCB\n" +
+            "kjELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\n" +
+            "A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxODA2BgNV\n" +
+            "BAMTL0NPTU9ETyBSU0EgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVy\n" +
+            "IENBMB4XDTE3MDYzMDAwMDAwMFoXDTE5MDkyOTIzNTk1OVowggFdMREwDwYDVQQF\n" +
+            "EwgwNDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0\n" +
+            "ZSBPcmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExGzAZ\n" +
+            "BgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEWMBQG\n" +
+            "A1UECRMNVHJhZmZvcmQgUm9hZDEWMBQGA1UECRMNRXhjaGFuZ2UgUXVheTElMCMG\n" +
+            "A1UECRMcM3JkIEZsb29yLCAyNiBPZmZpY2UgVmlsbGFnZTEaMBgGA1UEChMRQ09N\n" +
+            "T0RPIENBIExpbWl0ZWQxGjAYBgNVBAsTEUNPTU9ETyBFViBTR0MgU1NMMTgwNgYD\n" +
+            "VQQDEy9jb21vZG9yc2FjZXJ0aWZpY2F0aW9uYXV0aG9yaXR5LWV2LmNvbW9kb2Nh\n" +
+            "LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAND/eZQBTjpBDsut\n" +
+            "eKwl+zpTitF8tJzwHAhcQHC2AaLF/GJl1rnjx4OfelMhKhN1Od9KU6onHGOd2w4m\n" +
+            "D4EiYK9TpXwuwTyzfkCmnkqxZjYK3KAJN013o4L+8y1zsGVUulpN/GfMaxTb4Xdm\n" +
+            "eSekTP91Phw3xezijBq3sa++1rO5RBaT1IHeHhHviC9WNrG8CIg/j5MyC9i43LZH\n" +
+            "iRXLER1LzT/MCIRsiG5AEbiYXV5BNd5SiiHtBJ1q0ZJH+AxL2ERaT41VCppboZwT\n" +
+            "hmJGGoky9FWjp6z8U6Enx0fAMJIZNEzW6LAJFKPEynEU004jFFCEumPUqqCC4ogx\n" +
+            "ulphY80CAwEAAaOCA3QwggNwMB8GA1UdIwQYMBaAFDna/8ooFIqodBMIueQOqdL6\n" +
+            "fp1pMB0GA1UdDgQWBBQ+S4ZhIrwOoeGs9BBT4uXq89Ux/jAOBgNVHQ8BAf8EBAMC\n" +
+            "BaAwDAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIw\n" +
+            "TwYDVR0gBEgwRjA7BgwrBgEEAbIxAQIBBQEwKzApBggrBgEFBQcCARYdaHR0cHM6\n" +
+            "Ly9zZWN1cmUuY29tb2RvLmNvbS9DUFMwBwYFZ4EMAQEwVgYDVR0fBE8wTTBLoEmg\n" +
+            "R4ZFaHR0cDovL2NybC5jb21vZG9jYS5jb20vQ09NT0RPUlNBRXh0ZW5kZWRWYWxp\n" +
+            "ZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3JsMIGHBggrBgEFBQcBAQR7MHkwUQYIKwYB\n" +
+            "BQUHMAKGRWh0dHA6Ly9jcnQuY29tb2RvY2EuY29tL0NPTU9ET1JTQUV4dGVuZGVk\n" +
+            "VmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNydDAkBggrBgEFBQcwAYYYaHR0cDov\n" +
+            "L29jc3AuY29tb2RvY2EuY29tMDoGA1UdEQQzMDGCL2NvbW9kb3JzYWNlcnRpZmlj\n" +
+            "YXRpb25hdXRob3JpdHktZXYuY29tb2RvY2EuY29tMIIBgAYKKwYBBAHWeQIEAgSC\n" +
+            "AXAEggFsAWoAdgCkuQmQtBhYFIe7E6LMZ3AKPDWYBPkb37jjd80OyA3cEAAAAVz5\n" +
+            "cV7GAAAEAwBHMEUCIQCpgc0Eqw3g4pr+oX88h5xgL1VEAiDpqAhbRtilgYwBbgIg\n" +
+            "UaIm+n8AHi55nB//Sb4Nz18GYVcfELfpIzRh1vW9HbYAdwBWFAaaL9fC7NP14b1E\n" +
+            "sj7HRna5vJkRXMDvlJhV1onQ3QAAAVz5cVybAAAEAwBIMEYCIQDdsgC4KZ++OP44\n" +
+            "X7LbUcNaxe0kFzbctF2L3bnmhp9nXQIhAM0/g+PrZBIBpYlOtzidePi8bBHrLWn2\n" +
+            "uBiP3pYIntl4AHcA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFc\n" +
+            "+XFeoQAABAMASDBGAiEAoySTb/QKw7JwtZtPHnECEMzgENQSFy58Kl+Mvcd3SmcC\n" +
+            "IQD8cU66Ih3ejvt0OTX+lfxQPKyggQfm4Uk/lwn5LEJXbDANBgkqhkiG9w0BAQsF\n" +
+            "AAOCAQEAKEaSYWn3Hi8rfJS4cMTJoMkVp2vpPH2dGXySBEy67TEGRw9+f75w3q95\n" +
+            "r1m3P+xsR6dBoidTq/6wqUYI51lB4Fq9ylh1Stp5Gj54CuyT+S31l7lD7sl0KMsn\n" +
+            "HDUDQHId7hKeORYpiIZOcrKOglKdi1uiGwDgoiLKh98lUrZA6durrhH+sl69wqp2\n" +
+            "0XAu+3hurXzCoZFJfyngTO1kt9qcFUAxc5LofIa9QvC6VR7dI4aAh7dUpIRlnjG3\n" +
+            "jJ1mUMTqWO6TFTtddb+uQjDqNgkYYYNuSax1WMEIZWbIi13EjXK1GPQUXJe6gQin\n" +
+            "NUq9JH9NPK6m8A1YKT+wgzfTDeaV2Q==\n" +
+            "-----END CERTIFICATE-----";
 
     public void runTest(ValidatePathWithParams pathValidator) throws Exception {
         // Validate valid
@@ -226,7 +226,7 @@
         // Validate Revoked
         pathValidator.validate(new String[]{REVOKED, INT},
                 ValidatePathWithParams.Status.REVOKED,
-                "Fri Jun 30 07:20:56 PDT 2017", System.out);
+                "Thu Nov 29 08:41:09 PST 2018", System.out);
     }
 }
 
@@ -261,99 +261,97 @@
             + "lnxmeeOBnnCaDIxAcA3aCj2Gtdt3sA==\n"
             + "-----END CERTIFICATE-----";
 
-    // Owner: CN=comodoecccertificationauthority-ev.comodoca.com, OU=COMODO EV SSL,
-    // O=COMODO CA Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay,
-    // STREET=Trafford Road, L=Salford, ST=Greater Manchester, OID.2.5.4.17=M5 3EQ,
-    // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB,
-    // SERIALNUMBER=04058690
-    // Issuer: CN=COMODO ECC Extended Validation Secure Server CA, O=COMODO CA Limited,
-    // L=Salford, ST=Greater Manchester, C=GB
+    // Owner: CN=comodoecccertificationauthority-ev.comodoca.com, OU=COMODO EV SSL, O=Sectigo Limited,
+    // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford,
+    // ST=Greater Manchester, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization,
+    // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690
+    // Issuer: CN=COMODO ECC Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford,
+    // ST=Greater Manchester, C=GB
+    // Serial number: 603a5c2f85b63e00ba46ce8c3f6000b0
+    // Valid from: Wed Nov 28 16:00:00 PST 2018 until: Fri Feb 26 15:59:59 PST 2021
+    private static final String VALID = "-----BEGIN CERTIFICATE-----\n" +
+            "MIIGXzCCBgWgAwIBAgIQYDpcL4W2PgC6Rs6MP2AAsDAKBggqhkjOPQQDAjCBkjEL\n" +
+            "MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\n" +
+            "BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxODA2BgNVBAMT\n" +
+            "L0NPTU9ETyBFQ0MgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENB\n" +
+            "MB4XDTE4MTEyOTAwMDAwMFoXDTIxMDIyNjIzNTk1OVowggFXMREwDwYDVQQFEwgw\n" +
+            "NDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0ZSBP\n" +
+            "cmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExGzAZBgNV\n" +
+            "BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEWMBQGA1UE\n" +
+            "CRMNVHJhZmZvcmQgUm9hZDEWMBQGA1UECRMNRXhjaGFuZ2UgUXVheTElMCMGA1UE\n" +
+            "CRMcM3JkIEZsb29yLCAyNiBPZmZpY2UgVmlsbGFnZTEYMBYGA1UEChMPU2VjdGln\n" +
+            "byBMaW1pdGVkMRYwFAYDVQQLEw1DT01PRE8gRVYgU1NMMTgwNgYDVQQDEy9jb21v\n" +
+            "ZG9lY2NjZXJ0aWZpY2F0aW9uYXV0aG9yaXR5LWV2LmNvbW9kb2NhLmNvbTBZMBMG\n" +
+            "ByqGSM49AgEGCCqGSM49AwEHA0IABLduqgUu00bv8n0fkYqiwM1tgvlLKRWZTkXO\n" +
+            "BIS3zWDIBZKGSoxJ8Cc7nR+mvrkT6jzoT4FHejxX0UBTnC45oYGjggNzMIIDbzAf\n" +
+            "BgNVHSMEGDAWgBTTTsMZulhZ0Rxgt2FTRzund4/4ijAdBgNVHQ4EFgQU6WdLcyrH\n" +
+            "BcOmd7whAxcxkeVUpFcwDgYDVR0PAQH/BAQDAgWAMAwGA1UdEwEB/wQCMAAwHQYD\n" +
+            "VR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCME8GA1UdIARIMEYwOwYMKwYBBAGy\n" +
+            "MQECAQUBMCswKQYIKwYBBQUHAgEWHWh0dHBzOi8vc2VjdXJlLmNvbW9kby5jb20v\n" +
+            "Q1BTMAcGBWeBDAEBMFYGA1UdHwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwuY29tb2Rv\n" +
+            "Y2EuY29tL0NPTU9ET0VDQ0V4dGVuZGVkVmFsaWRhdGlvblNlY3VyZVNlcnZlckNB\n" +
+            "LmNybDCBhwYIKwYBBQUHAQEEezB5MFEGCCsGAQUFBzAChkVodHRwOi8vY3J0LmNv\n" +
+            "bW9kb2NhLmNvbS9DT01PRE9FQ0NFeHRlbmRlZFZhbGlkYXRpb25TZWN1cmVTZXJ2\n" +
+            "ZXJDQS5jcnQwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmNvbW9kb2NhLmNvbTA6\n" +
+            "BgNVHREEMzAxgi9jb21vZG9lY2NjZXJ0aWZpY2F0aW9uYXV0aG9yaXR5LWV2LmNv\n" +
+            "bW9kb2NhLmNvbTCCAX8GCisGAQQB1nkCBAIEggFvBIIBawFpAHYA7ku9t3XOYLrh\n" +
+            "Qmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFnYHQLpwAABAMARzBFAiB0pm9GZG/W\n" +
+            "REFW/umEd07eSzGsPZpRkOXahkiAmXiuxgIhAOiYZKB4Gr4JlAuQsajqbrS715L9\n" +
+            "03E7walRViBHMA3XAHcAb1N2rDHwMRnYmQCkURX/dxUcEdkCwQApBo2yCJo32RMA\n" +
+            "AAFnYHQLmwAABAMASDBGAiEAqUN6xU8mcNaYExuxUSZQR1WP5SZrgrDnAl+DN4t3\n" +
+            "R1MCIQCJseJMXtpzP2jB1d1sz/WS6pDERjutjYc0ko//m+WjlAB2ALvZ37wfinG1\n" +
+            "k5Qjl6qSe0c4V5UKq1LoGpCWZDaOHtGFAAABZ2B0C6cAAAQDAEcwRQIgI42QfFzd\n" +
+            "f9W0a383BnL3nGgLQinrd7usIbA81LwOvlECIQD+fmSDEs6lwsS5EGtIvygWMs2F\n" +
+            "7FWI1I8ucE0ikP+wCjAKBggqhkjOPQQDAgNIADBFAiB3P9kNVyLpA8tovSGeRvdx\n" +
+            "VfA0Slz//EIeeHhbHz7D/AIhAN+WFuDimGKE1XcKrmucSBLSrYGWlY8XJcF6en3v\n" +
+            "KOC7\n" +
+            "-----END CERTIFICATE-----";
+
+    // Owner: CN=comodoecccertificationauthority-ev.comodoca.com, OU=COMODO EV SSL, O=COMODO CA Limited,
+    // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford,
+    // ST=Greater Manchester, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization,
+    // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690
+    // Issuer: CN=COMODO ECC Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford,
+    // ST=Greater Manchester, C=GB
     // Serial number: 414e5d66ec7d15ca504213f2811d57af
     // Valid from: Mon Jul 03 17:00:00 PDT 2017 until: Thu Oct 03 16:59:59 PDT 2019
-    private static final String VALID = "-----BEGIN CERTIFICATE-----\n"
-            + "MIIGYDCCBgWgAwIBAgIQQU5dZux9FcpQQhPygR1XrzAKBggqhkjOPQQDAjCBkjEL\n"
-            + "MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\n"
-            + "BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxODA2BgNVBAMT\n"
-            + "L0NPTU9ETyBFQ0MgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENB\n"
-            + "MB4XDTE3MDcwNDAwMDAwMFoXDTE5MTAwMzIzNTk1OVowggFZMREwDwYDVQQFEwgw\n"
-            + "NDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0ZSBP\n"
-            + "cmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExGzAZBgNV\n"
-            + "BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEWMBQGA1UE\n"
-            + "CRMNVHJhZmZvcmQgUm9hZDEWMBQGA1UECRMNRXhjaGFuZ2UgUXVheTElMCMGA1UE\n"
-            + "CRMcM3JkIEZsb29yLCAyNiBPZmZpY2UgVmlsbGFnZTEaMBgGA1UEChMRQ09NT0RP\n"
-            + "IENBIExpbWl0ZWQxFjAUBgNVBAsTDUNPTU9ETyBFViBTU0wxODA2BgNVBAMTL2Nv\n"
-            + "bW9kb2VjY2NlcnRpZmljYXRpb25hdXRob3JpdHktZXYuY29tb2RvY2EuY29tMFkw\n"
-            + "EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEt26qBS7TRu/yfR+RiqLAzW2C+UspFZlO\n"
-            + "Rc4EhLfNYMgFkoZKjEnwJzudH6a+uRPqPOhPgUd6PFfRQFOcLjmhgaOCA3EwggNt\n"
-            + "MB8GA1UdIwQYMBaAFNNOwxm6WFnRHGC3YVNHO6d3j/iKMB0GA1UdDgQWBBTpZ0tz\n"
-            + "KscFw6Z3vCEDFzGR5VSkVzAOBgNVHQ8BAf8EBAMCBYAwDAYDVR0TAQH/BAIwADAd\n"
-            + "BgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwTwYDVR0gBEgwRjA7BgwrBgEE\n"
-            + "AbIxAQIBBQEwKzApBggrBgEFBQcCARYdaHR0cHM6Ly9zZWN1cmUuY29tb2RvLmNv\n"
-            + "bS9DUFMwBwYFZ4EMAQEwVgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDovL2NybC5jb21v\n"
-            + "ZG9jYS5jb20vQ09NT0RPRUNDRXh0ZW5kZWRWYWxpZGF0aW9uU2VjdXJlU2VydmVy\n"
-            + "Q0EuY3JsMIGHBggrBgEFBQcBAQR7MHkwUQYIKwYBBQUHMAKGRWh0dHA6Ly9jcnQu\n"
-            + "Y29tb2RvY2EuY29tL0NPTU9ET0VDQ0V4dGVuZGVkVmFsaWRhdGlvblNlY3VyZVNl\n"
-            + "cnZlckNBLmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29t\n"
-            + "MDoGA1UdEQQzMDGCL2NvbW9kb2VjY2NlcnRpZmljYXRpb25hdXRob3JpdHktZXYu\n"
-            + "Y29tb2RvY2EuY29tMIIBfQYKKwYBBAHWeQIEAgSCAW0EggFpAWcAdgCkuQmQtBhY\n"
-            + "FIe7E6LMZ3AKPDWYBPkb37jjd80OyA3cEAAAAV0NLqsqAAAEAwBHMEUCIAz9Jjq3\n"
-            + "qLUd/a2PYZnLGsEG/MrL7vab5rmGBg8RGAJxAiEA7JJnar07NIjCLLO77xJ3UFcu\n"
-            + "UMM3M8JgGC8wbuRwxbUAdgBWFAaaL9fC7NP14b1Esj7HRna5vJkRXMDvlJhV1onQ\n"
-            + "3QAAAV0NLqjmAAAEAwBHMEUCIHRvPWKr7vPMBWx1gLPkt8inPINWPNSoax178e5A\n"
-            + "D0cPAiEAvRL/VP4DLiyHvcU9AOqTzQXGuWCzswWKG59hSm7gS4kAdQDuS723dc5g\n"
-            + "uuFCaR+r4Z5mow9+X7By2IMAxHuJeqj9ywAAAV0NLqsDAAAEAwBGMEQCIFALT043\n"
-            + "X5IffLsxIAGXTrWgkZHf12QKgrYKXVB629eOAiAIeci2xi3fUW6mU8tT4LwyjowV\n"
-            + "DkrSCw1ZMo0JApsfzTAKBggqhkjOPQQDAgNJADBGAiEA7HUxjwx0MBC+4PuPx4Z1\n"
-            + "WpKz7jdHOMTh1sdaoVV5hNoCIQDrnjBFUopXHTvm/rj+aMFIeYejggPqv14KJOqT\n"
-            + "gym+uA==\n"
-            + "-----END CERTIFICATE-----";
-
-    // Owner: CN=comodoecccertificationauthority-ev.comodoca.com, OU=COMODO EV SSL,
-    // O=COMODO CA Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay,
-    // STREET=Trafford Road, L=Salford, ST=Greater Manchester, OID.2.5.4.17=M5 3EQ,
-    // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB,
-    // SERIALNUMBER=04058690
-    // Issuer: CN=COMODO ECC Extended Validation Secure Server CA, O=COMODO CA Limited,
-    // L=Salford, ST=Greater Manchester, C=GB
-    // Serial number: 6923086d88824ee9800742fcb82fdaa
-    // Valid from: Tue Aug 16 17:00:00 PDT 2016 until: Fri Nov 16 15:59:59 PST 2018
-    private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n"
-            + "MIIGizCCBjGgAwIBAgIQBpIwhtiIJO6YAHQvy4L9qjAKBggqhkjOPQQDAjCBkjEL\n"
-            + "MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\n"
-            + "BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxODA2BgNVBAMT\n"
-            + "L0NPTU9ETyBFQ0MgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENB\n"
-            + "MB4XDTE2MDgxNzAwMDAwMFoXDTE4MTExNjIzNTk1OVowggFZMREwDwYDVQQFEwgw\n"
-            + "NDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0ZSBP\n"
-            + "cmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExGzAZBgNV\n"
-            + "BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEWMBQGA1UE\n"
-            + "CRMNVHJhZmZvcmQgUm9hZDEWMBQGA1UECRMNRXhjaGFuZ2UgUXVheTElMCMGA1UE\n"
-            + "CRMcM3JkIEZsb29yLCAyNiBPZmZpY2UgVmlsbGFnZTEaMBgGA1UEChMRQ09NT0RP\n"
-            + "IENBIExpbWl0ZWQxFjAUBgNVBAsTDUNPTU9ETyBFViBTU0wxODA2BgNVBAMTL2Nv\n"
-            + "bW9kb2VjY2NlcnRpZmljYXRpb25hdXRob3JpdHktZXYuY29tb2RvY2EuY29tMFkw\n"
-            + "EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEt26qBS7TRu/yfR+RiqLAzW2C+UspFZlO\n"
-            + "Rc4EhLfNYMgFkoZKjEnwJzudH6a+uRPqPOhPgUd6PFfRQFOcLjmhgaOCA50wggOZ\n"
-            + "MB8GA1UdIwQYMBaAFNNOwxm6WFnRHGC3YVNHO6d3j/iKMB0GA1UdDgQWBBTpZ0tz\n"
-            + "KscFw6Z3vCEDFzGR5VSkVzAOBgNVHQ8BAf8EBAMCBYAwDAYDVR0TAQH/BAIwADAd\n"
-            + "BgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwRgYDVR0gBD8wPTA7BgwrBgEE\n"
-            + "AbIxAQIBBQEwKzApBggrBgEFBQcCARYdaHR0cHM6Ly9zZWN1cmUuY29tb2RvLmNv\n"
-            + "bS9DUFMwVgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDovL2NybC5jb21vZG9jYS5jb20v\n"
-            + "Q09NT0RPRUNDRXh0ZW5kZWRWYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3JsMIGH\n"
-            + "BggrBgEFBQcBAQR7MHkwUQYIKwYBBQUHMAKGRWh0dHA6Ly9jcnQuY29tb2RvY2Eu\n"
-            + "Y29tL0NPTU9ET0VDQ0V4dGVuZGVkVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNy\n"
-            + "dDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMG8GA1UdEQRo\n"
-            + "MGaCL2NvbW9kb2VjY2NlcnRpZmljYXRpb25hdXRob3JpdHktZXYuY29tb2RvY2Eu\n"
-            + "Y29tgjN3d3cuY29tb2RvZWNjY2VydGlmaWNhdGlvbmF1dGhvcml0eS1ldi5jb21v\n"
-            + "ZG9jYS5jb20wggF9BgorBgEEAdZ5AgQCBIIBbQSCAWkBZwB3AGj2mPgfZIK+Oozu\n"
-            + "uSgdTPxxUV1nk9RE0QpnrLtPT/vEAAABVpjKocAAAAQDAEgwRgIhAKIobm0UJdom\n"
-            + "Hrg1HZv6ESYoYQtlqBj5bR5Ge8RGF+7pAiEAupYu0q3X27KNIsrQpmSzfiEsCQWY\n"
-            + "C97ToQgEhbBNZUYAdQBWFAaaL9fC7NP14b1Esj7HRna5vJkRXMDvlJhV1onQ3QAA\n"
-            + "AVaYyqEdAAAEAwBGMEQCIEWbMoAJpig9oTbuW2R1x/sZwDbt0Z1iUhkbEwqhkRWu\n"
-            + "AiByCmEY/MEtEmVcsu3uMXtJ/SMBo1JcfFCHbPf5VleQpAB1AO5Lvbd1zmC64UJp\n"
-            + "H6vhnmajD35fsHLYgwDEe4l6qP3LAAABVpjKoaYAAAQDAEYwRAIgVB/p/u8amjg4\n"
-            + "Qlq0rKv4oYYqIVKL/kFtpeH3Lm4hpnwCIDYdBZBo2cpF+KjKDn68kqFysy7MbP9r\n"
-            + "h/zPjAm72GeRMAoGCCqGSM49BAMCA0gAMEUCIHL5pdruv0yoFggKHPN7PXT4BfRr\n"
-            + "1ksLXKgF/xANjsuFAiEA9bt7u96U5OrAzJBgSkJFmNE20vEdwoQDL+99JeX4bAc=\n"
-            + "-----END CERTIFICATE-----";
+    private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" +
+            "MIIGYDCCBgWgAwIBAgIQQU5dZux9FcpQQhPygR1XrzAKBggqhkjOPQQDAjCBkjEL\n" +
+            "MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\n" +
+            "BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxODA2BgNVBAMT\n" +
+            "L0NPTU9ETyBFQ0MgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENB\n" +
+            "MB4XDTE3MDcwNDAwMDAwMFoXDTE5MTAwMzIzNTk1OVowggFZMREwDwYDVQQFEwgw\n" +
+            "NDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0ZSBP\n" +
+            "cmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExGzAZBgNV\n" +
+            "BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEWMBQGA1UE\n" +
+            "CRMNVHJhZmZvcmQgUm9hZDEWMBQGA1UECRMNRXhjaGFuZ2UgUXVheTElMCMGA1UE\n" +
+            "CRMcM3JkIEZsb29yLCAyNiBPZmZpY2UgVmlsbGFnZTEaMBgGA1UEChMRQ09NT0RP\n" +
+            "IENBIExpbWl0ZWQxFjAUBgNVBAsTDUNPTU9ETyBFViBTU0wxODA2BgNVBAMTL2Nv\n" +
+            "bW9kb2VjY2NlcnRpZmljYXRpb25hdXRob3JpdHktZXYuY29tb2RvY2EuY29tMFkw\n" +
+            "EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEt26qBS7TRu/yfR+RiqLAzW2C+UspFZlO\n" +
+            "Rc4EhLfNYMgFkoZKjEnwJzudH6a+uRPqPOhPgUd6PFfRQFOcLjmhgaOCA3EwggNt\n" +
+            "MB8GA1UdIwQYMBaAFNNOwxm6WFnRHGC3YVNHO6d3j/iKMB0GA1UdDgQWBBTpZ0tz\n" +
+            "KscFw6Z3vCEDFzGR5VSkVzAOBgNVHQ8BAf8EBAMCBYAwDAYDVR0TAQH/BAIwADAd\n" +
+            "BgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwTwYDVR0gBEgwRjA7BgwrBgEE\n" +
+            "AbIxAQIBBQEwKzApBggrBgEFBQcCARYdaHR0cHM6Ly9zZWN1cmUuY29tb2RvLmNv\n" +
+            "bS9DUFMwBwYFZ4EMAQEwVgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDovL2NybC5jb21v\n" +
+            "ZG9jYS5jb20vQ09NT0RPRUNDRXh0ZW5kZWRWYWxpZGF0aW9uU2VjdXJlU2VydmVy\n" +
+            "Q0EuY3JsMIGHBggrBgEFBQcBAQR7MHkwUQYIKwYBBQUHMAKGRWh0dHA6Ly9jcnQu\n" +
+            "Y29tb2RvY2EuY29tL0NPTU9ET0VDQ0V4dGVuZGVkVmFsaWRhdGlvblNlY3VyZVNl\n" +
+            "cnZlckNBLmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29t\n" +
+            "MDoGA1UdEQQzMDGCL2NvbW9kb2VjY2NlcnRpZmljYXRpb25hdXRob3JpdHktZXYu\n" +
+            "Y29tb2RvY2EuY29tMIIBfQYKKwYBBAHWeQIEAgSCAW0EggFpAWcAdgCkuQmQtBhY\n" +
+            "FIe7E6LMZ3AKPDWYBPkb37jjd80OyA3cEAAAAV0NLqsqAAAEAwBHMEUCIAz9Jjq3\n" +
+            "qLUd/a2PYZnLGsEG/MrL7vab5rmGBg8RGAJxAiEA7JJnar07NIjCLLO77xJ3UFcu\n" +
+            "UMM3M8JgGC8wbuRwxbUAdgBWFAaaL9fC7NP14b1Esj7HRna5vJkRXMDvlJhV1onQ\n" +
+            "3QAAAV0NLqjmAAAEAwBHMEUCIHRvPWKr7vPMBWx1gLPkt8inPINWPNSoax178e5A\n" +
+            "D0cPAiEAvRL/VP4DLiyHvcU9AOqTzQXGuWCzswWKG59hSm7gS4kAdQDuS723dc5g\n" +
+            "uuFCaR+r4Z5mow9+X7By2IMAxHuJeqj9ywAAAV0NLqsDAAAEAwBGMEQCIFALT043\n" +
+            "X5IffLsxIAGXTrWgkZHf12QKgrYKXVB629eOAiAIeci2xi3fUW6mU8tT4LwyjowV\n" +
+            "DkrSCw1ZMo0JApsfzTAKBggqhkjOPQQDAgNJADBGAiEA7HUxjwx0MBC+4PuPx4Z1\n" +
+            "WpKz7jdHOMTh1sdaoVV5hNoCIQDrnjBFUopXHTvm/rj+aMFIeYejggPqv14KJOqT\n" +
+            "gym+uA==\n" +
+            "-----END CERTIFICATE-----";
 
     public void runTest(ValidatePathWithParams pathValidator) throws Exception {
         // Validate valid
@@ -363,7 +361,7 @@
         // Validate Revoked
         pathValidator.validate(new String[]{REVOKED, INT},
                 ValidatePathWithParams.Status.REVOKED,
-                "Tue Jul 04 03:34:40 PDT 2017", System.out);
+                "Thu Nov 29 08:12:02 PST 2018", System.out);
     }
 }
 
@@ -412,115 +410,112 @@
             + "-----END CERTIFICATE-----";
 
     // Owner: CN=usertrustrsacertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL,
-    // O=COMODO CA Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay,
-    // STREET=Trafford Road, L=Salford, ST=Greater Manchester, OID.2.5.4.17=M5 3EQ,
-    // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB,
-    // SERIALNUMBER=04058690
-    // Issuer: CN=USERTrust RSA Extended Validation Secure Server CA, O=The USERTRUST Network,
-    // L=Jersey City, ST=New Jersey, C=US
+    // O=Sectigo Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road,
+    // L=Salford, ST=Greater Manchester, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization,
+    // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690
+    // Issuer: CN=USERTrust RSA Extended Validation Secure Server CA, O=The USERTRUST Network, L=Jersey City,
+    // ST=New Jersey, C=US
+    // Serial number: d3c204e8df6a1539568cf15e97e57b1d
+    // Valid from: Wed Nov 28 16:00:00 PST 2018 until: Fri Feb 26 15:59:59 PST 2021
+    private static final String VALID = "-----BEGIN CERTIFICATE-----\n" +
+            "MIIIADCCBuigAwIBAgIRANPCBOjfahU5VozxXpflex0wDQYJKoZIhvcNAQELBQAw\n" +
+            "gZUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtK\n" +
+            "ZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMTswOQYD\n" +
+            "VQQDEzJVU0VSVHJ1c3QgUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNl\n" +
+            "cnZlciBDQTAeFw0xODExMjkwMDAwMDBaFw0yMTAyMjYyMzU5NTlaMIIBXjERMA8G\n" +
+            "A1UEBRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFBy\n" +
+            "aXZhdGUgT3JnYW5pemF0aW9uMQswCQYDVQQGEwJHQjEPMA0GA1UEERMGTTUgM0VR\n" +
+            "MRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQx\n" +
+            "FjAUBgNVBAkTDVRyYWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4Y2hhbmdlIFF1YXkx\n" +
+            "JTAjBgNVBAkTHDNyZCBGbG9vciwgMjYgT2ZmaWNlIFZpbGxhZ2UxGDAWBgNVBAoT\n" +
+            "D1NlY3RpZ28gTGltaXRlZDEaMBgGA1UECxMRQ09NT0RPIEVWIFNHQyBTU0wxOzA5\n" +
+            "BgNVBAMTMnVzZXJ0cnVzdHJzYWNlcnRpZmljYXRpb25hdXRob3JpdHktZXYuY29t\n" +
+            "b2RvY2EuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnh/rxeiY\n" +
+            "wpLa651eLvGnR+RErhDWkTZtqZcHw9Oy7JL2uELyEPbM+v0az40cBHS0bQZJZbWm\n" +
+            "XNukMUMSwIb4z7t8OXlxz9uvxEufvlqBl4qeC/z3LpFBRRHEero3yGKVwkoe1aP2\n" +
+            "Pq7Udi+7i7eVZZdA1ticxZWo/UBU9mwbIOYqf/4xzZ6G891hKb+NAuuEfxG52vXZ\n" +
+            "l8odMThfHuDlkfS7nZMQBaO40KJeSEBhr+5TIS7d7tWWye/F6oEQ0+dHBiF9PyZ1\n" +
+            "dXoO8aue/80mP+0FMYTmRFsKHge6ZjojfH9cLlR5kTqtP5Tqh5GBQ4zp3uyIBBU6\n" +
+            "ylKp9PNHkewGUQIDAQABo4IDfTCCA3kwHwYDVR0jBBgwFoAUL4FP4mb6vGi/mUOE\n" +
+            "UokgOoLzpKUwHQYDVR0OBBYEFHz7cvDn1LYe2M+z4plwQn7rt938MA4GA1UdDwEB\n" +
+            "/wQEAwIFoDAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF\n" +
+            "BQcDAjBLBgNVHSAERDBCMDcGDCsGAQQBsjEBAgEFATAnMCUGCCsGAQUFBwIBFhlo\n" +
+            "dHRwczovL2Nwcy51c2VydHJ1c3QuY29tMAcGBWeBDAEBMFoGA1UdHwRTMFEwT6BN\n" +
+            "oEuGSWh0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VU0VSVHJ1c3RSU0FFeHRlbmRl\n" +
+            "ZFZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcmwwgY0GCCsGAQUFBwEBBIGAMH4w\n" +
+            "VQYIKwYBBQUHMAKGSWh0dHA6Ly9jcnQudXNlcnRydXN0LmNvbS9VU0VSVHJ1c3RS\n" +
+            "U0FFeHRlbmRlZFZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcnQwJQYIKwYBBQUH\n" +
+            "MAGGGWh0dHA6Ly9vY3NwLnVzZXJ0cnVzdC5jb20wPQYDVR0RBDYwNIIydXNlcnRy\n" +
+            "dXN0cnNhY2VydGlmaWNhdGlvbmF1dGhvcml0eS1ldi5jb21vZG9jYS5jb20wggGA\n" +
+            "BgorBgEEAdZ5AgQCBIIBcASCAWwBagB3AO5Lvbd1zmC64UJpH6vhnmajD35fsHLY\n" +
+            "gwDEe4l6qP3LAAABZ2ElLBIAAAQDAEgwRgIhAM33ah4mcEfxzv4a8+BLysZKJygV\n" +
+            "jeARvesL/mH6y51bAiEA4hzW9aDRmEnuCcagONmIexMl0s3gMWfaU8/0s4ESJecA\n" +
+            "dgBvU3asMfAxGdiZAKRRFf93FRwR2QLBACkGjbIImjfZEwAAAWdhJSwQAAAEAwBH\n" +
+            "MEUCIQDCZ7GZayfWD3blSOWgk8PrAs/GVVpc5gJG3V+wq8LHMwIgH6n8DkoA46v1\n" +
+            "0UrmkVo7ND18ykuWyNH83QafsolTYSIAdwC72d+8H4pxtZOUI5eqkntHOFeVCqtS\n" +
+            "6BqQlmQ2jh7RhQAAAWdhJSwSAAAEAwBIMEYCIQC/XcbvfZzEqDpUthm3gYzndaiB\n" +
+            "8djqlQ89Mo29WDMS8AIhAKcWwmE5F2SuoTojiO0pPC5w5T38uW0vTXzb+fkj+6d5\n" +
+            "MA0GCSqGSIb3DQEBCwUAA4IBAQAmq2kRR74802+YMB2AaqklGcFRCuBVxU/ExbvE\n" +
+            "loNpNk64KH2eHwMK13ad0Lbc8/LaVgIJPtPz87LNqu00kQh0DL/kCnoO94+Z+usU\n" +
+            "ulQNYr8y3sg8+NZd9ui/VQTOcXrlovL+mnJnTgsCUzNYcoBIPq7lHxtZv5MG99AR\n" +
+            "6NyGTG28Aw8ZByCzhaasDOyT4YwlfveVUtsx1jKUC+0e6IhsGhxADnYOnrDD0cNd\n" +
+            "4bgX6SkpM0MCg6Nc3X/C4fo3WaSRM6FO4S98NY4g2DhNskT/7TmX2DsPwS005t0r\n" +
+            "3Ld31zbQaywKdpCsT74/hEBMfcDiP02mmtyrlqHD4R3tdYne\n" +
+            "-----END CERTIFICATE-----";
+
+    // Owner: CN=usertrustrsacertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, O=COMODO CA Limited,
+    // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford,
+    // ST=Greater Manchester, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization,
+    // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690
+    // Issuer: CN=USERTrust RSA Extended Validation Secure Server CA, O=The USERTRUST Network, L=Jersey City,
+    // ST=New Jersey, C=US
     // Serial number: ffcada019c9fb1155a32300083cb99c9
     // Valid from: Mon Jul 03 17:00:00 PDT 2017 until: Thu Oct 03 16:59:59 PDT 2019
-    private static final String VALID = "-----BEGIN CERTIFICATE-----\n"
-            + "MIIIATCCBumgAwIBAgIRAP/K2gGcn7EVWjIwAIPLmckwDQYJKoZIhvcNAQELBQAw\n"
-            + "gZUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtK\n"
-            + "ZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMTswOQYD\n"
-            + "VQQDEzJVU0VSVHJ1c3QgUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNl\n"
-            + "cnZlciBDQTAeFw0xNzA3MDQwMDAwMDBaFw0xOTEwMDMyMzU5NTlaMIIBYDERMA8G\n"
-            + "A1UEBRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFBy\n"
-            + "aXZhdGUgT3JnYW5pemF0aW9uMQswCQYDVQQGEwJHQjEPMA0GA1UEERMGTTUgM0VR\n"
-            + "MRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQx\n"
-            + "FjAUBgNVBAkTDVRyYWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4Y2hhbmdlIFF1YXkx\n"
-            + "JTAjBgNVBAkTHDNyZCBGbG9vciwgMjYgT2ZmaWNlIFZpbGxhZ2UxGjAYBgNVBAoT\n"
-            + "EUNPTU9ETyBDQSBMaW1pdGVkMRowGAYDVQQLExFDT01PRE8gRVYgU0dDIFNTTDE7\n"
-            + "MDkGA1UEAxMydXNlcnRydXN0cnNhY2VydGlmaWNhdGlvbmF1dGhvcml0eS1ldi5j\n"
-            + "b21vZG9jYS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCeH+vF\n"
-            + "6JjCktrrnV4u8adH5ESuENaRNm2plwfD07Lskva4QvIQ9sz6/RrPjRwEdLRtBkll\n"
-            + "taZc26QxQxLAhvjPu3w5eXHP26/ES5++WoGXip4L/PcukUFFEcR6ujfIYpXCSh7V\n"
-            + "o/Y+rtR2L7uLt5Vll0DW2JzFlaj9QFT2bBsg5ip//jHNnobz3WEpv40C64R/Ebna\n"
-            + "9dmXyh0xOF8e4OWR9LudkxAFo7jQol5IQGGv7lMhLt3u1ZbJ78XqgRDT50cGIX0/\n"
-            + "JnV1eg7xq57/zSY/7QUxhOZEWwoeB7pmOiN8f1wuVHmROq0/lOqHkYFDjOne7IgE\n"
-            + "FTrKUqn080eR7AZRAgMBAAGjggN8MIIDeDAfBgNVHSMEGDAWgBQvgU/iZvq8aL+Z\n"
-            + "Q4RSiSA6gvOkpTAdBgNVHQ4EFgQUfPty8OfUth7Yz7PimXBCfuu33fwwDgYDVR0P\n"
-            + "AQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG\n"
-            + "AQUFBwMCMEsGA1UdIAREMEIwNwYMKwYBBAGyMQECAQUBMCcwJQYIKwYBBQUHAgEW\n"
-            + "GWh0dHBzOi8vY3BzLnVzZXJ0cnVzdC5jb20wBwYFZ4EMAQEwWgYDVR0fBFMwUTBP\n"
-            + "oE2gS4ZJaHR0cDovL2NybC51c2VydHJ1c3QuY29tL1VTRVJUcnVzdFJTQUV4dGVu\n"
-            + "ZGVkVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNybDCBjQYIKwYBBQUHAQEEgYAw\n"
-            + "fjBVBggrBgEFBQcwAoZJaHR0cDovL2NydC51c2VydHJ1c3QuY29tL1VTRVJUcnVz\n"
-            + "dFJTQUV4dGVuZGVkVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNydDAlBggrBgEF\n"
-            + "BQcwAYYZaHR0cDovL29jc3AudXNlcnRydXN0LmNvbTA9BgNVHREENjA0gjJ1c2Vy\n"
-            + "dHJ1c3Ryc2FjZXJ0aWZpY2F0aW9uYXV0aG9yaXR5LWV2LmNvbW9kb2NhLmNvbTCC\n"
-            + "AX8GCisGAQQB1nkCBAIEggFvBIIBawFpAHYApLkJkLQYWBSHuxOizGdwCjw1mAT5\n"
-            + "G9+443fNDsgN3BAAAAFdDU2iYQAABAMARzBFAiB0o4GnVHD8MeVQ32D0XYu+EQQW\n"
-            + "jvN78rmCfk0OEBxyFAIhAKgyctIn0IaDJiZzsrtAiqEnkcMtuh8o+R0Rqw1ygAjk\n"
-            + "AHcAVhQGmi/XwuzT9eG9RLI+x0Z2ubyZEVzA75SYVdaJ0N0AAAFdDU2gFgAABAMA\n"
-            + "SDBGAiEA7mcmZ8H5uHuNCdI0CVxsqDZQcZX/gVk94KckePkzQoACIQCHwm5hcvNC\n"
-            + "M8vNmFkboQN79DglRctHrlh143A6mUTk8QB2AO5Lvbd1zmC64UJpH6vhnmajD35f\n"
-            + "sHLYgwDEe4l6qP3LAAABXQ1NojoAAAQDAEcwRQIhAPqwijgE0Fr6uJ+yF+TvyXco\n"
-            + "Hduv9h7R5WWwJfghXiMyAiBB4+fJm4rIcOnJBZmOqFnRpIjPN0jwDqJT0nDHxaXA\n"
-            + "nDANBgkqhkiG9w0BAQsFAAOCAQEACXitF1bTEvV1HX11WrT/XuoMhsoPK4TS16rs\n"
-            + "FqztV4iXKlA1/h5qbsjYY1gVrM+/6kQkmEs5qrxsek2WNxY80NO3WAzroRJ3H9Sd\n"
-            + "mPn0No2P8LZ5Fs5hvaD/PfWO5xxey80c3kGyvWOej90P3IrL/1RiULyh95TrXBjI\n"
-            + "ddCBsZ28904wsQUrPBPMpiu0DKl1HR/em9WkcipMi+onJxxFWjucssz5PW/BzGYF\n"
-            + "jfWLDEI0tN5L4CWV3iVXFXOURY1Mwhtsey9jvlEyxSsys55QdKF40yGgtV9VC+os\n"
-            + "7hJP33+qA0cvCTaRytiPP6z/l2G/KSIXTyv6SxzGhsTFfzLAOg==\n"
-            + "-----END CERTIFICATE-----";
-
-    // Owner: CN=usertrustrsacertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL,
-    // O=COMODO CA Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay,
-    // STREET=Trafford Road, L=Salford, ST=Greater Manchester, OID.2.5.4.17=M5 3EQ,
-    // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB,
-    // SERIALNUMBER=04058690
-    // Issuer: CN=USERTrust RSA Extended Validation Secure Server CA, O=The USERTRUST Network,
-    // L=Jersey City, ST=New Jersey, C=US
-    // Serial number: 643d7e2b0112d51a05a4efb266ebd70d
-    // Valid from: Tue Aug 16 17:00:00 PDT 2016 until: Fri Nov 16 15:59:59 PST 2018
-    private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n"
-            + "MIIILjCCBxagAwIBAgIQZD1+KwES1RoFpO+yZuvXDTANBgkqhkiG9w0BAQsFADCB\n"
-            + "lTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl\n"
-            + "cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxOzA5BgNV\n"
-            + "BAMTMlVTRVJUcnVzdCBSU0EgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2Vy\n"
-            + "dmVyIENBMB4XDTE2MDgxNzAwMDAwMFoXDTE4MTExNjIzNTk1OVowggFgMREwDwYD\n"
-            + "VQQFEwgwNDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJp\n"
-            + "dmF0ZSBPcmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVEx\n"
-            + "GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEW\n"
-            + "MBQGA1UECRMNVHJhZmZvcmQgUm9hZDEWMBQGA1UECRMNRXhjaGFuZ2UgUXVheTEl\n"
-            + "MCMGA1UECRMcM3JkIEZsb29yLCAyNiBPZmZpY2UgVmlsbGFnZTEaMBgGA1UEChMR\n"
-            + "Q09NT0RPIENBIExpbWl0ZWQxGjAYBgNVBAsTEUNPTU9ETyBFViBTR0MgU1NMMTsw\n"
-            + "OQYDVQQDEzJ1c2VydHJ1c3Ryc2FjZXJ0aWZpY2F0aW9uYXV0aG9yaXR5LWV2LmNv\n"
-            + "bW9kb2NhLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ4f68Xo\n"
-            + "mMKS2uudXi7xp0fkRK4Q1pE2bamXB8PTsuyS9rhC8hD2zPr9Gs+NHAR0tG0GSWW1\n"
-            + "plzbpDFDEsCG+M+7fDl5cc/br8RLn75agZeKngv89y6RQUURxHq6N8hilcJKHtWj\n"
-            + "9j6u1HYvu4u3lWWXQNbYnMWVqP1AVPZsGyDmKn/+Mc2ehvPdYSm/jQLrhH8Rudr1\n"
-            + "2ZfKHTE4Xx7g5ZH0u52TEAWjuNCiXkhAYa/uUyEu3e7VlsnvxeqBENPnRwYhfT8m\n"
-            + "dXV6DvGrnv/NJj/tBTGE5kRbCh4HumY6I3x/XC5UeZE6rT+U6oeRgUOM6d7siAQV\n"
-            + "OspSqfTzR5HsBlECAwEAAaOCA6owggOmMB8GA1UdIwQYMBaAFC+BT+Jm+rxov5lD\n"
-            + "hFKJIDqC86SlMB0GA1UdDgQWBBR8+3Lw59S2HtjPs+KZcEJ+67fd/DAOBgNVHQ8B\n"
-            + "Af8EBAMCBaAwDAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYB\n"
-            + "BQUHAwIwQgYDVR0gBDswOTA3BgwrBgEEAbIxAQIBBQEwJzAlBggrBgEFBQcCARYZ\n"
-            + "aHR0cHM6Ly9jcHMudXNlcnRydXN0LmNvbTBaBgNVHR8EUzBRME+gTaBLhklodHRw\n"
-            + "Oi8vY3JsLnVzZXJ0cnVzdC5jb20vVVNFUlRydXN0UlNBRXh0ZW5kZWRWYWxpZGF0\n"
-            + "aW9uU2VjdXJlU2VydmVyQ0EuY3JsMIGNBggrBgEFBQcBAQSBgDB+MFUGCCsGAQUF\n"
-            + "BzAChklodHRwOi8vY3J0LnVzZXJ0cnVzdC5jb20vVVNFUlRydXN0UlNBRXh0ZW5k\n"
-            + "ZWRWYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCUGCCsGAQUFBzABhhlodHRw\n"
-            + "Oi8vb2NzcC51c2VydHJ1c3QuY29tMHUGA1UdEQRuMGyCMnVzZXJ0cnVzdHJzYWNl\n"
-            + "cnRpZmljYXRpb25hdXRob3JpdHktZXYuY29tb2RvY2EuY29tgjZ3d3cudXNlcnRy\n"
-            + "dXN0cnNhY2VydGlmaWNhdGlvbmF1dGhvcml0eS1ldi5jb21vZG9jYS5jb20wggF+\n"
-            + "BgorBgEEAdZ5AgQCBIIBbgSCAWoBaAB2AGj2mPgfZIK+OozuuSgdTPxxUV1nk9RE\n"
-            + "0QpnrLtPT/vEAAABVpjLYnEAAAQDAEcwRQIhAL6/noD1PEwlZBByj9MKJSXPrEpW\n"
-            + "jpL335zhD+hrmvuqAiBizohmz9W29E8DoEuhca5PzKL8lSl5DpAOUGjMN0ihmgB2\n"
-            + "AFYUBpov18Ls0/XhvUSyPsdGdrm8mRFcwO+UmFXWidDdAAABVpjLYOgAAAQDAEcw\n"
-            + "RQIhAIRRWFG7M/XEgivLEdgEHWVNN7hk2QdVTvjr1DfRV2c3AiADq0LWpJ3dV7Je\n"
-            + "2Z3zKvqJEmRFNj5Pn9TwsIcEe1iNNgB2AO5Lvbd1zmC64UJpH6vhnmajD35fsHLY\n"
-            + "gwDEe4l6qP3LAAABVpjLYZ8AAAQDAEcwRQIge8b8UhHJWJ8/XWGIg6rQpaVXGP6q\n"
-            + "evL01KFNB28t8VQCIQCzddHCr/LLTVE+dB4kZHxuW5pOB+AtZlrAAQcuLoEauDAN\n"
-            + "BgkqhkiG9w0BAQsFAAOCAQEAPYqfbjlMjMJ2CEoIOUih/1BBnzXXkmmqXsXFI9gJ\n"
-            + "/tV1u4OzYOXHwOPhy/1JHv5dtNDSzyoeagYcjxEpl64kAJHrtzYwFlrqCU1xSIwd\n"
-            + "qrfmupyc5JwRqGE0Q01lryCxflUikh/pyDBtsxED4r+Topb+QwVZCzIMtOr49/S9\n"
-            + "GHA7HJo6nwSoV6rfrnLDCtcJN4ezEzOs7MOOq9K1MiAoAOXa/maelXwqbNGVpN2p\n"
-            + "HihRuBRDqusdS8zNGPxhvbviCDf8mJRvFoPgk/5o6mxf6bKfjmtkWOxMApvJU3Nd\n"
-            + "ib1aMX9KArEiNFwHFxOSYmE8c8x/zhLlk1btOo7gQrVNyw==\n"
-            + "-----END CERTIFICATE-----";
+    private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" +
+            "MIIIATCCBumgAwIBAgIRAP/K2gGcn7EVWjIwAIPLmckwDQYJKoZIhvcNAQELBQAw\n" +
+            "gZUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtK\n" +
+            "ZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMTswOQYD\n" +
+            "VQQDEzJVU0VSVHJ1c3QgUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNl\n" +
+            "cnZlciBDQTAeFw0xNzA3MDQwMDAwMDBaFw0xOTEwMDMyMzU5NTlaMIIBYDERMA8G\n" +
+            "A1UEBRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFBy\n" +
+            "aXZhdGUgT3JnYW5pemF0aW9uMQswCQYDVQQGEwJHQjEPMA0GA1UEERMGTTUgM0VR\n" +
+            "MRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQx\n" +
+            "FjAUBgNVBAkTDVRyYWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4Y2hhbmdlIFF1YXkx\n" +
+            "JTAjBgNVBAkTHDNyZCBGbG9vciwgMjYgT2ZmaWNlIFZpbGxhZ2UxGjAYBgNVBAoT\n" +
+            "EUNPTU9ETyBDQSBMaW1pdGVkMRowGAYDVQQLExFDT01PRE8gRVYgU0dDIFNTTDE7\n" +
+            "MDkGA1UEAxMydXNlcnRydXN0cnNhY2VydGlmaWNhdGlvbmF1dGhvcml0eS1ldi5j\n" +
+            "b21vZG9jYS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCeH+vF\n" +
+            "6JjCktrrnV4u8adH5ESuENaRNm2plwfD07Lskva4QvIQ9sz6/RrPjRwEdLRtBkll\n" +
+            "taZc26QxQxLAhvjPu3w5eXHP26/ES5++WoGXip4L/PcukUFFEcR6ujfIYpXCSh7V\n" +
+            "o/Y+rtR2L7uLt5Vll0DW2JzFlaj9QFT2bBsg5ip//jHNnobz3WEpv40C64R/Ebna\n" +
+            "9dmXyh0xOF8e4OWR9LudkxAFo7jQol5IQGGv7lMhLt3u1ZbJ78XqgRDT50cGIX0/\n" +
+            "JnV1eg7xq57/zSY/7QUxhOZEWwoeB7pmOiN8f1wuVHmROq0/lOqHkYFDjOne7IgE\n" +
+            "FTrKUqn080eR7AZRAgMBAAGjggN8MIIDeDAfBgNVHSMEGDAWgBQvgU/iZvq8aL+Z\n" +
+            "Q4RSiSA6gvOkpTAdBgNVHQ4EFgQUfPty8OfUth7Yz7PimXBCfuu33fwwDgYDVR0P\n" +
+            "AQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG\n" +
+            "AQUFBwMCMEsGA1UdIAREMEIwNwYMKwYBBAGyMQECAQUBMCcwJQYIKwYBBQUHAgEW\n" +
+            "GWh0dHBzOi8vY3BzLnVzZXJ0cnVzdC5jb20wBwYFZ4EMAQEwWgYDVR0fBFMwUTBP\n" +
+            "oE2gS4ZJaHR0cDovL2NybC51c2VydHJ1c3QuY29tL1VTRVJUcnVzdFJTQUV4dGVu\n" +
+            "ZGVkVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNybDCBjQYIKwYBBQUHAQEEgYAw\n" +
+            "fjBVBggrBgEFBQcwAoZJaHR0cDovL2NydC51c2VydHJ1c3QuY29tL1VTRVJUcnVz\n" +
+            "dFJTQUV4dGVuZGVkVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNydDAlBggrBgEF\n" +
+            "BQcwAYYZaHR0cDovL29jc3AudXNlcnRydXN0LmNvbTA9BgNVHREENjA0gjJ1c2Vy\n" +
+            "dHJ1c3Ryc2FjZXJ0aWZpY2F0aW9uYXV0aG9yaXR5LWV2LmNvbW9kb2NhLmNvbTCC\n" +
+            "AX8GCisGAQQB1nkCBAIEggFvBIIBawFpAHYApLkJkLQYWBSHuxOizGdwCjw1mAT5\n" +
+            "G9+443fNDsgN3BAAAAFdDU2iYQAABAMARzBFAiB0o4GnVHD8MeVQ32D0XYu+EQQW\n" +
+            "jvN78rmCfk0OEBxyFAIhAKgyctIn0IaDJiZzsrtAiqEnkcMtuh8o+R0Rqw1ygAjk\n" +
+            "AHcAVhQGmi/XwuzT9eG9RLI+x0Z2ubyZEVzA75SYVdaJ0N0AAAFdDU2gFgAABAMA\n" +
+            "SDBGAiEA7mcmZ8H5uHuNCdI0CVxsqDZQcZX/gVk94KckePkzQoACIQCHwm5hcvNC\n" +
+            "M8vNmFkboQN79DglRctHrlh143A6mUTk8QB2AO5Lvbd1zmC64UJpH6vhnmajD35f\n" +
+            "sHLYgwDEe4l6qP3LAAABXQ1NojoAAAQDAEcwRQIhAPqwijgE0Fr6uJ+yF+TvyXco\n" +
+            "Hduv9h7R5WWwJfghXiMyAiBB4+fJm4rIcOnJBZmOqFnRpIjPN0jwDqJT0nDHxaXA\n" +
+            "nDANBgkqhkiG9w0BAQsFAAOCAQEACXitF1bTEvV1HX11WrT/XuoMhsoPK4TS16rs\n" +
+            "FqztV4iXKlA1/h5qbsjYY1gVrM+/6kQkmEs5qrxsek2WNxY80NO3WAzroRJ3H9Sd\n" +
+            "mPn0No2P8LZ5Fs5hvaD/PfWO5xxey80c3kGyvWOej90P3IrL/1RiULyh95TrXBjI\n" +
+            "ddCBsZ28904wsQUrPBPMpiu0DKl1HR/em9WkcipMi+onJxxFWjucssz5PW/BzGYF\n" +
+            "jfWLDEI0tN5L4CWV3iVXFXOURY1Mwhtsey9jvlEyxSsys55QdKF40yGgtV9VC+os\n" +
+            "7hJP33+qA0cvCTaRytiPP6z/l2G/KSIXTyv6SxzGhsTFfzLAOg==\n" +
+            "-----END CERTIFICATE-----";
 
     public void runTest(ValidatePathWithParams pathValidator) throws Exception {
         // Validate valid
@@ -530,7 +525,7 @@
         // Validate Revoked
         pathValidator.validate(new String[]{REVOKED, INT},
                 ValidatePathWithParams.Status.REVOKED,
-                "Tue Jul 04 04:09:55 PDT 2017", System.out);
+                "Thu Nov 29 10:58:13 PST 2018", System.out);
     }
 }
 
@@ -566,100 +561,97 @@
             + "s1rWGRU=\n"
             + "-----END CERTIFICATE-----";
 
-    // Owner: CN=usertrustecccertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL,
-    // O=COMODO CA Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay,
-    // STREET=Trafford Road, L=Salford, ST=Greater Manchester, OID.2.5.4.17=M5 3EQ,
-    // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB,
-    // SERIALNUMBER=04058690
-    // Issuer: CN=USERTrust ECC Extended Validation Secure Server CA, O=The USERTRUST Network,
-    // L=Jersey City, ST=New Jersey, C=US
+    // Owner: CN=usertrustecccertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, O=Sectigo Limited,
+    // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford,
+    // ST=Greater Manchester, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization,
+    // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690
+    // Issuer: CN=USERTrust ECC Extended Validation Secure Server CA, O=The USERTRUST Network, L=Jersey City,
+    // ST=New Jersey, C=US
+    // Serial number: ab1455f9833ae7783f95de8744181f6a
+    // Valid from: Wed Nov 28 16:00:00 PST 2018 until: Fri Feb 26 15:59:59 PST 2021
+    private static final String VALID = "-----BEGIN CERTIFICATE-----\n" +
+            "MIIGhjCCBiygAwIBAgIRAKsUVfmDOud4P5Xeh0QYH2owCgYIKoZIzj0EAwIwgZUx\n" +
+            "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtKZXJz\n" +
+            "ZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMTswOQYDVQQD\n" +
+            "EzJVU0VSVHJ1c3QgRUNDIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZl\n" +
+            "ciBDQTAeFw0xODExMjkwMDAwMDBaFw0yMTAyMjYyMzU5NTlaMIIBXjERMA8GA1UE\n" +
+            "BRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFByaXZh\n" +
+            "dGUgT3JnYW5pemF0aW9uMQswCQYDVQQGEwJHQjEPMA0GA1UEERMGTTUgM0VRMRsw\n" +
+            "GQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxFjAU\n" +
+            "BgNVBAkTDVRyYWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4Y2hhbmdlIFF1YXkxJTAj\n" +
+            "BgNVBAkTHDNyZCBGbG9vciwgMjYgT2ZmaWNlIFZpbGxhZ2UxGDAWBgNVBAoTD1Nl\n" +
+            "Y3RpZ28gTGltaXRlZDEaMBgGA1UECxMRQ09NT0RPIEVWIFNHQyBTU0wxOzA5BgNV\n" +
+            "BAMTMnVzZXJ0cnVzdGVjY2NlcnRpZmljYXRpb25hdXRob3JpdHktZXYuY29tb2Rv\n" +
+            "Y2EuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELTJfEd92Wlg+h/AVtPsM\n" +
+            "mwX9Puvi+WGCv3sgFRpur8Iy2kGVpXHRQTCn2j9aky4tFQGm7OG2klJA/MEeevKV\n" +
+            "aaOCA48wggOLMB8GA1UdIwQYMBaAFCqcWvlOoTDaQEsr6Uvx9ZzcAvkuMB0GA1Ud\n" +
+            "DgQWBBSzrWHzmiHwx2Rrm7SjRC0UegNrKzAOBgNVHQ8BAf8EBAMCBYAwDAYDVR0T\n" +
+            "AQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwUAYDVR0gBEkw\n" +
+            "RzA8BgwrBgEEAbIxAQIBBQEwLDAqBggrBgEFBQcCARYeaHR0cHM6Ly9jcHMudHJ1\n" +
+            "c3QtcHJvdmlkZXIuY29tMAcGBWeBDAEBMF8GA1UdHwRYMFYwVKBSoFCGTmh0dHA6\n" +
+            "Ly9jcmwudHJ1c3QtcHJvdmlkZXIuY29tL1VTRVJUcnVzdEVDQ0V4dGVuZGVkVmFs\n" +
+            "aWRhdGlvblNlY3VyZVNlcnZlckNBLmNybDCBmAYIKwYBBQUHAQEEgYswgYgwWgYI\n" +
+            "KwYBBQUHMAKGTmh0dHA6Ly9jcnQudHJ1c3QtcHJvdmlkZXIuY29tL1VTRVJUcnVz\n" +
+            "dEVDQ0V4dGVuZGVkVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNydDAqBggrBgEF\n" +
+            "BQcwAYYeaHR0cDovL29jc3AudHJ1c3QtcHJvdmlkZXIuY29tMD0GA1UdEQQ2MDSC\n" +
+            "MnVzZXJ0cnVzdGVjY2NlcnRpZmljYXRpb25hdXRob3JpdHktZXYuY29tb2RvY2Eu\n" +
+            "Y29tMIIBfQYKKwYBBAHWeQIEAgSCAW0EggFpAWcAdgDuS723dc5guuFCaR+r4Z5m\n" +
+            "ow9+X7By2IMAxHuJeqj9ywAAAWdhJc3KAAAEAwBHMEUCIQCPBqO6bw8GSm3HxUf5\n" +
+            "vRcv74BOEAwZxEr0+PyszJHDbQIgCDXHPzlznU2jbaPdbZ65OQ78mRL5aDDMt1vf\n" +
+            "/foQr/wAdQBvU3asMfAxGdiZAKRRFf93FRwR2QLBACkGjbIImjfZEwAAAWdhJc3B\n" +
+            "AAAEAwBGMEQCICIvBLk08NTaEWtKdH8xl2VjjYUo+yQmtdqwMiVMjEB8AiAc50at\n" +
+            "gCogvZhdlIlGAqg5oND0K74+iglilBVvuTcIoQB2ALvZ37wfinG1k5Qjl6qSe0c4\n" +
+            "V5UKq1LoGpCWZDaOHtGFAAABZ2ElzcsAAAQDAEcwRQIhALDnAxdhUQvt2HkslYbG\n" +
+            "J8mYzWbDSSoidZzF4EF4bredAiB3xrSKOKFdTF3KUFHJANqT0c6Xxmo5dVUtovwM\n" +
+            "QMb1vTAKBggqhkjOPQQDAgNIADBFAiEA2ZwNj/BD8n2yR5BMBQvw7utv9XWrJvKQ\n" +
+            "11EPtBSCEhUCIBcyI0yl5dRff6+4x8IeCrLiAOYsfzM7Y/a5uRKFnbYz\n" +
+            "-----END CERTIFICATE-----";
+
+    // Owner: CN=usertrustecccertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, O=COMODO CA Limited,
+    // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford,
+    // ST=Greater Manchester, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization,
+    // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690
+    // Issuer: CN=USERTrust ECC Extended Validation Secure Server CA, O=The USERTRUST Network, L=Jersey City,
+    // ST=New Jersey, C=US
     // Serial number: 9bd0c93cac9ca2edc1a7dd923316b3c6
     // Valid from: Mon Jul 03 17:00:00 PDT 2017 until: Thu Oct 03 16:59:59 PDT 2019
-    private static final String VALID = "-----BEGIN CERTIFICATE-----\n"
-            + "MIIGhzCCBi2gAwIBAgIRAJvQyTysnKLtwafdkjMWs8YwCgYIKoZIzj0EAwIwgZUx\n"
-            + "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtKZXJz\n"
-            + "ZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMTswOQYDVQQD\n"
-            + "EzJVU0VSVHJ1c3QgRUNDIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZl\n"
-            + "ciBDQTAeFw0xNzA3MDQwMDAwMDBaFw0xOTEwMDMyMzU5NTlaMIIBYDERMA8GA1UE\n"
-            + "BRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFByaXZh\n"
-            + "dGUgT3JnYW5pemF0aW9uMQswCQYDVQQGEwJHQjEPMA0GA1UEERMGTTUgM0VRMRsw\n"
-            + "GQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxFjAU\n"
-            + "BgNVBAkTDVRyYWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4Y2hhbmdlIFF1YXkxJTAj\n"
-            + "BgNVBAkTHDNyZCBGbG9vciwgMjYgT2ZmaWNlIFZpbGxhZ2UxGjAYBgNVBAoTEUNP\n"
-            + "TU9ETyBDQSBMaW1pdGVkMRowGAYDVQQLExFDT01PRE8gRVYgU0dDIFNTTDE7MDkG\n"
-            + "A1UEAxMydXNlcnRydXN0ZWNjY2VydGlmaWNhdGlvbmF1dGhvcml0eS1ldi5jb21v\n"
-            + "ZG9jYS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQtMl8R33ZaWD6H8BW0\n"
-            + "+wybBf0+6+L5YYK/eyAVGm6vwjLaQZWlcdFBMKfaP1qTLi0VAabs4baSUkD8wR56\n"
-            + "8pVpo4IDjjCCA4owHwYDVR0jBBgwFoAUKpxa+U6hMNpASyvpS/H1nNwC+S4wHQYD\n"
-            + "VR0OBBYEFLOtYfOaIfDHZGubtKNELRR6A2srMA4GA1UdDwEB/wQEAwIFgDAMBgNV\n"
-            + "HRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBQBgNVHSAE\n"
-            + "STBHMDwGDCsGAQQBsjEBAgEFATAsMCoGCCsGAQUFBwIBFh5odHRwczovL2Nwcy50\n"
-            + "cnVzdC1wcm92aWRlci5jb20wBwYFZ4EMAQEwXwYDVR0fBFgwVjBUoFKgUIZOaHR0\n"
-            + "cDovL2NybC50cnVzdC1wcm92aWRlci5jb20vVVNFUlRydXN0RUNDRXh0ZW5kZWRW\n"
-            + "YWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3JsMIGYBggrBgEFBQcBAQSBizCBiDBa\n"
-            + "BggrBgEFBQcwAoZOaHR0cDovL2NydC50cnVzdC1wcm92aWRlci5jb20vVVNFUlRy\n"
-            + "dXN0RUNDRXh0ZW5kZWRWYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCoGCCsG\n"
-            + "AQUFBzABhh5odHRwOi8vb2NzcC50cnVzdC1wcm92aWRlci5jb20wPQYDVR0RBDYw\n"
-            + "NIIydXNlcnRydXN0ZWNjY2VydGlmaWNhdGlvbmF1dGhvcml0eS1ldi5jb21vZG9j\n"
-            + "YS5jb20wggF8BgorBgEEAdZ5AgQCBIIBbASCAWgBZgB1AKS5CZC0GFgUh7sTosxn\n"
-            + "cAo8NZgE+RvfuON3zQ7IDdwQAAABXQ0/jQ0AAAQDAEYwRAIgPbaNWgoi6OfyNwL2\n"
-            + "+jiySsoLrkx+0d4NJE1WnZQcfzwCICW4yvsXaMxoOXpQp3EPgrYk5Ajfvy/dY3Ui\n"
-            + "0/dbQtHxAHYAVhQGmi/XwuzT9eG9RLI+x0Z2ubyZEVzA75SYVdaJ0N0AAAFdDT+K\n"
-            + "xwAABAMARzBFAiB3GQasrX+akoHX02ZvXCcvhWCqv6qQOhLCUqflPoRbuAIhALwe\n"
-            + "hrQo8S1Tm5vbMcxGiViq5ZcawxENWhxZ9hS0BZweAHUA7ku9t3XOYLrhQmkfq+Ge\n"
-            + "ZqMPfl+wctiDAMR7iXqo/csAAAFdDT+M4AAABAMARjBEAiAjvp8w/fdTVW1VGE0T\n"
-            + "I0YcCIXTYFDgzUMsEUiKHANAgwIgETQUcac7Hiis2fgQ+GdGF9yuh+xMo2Z8QXNu\n"
-            + "1Cknf+8wCgYIKoZIzj0EAwIDSAAwRQIgQ5UiUI7xodmmMYNs3CmqlZHw/04BQRAR\n"
-            + "4gRm7blZSIMCIQDHvIWTaPzSO6vwVzs6wSD6FqebLiFxoddC6aZG8Nm0wQ==\n"
-            + "-----END CERTIFICATE-----";
-
-    // Owner: CN=usertrustecccertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL,
-    // O=COMODO CA Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay,
-    // STREET=Trafford Road, L=Salford, ST=Greater Manchester, OID.2.5.4.17=M5 3EQ,
-    // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB,
-    // SERIALNUMBER=04058690
-    // Issuer: CN=USERTrust ECC Extended Validation Secure Server CA, O=The USERTRUST Network,
-    // L=Jersey City, ST=New Jersey, C=US
-    // Serial number: 4a2545ad661540057c81281ff8c101b9
-    // Valid from: Tue Aug 16 17:00:00 PDT 2016 until: Fri Nov 16 15:59:59 PST 2018
-    private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n"
-            + "MIIGtzCCBlygAwIBAgIQSiVFrWYVQAV8gSgf+MEBuTAKBggqhkjOPQQDAjCBlTEL\n"
-            + "MAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNl\n"
-            + "eSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxOzA5BgNVBAMT\n"
-            + "MlVTRVJUcnVzdCBFQ0MgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVy\n"
-            + "IENBMB4XDTE2MDgxNzAwMDAwMFoXDTE4MTExNjIzNTk1OVowggFgMREwDwYDVQQF\n"
-            + "EwgwNDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0\n"
-            + "ZSBPcmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExGzAZ\n"
-            + "BgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEWMBQG\n"
-            + "A1UECRMNVHJhZmZvcmQgUm9hZDEWMBQGA1UECRMNRXhjaGFuZ2UgUXVheTElMCMG\n"
-            + "A1UECRMcM3JkIEZsb29yLCAyNiBPZmZpY2UgVmlsbGFnZTEaMBgGA1UEChMRQ09N\n"
-            + "T0RPIENBIExpbWl0ZWQxGjAYBgNVBAsTEUNPTU9ETyBFViBTR0MgU1NMMTswOQYD\n"
-            + "VQQDEzJ1c2VydHJ1c3RlY2NjZXJ0aWZpY2F0aW9uYXV0aG9yaXR5LWV2LmNvbW9k\n"
-            + "b2NhLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABC0yXxHfdlpYPofwFbT7\n"
-            + "DJsF/T7r4vlhgr97IBUabq/CMtpBlaVx0UEwp9o/WpMuLRUBpuzhtpJSQPzBHnry\n"
-            + "lWmjggO+MIIDujAfBgNVHSMEGDAWgBQqnFr5TqEw2kBLK+lL8fWc3AL5LjAdBgNV\n"
-            + "HQ4EFgQUs61h85oh8Mdka5u0o0QtFHoDayswDgYDVR0PAQH/BAQDAgWAMAwGA1Ud\n"
-            + "EwEB/wQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMEcGA1UdIARA\n"
-            + "MD4wPAYMKwYBBAGyMQECAQUBMCwwKgYIKwYBBQUHAgEWHmh0dHBzOi8vY3BzLnRy\n"
-            + "dXN0LXByb3ZpZGVyLmNvbTBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vY3JsLnRy\n"
-            + "dXN0LXByb3ZpZGVyLmNvbS9VU0VSVHJ1c3RFQ0NFeHRlbmRlZFZhbGlkYXRpb25T\n"
-            + "ZWN1cmVTZXJ2ZXJDQS5jcmwwgZgGCCsGAQUFBwEBBIGLMIGIMFoGCCsGAQUFBzAC\n"
-            + "hk5odHRwOi8vY3J0LnRydXN0LXByb3ZpZGVyLmNvbS9VU0VSVHJ1c3RFQ0NFeHRl\n"
-            + "bmRlZFZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcnQwKgYIKwYBBQUHMAGGHmh0\n"
-            + "dHA6Ly9vY3NwLnRydXN0LXByb3ZpZGVyLmNvbTB1BgNVHREEbjBsgjJ1c2VydHJ1\n"
-            + "c3RlY2NjZXJ0aWZpY2F0aW9uYXV0aG9yaXR5LWV2LmNvbW9kb2NhLmNvbYI2d3d3\n"
-            + "LnVzZXJ0cnVzdGVjY2NlcnRpZmljYXRpb25hdXRob3JpdHktZXYuY29tb2RvY2Eu\n"
-            + "Y29tMIIBfQYKKwYBBAHWeQIEAgSCAW0EggFpAWcAdQBo9pj4H2SCvjqM7rkoHUz8\n"
-            + "cVFdZ5PURNEKZ6y7T0/7xAAAAVaYy/EsAAAEAwBGMEQCIATN694opYRAY9yCNZXZ\n"
-            + "TBJapGSqKHg1GBtlifmy+WB+AiACeljNAF3VK9Ma1bbJiRtB9ZRAN7mPbzaC3wha\n"
-            + "+5riaAB2AFYUBpov18Ls0/XhvUSyPsdGdrm8mRFcwO+UmFXWidDdAAABVpjL8F8A\n"
-            + "AAQDAEcwRQIgLq1mfWnNQWNTtQYtNCWm8wUm1Jez6AqfzmFLKJc4NC8CIQCsaHIH\n"
-            + "b/nKPPyKL9hxi2o5n0K3DpnHFv5V+0dtTBjOCgB2AO5Lvbd1zmC64UJpH6vhnmaj\n"
-            + "D35fsHLYgwDEe4l6qP3LAAABVpjL8RMAAAQDAEcwRQIhAOR5Hx0Mq6iX7lE6mfIR\n"
-            + "efJknMqXCnjcDsvzk6ZiXwSQAiB31TTkVHIVyscNYsup34Vcid7nWMuZiLjEElBo\n"
-            + "vYYh3jAKBggqhkjOPQQDAgNJADBGAiEA0CZ8Utr9boJ2y9mfVkOv2US4Nk9oWT/y\n"
-            + "P5YGb+ox/EICIQCBHZdD3tPNJ5BDkIdUCjnaFkNsHJchsU8e5a+1CV4knQ==\n"
-            + "-----END CERTIFICATE-----";
+    private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" +
+            "MIIGhzCCBi2gAwIBAgIRAJvQyTysnKLtwafdkjMWs8YwCgYIKoZIzj0EAwIwgZUx\n" +
+            "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtKZXJz\n" +
+            "ZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMTswOQYDVQQD\n" +
+            "EzJVU0VSVHJ1c3QgRUNDIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZl\n" +
+            "ciBDQTAeFw0xNzA3MDQwMDAwMDBaFw0xOTEwMDMyMzU5NTlaMIIBYDERMA8GA1UE\n" +
+            "BRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFByaXZh\n" +
+            "dGUgT3JnYW5pemF0aW9uMQswCQYDVQQGEwJHQjEPMA0GA1UEERMGTTUgM0VRMRsw\n" +
+            "GQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxFjAU\n" +
+            "BgNVBAkTDVRyYWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4Y2hhbmdlIFF1YXkxJTAj\n" +
+            "BgNVBAkTHDNyZCBGbG9vciwgMjYgT2ZmaWNlIFZpbGxhZ2UxGjAYBgNVBAoTEUNP\n" +
+            "TU9ETyBDQSBMaW1pdGVkMRowGAYDVQQLExFDT01PRE8gRVYgU0dDIFNTTDE7MDkG\n" +
+            "A1UEAxMydXNlcnRydXN0ZWNjY2VydGlmaWNhdGlvbmF1dGhvcml0eS1ldi5jb21v\n" +
+            "ZG9jYS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQtMl8R33ZaWD6H8BW0\n" +
+            "+wybBf0+6+L5YYK/eyAVGm6vwjLaQZWlcdFBMKfaP1qTLi0VAabs4baSUkD8wR56\n" +
+            "8pVpo4IDjjCCA4owHwYDVR0jBBgwFoAUKpxa+U6hMNpASyvpS/H1nNwC+S4wHQYD\n" +
+            "VR0OBBYEFLOtYfOaIfDHZGubtKNELRR6A2srMA4GA1UdDwEB/wQEAwIFgDAMBgNV\n" +
+            "HRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBQBgNVHSAE\n" +
+            "STBHMDwGDCsGAQQBsjEBAgEFATAsMCoGCCsGAQUFBwIBFh5odHRwczovL2Nwcy50\n" +
+            "cnVzdC1wcm92aWRlci5jb20wBwYFZ4EMAQEwXwYDVR0fBFgwVjBUoFKgUIZOaHR0\n" +
+            "cDovL2NybC50cnVzdC1wcm92aWRlci5jb20vVVNFUlRydXN0RUNDRXh0ZW5kZWRW\n" +
+            "YWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3JsMIGYBggrBgEFBQcBAQSBizCBiDBa\n" +
+            "BggrBgEFBQcwAoZOaHR0cDovL2NydC50cnVzdC1wcm92aWRlci5jb20vVVNFUlRy\n" +
+            "dXN0RUNDRXh0ZW5kZWRWYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCoGCCsG\n" +
+            "AQUFBzABhh5odHRwOi8vb2NzcC50cnVzdC1wcm92aWRlci5jb20wPQYDVR0RBDYw\n" +
+            "NIIydXNlcnRydXN0ZWNjY2VydGlmaWNhdGlvbmF1dGhvcml0eS1ldi5jb21vZG9j\n" +
+            "YS5jb20wggF8BgorBgEEAdZ5AgQCBIIBbASCAWgBZgB1AKS5CZC0GFgUh7sTosxn\n" +
+            "cAo8NZgE+RvfuON3zQ7IDdwQAAABXQ0/jQ0AAAQDAEYwRAIgPbaNWgoi6OfyNwL2\n" +
+            "+jiySsoLrkx+0d4NJE1WnZQcfzwCICW4yvsXaMxoOXpQp3EPgrYk5Ajfvy/dY3Ui\n" +
+            "0/dbQtHxAHYAVhQGmi/XwuzT9eG9RLI+x0Z2ubyZEVzA75SYVdaJ0N0AAAFdDT+K\n" +
+            "xwAABAMARzBFAiB3GQasrX+akoHX02ZvXCcvhWCqv6qQOhLCUqflPoRbuAIhALwe\n" +
+            "hrQo8S1Tm5vbMcxGiViq5ZcawxENWhxZ9hS0BZweAHUA7ku9t3XOYLrhQmkfq+Ge\n" +
+            "ZqMPfl+wctiDAMR7iXqo/csAAAFdDT+M4AAABAMARjBEAiAjvp8w/fdTVW1VGE0T\n" +
+            "I0YcCIXTYFDgzUMsEUiKHANAgwIgETQUcac7Hiis2fgQ+GdGF9yuh+xMo2Z8QXNu\n" +
+            "1Cknf+8wCgYIKoZIzj0EAwIDSAAwRQIgQ5UiUI7xodmmMYNs3CmqlZHw/04BQRAR\n" +
+            "4gRm7blZSIMCIQDHvIWTaPzSO6vwVzs6wSD6FqebLiFxoddC6aZG8Nm0wQ==\n" +
+            "-----END CERTIFICATE-----";
 
     public void runTest(ValidatePathWithParams pathValidator) throws Exception {
         // Validate valid
@@ -669,6 +661,6 @@
         // Validate Revoked
         pathValidator.validate(new String[]{REVOKED, INT},
                 ValidatePathWithParams.Status.REVOKED,
-                "Tue Jul 04 03:51:20 PDT 2017", System.out);
+                "Thu Nov 29 10:06:00 PST 2018", System.out);
     }
 }
--- a/test/sun/java2d/pisces/OpenJDKFillBug.java	Fri May 24 16:15:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-import java.awt.Color;
-import java.awt.Composite;
-import java.awt.CompositeContext;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.GeneralPath;
-import java.awt.image.BufferedImage;
-import java.awt.image.ColorModel;
-import java.awt.image.Raster;
-import java.awt.image.WritableRaster;
-import java.awt.image.RasterFormatException;
-
-/**
- * @test
- * @bug 8048782
- * @summary Test program that demonstrates PiscesRendering bug in
- * OpenJDK 1.7.0.60 (and probably in all other OpenJDK versions, too).
- */
-
-public class OpenJDKFillBug
-{
-    /**
-     * Test program that demonstrates a bug in OpenJDK 1.7.0.60 (and
-     * probably in all other OpenJDK versions, too). To see the bug, simply run
-     * the 'main' program with OpenJDK. The bug makes the 'g2d.fill'
-     * method fail with the following exception:
-     *
-     * This bug is found in OpenJDK but also is present in OracleJDK
-     * if run with
-     * -Dsun.java2d.renderer=sun.java2d.pisces.PiscesRenderingEngine
-     *
-     * The bug is related to sun.java2d.pisces.PiscesCache constructor
-     * that accepts '(int minx,int miny,int maxx,int maxy)' arguments:
-     * the internal 'bboxX1' and 'bboxY1' are set to values one greater
-     * than given maximum X and Y values. Those maximum values are then
-     * later used in AAShapePipe' class 'renderTiles' method, where a
-     * Y/X loop eventually calls 'GeneralCompositePipe' class
-     * 'renderPathTile' method. In that method, the operation will
-     * eventually call 'IntegerInterleavedRaster' class
-     * 'createWritableChild' method with arguments:
-     *
-     * <UL>
-     * <LI>x=800
-     * <LI>y=0
-     * <LI>width=2 (this value is too high: should be 1)
-     * <LI>height=32
-     * <LI>x0=0
-     * <LI>y0=0
-     * <LI>bandList[]=null
-     * </UL>
-     *
-     * This calls for a sub-raster with bounds that fall outside the
-     * original raster, and therefore the 'createWritableChild' method
-     * correctly throws 'RasterFormatException'.
-     *
-     * The bug is closely related to the use of a custom Composite
-     * implementation, which are quite rare. The application where this
-     * bug was first detected implements a high-quality PDF rendering
-     * engine that needs custom Composite operations to properly
-     * implement PDF advanced color blending and masking operators.
-     */
-
-    public static void main(String args[])
-    {
-        BufferedImage bi = new BufferedImage(801,1202,
-                                             BufferedImage.TYPE_INT_ARGB);
-        Graphics2D g2d = bi.createGraphics();
-        GeneralPath gp = new GeneralPath();
-        AffineTransform m = new AffineTransform(2.483489907915543,
-                                                0.0,
-                                                0.0,
-                                                -2.4844977263331955,
-                                                0.0,
-                                                1202.0);
-        Composite c = new CustomComposite();
-
-        gp.moveTo(-4.511, -14.349);
-        gp.lineTo(327.489, -14.349);
-        gp.lineTo(327.489, 494.15);
-        gp.lineTo(-4.511, 494.15);
-        gp.closePath();
-
-        g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
-                             RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
-        g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
-                             RenderingHints.VALUE_RENDER_QUALITY);
-        g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
-                             RenderingHints.VALUE_COLOR_RENDER_QUALITY);
-        g2d.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST,
-                             Integer.valueOf(140));
-        g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
-                             RenderingHints.VALUE_DITHER_ENABLE);
-        g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
-                             RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
-        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
-                             RenderingHints.VALUE_ANTIALIAS_ON);
-        g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
-                             RenderingHints.VALUE_STROKE_NORMALIZE);
-        g2d.setPaint(Color.red);
-        g2d.setComposite(c);
-        g2d.setTransform(m);
-        try {
-            g2d.fill(gp);
-        } catch (RasterFormatException rfe) {
-            System.out.println("Test failed");
-            throw new RuntimeException("xmax/ymax rounding cause RasterFormatException: " + rfe);
-        }
-        g2d.dispose();
-        System.out.println("Test passed");
-    }
-
-    // === CustomComposite ===
-
-    /**
-     * Dummy custom Composite implementation.
-     */
-
-    public static class CustomComposite implements Composite
-    {
-        @Override
-        public CompositeContext createContext(ColorModel srcColorModel,
-                                              ColorModel dstColorModel,
-                                              RenderingHints hints)
-        {
-            return new CustomCompositeContext();
-        }
-
-        // === CustomCompositeContext ===
-
-        /**
-         * Dummy custom CompositeContext implementation.
-         */
-
-        public static class CustomCompositeContext implements CompositeContext
-        {
-
-            @Override
-            public void dispose()
-            {
-                // NOP
-            }
-
-            @Override
-            public void compose(Raster src,Raster dstIn,WritableRaster dstOut)
-            {
-                // NOP
-            }
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/SSLContextImpl/DefautlCacheSize.java	Wed Jun 05 05:16:47 2019 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, 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 8210985
+ * @summary Update the default SSL session cache size to 20480
+ * @run main/othervm DefautlCacheSize
+ */
+
+// The SunJSSE provider cannot use System Properties in samevm/agentvm mode.
+// Please run JSSE test in othervm mode.
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLServerSocket;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLSessionContext;
+
+public class DefautlCacheSize {
+
+    public static void main(String[] args) throws Exception {
+        SSLServerSocketFactory sssf =
+                (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
+
+        try (SSLServerSocket serverSocket =
+                    (SSLServerSocket)sssf.createServerSocket()) {
+
+            String[] protocols = serverSocket.getSupportedProtocols();
+            for (int i = 0; i < protocols.length; i++) {
+                if (protocols[i].equals("SSLv2Hello")) {
+                    continue;
+                }
+                SSLContext sslContext = SSLContext.getInstance(protocols[i]);
+                SSLSessionContext sessionContext =
+                        sslContext.getServerSessionContext();
+                if (sessionContext.getSessionCacheSize() == 0) {
+                    throw new Exception(
+                        "the default server session cache size is infinite");
+                }
+
+                sessionContext = sslContext.getClientSessionContext();
+                if (sessionContext.getSessionCacheSize() == 0) {
+                    throw new Exception(
+                        "the default client session cache size is infinite");
+                }
+            }
+        }
+    }
+}